Browse Source

Pull request #14224: REPORT-114391 【微服务适配】远程&本地设计器能够正常启动

Merge in DESIGN/design from ~DESTINY.LIN/design:mss/2.0 to mss/2.0

* commit '47f2e189eea2eeb67e6804b855770013637d1864':
  REPORT-114391 【微服务适配】远程&本地设计器能够正常启动 预留token接口+完善报错
  REPORT-114391 【微服务适配】远程&本地设计器能够正常启动 完善部分代码+屏蔽frm入口
  REPORT-114391 【微服务适配】远程&本地设计器能够正常启动 适配数据连接+地图配置
mss/2.0
Destiny.Lin-林锦龙 4 months ago
parent
commit
4959f5b8c9
  1. 4
      designer-base/src/main/java/com/fr/design/actions/file/WebPreviewUtils.java
  2. 15
      designer-base/src/main/java/com/fr/design/backup/DesignContext.java
  3. 1
      designer-base/src/main/java/com/fr/design/env/HttpWorkspaceConnector.java
  4. 17
      designer-base/src/main/java/com/fr/design/utils/DesignUtils.java
  5. 35
      designer-base/src/main/java/com/fr/design/versioncheck/VersionCheckUtils.java
  6. 3
      designer-base/src/main/java/com/fr/start/server/FineEmbedServer.java
  7. 5
      designer-chart/src/main/java/com/fr/van/chart/map/server/ChartMapEditorAction.java
  8. 4
      designer-realize/src/main/java/com/fanruan/boot/env/function/DesignComponent.java

4
designer-base/src/main/java/com/fr/design/actions/file/WebPreviewUtils.java

