Browse Source

REPORT-114392 FR-FBP版本本地设计适配 部分代码规范+decision依赖去除

mss/2.0
Destiny.Lin 6 months ago
parent
commit
5d136679fd
  1. 2
      build.gradle
  2. 1
      designer-base/src/main/java/com/fr/start/server/DesignEmbedHelper.java
  3. 1
      designer-base/src/main/java/com/fr/start/server/FineEmbedServerActivator.java
  4. 3
      designer-realize/src/main/java/com/fanruan/boot/adaptation/ReportAdaptationComponent.java
  5. 20
      designer-realize/src/main/java/com/fanruan/boot/pre/DesignPreStartComponent.java

2
build.gradle

@ -101,11 +101,9 @@ allprojects {
implementation 'io.socket:socket.io-client:0.7.0'
implementation('com.fr.third:fine-third:' + frVersion) { exclude group: "com.fr.cbb", module: "fine-cbb" }
implementation 'com.fr.core:fine-core:' + frDevVersion
implementation 'com.fr.activator:fine-activator:' + frVersion
implementation 'com.fr.datasource:fine-datasource-api:' + fdlVersion
implementation 'com.fr.datasource:fine-datasource-core:' + fdlVersion
implementation 'com.fr.decision:decision-i18n:' + frVersion
implementation 'com.fr.schedule:fine-schedule:' + frVersion
implementation 'com.fr.report:engine-report:' + frDevVersion
implementation 'com.fr.report:engine-x:' + frDevVersion
implementation 'com.fr.report:engine-chart:' + frDevVersion

1
designer-base/src/main/java/com/fr/start/server/DesignEmbedHelper.java

@ -100,7 +100,6 @@ public class DesignEmbedHelper {
Set<Class<?>> classes = new HashSet<Class<?>>();
classes.add(EmbedWebApplicationInitializer.class);
context.addServletContainerInitializer(initializer, classes);
context.addServletContainerInitializer(new WsSci(), Sets.newHashSet(WebSocketEndpoint.class));
}
/**

1
designer-base/src/main/java/com/fr/start/server/FineEmbedServerActivator.java

@ -91,6 +91,7 @@ public class FineEmbedServerActivator extends Activator {
//直接指定initializer,tomcat就不用再扫描一遍了
SpringServletContainerInitializer initializer = new SpringServletContainerInitializer();
Set<Class<?>> classes = new HashSet<Class<?>>();
/// 该Initializer已去除
//classes.add(FineWebApplicationInitializer.class);
context.addServletContainerInitializer(initializer, classes);
// 后面本地设计的内置服务器考虑用XST

3
designer-realize/src/main/java/com/fanruan/boot/adaptation/ReportAdaptationComponent.java

@ -20,6 +20,9 @@ import com.fr.locale.LocaleScope;
@FineComponent(name = "fine_report_adaptation")
public class ReportAdaptationComponent {
/**
* 启动
*/
@Start
public void start() {
checkI18n();

20
designer-realize/src/main/java/com/fanruan/boot/pre/DesignPreStartComponent.java

@ -84,7 +84,13 @@ import java.util.concurrent.CompletableFuture;
*/
@FineComponent(name = "design_pre_start")
public class DesignPreStartComponent {
private static final String SEPARATOR = "/";
private static final String CPT = ".cpt";
private static final String XML = ".xml";
/**
* 启动
*/
@Start
public void start() throws Exception {
// 1.注册ConfigFactory与对应的membuilder
@ -146,17 +152,17 @@ public class DesignPreStartComponent {
@Override
public @Nullable InputStream getResource(@NotNull String resourcePath) {
if (!resourcePath.startsWith("/")) {
resourcePath = "/" + resourcePath;
if (!resourcePath.startsWith(SEPARATOR)) {
resourcePath = SEPARATOR + resourcePath;
}
InputStream result = null;
try {
if (resourcePath.endsWith(".cpt")) {
if (resourcePath.endsWith(CPT)) {
result = new ByteArrayInputStream(WorkContext.getWorkResource().readFully(CommonUtils.pathJoin(ProjectConstants.REPORTLETS_NAME, resourcePath)));
}
if (resourcePath.endsWith(".xml")) {
if (resourcePath.endsWith(XML)) {
result = new ByteArrayInputStream(WorkContext.getWorkResource().readFully(CommonUtils.pathJoin(ProjectConstants.RESOURCES_NAME, resourcePath)));
}
@ -167,11 +173,7 @@ public class DesignPreStartComponent {
} catch (Exception ignored) {
}
if (resourcePath.startsWith("/")) {
result = ResourceLoader.getResourceAsStream(resourcePath, GeneralUtils.class);
} else {
result = ResourceLoader.getResourceAsStream("/" + resourcePath, GeneralUtils.class);
}
result = ResourceLoader.getResourceAsStream(resourcePath, GeneralUtils.class);
return result;
}
});

Loading…
Cancel
Save