|
|
@ -153,6 +153,10 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { |
|
|
|
* DesignerEnvManager. |
|
|
|
* DesignerEnvManager. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public static DesignerEnvManager getEnvManager() { |
|
|
|
public static DesignerEnvManager getEnvManager() { |
|
|
|
|
|
|
|
return getEnvManager(true); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static DesignerEnvManager getEnvManager(boolean needCheckEnv) { |
|
|
|
if (designerEnvManager == null) { |
|
|
|
if (designerEnvManager == null) { |
|
|
|
designerEnvManager = new DesignerEnvManager(); |
|
|
|
designerEnvManager = new DesignerEnvManager(); |
|
|
|
try { |
|
|
|
try { |
|
|
@ -162,14 +166,8 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// james:如果没有env定义,要设置一个默认的
|
|
|
|
// james:如果没有env定义,要设置一个默认的
|
|
|
|
if (designerEnvManager.nameEnvMap.size() <= 0) { |
|
|
|
if (needCheckEnv) { |
|
|
|
String installHome = StableUtils.getInstallHome(); |
|
|
|
checkNameEnvMap(); |
|
|
|
if (installHome != null) { |
|
|
|
|
|
|
|
String name = Inter.getLocText("FR-Engine_DEFAULT"); |
|
|
|
|
|
|
|
String envPath = StableUtils.pathJoin(new String[]{installHome, ProjectConstants.WEBAPP_NAME, ProjectConstants.WEBINF_NAME}); |
|
|
|
|
|
|
|
designerEnvManager.putEnv(name, LocalEnv.createEnv(envPath)); |
|
|
|
|
|
|
|
designerEnvManager.setCurEnvName(name); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
GeneralContext.addEnvChangedListener(new EnvChangedListener() { |
|
|
|
GeneralContext.addEnvChangedListener(new EnvChangedListener() { |
|
|
@ -187,6 +185,19 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { |
|
|
|
return designerEnvManager; |
|
|
|
return designerEnvManager; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static void checkNameEnvMap() { |
|
|
|
|
|
|
|
if (designerEnvManager == null || designerEnvManager.nameEnvMap.size() > 0) { |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
String installHome = StableUtils.getInstallHome(); |
|
|
|
|
|
|
|
if (installHome != null) { |
|
|
|
|
|
|
|
String name = Inter.getLocText("FR-Engine_DEFAULT"); |
|
|
|
|
|
|
|
String envPath = StableUtils.pathJoin(new String[]{installHome, ProjectConstants.WEBAPP_NAME, ProjectConstants.WEBINF_NAME}); |
|
|
|
|
|
|
|
designerEnvManager.putEnv(name, LocalEnv.createEnv(envPath)); |
|
|
|
|
|
|
|
designerEnvManager.setCurEnvName(name); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 添加设计器中相关的worker |
|
|
|
* 添加设计器中相关的worker |
|
|
|
* |
|
|
|
* |
|
|
|