From 3923db4881c1addc816c478e4cf66537d4d328a0 Mon Sep 17 00:00:00 2001 From: rinoux Date: Sun, 28 Apr 2019 17:09:32 +0800 Subject: [PATCH] =?UTF-8?q?BI-44084=20=E7=B4=A7=E6=80=A5=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E5=88=B0final=EF=BC=8C=E5=B7=B2=E8=81=94=E7=B3=BBfiona?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ui/dialog/RestoreResultDialog.java | 19 +++++-------------- .../ui/dialog/UpdateMainDialog.java | 11 +++++------ .../server/FineEmbedServerActivator.java | 3 +++ 3 files changed, 13 insertions(+), 20 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/onlineupdate/ui/dialog/RestoreResultDialog.java b/designer-base/src/main/java/com/fr/design/onlineupdate/ui/dialog/RestoreResultDialog.java index 680d3190dc..d76d24943d 100644 --- a/designer-base/src/main/java/com/fr/design/onlineupdate/ui/dialog/RestoreResultDialog.java +++ b/designer-base/src/main/java/com/fr/design/onlineupdate/ui/dialog/RestoreResultDialog.java @@ -1,6 +1,5 @@ package com.fr.design.onlineupdate.ui.dialog; -import com.fr.base.FRContext; import com.fr.design.RestartHelper; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ilable.UILabel; @@ -8,21 +7,13 @@ import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.onlineupdate.domain.UpdateConstants; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.ComparatorUtils; -import com.fr.locale.InterProviderFactory; +import com.fr.stable.ProductConstants; import com.fr.stable.StableUtils; import com.fr.stable.StringUtils; import com.fr.stable.project.ProjectConstants; -import javax.swing.AbstractAction; -import javax.swing.BorderFactory; -import javax.swing.JDialog; -import javax.swing.JPanel; -import javax.swing.JTextArea; -import java.awt.BorderLayout; -import java.awt.Dialog; -import java.awt.Dimension; -import java.awt.Font; -import java.awt.Frame; +import javax.swing.*; +import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.ArrayList; @@ -176,8 +167,8 @@ public class RestoreResultDialog extends JDialog { String backupDir = UpdateConstants.DESIGNER_BACKUP_DIR; for (String file : files) { map.put(StableUtils.pathJoin(installHome, backupDir, jarRestoreDir, file), - StableUtils.pathJoin(installHome, UpdateConstants.APPS_FOLDER_NAME, FRContext.getCommonOperator().getAppName(), ProjectConstants.WEBINF_NAME, ProjectConstants.LIB_NAME, file)); - list.add(StableUtils.pathJoin(installHome, UpdateConstants.APPS_FOLDER_NAME, FRContext.getCommonOperator().getAppName(), ProjectConstants.WEBINF_NAME, ProjectConstants.LIB_NAME, file)); + StableUtils.pathJoin(installHome, UpdateConstants.APPS_FOLDER_NAME, ProductConstants.getAppFolderName(), ProjectConstants.WEBINF_NAME, ProjectConstants.LIB_NAME, file)); + list.add(StableUtils.pathJoin(installHome, UpdateConstants.APPS_FOLDER_NAME, ProductConstants.getAppFolderName(), ProjectConstants.WEBINF_NAME, ProjectConstants.LIB_NAME, file)); } } } \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/onlineupdate/ui/dialog/UpdateMainDialog.java b/designer-base/src/main/java/com/fr/design/onlineupdate/ui/dialog/UpdateMainDialog.java index 570042d4e4..e0a8fa4de8 100644 --- a/designer-base/src/main/java/com/fr/design/onlineupdate/ui/dialog/UpdateMainDialog.java +++ b/designer-base/src/main/java/com/fr/design/onlineupdate/ui/dialog/UpdateMainDialog.java @@ -1,6 +1,5 @@ package com.fr.design.onlineupdate.ui.dialog; -import com.fr.base.FRContext; import com.fr.design.RestartHelper; import com.fr.design.constants.LayoutConstants; import com.fr.design.dialog.UIDialog; @@ -344,10 +343,10 @@ public class UpdateMainDialog extends UIDialog { add(jarVersionInfoPane, BorderLayout.NORTH); //海外版本不显示更新信息 - if (GeneralContext.getLocale().equals(Locale.CHINA) || GeneralContext.getLocale().equals(Locale.TAIWAN)){ + if (GeneralContext.getLocale().equals(Locale.CHINA) || GeneralContext.getLocale().equals(Locale.TAIWAN)) { add(jarUpdateInfoPane, BorderLayout.CENTER); add(updateActionPane, BorderLayout.SOUTH); - }else { + } else { add(updateActionPane, BorderLayout.CENTER); } @@ -684,7 +683,7 @@ public class UpdateMainDialog extends UIDialog { for (String file : files) { try { IOUtils.copy( - new File(StableUtils.pathJoin(installHome, UpdateConstants.APPS_FOLDER_NAME, FRContext.getCommonOperator().getAppName(), ProjectConstants.WEBINF_NAME, ProjectConstants.LIB_NAME, file)), + new File(StableUtils.pathJoin(installHome, UpdateConstants.APPS_FOLDER_NAME, ProductConstants.getAppFolderName(), ProjectConstants.WEBINF_NAME, ProjectConstants.LIB_NAME, file)), new File(StableUtils.pathJoin(todayBackupDir))); } catch (IOException e) { FineLoggerFactory.getLogger().error(e.getMessage()); @@ -725,8 +724,8 @@ public class UpdateMainDialog extends UIDialog { private void putNewFilesToInstallEnv(String installHome, String[] files, Map map, java.util.List list) { for (String file : files) { map.put(StableUtils.pathJoin(installHome, UpdateConstants.DOWNLOAD_DIR, file), - StableUtils.pathJoin(installHome, UpdateConstants.APPS_FOLDER_NAME, FRContext.getCommonOperator().getAppName(), ProjectConstants.WEBINF_NAME, ProjectConstants.LIB_NAME, file)); - list.add(StableUtils.pathJoin(installHome, UpdateConstants.APPS_FOLDER_NAME, FRContext.getCommonOperator().getAppName(), ProjectConstants.WEBINF_NAME, ProjectConstants.LIB_NAME, file)); + StableUtils.pathJoin(installHome, UpdateConstants.APPS_FOLDER_NAME, ProductConstants.getAppFolderName(), ProjectConstants.WEBINF_NAME, ProjectConstants.LIB_NAME, file)); + list.add(StableUtils.pathJoin(installHome, UpdateConstants.APPS_FOLDER_NAME, ProductConstants.getAppFolderName(), ProjectConstants.WEBINF_NAME, ProjectConstants.LIB_NAME, file)); } } diff --git a/designer-base/src/main/java/com/fr/start/server/FineEmbedServerActivator.java b/designer-base/src/main/java/com/fr/start/server/FineEmbedServerActivator.java index 2d08b286d5..0955c16e57 100644 --- a/designer-base/src/main/java/com/fr/start/server/FineEmbedServerActivator.java +++ b/designer-base/src/main/java/com/fr/start/server/FineEmbedServerActivator.java @@ -6,6 +6,7 @@ import com.fr.log.FineLoggerFactory; import com.fr.module.Activator; import com.fr.module.ModuleRole; import com.fr.stable.EncodeConstants; +import com.fr.stable.ProductConstants; import com.fr.startup.FineWebApplicationInitializer; import com.fr.third.springframework.web.SpringServletContainerInitializer; import com.fr.third.springframework.web.context.support.AnnotationConfigWebApplicationContext; @@ -62,6 +63,8 @@ public class FineEmbedServerActivator extends Activator { // 设置解码uri使用的字符编码 tomcat.getConnector().setURIEncoding(EncodeConstants.ENCODING_UTF_8); String docBase = new File(WorkContext.getCurrent().getPath()).getParent(); + //内置的上下文是自己定的,这里把WEB_APP_NAME一并设置了,否则下面appName是/null + ProductConstants.setWebAppName(ProductConstants.getAppFolderName()); String appName = "/" + FRContext.getCommonOperator().getAppName(); Context context = tomcat.addContext(appName, docBase); Tomcat.initWebappDefaults(context);