Browse Source

REPORT-114391 【微服务适配】远程&本地设计器能够正常启动 适配数据连接+地图配置

mss/2.0
Destiny.Lin 7 months ago
parent
commit
06f8fd78a8
  1. 15
      designer-base/src/main/java/com/fr/design/backup/DesignContext.java
  2. 2
      designer-base/src/main/java/com/fr/design/utils/DesignUtils.java
  3. 5
      designer-chart/src/main/java/com/fr/van/chart/map/server/ChartMapEditorAction.java

15
designer-base/src/main/java/com/fr/design/backup/DesignContext.java

@ -2,8 +2,8 @@ package com.fr.design.backup;
import com.fanruan.carina.context.CarinaApplicationContext;
import com.fanruan.carina.standard.PartitionManager;
import com.fanruan.carina.standard.PartitionManagerImpl;
import com.fr.start.server.EmptyServletContext;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.StringUtils;
import javax.servlet.ServletContext;
@ -17,7 +17,9 @@ import java.util.Properties;
* Created on 2024/5/14
*/
public class DesignContext extends CarinaApplicationContext {
public static final String WEB_INF = "\\WEB-INF";
private String designWebInfPath;
private String designDataPath;
public DesignContext(ServletContext servletContext, PartitionManager manager, Properties carinaApplicationProperties) {
@ -36,5 +38,14 @@ public class DesignContext extends CarinaApplicationContext {
public void setDesignWebInfPath(String designWebInfPath) {
this.designWebInfPath = designWebInfPath;
if (StringUtils.isNotEmpty(this.designWebInfPath)) {
this.designDataPath = this.designWebInfPath.replace(WEB_INF, StringUtils.EMPTY);
}
FineLoggerFactory.getLogger().info("[DesignContext] designWebInfPath:{}, designDataPath:{}", this.designWebInfPath, this.designDataPath);
}
@Override
public String getDataPath() {
return designDataPath;
}
}

2
designer-base/src/main/java/com/fr/design/utils/DesignUtils.java

@ -438,7 +438,7 @@ public class DesignUtils {
}
private static String getWebBrowserPath() {
String urlPath = WorkContext.getCurrent().getPath() + HttpConstants.FR;
String urlPath = WorkContext.getCurrent().getPath() + HttpConstants.PUBLIC;
DesignerEnvProcessor processor = ExtraDesignClassManager.getInstance().getSingle(DesignerEnvProcessor.XML_TAG);
if (processor != null) {
//cas访问的时候, url要处理下.

5
designer-chart/src/main/java/com/fr/van/chart/map/server/ChartMapEditorAction.java

@ -1,10 +1,9 @@
package com.fr.van.chart.map.server;
import com.fanruan.workplace.http.HttpConstants;
import com.fr.base.ServerConfig;
import com.fr.base.svg.IconUtils;
import com.fr.design.DesignerEnvManager;
import com.fr.design.actions.UpdateAction;
import com.fr.general.GeneralContext;
import com.fr.start.ServerStarter;
import com.fr.start.server.DesignEmbedHelper;
@ -26,7 +25,7 @@ public class ChartMapEditorAction extends UpdateAction {
int port = DesignerEnvManager.getEnvManager().getEmbedServerPort();
String web = DesignEmbedHelper.getAppFolderName();
String serverlet = ServerConfig.getInstance().getServletName();
ServerStarter.browserURLWithLocalEnv(WorkContext.getCurrent().isLocal() ? String.format("http://localhost:%d/%s/%s/map/edit", port, web, serverlet) : WorkContext.getCurrent().getPath() + "/map/edit");
ServerStarter.browserURLWithLocalEnv(WorkContext.getCurrent().isLocal() ? String.format("http://localhost:%d/%s/%s/map/edit", port, web, serverlet) : WorkContext.getCurrent().getPath() + HttpConstants.PUBLIC + "/map/edit");
}
}

Loading…
Cancel
Save