From 06f8fd78a829c7552e6c0713f0429973bd7bf2dc Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Thu, 18 Jul 2024 17:15:22 +0800 Subject: [PATCH 1/3] =?UTF-8?q?REPORT-114391=20=E3=80=90=E5=BE=AE=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E9=80=82=E9=85=8D=E3=80=91=E8=BF=9C=E7=A8=8B&?= =?UTF-8?q?=E6=9C=AC=E5=9C=B0=E8=AE=BE=E8=AE=A1=E5=99=A8=E8=83=BD=E5=A4=9F?= =?UTF-8?q?=E6=AD=A3=E5=B8=B8=E5=90=AF=E5=8A=A8=20=E9=80=82=E9=85=8D?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E8=BF=9E=E6=8E=A5+=E5=9C=B0=E5=9B=BE?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/backup/DesignContext.java | 15 +++++++++++++-- .../java/com/fr/design/utils/DesignUtils.java | 2 +- .../chart/map/server/ChartMapEditorAction.java | 5 ++--- 3 files changed, 16 insertions(+), 6 deletions(-) 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/utils/DesignUtils.java b/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java index 90702e6af2..03c60ba6ec 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 @@ -438,7 +438,7 @@ public class DesignUtils { } private static String getWebBrowserPath() { - String urlPath = WorkContext.getCurrent().getPath() + HttpConstants.FR; + String urlPath = WorkContext.getCurrent().getPath() + HttpConstants.PUBLIC; DesignerEnvProcessor processor = ExtraDesignClassManager.getInstance().getSingle(DesignerEnvProcessor.XML_TAG); if (processor != null) { //cas访问的时候, url要处理下. 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"); } } From e4a1d49870a0577b62b7a5b47b5e88811a9298f4 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Fri, 19 Jul 2024 11:57:16 +0800 Subject: [PATCH 2/3] =?UTF-8?q?REPORT-114391=20=E3=80=90=E5=BE=AE=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E9=80=82=E9=85=8D=E3=80=91=E8=BF=9C=E7=A8=8B&?= =?UTF-8?q?=E6=9C=AC=E5=9C=B0=E8=AE=BE=E8=AE=A1=E5=99=A8=E8=83=BD=E5=A4=9F?= =?UTF-8?q?=E6=AD=A3=E5=B8=B8=E5=90=AF=E5=8A=A8=20=E5=AE=8C=E5=96=84?= =?UTF-8?q?=E9=83=A8=E5=88=86=E4=BB=A3=E7=A0=81+=E5=B1=8F=E8=94=BDfrm?= =?UTF-8?q?=E5=85=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/actions/file/WebPreviewUtils.java | 4 ++- .../java/com/fr/design/utils/DesignUtils.java | 17 ++++++--- .../versioncheck/VersionCheckUtils.java | 35 ++++++++++--------- .../com/fr/start/server/FineEmbedServer.java | 3 +- .../boot/env/function/DesignComponent.java | 4 +-- 5 files changed, 38 insertions(+), 25 deletions(-) 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/utils/DesignUtils.java b/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java index 03c60ba6ec..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.PUBLIC; + 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-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); From 47f2e189eea2eeb67e6804b855770013637d1864 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Fri, 19 Jul 2024 15:52:55 +0800 Subject: [PATCH 3/3] =?UTF-8?q?REPORT-114391=20=E3=80=90=E5=BE=AE=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E9=80=82=E9=85=8D=E3=80=91=E8=BF=9C=E7=A8=8B&?= =?UTF-8?q?=E6=9C=AC=E5=9C=B0=E8=AE=BE=E8=AE=A1=E5=99=A8=E8=83=BD=E5=A4=9F?= =?UTF-8?q?=E6=AD=A3=E5=B8=B8=E5=90=AF=E5=8A=A8=20=E9=A2=84=E7=95=99token?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3+=E5=AE=8C=E5=96=84=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/env/HttpWorkspaceConnector.java | 1 + 1 file changed, 1 insertion(+) 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