diff --git a/designer-base/src/main/java/com/fr/design/actions/file/WebPreviewUtils.java b/designer-base/src/main/java/com/fr/design/actions/file/WebPreviewUtils.java index 2503db1de2..3d98fe18dc 100644 --- a/designer-base/src/main/java/com/fr/design/actions/file/WebPreviewUtils.java +++ b/designer-base/src/main/java/com/fr/design/actions/file/WebPreviewUtils.java @@ -1,5 +1,6 @@ package com.fr.design.actions.file; +import com.fanruan.workplace.http.HttpConstants; import com.fr.design.base.mode.DesignModeContext; import com.fr.design.fun.PreviewProvider; import com.fr.design.i18n.Toolkit; @@ -158,7 +159,8 @@ public final class WebPreviewUtils { DesignUtils.visitEnvServerByParameters( baseRoute, parameterNameList.toArray(new String[0]), - parameterValueList.toArray(new String[0]) + parameterValueList.toArray(new String[0]), + HttpConstants.FR ); } else { int selVal = showConfirmDialog( diff --git a/designer-base/src/main/java/com/fr/design/backup/DesignContext.java b/designer-base/src/main/java/com/fr/design/backup/DesignContext.java index bdb739b339..e2aebc14db 100644 --- a/designer-base/src/main/java/com/fr/design/backup/DesignContext.java +++ b/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.standard.PartitionManager; -import com.fanruan.carina.standard.PartitionManagerImpl; -import com.fr.start.server.EmptyServletContext; +import com.fr.log.FineLoggerFactory; +import com.fr.stable.StringUtils; import javax.servlet.ServletContext; @@ -17,7 +17,9 @@ import java.util.Properties; * Created on 2024/5/14 */ public class DesignContext extends CarinaApplicationContext { + public static final String WEB_INF = "\\WEB-INF"; private String designWebInfPath; + private String designDataPath; public DesignContext(ServletContext servletContext, PartitionManager manager, Properties carinaApplicationProperties) { @@ -36,5 +38,14 @@ public class DesignContext extends CarinaApplicationContext { public void setDesignWebInfPath(String 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; } } diff --git a/designer-base/src/main/java/com/fr/design/env/HttpWorkspaceConnector.java b/designer-base/src/main/java/com/fr/design/env/HttpWorkspaceConnector.java index f45964508c..4c4d7c9429 100644 --- a/designer-base/src/main/java/com/fr/design/env/HttpWorkspaceConnector.java +++ b/designer-base/src/main/java/com/fr/design/env/HttpWorkspaceConnector.java @@ -74,6 +74,7 @@ public class HttpWorkspaceConnector implements WorkspaceConnector { bean.setUsername(connectionInfo.getUserName()); bean.setPassword(connectionInfo.getPassword()); bean.setEncrypted(false); + bean.setValidity(-2); return bean; } } \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java b/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java index 90702e6af2..afe21e2ccb 100644 --- a/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java +++ b/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java @@ -405,6 +405,16 @@ public class DesignUtils { * @param 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)); String[] nameValuePairs = new String[len]; for (int i = 0; i < len; i++) { @@ -417,10 +427,9 @@ public class DesignUtils { "=" + CommonCodeUtils.encodeURIComponent(CommonCodeUtils.encodeURIComponent(value)); } String postfixOfUri = (nameValuePairs.length > 0 ? "?" + StableUtils.join(nameValuePairs, "&") : StringUtils.EMPTY); - if (!WorkContext.getCurrent().isLocal()) { try { - String urlPath = getWebBrowserPath(); + String urlPath = getWebBrowserPath(serverType); Desktop.getDesktop().browse(new URI(urlPath + baseRoute + postfixOfUri)); } catch (Exception e) { FineLoggerFactory.getLogger().error("cannot open the url Successful", e); @@ -437,8 +446,8 @@ public class DesignUtils { } } - private static String getWebBrowserPath() { - String urlPath = WorkContext.getCurrent().getPath() + HttpConstants.FR; + private static String getWebBrowserPath(String serverPath) { + String urlPath = WorkContext.getCurrent().getPath() + serverPath; DesignerEnvProcessor processor = ExtraDesignClassManager.getInstance().getSingle(DesignerEnvProcessor.XML_TAG); if (processor != null) { //cas访问的时候, url要处理下. diff --git a/designer-base/src/main/java/com/fr/design/versioncheck/VersionCheckUtils.java b/designer-base/src/main/java/com/fr/design/versioncheck/VersionCheckUtils.java index e66d5923f8..0d10600b64 100644 --- a/designer-base/src/main/java/com/fr/design/versioncheck/VersionCheckUtils.java +++ b/designer-base/src/main/java/com/fr/design/versioncheck/VersionCheckUtils.java @@ -113,23 +113,24 @@ public class VersionCheckUtils { } public static void showVersionCheckDialog(String envName) { - new SwingWorker() { - @Override - protected Boolean doInBackground() { - return !VersionCheckUtils.versionCheck(envName); - } - - @Override - protected void done() { - try { - if (get()) { - showNotificationDialog(envName); - } - } catch (Exception e) { - FineLoggerFactory.getLogger().warn(e.getMessage(), e); - } - } - }.execute(); + /// 环境检测类都先屏蔽 +// new SwingWorker() { +// @Override +// protected Boolean doInBackground() { +// return !VersionCheckUtils.versionCheck(envName); +// } +// +// @Override +// protected void done() { +// try { +// if (get()) { +// showNotificationDialog(envName); +// } +// } catch (Exception e) { +// FineLoggerFactory.getLogger().warn(e.getMessage(), e); +// } +// } +// }.execute(); } private static void showNotificationDialog(String envName) { diff --git a/designer-base/src/main/java/com/fr/start/server/FineEmbedServer.java b/designer-base/src/main/java/com/fr/start/server/FineEmbedServer.java index 40a95758b5..fc3d2a4e46 100644 --- a/designer-base/src/main/java/com/fr/start/server/FineEmbedServer.java +++ b/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.fr.event.EventDispatcher; +import com.fr.workspace.WorkContext; /** * Created by juhaoyu on 2018/6/6. @@ -38,7 +39,7 @@ public abstract class FineEmbedServer { 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() { diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/server/ChartMapEditorAction.java b/designer-chart/src/main/java/com/fr/van/chart/map/server/ChartMapEditorAction.java index bb854f8a81..249c92b397 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/server/ChartMapEditorAction.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/server/ChartMapEditorAction.java @@ -1,10 +1,9 @@ package com.fr.van.chart.map.server; +import com.fanruan.workplace.http.HttpConstants; import com.fr.base.ServerConfig; -import com.fr.base.svg.IconUtils; import com.fr.design.DesignerEnvManager; import com.fr.design.actions.UpdateAction; -import com.fr.general.GeneralContext; import com.fr.start.ServerStarter; import com.fr.start.server.DesignEmbedHelper; @@ -26,7 +25,7 @@ public class ChartMapEditorAction extends UpdateAction { int port = DesignerEnvManager.getEnvManager().getEmbedServerPort(); String web = DesignEmbedHelper.getAppFolderName(); 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"); } } diff --git a/designer-realize/src/main/java/com/fanruan/boot/env/function/DesignComponent.java b/designer-realize/src/main/java/com/fanruan/boot/env/function/DesignComponent.java index 0afc229a09..d55b4a4fbd 100644 --- a/designer-realize/src/main/java/com/fanruan/boot/env/function/DesignComponent.java +++ b/designer-realize/src/main/java/com/fanruan/boot/env/function/DesignComponent.java @@ -455,8 +455,8 @@ public class DesignComponent { private static void formDesignerRegister() { StableFactory.registerMarkedObject(DesignToolbarProvider.STRING_MARKED, WidgetToolBarPane.getInstance()); - - DesignModuleFactory.registerNewFormActionClass(NewFormAction.class); + /// REPORT-127453 屏蔽frm入口 + // DesignModuleFactory.registerNewFormActionClass(NewFormAction.class); DesignModuleFactory.registerReplaceActionClass(ITReplaceAction.class); DesignModuleFactory.registerFormParaDesignerClass(FormParaDesigner.class); DesignModuleFactory.registerParaPropertyPaneClass(ParameterPropertyPane.class);