From b79ce4609b9a72b660e19e19f87c740de97ad82a Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Thu, 6 Jun 2024 10:47:36 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-114391=20=E3=80=90=E5=BE=AE=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E9=80=82=E9=85=8D=E3=80=91=E8=BF=9C=E7=A8=8B&?= =?UTF-8?q?=E6=9C=AC=E5=9C=B0=E8=AE=BE=E8=AE=A1=E5=99=A8=E8=83=BD=E5=A4=9F?= =?UTF-8?q?=E6=AD=A3=E5=B8=B8=E5=90=AF=E5=8A=A8=20=E5=85=BC=E5=AE=B9+?= =?UTF-8?q?=E9=97=A8=E6=A7=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/data/DesignTableDataManager.java | 16 +++------------- .../data/datapane/auth/TableDataAuthHelper.java | 3 ++- .../connect/ConnectionComboBoxPanel.java | 3 ++- .../fr/design/env/HttpWorkspaceConnector.java | 2 ++ .../design/gui/itree/filetree/EnvFileTree.java | 3 ++- .../gui/itree/filetree/FileNodeComparator.java | 3 ++- .../gui/itree/filetree/FileNodeConstants.java | 3 ++- .../main/java/com/fr/file/FILEChooserPane.java | 3 ++- .../com/fr/startup/ui/StartupLoadingPanel.java | 5 ++--- .../boot/init/DesignWorkContextComponent.java | 4 +++- .../main/java/com/fr/start/SplashContext.java | 4 ++-- .../fr/start/module/DesignerShowActivator.java | 4 ++-- 12 files changed, 26 insertions(+), 27 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java b/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java index 9bde927d8f..7eadc5760d 100644 --- a/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java +++ b/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java @@ -40,6 +40,7 @@ import com.fr.stable.ParameterProvider; import com.fr.stable.StringUtils; import com.fr.stable.xml.XMLPrintWriter; import com.fr.workspace.server.entity.tabledata.PreviewDataBean; +import com.fr.workspace.server.entity.tabledata.PreviewSourceBean; import com.fr.workspace.server.repository.tabledata.TableDataRepository; import javax.swing.JFrame; @@ -572,10 +573,10 @@ public abstract class DesignTableDataManager { parameter.setValue(parameterMap.get(parameter.getName())); } } - PreviewDataBean bean = new PreviewDataBean(); + PreviewSourceBean bean = new PreviewSourceBean(); TableDataSource source = TableDataSourceTailor.extractTableData(tableDataSource); bean.setDataSource(source); - bean.setDataName(getTableDataName(source, tabledata)); + bean.setDataName(DataOperator.getTableDataName(source, tabledata)); bean.setParameterMap(parameterMap); return (EmbeddedTableData) TableDataRepository.getInstance().previewTableData(bean).getTableData(); } catch (Exception e) { @@ -700,16 +701,5 @@ public abstract class DesignTableDataManager { return globalDsCache.containsKey(tableDataName); } - private static String getTableDataName(TableDataSource source, TableData data) { - Iterator tableDataNameIterator = source.getTableDataNameIterator(); - while (tableDataNameIterator.hasNext()) { - String tableDataName = (String) tableDataNameIterator.next(); - TableData tableData = source.getTableData(tableDataName); - if (tableData.equals(data)) { - return tableDataName; - } - } - return StringUtils.EMPTY; - } } diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/auth/TableDataAuthHelper.java b/designer-base/src/main/java/com/fr/design/data/datapane/auth/TableDataAuthHelper.java index 382e04dd94..79bc1816e4 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/auth/TableDataAuthHelper.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/auth/TableDataAuthHelper.java @@ -7,6 +7,7 @@ import com.fr.data.impl.NameDatabaseConnection; import com.fr.stable.StringUtils; import com.fr.workspace.WorkContext; import com.fr.workspace.server.connection.DBConnectAuth; +import com.fr.workspace.server.repository.authority.RemoteAuthorityRepository; import java.util.Collection; import java.util.Collections; @@ -34,7 +35,7 @@ public class TableDataAuthHelper { */ public static Collection getNoAuthConnections() { // 获取无权限连接集合 - Collection noAuthConnections = WorkContext.getCurrent().get(DBConnectAuth.class).getNoAuthConnections(); + Collection noAuthConnections = RemoteAuthorityRepository.getInstance().getNoAuthConnections(); return noAuthConnections == null ? Collections.emptyList() : noAuthConnections; } diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionComboBoxPanel.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionComboBoxPanel.java index a3c12c890b..28f9b0d507 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionComboBoxPanel.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionComboBoxPanel.java @@ -14,6 +14,7 @@ import com.fr.report.LockItem; import com.fr.stable.StringUtils; import com.fr.workspace.WorkContext; import com.fr.workspace.server.connection.DBConnectAuth; +import com.fr.workspace.server.repository.authority.RemoteAuthorityRepository; import javax.swing.SwingUtilities; import java.awt.Dimension; @@ -81,7 +82,7 @@ public class ConnectionComboBoxPanel extends ItemEditableComboBoxPanel { protected Iterator items() { Iterator nameIt = ConnectionConfigProviderFactory.getConfigProvider().getConnections().keySet().iterator(); - Collection noAuthConnections = WorkContext.getCurrent().get(DBConnectAuth.class).getNoAuthConnections(); + Collection noAuthConnections = RemoteAuthorityRepository.getInstance().getNoAuthConnections(); nameList = new ArrayList<>(); diff --git a/designer-base/src/main/java/com/fr/design/env/HttpWorkspaceConnector.java b/designer-base/src/main/java/com/fr/design/env/HttpWorkspaceConnector.java index d2a708e390..e8f8209b41 100644 --- a/designer-base/src/main/java/com/fr/design/env/HttpWorkspaceConnector.java +++ b/designer-base/src/main/java/com/fr/design/env/HttpWorkspaceConnector.java @@ -2,6 +2,7 @@ package com.fr.design.env; import com.fanruan.workplace.http.HttpConstants; import com.fr.stable.StringUtils; +import com.fr.workspace.server.repository.compatible.register.CompatibleRegister; import com.fr.workspace.server.repository.connect.FineWorkspaceHttpClient; import com.fr.decision.webservice.bean.authentication.LoginRequestInfoBean; import com.fr.decision.webservice.bean.authentication.LoginResponseInfoBean; @@ -49,6 +50,7 @@ public class HttpWorkspaceConnector implements WorkspaceConnector { InetAddress.getLocalHost().getHostAddress()); client.updateConnection(connection); client.startHeartBeat(); + CompatibleRegister.registerCompatibleEnv(); return client; } diff --git a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/EnvFileTree.java b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/EnvFileTree.java index d61b58cf1c..01b5beb68c 100644 --- a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/EnvFileTree.java +++ b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/EnvFileTree.java @@ -12,6 +12,7 @@ import com.fr.log.FineLoggerFactory; import com.fr.stable.CoreConstants; import com.fr.stable.StableUtils; import com.fr.workspace.WorkContext; +import com.fr.workspace.server.repository.template.TemplateRepository; import java.util.HashMap; import java.util.Map; @@ -215,7 +216,7 @@ public class EnvFileTree extends RefreshableJTree { resFns = fileNodes.values().toArray(new FileNode[fileNodes.size()]); } - Arrays.sort(resFns, new FileNodeComparator(FRContext.getFileNodes().getSupportedTypes())); + Arrays.sort(resFns, new FileNodeComparator(TemplateRepository.getInstance().getSupportedTypes())); return resFns; } diff --git a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileNodeComparator.java b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileNodeComparator.java index 9c9533bd4a..1429aac3e0 100644 --- a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileNodeComparator.java +++ b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileNodeComparator.java @@ -2,6 +2,7 @@ package com.fr.design.gui.itree.filetree; import com.fr.base.FRContext; import com.fr.file.filetree.FileNode; +import com.fr.workspace.server.repository.template.TemplateRepository; import java.io.Serializable; import java.util.Arrays; @@ -43,7 +44,7 @@ public class FileNodeComparator implements Comparator, Serializable { @Deprecated public FileNodeComparator(boolean reverse) { this.isReverse = reverse; - this.supportTypes = FRContext.getFileNodes().getSupportedTypes(); + this.supportTypes = TemplateRepository.getInstance().getSupportedTypes(); } public FileNodeComparator(boolean reverse, String[] types) { diff --git a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileNodeConstants.java b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileNodeConstants.java index f5da5302c4..036196f827 100644 --- a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileNodeConstants.java +++ b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileNodeConstants.java @@ -10,6 +10,7 @@ import com.fr.plugin.observer.PluginEvent; import com.fr.plugin.observer.PluginEventListener; import com.fr.report.ExtraReportClassManager; import com.fr.report.fun.ReportSupportedFileProvider; +import com.fr.workspace.server.repository.template.TemplateRepository; import java.util.ArrayList; import java.util.Arrays; @@ -62,7 +63,7 @@ public class FileNodeConstants { for (ReportSupportedFileProvider provider : providers) { addAppExtensions(provider.getFileExtensions()); } - supportFileType.addAll(Arrays.asList(FRContext.getFileNodes().getSupportedTypes())); + supportFileType.addAll(Arrays.asList(TemplateRepository.getInstance().getSupportedTypes())); } finally { rwl.writeLock().unlock(); diff --git a/designer-base/src/main/java/com/fr/file/FILEChooserPane.java b/designer-base/src/main/java/com/fr/file/FILEChooserPane.java index fb3ad45240..78c0378a1f 100644 --- a/designer-base/src/main/java/com/fr/file/FILEChooserPane.java +++ b/designer-base/src/main/java/com/fr/file/FILEChooserPane.java @@ -51,6 +51,7 @@ import com.fr.stable.project.ProjectConstants; import com.fr.workspace.WorkContext; import com.fr.workspace.Workspace; import com.fr.workspace.WorkspaceEvent; +import com.fr.workspace.server.repository.template.TemplateRepository; import javax.swing.AbstractAction; import javax.swing.AbstractListModel; @@ -799,7 +800,7 @@ public class FILEChooserPane extends BasicPane { if (editing == null || !editing.isChartBook()) { if (type == JFileChooser.OPEN_DIALOG) { - ChooseFileFilter supportedTypes = new ChooseFileFilter(FRContext.getFileNodes().getSupportedTypes(), appName + Toolkit.i18nText("Fine-Design_Report_Template_File")); + ChooseFileFilter supportedTypes = new ChooseFileFilter(TemplateRepository.getInstance().getSupportedTypes(), appName + Toolkit.i18nText("Fine-Design_Report_Template_File")); Set providers = ExtraReportClassManager.getInstance().getArray(ReportSupportedFileProvider.XML_TAG); for (ReportSupportedFileProvider provider : providers) { for (FileExtension fileExtension : provider.getFileExtensions()) { diff --git a/designer-base/src/main/java/com/fr/startup/ui/StartupLoadingPanel.java b/designer-base/src/main/java/com/fr/startup/ui/StartupLoadingPanel.java index 59f86fc467..3faf1c2232 100644 --- a/designer-base/src/main/java/com/fr/startup/ui/StartupLoadingPanel.java +++ b/designer-base/src/main/java/com/fr/startup/ui/StartupLoadingPanel.java @@ -8,7 +8,6 @@ import com.fr.design.ui.util.UIUtil; import com.fr.event.Event; import com.fr.event.EventDispatcher; import com.fr.event.Listener; -import com.fr.module.ModuleEvent; import java.awt.Frame; import java.util.concurrent.ScheduledExecutorService; @@ -88,8 +87,8 @@ public class StartupLoadingPanel { } private void initListeners() { - - EventDispatcher.listen(ModuleEvent.MajorModuleStarting, MODULE_LISTENER); + /// 后续换成其他进度方式 + //EventDispatcher.listen(ModuleEvent.MajorModuleStarting, MODULE_LISTENER); } private void resetListeners() { diff --git a/designer-realize/src/main/java/com/fanruan/boot/init/DesignWorkContextComponent.java b/designer-realize/src/main/java/com/fanruan/boot/init/DesignWorkContextComponent.java index e0fb016396..683a3c9974 100644 --- a/designer-realize/src/main/java/com/fanruan/boot/init/DesignWorkContextComponent.java +++ b/designer-realize/src/main/java/com/fanruan/boot/init/DesignWorkContextComponent.java @@ -29,6 +29,7 @@ import com.fr.workspace.resource.WorkResource; import com.fr.workspace.server.repository.authority.RemoteAuthorityRepository; import com.fr.workspace.server.repository.connect.RemoteNetworkRepository; import com.fr.workspace.server.repository.connection.ConnectionRepository; +import com.fr.workspace.server.repository.resource.WorkResourceRepository; import com.fr.workspace.server.repository.system.SystemInfoRepository; import com.fr.workspace.server.repository.tabledata.TableDataRepository; import com.fr.workspace.server.repository.template.TemplateRepository; @@ -76,7 +77,8 @@ public class DesignWorkContextComponent { RepositoryManager.getInstance().pureRegisterRepo4Start(TemplateRepository.getInstance()); RepositoryManager.getInstance().pureRegisterRepo4Start(VcsRepository.getInstance()); RepositoryManager.getInstance().pureRegisterRepo4Start(ShareRepository.getInstance()); - + RepositoryManager.getInstance().pureRegisterRepo4Start(WorkResourceRepository.getInstance()); + RepositoryManager.getInstance().initLocalRepository(); for (WorkRPCRegister workRPCRegister : ServiceContext.group(WorkspaceKey.class).getAll()) { validate(workRPCRegister.getClazz()); FineObjectPool.getInstance().add(workRPCRegister.getClazz(), workRPCRegister.getType(), workRPCRegister.getObject()); diff --git a/designer-realize/src/main/java/com/fr/start/SplashContext.java b/designer-realize/src/main/java/com/fr/start/SplashContext.java index bda4f4f783..e5b7e57198 100644 --- a/designer-realize/src/main/java/com/fr/start/SplashContext.java +++ b/designer-realize/src/main/java/com/fr/start/SplashContext.java @@ -10,7 +10,6 @@ import com.fr.event.Listener; import com.fr.general.GeneralContext; import com.fr.general.locale.LocaleCenter; import com.fr.general.locale.LocaleMark; -import com.fr.module.ModuleEvent; import com.fr.stable.StringUtils; import java.util.Locale; @@ -106,7 +105,8 @@ public class SplashContext { updateModuleLog(moduleId.isEmpty() ? StringUtils.EMPTY : moduleId + loading[loadingIndex % 3]); } }; - EventDispatcher.listen(ModuleEvent.MajorModuleStarting, listener); + /// 后续换成其他进度方式 + //EventDispatcher.listen(ModuleEvent.MajorModuleStarting, listener); } private void updateModuleLog(String text) { diff --git a/designer-realize/src/main/java/com/fr/start/module/DesignerShowActivator.java b/designer-realize/src/main/java/com/fr/start/module/DesignerShowActivator.java index d6e571575a..e826af16ce 100644 --- a/designer-realize/src/main/java/com/fr/start/module/DesignerShowActivator.java +++ b/designer-realize/src/main/java/com/fr/start/module/DesignerShowActivator.java @@ -3,7 +3,6 @@ package com.fr.start.module; import com.fr.design.i18n.Toolkit; import com.fr.event.EventDispatcher; import com.fr.module.Activator; -import com.fr.module.ModuleEvent; import com.fr.start.DesignerInitial; /** @@ -13,7 +12,8 @@ public class DesignerShowActivator extends Activator { @Override public void start() { - EventDispatcher.asyncFire(ModuleEvent.MajorModuleStarting, Toolkit.i18nText("Fine-Design_Module_Name_Designer")); + /// 后续换成其他进度方式 + //EventDispatcher.asyncFire(ModuleEvent.MajorModuleStarting, Toolkit.i18nText("Fine-Design_Module_Name_Designer")); DesignerInitial.prepare(); }