@ -1,5 +1,6 @@
package com.fr.design.actions.file; package com.fr.design.actions.file;
import com.fanruan.workplace.http.HttpConstants;
import com.fr.design.base.mode.DesignModeContext; import com.fr.design.base.mode.DesignModeContext;
import com.fr.design.fun.PreviewProvider; import com.fr.design.fun.PreviewProvider;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
@ -158,7 +159,8 @@ public final class WebPreviewUtils {
DesignUtils.visitEnvServerByParameters( DesignUtils.visitEnvServerByParameters(
baseRoute, baseRoute,
parameterNameList.toArray(new String[0]), parameterNameList.toArray(new String[0]),
parameterValueList.toArray(new String[0]) parameterValueList.toArray(new String[0]),
HttpConstants.FR
); );
} else { } else {
int selVal = showConfirmDialog( int selVal = showConfirmDialog(

15
designer-base/src/main/java/com/fr/design/backup/DesignContext.java

@ -2,8 +2,8 @@ package com.fr.design.backup;
import com.fanruan.carina.context.CarinaApplicationContext; import com.fanruan.carina.context.CarinaApplicationContext;
import com.fanruan.carina.standard.PartitionManager; import com.fanruan.carina.standard.PartitionManager;
import com.fanruan.carina.standard.PartitionManagerImpl; import com.fr.log.FineLoggerFactory;
import com.fr.start.server.EmptyServletContext; import com.fr.stable.StringUtils;
import javax.servlet.ServletContext; import javax.servlet.ServletContext;
@ -17,7 +17,9 @@ import java.util.Properties;
* Created on 2024/5/14 * Created on 2024/5/14
*/ */
public class DesignContext extends CarinaApplicationContext { public class DesignContext extends CarinaApplicationContext {
public static final String WEB_INF = "\\WEB-INF";
private String designWebInfPath; private String designWebInfPath;
private String designDataPath;
public DesignContext(ServletContext servletContext, PartitionManager manager, Properties carinaApplicationProperties) { public DesignContext(ServletContext servletContext, PartitionManager manager, Properties carinaApplicationProperties) {
@ -36,5 +38,14 @@ public class DesignContext extends CarinaApplicationContext {
public void setDesignWebInfPath(String designWebInfPath) { public void setDesignWebInfPath(String designWebInfPath) {
this.designWebInfPath = designWebInfPath; this.designWebInfPath = designWebInfPath;
if (StringUtils.isNotEmpty(this.designWebInfPath)) {
this.designDataPath = this.designWebInfPath.replace(WEB_INF, StringUtils.EMPTY);
}
FineLoggerFactory.getLogger().info("[DesignContext] designWebInfPath:{}, designDataPath:{}", this.designWebInfPath, this.designDataPath);
}
@Override
public String getDataPath() {
return designDataPath;
} }
} }

1
designer-base/src/main/java/com/fr/design/env/HttpWorkspaceConnector.java vendored

@ -74,6 +74,7 @@ public class HttpWorkspaceConnector implements WorkspaceConnector {
bean.setUsername(connectionInfo.getUserName()); bean.setUsername(connectionInfo.getUserName());
bean.setPassword(connectionInfo.getPassword()); bean.setPassword(connectionInfo.getPassword());
bean.setEncrypted(false); bean.setEncrypted(false);
bean.setValidity(-2);
return bean; return bean;
} }
} }

17
designer-base/src/main/java/com/fr/design/utils/DesignUtils.java

@ -405,6 +405,16 @@ public class DesignUtils {
* @param values 参数值 * @param values 参数值
*/ */
public static void visitEnvServerByParameters(String baseRoute, String[] names, String[] values) { public static void visitEnvServerByParameters(String baseRoute, String[] names, String[] values) {
visitEnvServerByParameters(baseRoute, names, values, HttpConstants.PUBLIC);
}
/**
* 访问服务器环境
*
* @param names 参数名字
* @param values 参数值
*/
public static void visitEnvServerByParameters(String baseRoute, String[] names, String[] values, String serverType) {
int len = Math.min(ArrayUtils.getLength(names), ArrayUtils.getLength(values)); int len = Math.min(ArrayUtils.getLength(names), ArrayUtils.getLength(values));
String[] nameValuePairs = new String[len]; String[] nameValuePairs = new String[len];
for (int i = 0; i < len; i++) { for (int i = 0; i < len; i++) {
@ -417,10 +427,9 @@ public class DesignUtils {
"=" + CommonCodeUtils.encodeURIComponent(CommonCodeUtils.encodeURIComponent(value)); "=" + CommonCodeUtils.encodeURIComponent(CommonCodeUtils.encodeURIComponent(value));
} }
String postfixOfUri = (nameValuePairs.length > 0 ? "?" + StableUtils.join(nameValuePairs, "&") : StringUtils.EMPTY); String postfixOfUri = (nameValuePairs.length > 0 ? "?" + StableUtils.join(nameValuePairs, "&") : StringUtils.EMPTY);
if (!WorkContext.getCurrent().isLocal()) { if (!WorkContext.getCurrent().isLocal()) {
try { try {
String urlPath = getWebBrowserPath(); String urlPath = getWebBrowserPath(serverType);
Desktop.getDesktop().browse(new URI(urlPath + baseRoute + postfixOfUri)); Desktop.getDesktop().browse(new URI(urlPath + baseRoute + postfixOfUri));
} catch (Exception e) { } catch (Exception e) {
FineLoggerFactory.getLogger().error("cannot open the url Successful", e); FineLoggerFactory.getLogger().error("cannot open the url Successful", e);
@ -437,8 +446,8 @@ public class DesignUtils {
} }
} }
private static String getWebBrowserPath() { private static String getWebBrowserPath(String serverPath) {
String urlPath = WorkContext.getCurrent().getPath() + HttpConstants.FR; String urlPath = WorkContext.getCurrent().getPath() + serverPath;
DesignerEnvProcessor processor = ExtraDesignClassManager.getInstance().getSingle(DesignerEnvProcessor.XML_TAG); DesignerEnvProcessor processor = ExtraDesignClassManager.getInstance().getSingle(DesignerEnvProcessor.XML_TAG);
if (processor != null) { if (processor != null) {
//cas访问的时候, url要处理下. //cas访问的时候, url要处理下.

35
designer-base/src/main/java/com/fr/design/versioncheck/VersionCheckUtils.java

@ -113,23 +113,24 @@ public class VersionCheckUtils {
} }
public static void showVersionCheckDialog(String envName) { public static void showVersionCheckDialog(String envName) {
new SwingWorker<Boolean, Void>() { /// 环境检测类都先屏蔽
@Override // new SwingWorker<Boolean, Void>() {
protected Boolean doInBackground() { // @Override
return !VersionCheckUtils.versionCheck(envName); // protected Boolean doInBackground() {
} // return !VersionCheckUtils.versionCheck(envName);
// }
@Override //
protected void done() { // @Override
try { // protected void done() {
if (get()) { // try {
showNotificationDialog(envName); // if (get()) {
} // showNotificationDialog(envName);
} catch (Exception e) { // }
FineLoggerFactory.getLogger().warn(e.getMessage(), e); // } catch (Exception e) {
} // FineLoggerFactory.getLogger().warn(e.getMessage(), e);
} // }
}.execute(); // }
// }.execute();
} }
private static void showNotificationDialog(String envName) { private static void showNotificationDialog(String envName) {

3
designer-base/src/main/java/com/fr/start/server/FineEmbedServer.java

@ -2,6 +2,7 @@ package com.fr.start.server;
import com.fanruan.carina.Carina; import com.fanruan.carina.Carina;
import com.fr.event.EventDispatcher; import com.fr.event.EventDispatcher;
import com.fr.workspace.WorkContext;
/** /**
* Created by juhaoyu on 2018/6/6. * Created by juhaoyu on 2018/6/6.
@ -38,7 +39,7 @@ public abstract class FineEmbedServer {
public static boolean isRunning() { public static boolean isRunning() {
return Carina.partition("fine_report") != null && Carina.partition("fine_report").getReady(); return (Carina.partition("fine_report") != null && Carina.partition("fine_report").getReady()) || !WorkContext.getCurrent().isLocal();
} }
public static boolean isOnStarting() { public static boolean isOnStarting() {

5
designer-chart/src/main/java/com/fr/van/chart/map/server/ChartMapEditorAction.java

@ -1,10 +1,9 @@
package com.fr.van.chart.map.server; package com.fr.van.chart.map.server;
import com.fanruan.workplace.http.HttpConstants;
import com.fr.base.ServerConfig; import com.fr.base.ServerConfig;
import com.fr.base.svg.IconUtils;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
import com.fr.design.actions.UpdateAction; import com.fr.design.actions.UpdateAction;
import com.fr.general.GeneralContext;
import com.fr.start.ServerStarter; import com.fr.start.ServerStarter;
import com.fr.start.server.DesignEmbedHelper; import com.fr.start.server.DesignEmbedHelper;
@ -26,7 +25,7 @@ public class ChartMapEditorAction extends UpdateAction {
int port = DesignerEnvManager.getEnvManager().getEmbedServerPort(); int port = DesignerEnvManager.getEnvManager().getEmbedServerPort();
String web = DesignEmbedHelper.getAppFolderName(); String web = DesignEmbedHelper.getAppFolderName();
String serverlet = ServerConfig.getInstance().getServletName(); String serverlet = ServerConfig.getInstance().getServletName();
ServerStarter.browserURLWithLocalEnv(WorkContext.getCurrent().isLocal() ? String.format("http://localhost:%d/%s/%s/map/edit", port, web, serverlet) : WorkContext.getCurrent().getPath() + "/map/edit"); ServerStarter.browserURLWithLocalEnv(WorkContext.getCurrent().isLocal() ? String.format("http://localhost:%d/%s/%s/map/edit", port, web, serverlet) : WorkContext.getCurrent().getPath() + HttpConstants.PUBLIC + "/map/edit");
} }
} }

4
designer-realize/src/main/java/com/fanruan/boot/env/function/DesignComponent.java vendored

@ -455,8 +455,8 @@ public class DesignComponent {
private static void formDesignerRegister() { private static void formDesignerRegister() {
StableFactory.registerMarkedObject(DesignToolbarProvider.STRING_MARKED, WidgetToolBarPane.getInstance()); StableFactory.registerMarkedObject(DesignToolbarProvider.STRING_MARKED, WidgetToolBarPane.getInstance());
/// REPORT-127453 屏蔽frm入口
DesignModuleFactory.registerNewFormActionClass(NewFormAction.class); // DesignModuleFactory.registerNewFormActionClass(NewFormAction.class);
DesignModuleFactory.registerReplaceActionClass(ITReplaceAction.class); DesignModuleFactory.registerReplaceActionClass(ITReplaceAction.class);
DesignModuleFactory.registerFormParaDesignerClass(FormParaDesigner.class); DesignModuleFactory.registerFormParaDesignerClass(FormParaDesigner.class);
DesignModuleFactory.registerParaPropertyPaneClass(ParameterPropertyPane.class); DesignModuleFactory.registerParaPropertyPaneClass(ParameterPropertyPane.class);

Loading…
Cancel
Save