Browse Source

Merge pull request #861 in DESIGN/design from ~RINOUX/design:final/10.0 to final/10.0

* commit '860a0c6f0881e4928a47e09b401503a882841d9a':
  import
  BI-44084 紧急提交到final,已联系fiona
final/10.0
Kara 6 years ago
parent
commit
0cc1808d47
  1. 8
      designer-base/src/main/java/com/fr/design/onlineupdate/ui/dialog/RestoreResultDialog.java
  2. 7
      designer-base/src/main/java/com/fr/design/onlineupdate/ui/dialog/UpdateMainDialog.java
  3. 3
      designer-base/src/main/java/com/fr/start/server/FineEmbedServerActivator.java

8
designer-base/src/main/java/com/fr/design/onlineupdate/ui/dialog/RestoreResultDialog.java

@ -1,6 +1,5 @@
package com.fr.design.onlineupdate.ui.dialog; package com.fr.design.onlineupdate.ui.dialog;
import com.fr.base.FRContext;
import com.fr.design.RestartHelper; import com.fr.design.RestartHelper;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
@ -8,11 +7,12 @@ import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.onlineupdate.domain.UpdateConstants; import com.fr.design.onlineupdate.domain.UpdateConstants;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.locale.InterProviderFactory; import com.fr.stable.ProductConstants;
import com.fr.stable.StableUtils; import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.stable.project.ProjectConstants; import com.fr.stable.project.ProjectConstants;
import javax.swing.AbstractAction; import javax.swing.AbstractAction;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.JDialog; import javax.swing.JDialog;
@ -176,8 +176,8 @@ public class RestoreResultDialog extends JDialog {
String backupDir = UpdateConstants.DESIGNER_BACKUP_DIR; String backupDir = UpdateConstants.DESIGNER_BACKUP_DIR;
for (String file : files) { for (String file : files) {
map.put(StableUtils.pathJoin(installHome, backupDir, jarRestoreDir, file), 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)); 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, FRContext.getCommonOperator().getAppName(), 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));
} }
} }
} }

7
designer-base/src/main/java/com/fr/design/onlineupdate/ui/dialog/UpdateMainDialog.java

@ -1,6 +1,5 @@
package com.fr.design.onlineupdate.ui.dialog; package com.fr.design.onlineupdate.ui.dialog;
import com.fr.base.FRContext;
import com.fr.design.RestartHelper; import com.fr.design.RestartHelper;
import com.fr.design.constants.LayoutConstants; import com.fr.design.constants.LayoutConstants;
import com.fr.design.dialog.UIDialog; import com.fr.design.dialog.UIDialog;
@ -684,7 +683,7 @@ public class UpdateMainDialog extends UIDialog {
for (String file : files) { for (String file : files) {
try { try {
IOUtils.copy( 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))); new File(StableUtils.pathJoin(todayBackupDir)));
} catch (IOException e) { } catch (IOException e) {
FineLoggerFactory.getLogger().error(e.getMessage()); FineLoggerFactory.getLogger().error(e.getMessage());
@ -725,8 +724,8 @@ public class UpdateMainDialog extends UIDialog {
private void putNewFilesToInstallEnv(String installHome, String[] files, Map<String, String> map, java.util.List<String> list) { private void putNewFilesToInstallEnv(String installHome, String[] files, Map<String, String> map, java.util.List<String> list) {
for (String file : files) { for (String file : files) {
map.put(StableUtils.pathJoin(installHome, UpdateConstants.DOWNLOAD_DIR, file), 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)); 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, FRContext.getCommonOperator().getAppName(), 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));
} }
} }

3
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.Activator;
import com.fr.module.ModuleRole; import com.fr.module.ModuleRole;
import com.fr.stable.EncodeConstants; import com.fr.stable.EncodeConstants;
import com.fr.stable.ProductConstants;
import com.fr.startup.FineWebApplicationInitializer; import com.fr.startup.FineWebApplicationInitializer;
import com.fr.third.springframework.web.SpringServletContainerInitializer; import com.fr.third.springframework.web.SpringServletContainerInitializer;
import com.fr.third.springframework.web.context.support.AnnotationConfigWebApplicationContext; import com.fr.third.springframework.web.context.support.AnnotationConfigWebApplicationContext;
@ -62,6 +63,8 @@ public class FineEmbedServerActivator extends Activator {
// 设置解码uri使用的字符编码 // 设置解码uri使用的字符编码
tomcat.getConnector().setURIEncoding(EncodeConstants.ENCODING_UTF_8); tomcat.getConnector().setURIEncoding(EncodeConstants.ENCODING_UTF_8);
String docBase = new File(WorkContext.getCurrent().getPath()).getParent(); String docBase = new File(WorkContext.getCurrent().getPath()).getParent();
//内置的上下文是自己定的,这里把WEB_APP_NAME一并设置了,否则下面appName是/null
ProductConstants.setWebAppName(ProductConstants.getAppFolderName());
String appName = "/" + FRContext.getCommonOperator().getAppName(); String appName = "/" + FRContext.getCommonOperator().getAppName();
Context context = tomcat.addContext(appName, docBase); Context context = tomcat.addContext(appName, docBase);
Tomcat.initWebappDefaults(context); Tomcat.initWebappDefaults(context);

Loading…
Cancel
Save