Browse Source

REPORT-139789 fix: FBP SystemOptionProvider 放到 extra-decision

fbp/feature
anner 1 month ago
parent
commit
21d1260dfd
  1. 42
      designer-realize/src/main/java/com/fanruan/boot/adaptation/ReportAdaptationComponent.java

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

@ -4,6 +4,7 @@ import com.fanruan.carina.Carina;
import com.fanruan.carina.annotions.DependsOn; import com.fanruan.carina.annotions.DependsOn;
import com.fanruan.carina.annotions.FineComponent; import com.fanruan.carina.annotions.FineComponent;
import com.fanruan.carina.annotions.Start; import com.fanruan.carina.annotions.Start;
import com.fanruan.carina.context.ContextListener;
import com.fanruan.plugins.resource.PluginResourceHelper; import com.fanruan.plugins.resource.PluginResourceHelper;
import com.fanruan.portal.FinePortal; import com.fanruan.portal.FinePortal;
import com.fanruan.portal.module.PortalModule; import com.fanruan.portal.module.PortalModule;
@ -23,7 +24,6 @@ import com.fr.general.InterProviderImpl;
import com.fr.locale.InterMutableKey; import com.fr.locale.InterMutableKey;
import com.fr.locale.LocaleMarker; import com.fr.locale.LocaleMarker;
import com.fr.locale.LocaleScope; import com.fr.locale.LocaleScope;
import com.fr.plugin.ExtraClassManager;
import com.fr.plugin.context.PluginContext; import com.fr.plugin.context.PluginContext;
import com.fr.plugin.injectable.PluginModule; import com.fr.plugin.injectable.PluginModule;
import com.fr.plugin.observer.PluginEventType; import com.fr.plugin.observer.PluginEventType;
@ -167,25 +167,31 @@ public class ReportAdaptationComponent {
} }
private void registerPluginModules() { private void registerPluginModules() {
// 注册插件模块
try { Carina.getApplicationContext().addListener(new ContextListener() {
Set<SystemOptionProvider> systemOptionProviders = ExtraClassManager.getInstance().getArray(SystemOptionProvider.XML_TAG); @Override
if (!CollectionUtils.isEmpty(systemOptionProviders)) { public void onStart() {
// 资源引入采用新的方式,WebCoalition接口不再继承使用,这里只处理模块注册 // 注册插件模块
for (SystemOptionProvider optionProvider : systemOptionProviders) { try {
PortalModule portalModule = PortalModule.create(optionProvider.id(), optionProvider.displayName()) Set<SystemOptionProvider> systemOptionProviders = ExtraDecisionClassManager.getInstance().getArray(SystemOptionProvider.XML_TAG);
.sortIndex(optionProvider.sortIndex()) if (!CollectionUtils.isEmpty(systemOptionProviders)) {
.dynamicControl(m -> new PluginPortalModuleDevice(optionProvider.parentId(), m)); // 资源引入采用新的方式,WebCoalition接口不再继承使用,这里只处理模块注册
for (SystemOptionProvider optionProvider : systemOptionProviders) {
FinePortal.registerModule(optionProvider.parentId(), portalModule); PortalModule portalModule = PortalModule.create(optionProvider.id(), optionProvider.displayName())
.sortIndex(optionProvider.sortIndex())
// 插件资源注册 .dynamicControl(m -> new PluginPortalModuleDevice(optionProvider.parentId(), m));
PluginResourceHelper.getInstance().registerAtom2Portal(optionProvider);
FinePortal.registerModule(optionProvider.parentId(), portalModule);
// 插件资源注册
PluginResourceHelper.getInstance().registerAtom2Portal(optionProvider);
}
}
} catch (Exception e) {
throw new RuntimeException(e);
} }
} }
} catch (Exception e) { });
throw new RuntimeException(e);
}
} }
private void checkI18n() { private void checkI18n() {
for (LocaleMarker marker : Carina.getApplicationContext().group(InterMutableKey.class).getAll()) { for (LocaleMarker marker : Carina.getApplicationContext().group(InterMutableKey.class).getAll()) {

Loading…
Cancel
Save