Browse Source

Merge remote-tracking branch 'origin/feature/x' into feature/x

feature/x
Hoky 3 years ago
parent
commit
0506b12a61
  1. 28
      designer-base/src/main/java/com/fr/design/DesignerEnvManager.java
  2. 19
      designer-base/src/main/java/com/fr/file/FILEChooserPane.java
  3. 34
      designer-realize/src/main/java/com/fr/start/module/DesignerStartup.java
  4. 32
      designer-realize/src/main/java/com/fr/start/module/optimized/ReportBaseActivator4Designer.java
  5. 2
      designer-realize/src/main/java/com/fr/start/module/optimized/TenantDBAdapter4Designer.java

28
designer-base/src/main/java/com/fr/design/DesignerEnvManager.java

@ -444,12 +444,35 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
private static File envFile = null; private static File envFile = null;
private File getEnvFile() { private File getEnvFile() {
checkDebugStart();
if (envFile == null) { if (envFile == null) {
envFile = new File(ProductConstants.getEnvHome() + File.separator + ProductConstants.APP_NAME + "Env.xml"); envFile = new File(ProductConstants.getEnvHome() + File.separator + ProductConstants.APP_NAME + "Env.xml");
} }
return envFile; return envFile;
} }
/**
* 在VM options里加入-Ddebug=true激活
*/
private static void checkDebugStart() {
if (ComparatorUtils.equals("true", System.getProperty("debug"))) {
setDebugEnv();
}
}
/**
* 端口改一下环境配置文件改一下便于启动两个设计器进行对比调试
*/
private static void setDebugEnv() {
DesignUtils.setPort(DesignerPort.getInstance().getDebugMessagePort());
DesignerEnvManager.setEnvFile(new File(StableUtils.pathJoin(
ProductConstants.getEnvHome(),
ProductConstants.APP_NAME + "Env_debug.xml"
)));
}
/** /**
* 是否启用了https * 是否启用了https
* *
@ -679,8 +702,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
} }
public boolean isPropertiesUsable() { public boolean isPropertiesUsable() {
// todo return this.propertiesUsable;
return false;
} }
public void setPropertiesUsable(boolean propertiesUsable) { public void setPropertiesUsable(boolean propertiesUsable) {
@ -1911,6 +1933,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
this.setEmbedServerLazyStartup(reader.getAttrAsBoolean("embedServerLazyStartup", false)); this.setEmbedServerLazyStartup(reader.getAttrAsBoolean("embedServerLazyStartup", false));
this.setShowTemplateMissingPlugin(reader.getAttrAsBoolean("showTemplateMissingPlugin", true)); this.setShowTemplateMissingPlugin(reader.getAttrAsBoolean("showTemplateMissingPlugin", true));
this.setUseOptimizedUPM4Adapter(reader.getAttrAsBoolean("useOptimizedUPM4Adapter", SupportOSImpl.MACOS_12_VERSION_ADAPTER.support())); this.setUseOptimizedUPM4Adapter(reader.getAttrAsBoolean("useOptimizedUPM4Adapter", SupportOSImpl.MACOS_12_VERSION_ADAPTER.support()));
this.setPropertiesUsable(reader.getAttrAsBoolean("propertiesUsable", false));
this.setShowServerDatasetAuthTip(reader.getAttrAsBoolean("showServerDatasetAuthTip", true)); this.setShowServerDatasetAuthTip(reader.getAttrAsBoolean("showServerDatasetAuthTip", true));
this.setLayoutTemplateStyle(reader.getAttrAsInt("layoutTemplateStyle", LAYOUT_TEMPLATE_SIMPLE_STYLE)); this.setLayoutTemplateStyle(reader.getAttrAsInt("layoutTemplateStyle", LAYOUT_TEMPLATE_SIMPLE_STYLE));
} }
@ -2189,6 +2212,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
writer.attr("layoutTemplateStyle", this.getLayoutTemplateStyle()); writer.attr("layoutTemplateStyle", this.getLayoutTemplateStyle());
writer.attr("showServerDatasetAuthTip", this.isShowServerDatasetAuthTip()); writer.attr("showServerDatasetAuthTip", this.isShowServerDatasetAuthTip());
writer.attr("useOptimizedUPM4Adapter", this.isUseOptimizedUPM4Adapter()); writer.attr("useOptimizedUPM4Adapter", this.isUseOptimizedUPM4Adapter());
writer.attr("propertiesUsable", this.isPropertiesUsable());
writer.end(); writer.end();
} }

19
designer-base/src/main/java/com/fr/file/FILEChooserPane.java

@ -1495,17 +1495,13 @@ public class FILEChooserPane extends BasicPane {
btn_text = webAppName; btn_text = webAppName;
} }
node_start = matcher.end(); node_start = matcher.end();
if (needTopPath) { if (needTopPath && topPath.equals(btn_text)) {
if (topPath.equals(btn_text)) { needTopPath = false;
needTopPath = false;
} else {
continue;
}
} }
this.buttonList.add(createBlankButton((new SetDirectoryAction(btn_text + '/', this.buttonList.add(createBlankButton((new SetDirectoryAction(btn_text + '/',
// alex:dir.prefix不和btn_path一起参与pathJoin,因为btn_path是否以/打头在unix,linux // alex:dir.prefix不和btn_path一起参与pathJoin,因为btn_path是否以/打头在unix,linux
// OS中意义很不一样 // OS中意义很不一样
FILEFactory.createFolder(dir.prefix() + StableUtils.pathJoin(btn_path, "/")))))); FILEFactory.createFolder(dir.prefix() + StableUtils.pathJoin(btn_path, "/")), !needTopPath))));
} }
maxPathIndex = calculateMaxPathIndex(); maxPathIndex = calculateMaxPathIndex();
@ -1606,6 +1602,7 @@ public class FILEChooserPane extends BasicPane {
private class SetDirectoryAction extends UpdateAction { private class SetDirectoryAction extends UpdateAction {
private FILE dir; private FILE dir;
private boolean response = true;
public SetDirectoryAction(String name) { public SetDirectoryAction(String name) {
this.setName(name); this.setName(name);
@ -1617,9 +1614,15 @@ public class FILEChooserPane extends BasicPane {
this.dir = file; this.dir = file;
} }
public SetDirectoryAction(String name, FILE file, boolean response) {
this.setName(name);
this.dir = file;
this.response = response;
}
@Override @Override
public void actionPerformed(ActionEvent evt) { public void actionPerformed(ActionEvent evt) {
if (dir != null) { if (dir != null && response) {
setSelectedDirectory(dir); setSelectedDirectory(dir);
} }
} }

34
designer-realize/src/main/java/com/fr/start/module/DesignerStartup.java

@ -3,7 +3,6 @@ package com.fr.start.module;
import com.fr.base.OptimizeUtil; import com.fr.base.OptimizeUtil;
import com.fr.concurrent.NamedThreadFactory; import com.fr.concurrent.NamedThreadFactory;
import com.fr.config.dao.DaoSelector;
import com.fr.config.dao.DaoSelectorFactory; import com.fr.config.dao.DaoSelectorFactory;
import com.fr.decision.webservice.v10.encryption.EncryptionConstants; import com.fr.decision.webservice.v10.encryption.EncryptionConstants;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
@ -11,7 +10,6 @@ import com.fr.design.RestartHelper;
import com.fr.design.dialog.TipDialog; import com.fr.design.dialog.TipDialog;
import com.fr.design.env.DesignerWorkspaceInfo; import com.fr.design.env.DesignerWorkspaceInfo;
import com.fr.design.env.DesignerWorkspaceType; import com.fr.design.env.DesignerWorkspaceType;
import com.fr.design.fun.OemProcessor;
import com.fr.design.fun.impl.GlobalListenerProviderManager; import com.fr.design.fun.impl.GlobalListenerProviderManager;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.messagecollect.StartErrorMessageCollector; import com.fr.design.mainframe.messagecollect.StartErrorMessageCollector;
@ -24,23 +22,17 @@ import com.fr.event.Event;
import com.fr.event.Listener; import com.fr.event.Listener;
import com.fr.event.Null; import com.fr.event.Null;
import com.fr.exit.DesignerExiter; import com.fr.exit.DesignerExiter;
import com.fr.general.ComparatorUtils;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.module.Activator; import com.fr.module.Activator;
import com.fr.module.extension.Prepare;
import com.fr.record.analyzer.EnableMetrics; import com.fr.record.analyzer.EnableMetrics;
import com.fr.record.analyzer.Metrics; import com.fr.record.analyzer.Metrics;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.BuildContext; import com.fr.stable.BuildContext;
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 com.fr.start.DesignerProcessType; import com.fr.start.DesignerProcessType;
import com.fr.start.ServerStarter; import com.fr.start.ServerStarter;
import com.fr.start.SplashContext;
import com.fr.start.SplashStrategy;
import com.fr.start.common.SplashCommon;
import com.fr.start.event.LazyStartupEvent; import com.fr.start.event.LazyStartupEvent;
import com.fr.start.server.FineEmbedServer; import com.fr.start.server.FineEmbedServer;
import com.fr.value.NotNullLazyValue; import com.fr.value.NotNullLazyValue;
@ -66,10 +58,6 @@ public class DesignerStartup extends Activator {
@Override @Override
public void beforeAllStart() { public void beforeAllStart() {
BuildContext.setBuildFilePath("/com/fr/stable/build.properties"); BuildContext.setBuildFilePath("/com/fr/stable/build.properties");
// 检查是否是-Ddebug = true 启动 并切换对应的端口以及环境配置文件
checkDebugStart();
// 都是在启动过程中读取,这边提前初始化xml配置
DesignerEnvManager.getEnvManager();
registerDaoSelector(); registerDaoSelector();
@ -163,16 +151,6 @@ public class DesignerStartup extends Activator {
} }
} }
/**
* 在VM options里加入-Ddebug=true激活
*/
private void checkDebugStart() {
if (ComparatorUtils.equals("true", System.getProperty("debug"))) {
setDebugEnv();
}
}
private void registerDaoSelector() { private void registerDaoSelector() {
// 注入设计器db cache 是否可用 // 注入设计器db cache 是否可用
DesignerWorkspaceInfo info = WorkspaceUtils.getWorkspaceInfo(); DesignerWorkspaceInfo info = WorkspaceUtils.getWorkspaceInfo();
@ -188,18 +166,6 @@ public class DesignerStartup extends Activator {
} }
} }
/**
* 端口改一下环境配置文件改一下便于启动两个设计器进行对比调试
*/
private void setDebugEnv() {
DesignUtils.setPort(DesignerPort.getInstance().getDebugMessagePort());
DesignerEnvManager.setEnvFile(new File(StableUtils.pathJoin(
ProductConstants.getEnvHome(),
ProductConstants.APP_NAME + "Env_debug.xml"
)));
}
@Override @Override
public void stop() { public void stop() {
// void // void

32
designer-realize/src/main/java/com/fr/start/module/optimized/ReportBaseActivator4Designer.java

@ -0,0 +1,32 @@
package com.fr.start.module.optimized;
import com.fr.config.dao.DaoSelectorFactory;
import com.fr.event.Event;
import com.fr.event.Listener;
import com.fr.event.Null;
import com.fr.report.module.ReportBaseActivator;
import com.fr.start.event.LazyStartupEvent;
/**
* @author hades
* @version 11.0
* Created by hades on 2022/3/16
*/
public class ReportBaseActivator4Designer extends ReportBaseActivator {
@Override
protected void vcsInit() {
if (DaoSelectorFactory.getDaoSelector().useCacheDao()) {
listenEvent(LazyStartupEvent.INSTANCE, new Listener<Null>() {
@Override
public void on(Event event, Null param) {
ReportBaseActivator4Designer.super.vcsInit();
}
});
} else {
super.vcsInit();
}
}
}

2
designer-realize/src/main/java/com/fr/start/module/optimized/TenantDBAdapter4Designer.java

@ -34,9 +34,9 @@ public class TenantDBAdapter4Designer extends TenantDBAdapter {
} }
private void afterStart() { private void afterStart() {
DesignerEnvManager.getEnvManager().setPropertiesUsable(false);
DaoSwitcher.executeSwitch(); DaoSwitcher.executeSwitch();
ConfigToPropMigrator.getInstance().deletePropertiesCache(); ConfigToPropMigrator.getInstance().deletePropertiesCache();
DesignerEnvManager.getEnvManager().setPropertiesUsable(false);
DesignerEnvManager.getEnvManager().saveXMLFile(); DesignerEnvManager.getEnvManager().saveXMLFile();
} }
} }

Loading…
Cancel
Save