From 72e819a9e6449861157979bfae6c17886dc0450a Mon Sep 17 00:00:00 2001 From: hades Date: Thu, 3 Dec 2020 15:04:57 +0800 Subject: [PATCH 1/2] =?UTF-8?q?REPORT-44583=20=E9=83=A8=E7=BD=B2=E9=9B=86?= =?UTF-8?q?=E6=88=90-=E8=BF=9C=E7=A8=8B-=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=E5=92=8C=E6=9C=8D=E5=8A=A1=E5=99=A8=E5=9C=A8=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E7=94=B5=E8=84=91=E4=B8=8A=EF=BC=8C=E8=BF=9C=E7=A8=8B=E8=BF=9E?= =?UTF-8?q?=E6=8E=A5=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../env/RemoteDesignerWorkspaceInfo.java | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/env/RemoteDesignerWorkspaceInfo.java b/designer-base/src/main/java/com/fr/design/env/RemoteDesignerWorkspaceInfo.java index f9de1cfa41..96069b4356 100644 --- a/designer-base/src/main/java/com/fr/design/env/RemoteDesignerWorkspaceInfo.java +++ b/designer-base/src/main/java/com/fr/design/env/RemoteDesignerWorkspaceInfo.java @@ -25,13 +25,19 @@ public class RemoteDesignerWorkspaceInfo implements DesignerWorkspaceInfo { private static final String HOST_NAME = "127.0.0.1"; private static final String LOCAL_HOTS_NAME = "localhost"; private static final String QUOTATION = ":"; - private static final String PORT = Integer.toString(DesignerEnvManager.getEnvManager().getEmbedServerPort()); + private static String port = Integer.toString(DesignerEnvManager.getEnvManager().getEmbedServerPort()); static { - FILTER_SET.add(HTTP + HOST_NAME + QUOTATION + PORT + PATH); - FILTER_SET.add(HTTPS + HOST_NAME + QUOTATION + PORT + PATH); - FILTER_SET.add(HTTP + LOCAL_HOTS_NAME + QUOTATION + PORT + PATH); - FILTER_SET.add(HTTPS + LOCAL_HOTS_NAME + QUOTATION + PORT + PATH); + initFilerSet(port); + } + + private static void initFilerSet(String newPort) { + FILTER_SET.clear(); + FILTER_SET.add(HTTP + HOST_NAME + QUOTATION + newPort + PATH); + FILTER_SET.add(HTTPS + HOST_NAME + QUOTATION + newPort + PATH); + FILTER_SET.add(HTTP + LOCAL_HOTS_NAME + QUOTATION + newPort + PATH); + FILTER_SET.add(HTTPS + LOCAL_HOTS_NAME + QUOTATION + newPort + PATH); + port = newPort; } private String name; @@ -164,6 +170,11 @@ public class RemoteDesignerWorkspaceInfo implements DesignerWorkspaceInfo { @Override public boolean checkValid() { boolean result = false; + String newPort = Integer.toString(DesignerEnvManager.getEnvManager().getEmbedServerPort()); + if (!ComparatorUtils.equals(port, newPort)) { + // 使用过程中 更改了内置服务器端口 重新初始化下 + initFilerSet(newPort); + } if (FILTER_SET.contains(connection.getUrl())) { FineLoggerFactory.getLogger().error("url is same with local designer"); return result; From 71646c4285253314688aefac0ff88a7a6cada6d4 Mon Sep 17 00:00:00 2001 From: hades Date: Thu, 3 Dec 2020 15:12:31 +0800 Subject: [PATCH 2/2] =?UTF-8?q?REPORT-43864=20=E5=8D=95=E5=85=83=E6=A0=BC?= =?UTF-8?q?=E5=B1=9E=E6=80=A7-=E8=87=AA=E5=AE=9A=E4=B9=89=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E4=B8=A2=E5=A4=B1=EF=BC=8C=E5=87=BA=E7=8E=B0=E5=A4=A7?= =?UTF-8?q?=E9=87=8F=E9=87=8D=E5=A4=8D=E5=BC=B9=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/mainframe/App.java | 11 +++++++++++ .../com/fr/design/mainframe/JTemplateFactory.java | 2 +- .../main/java/com/fr/design/mainframe/app/CptApp.java | 8 +++++++- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/App.java b/designer-base/src/main/java/com/fr/design/mainframe/App.java index 3cae10f6bb..c941df8afd 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/App.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/App.java @@ -41,4 +41,15 @@ public interface App extends Mutable, Aftermath { * @return 报表 */ T asIOFile(FILE tplFile); + + + /** + * 输出workbook等对象 + * @param tplFile 文件 + * @param needCheck 是否需要check + * @return + */ + default T asIOFile(FILE tplFile, boolean needCheck) { + return asIOFile(tplFile); + } } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/JTemplateFactory.java b/designer-base/src/main/java/com/fr/design/mainframe/JTemplateFactory.java index 8019cc178a..678b9bf841 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/JTemplateFactory.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/JTemplateFactory.java @@ -56,7 +56,7 @@ public final class JTemplateFactory { String[] defaultAppExtensions = app.defaultExtensions(); for (String defaultAppExtension : defaultAppExtensions) { if (defaultAppExtension.equalsIgnoreCase(fileExtension)) { - BaseBook bb = app.asIOFile(file); + BaseBook bb = app.asIOFile(file, false); if (bb != null) { return (T) bb; } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/app/CptApp.java b/designer-realize/src/main/java/com/fr/design/mainframe/app/CptApp.java index cb6fb8d3e3..adadab36d4 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/app/CptApp.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/app/CptApp.java @@ -42,7 +42,11 @@ class CptApp extends AbstractWorkBookApp { @Override public WorkBook asIOFile(FILE file) { + return asIOFile(file, true); + } + @Override + public WorkBook asIOFile(FILE file, boolean needCheck) { if (XMLEncryptUtils.isCptEncoded() && !XMLEncryptUtils.checkVaild(DesignerEnvManager.getEnvManager().getEncryptionKey())) { if (!new DecodeDialog(file).isPwdRight()) { @@ -67,7 +71,9 @@ class CptApp extends AbstractWorkBookApp { } catch (Exception exp) { FineLoggerFactory.getLogger().error(Toolkit.i18nText("Fine-Design_Report_NS_Exception_ReadError") + file, exp); } - checkNameStyle(namestyle); + if (needCheck) { + checkNameStyle(namestyle); + } return tpl; }