Browse Source

Pull request #14216: REPORT-114391 【微服务适配】远程&本地设计器能够正常启动

Merge in DESIGN/design from ~DESTINY.LIN/design:mss/2.0 to mss/2.0

* commit 'b78b95630d99915f0f7a3162afb367e9afbb4a49':
  REPORT-114391 【微服务适配】远程&本地设计器能够正常启动
  REPORT-114391 【微服务适配】远程&本地设计器能够正常启动
mss/2.0
Destiny.Lin-林锦龙 5 months ago
parent
commit
251a2530dd
  1. 13
      build.gradle
  2. 5
      designer-base/src/main/java/com/fr/design/backup/EnvBackupHelper.java
  3. 6
      designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionComboBoxPanel.java
  4. 83
      designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java
  5. 4
      designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java
  6. 67
      designer-base/src/main/java/com/fr/design/data/datapane/connect/LocalConnectionSource.java
  7. 13
      designer-base/src/main/java/com/fr/design/gui/ilist/TableViewList.java
  8. 19
      designer-realize/src/main/java/com/fanruan/boot/env/DesignEnvComponent.java
  9. 3
      designer-realize/src/main/java/com/fanruan/boot/env/function/DesignDatasourceComponent.java

13
build.gradle

@ -79,17 +79,28 @@ allprojects {
// //
implementation 'com.fr.cbb:fine-cbb-common:' + cbbVersion implementation 'com.fr.cbb:fine-cbb-common:' + cbbVersion
implementation 'com.fr.auth:fine-auth-webui:' + apiVersion implementation 'com.fr.auth:fine-auth-webui:' + apiVersion
//
implementation 'com.fr.portal:fine-portal:' + apiVersion
implementation 'com.fr.portal:fine-portal-api:' + apiVersion implementation 'com.fr.portal:fine-portal-api:' + apiVersion
// cbb
implementation 'com.fr.essential:fine-essential:' + cbbVersion implementation 'com.fr.essential:fine-essential:' + cbbVersion
implementation 'com.fr.cbb:fine-universal-skeleton:' + cbbVersion implementation 'com.fr.cbb:fine-universal-skeleton:' + cbbVersion
// plugin
implementation 'com.fr.plugin:fine-plugin-api:' + apiVersion implementation 'com.fr.plugin:fine-plugin-api:' + apiVersion
implementation 'com.fr.plugin:fine-plugin:' + apiVersion implementation 'com.fr.plugin:fine-plugin:' + apiVersion
//
implementation 'com.fr.workplace:workplace:' + apiVersion
implementation 'com.fr.workplace:workplace-api:' + apiVersion implementation 'com.fr.workplace:workplace-api:' + apiVersion
//
implementation 'com.fr.carina:fine-carina:' + apiVersion implementation 'com.fr.carina:fine-carina:' + apiVersion
// auth
implementation 'com.fr.auth:fine-auth:' + apiVersion
implementation 'com.fr.auth:fine-auth-api:' + apiVersion implementation 'com.fr.auth:fine-auth-api:' + apiVersion
// lic
implementation 'com.fr.license:fine-license-api:' + apiVersion implementation 'com.fr.license:fine-license-api:' + apiVersion
implementation 'com.fr.workplace:workplace:' + apiVersion // cluster
implementation 'com.fr.cluster:fine-cluster-api:' + apiVersion implementation 'com.fr.cluster:fine-cluster-api:' + apiVersion
// messenger
implementation 'com.fr.messenger:fine-messenger:' + carinaVersion implementation 'com.fr.messenger:fine-messenger:' + carinaVersion
implementation 'com.install4j:install4j-runtime:8.0.4' implementation 'com.install4j:install4j-runtime:8.0.4'
implementation 'com.fr.third:jxbrowser:6.23' implementation 'com.fr.third:jxbrowser:6.23'

5
designer-base/src/main/java/com/fr/design/backup/EnvBackupHelper.java

@ -5,6 +5,7 @@ import com.fanruan.config.realm.ConfigRepositoryFactory;
import com.fanruan.config.realm.local.LocalConfigRepositoryBuilder; import com.fanruan.config.realm.local.LocalConfigRepositoryBuilder;
import com.fr.design.ConfigHelper; import com.fr.design.ConfigHelper;
import com.fr.design.mem.MemConfigBackupManager; import com.fr.design.mem.MemConfigBackupManager;
import com.fr.design.mem.MemConfigRepositoryBuilder;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.workspace.WorkContext; import com.fr.workspace.WorkContext;
import com.fr.workspace.Workspace; import com.fr.workspace.Workspace;
@ -71,6 +72,10 @@ public class EnvBackupHelper {
} else { } else {
// 如果是切到远程,先暂时用备份的内存配置,成功后再转到新配置,失败则切回原内存配置 // 如果是切到远程,先暂时用备份的内存配置,成功后再转到新配置,失败则切回原内存配置
MemConfigBackupManager.getInstance().startSwitch(); MemConfigBackupManager.getInstance().startSwitch();
if (local) {
// 原来不是远程,需要先切一下内存配置框架
ConfigRepositoryFactory.getInstance().registerConfigRepositoryBuilder(new MemConfigRepositoryBuilder());
}
} }
} }

6
designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionComboBoxPanel.java

@ -13,8 +13,8 @@ import com.fr.design.gui.ibutton.UILockButton;
import com.fr.report.LockItem; import com.fr.report.LockItem;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.workspace.WorkContext; import com.fr.workspace.WorkContext;
import com.fr.workspace.server.connection.DBConnectAuth;
import com.fr.workspace.server.repository.authority.RemoteAuthorityRepository; import com.fr.workspace.server.repository.authority.RemoteAuthorityRepository;
import com.fr.workspace.server.repository.connection.ConnectionRepository;
import javax.swing.SwingUtilities; import javax.swing.SwingUtilities;
import java.awt.Dimension; import java.awt.Dimension;
@ -80,7 +80,7 @@ public class ConnectionComboBoxPanel extends ItemEditableComboBoxPanel {
* 刷新ComboBox.items * 刷新ComboBox.items
*/ */
protected Iterator<String> items() { protected Iterator<String> items() {
Iterator<String> nameIt = ConnectionConfigProviderFactory.getConfigProvider().getConnections().keySet().iterator(); Iterator<String> nameIt = ConnectionRepository.getInstance().getConnNames().iterator();
Collection<String> noAuthConnections = RemoteAuthorityRepository.getInstance().getNoAuthConnections(); Collection<String> noAuthConnections = RemoteAuthorityRepository.getInstance().getNoAuthConnections();
@ -94,7 +94,7 @@ public class ConnectionComboBoxPanel extends ItemEditableComboBoxPanel {
if (noAuthConnections.contains(conName)) { if (noAuthConnections.contains(conName)) {
continue; continue;
} }
Connection connection = ConnectionConfigProviderFactory.getConfigProvider().getConnection(conName); Connection connection = ConnectionRepository.getInstance().getByName(conName).getConnection();
// nameList依赖items方法初始化,父类ItemEditableComboBoxPanel里异步执行item方法 // nameList依赖items方法初始化,父类ItemEditableComboBoxPanel里异步执行item方法
filterConnection(connection, conName, nameList); filterConnection(connection, conName, nameList);
} }

83
designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java

@ -3,12 +3,11 @@ package com.fr.design.data.datapane.connect;
import com.fanruan.config.impl.data.ConnectionConfigProviderFactory; import com.fanruan.config.impl.data.ConnectionConfigProviderFactory;
import com.fanruan.config.impl.data.ConnectionConfigWriterFactory; import com.fanruan.config.impl.data.ConnectionConfigWriterFactory;
import com.fr.config.remote.RemoteConfigEvent; import com.fr.config.remote.RemoteConfigEvent;
import com.fr.data.driver.DriverClassNotFoundException;
import com.fr.data.impl.Connection; import com.fr.data.impl.Connection;
import com.fr.data.impl.JDBCDatabaseConnection; import com.fr.data.impl.JDBCDatabaseConnection;
import com.fr.data.impl.JNDIDatabaseConnection; import com.fr.data.impl.JNDIDatabaseConnection;
import com.fr.data.metric.utils.DatabaseConnectionMetricHandler; import com.fr.decision.webservice.bean.datasource.ConnectionInfoBean;
import com.fr.data.operator.DataOperator; import com.fr.decision.webservice.v10.datasource.connection.processor.impl.ConnectionProcessorFactory;
import com.fr.design.ExtraDesignClassManager; import com.fr.design.ExtraDesignClassManager;
import com.fr.design.data.MapCompareUtils; import com.fr.design.data.MapCompareUtils;
import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicDialog;
@ -219,27 +218,25 @@ public class ConnectionListPane extends JListControlPane implements ConnectionSh
Arrays.stream(res).map(n -> (NameObject) n).forEach(no -> updatedMap.put(no.getName(), (Connection) no.getObject())); Arrays.stream(res).map(n -> (NameObject) n).forEach(no -> updatedMap.put(no.getName(), (Connection) no.getObject()));
List<String> removedConnNames = new ArrayList<>(); List<String> removedConnNames = new ArrayList<>();
List<ConnectionBean> addConnections = new ArrayList<>(); List<ConnectionInfoBean> addConnections = new ArrayList<>();
List<ConnectionBean> updateConnection = new ArrayList<>(); List<ConnectionInfoBean> updateConnection = new ArrayList<>();
MapCompareUtils.contrastMapEntries(populatedConnectionsSnapshot, updatedMap, (entryEventKind, s, connection) -> { MapCompareUtils.contrastMapEntries(populatedConnectionsSnapshot, updatedMap, (entryEventKind, s, connection) -> {
switch (entryEventKind) { try {
case REMOVED: switch (entryEventKind) {
removedConnNames.add(s); case REMOVED:
break; removedConnNames.add(s);
case ADDED: break;
addConnections.add(new ConnectionBean(connection, s)); case ADDED:
if (connection instanceof JDBCDatabaseConnection) { addConnections.add(ConnectionProcessorFactory.createConnectionInfoBean(s, connection));
DatabaseConnectionMetricHandler.handleSaveConnection((JDBCDatabaseConnection) connection, null); break;
} case UPDATED:
break; updateConnection.add(ConnectionProcessorFactory.createConnectionInfoBean(s, connection));
case UPDATED: break;
updateConnection.add(new ConnectionBean(connection, s)); default:
if (connection instanceof JDBCDatabaseConnection) { break;
DatabaseConnectionMetricHandler.handleSaveConnection((JDBCDatabaseConnection) connection, null); }
} } catch (Exception e) {
break; FineLoggerFactory.getLogger().error(e.getMessage(), e);
default:
break;
} }
}, new MapCompareUtils.UpdateRule<String, Connection>() { }, new MapCompareUtils.UpdateRule<String, Connection>() {
@Override @Override
@ -269,23 +266,22 @@ public class ConnectionListPane extends JListControlPane implements ConnectionSh
} }
}); });
List<ConnectionBean> validateBeans = new ArrayList<>(); List<ConnectionInfoBean> validateBeans = new ArrayList<>();
validateBeans.addAll(addConnections); validateBeans.addAll(addConnections);
validateBeans.addAll(updateConnection); validateBeans.addAll(updateConnection);
this.validateDatabaseType(validateBeans); this.validateDatabaseType(validateBeans);
this.validateConnections(validateBeans); this.alterConnections(addConnections, removedConnNames, updateConnection);
this.alterConnections(new BatchConnectionModifyBean(addConnections, removedConnNames, updateConnection));
} }
/** /**
* 校验是否支持所有新增和修改数据连接的数据库类型 * 校验是否支持所有新增和修改数据连接的数据库类型
*/ */
public void validateDatabaseType(@NotNull List<ConnectionBean> addedOrUpdatedConnections) { public void validateDatabaseType(@NotNull List<ConnectionInfoBean> addedOrUpdatedConnections) throws Exception {
Set<String> notSupportedConnections = new HashSet<>(); Set<String> notSupportedConnections = new HashSet<>();
if (!addedOrUpdatedConnections.isEmpty()) { if (!addedOrUpdatedConnections.isEmpty()) {
for (ConnectionBean bean : addedOrUpdatedConnections) { for (ConnectionInfoBean bean : addedOrUpdatedConnections) {
Connection connection = bean.getConnection(); Connection connection = ConnectionProcessorFactory.createConnection(bean);
// 仅校验jdbc连接,其他插件数据连接不进行校验 // 仅校验jdbc连接,其他插件数据连接不进行校验;
if (connection instanceof JDBCDatabaseConnection) { if (connection instanceof JDBCDatabaseConnection) {
DBTypes dataBaseTypePoint = DataBaseTypePointManager.getInstance().getDataBaseTypePoint(connection.getDriver(), connection.feature()); DBTypes dataBaseTypePoint = DataBaseTypePointManager.getInstance().getDataBaseTypePoint(connection.getDriver(), connection.feature());
if (connectionIsNotSupported(connection, dataBaseTypePoint)) { if (connectionIsNotSupported(connection, dataBaseTypePoint)) {
@ -322,25 +318,18 @@ public class ConnectionListPane extends JListControlPane implements ConnectionSh
} }
private void validateConnections(List<ConnectionBean> addedOrUpdatedConnections) throws Exception { private void alterConnections(List<ConnectionInfoBean> addConnections, List<String> removedConnNames, List<ConnectionInfoBean> updateConnection) {
for (ConnectionBean connectionBean : addedOrUpdatedConnections) {
Connection connection = connectionBean.getConnection();
try {
ConnectionRepository.getInstance().validSettings(new com.fr.workspace.server.entity.connection.ConnectionBean(connection));
} catch (DriverClassNotFoundException e) {
FineLoggerFactory.getLogger().info(e.getMessage());
} catch (Exception e) {
throw new SQLException(Toolkit.i18nText("Fine-Design_Basic_Database_Connection_Invalid_Config", connectionBean.getName()) + ", " + e.getMessage(), e.getCause());
}
}
}
private void alterConnections(BatchConnectionModifyBean bean) {
try { try {
ConnectionRepository.getInstance().save(bean); for (ConnectionInfoBean bean : addConnections) {
ConnectionRepository.getInstance().add(bean);
}
for (ConnectionInfoBean bean : updateConnection) {
ConnectionRepository.getInstance().update(bean);
}
for (String name : removedConnNames) {
ConnectionRepository.getInstance().delete(new ConnectionInfoBean(name));
}
// hades:远程环境时,由于时直接RPC调用远程修改,因此设计器本地配置需要失效 // hades:远程环境时,由于时直接RPC调用远程修改,因此设计器本地配置需要失效
if (!WorkContext.getCurrent().isLocal()) { if (!WorkContext.getCurrent().isLocal()) {
EventDispatcher.fire(RemoteConfigEvent.EDIT, "ConnectionConfig"); EventDispatcher.fire(RemoteConfigEvent.EDIT, "ConnectionConfig");

4
designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java

@ -451,8 +451,8 @@ public class JDBCDefPane extends JPanel {
jdbcDatabase.setPassword(new String(this.passwordTextField.getPassword()).trim()); jdbcDatabase.setPassword(new String(this.passwordTextField.getPassword()).trim());
jdbcDatabase.setOriginalCharsetName(this.originalCharSet); jdbcDatabase.setOriginalCharsetName(this.originalCharSet);
if (this.charSetComboBox.getSelectedIndex() == 0) { if (this.charSetComboBox.getSelectedIndex() == 0) {
jdbcDatabase.setNewCharsetName(null); jdbcDatabase.setNewCharsetName(StringUtils.EMPTY);
jdbcDatabase.setOriginalCharsetName(null); jdbcDatabase.setOriginalCharsetName(StringUtils.EMPTY);
} else { } else {
jdbcDatabase.setNewCharsetName(EncodeConstants.ENCODING_GBK); jdbcDatabase.setNewCharsetName(EncodeConstants.ENCODING_GBK);
jdbcDatabase.setOriginalCharsetName(((String) this.charSetComboBox.getSelectedItem())); jdbcDatabase.setOriginalCharsetName(((String) this.charSetComboBox.getSelectedItem()));

67
designer-base/src/main/java/com/fr/design/data/datapane/connect/LocalConnectionSource.java

@ -0,0 +1,67 @@
package com.fr.design.data.datapane.connect;
import com.fr.data.driver.DriverClassNotFoundException;
import com.fr.data.impl.Connection;
import com.fr.decision.webservice.bean.datasource.ConnectionInfoBean;
import com.fr.decision.webservice.v10.datasource.connection.processor.impl.ConnectionProcessorFactory;
import com.fr.design.i18n.Toolkit;
import com.fr.log.FineLoggerFactory;
import com.fr.workspace.server.repository.connection.BaseConnectionSource;
import java.sql.SQLException;
/**
* 本地Connection资源操作
*
* @author Destiny.Lin
* @since 11.0
* Created on 2024/5/29
*/
public class LocalConnectionSource extends BaseConnectionSource {
@Override
public void add(ConnectionInfoBean bean) throws Exception {
Connection connection = ConnectionProcessorFactory.createConnection(bean);
validate(bean.getConnectionName(), connection);
ConnectionProcessorFactory.addConnection(bean);
}
@Override
public void delete(ConnectionInfoBean bean) throws Exception {
ConnectionProcessorFactory.deleteConnection(bean.getConnectionName());
}
@Override
public void update(ConnectionInfoBean bean) throws Exception {
Connection connection = ConnectionProcessorFactory.createConnection(bean);
validate(bean.getConnectionName(), connection);
ConnectionProcessorFactory.updateConnection(bean.getConnectionName(), bean);
}
@Override
public boolean lock(String str) {
// 本地默认锁定成功,让其执行后续动作
return true;
}
@Override
public boolean unlock(String str) {
// 本地默认解锁成功
return true;
}
@Override
public boolean isLock(String str) {
// 本地默认未锁定
return false;
}
private void validate(String name, Connection connection) throws SQLException {
try {
connection.validateSettings();
} catch (DriverClassNotFoundException e) {
FineLoggerFactory.getLogger().info(e.getMessage());
} catch (Exception e) {
throw new SQLException(Toolkit.i18nText("Fine-Design_Basic_Database_Connection_Invalid_Config", name) + ", " + e.getMessage(), e.getCause());
}
}
}

13
designer-base/src/main/java/com/fr/design/gui/ilist/TableViewList.java

@ -15,6 +15,8 @@ import com.fr.general.ComparatorUtils;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.workspace.server.entity.connection.ConnectionBean;
import com.fr.workspace.server.repository.connection.ConnectionRepository;
import javax.swing.DefaultListCellRenderer; import javax.swing.DefaultListCellRenderer;
import javax.swing.DefaultListModel; import javax.swing.DefaultListModel;
@ -95,13 +97,18 @@ public class TableViewList extends UIList {
@Override @Override
protected DefaultListModel doInBackground() throws Exception { protected DefaultListModel doInBackground() throws Exception {
Connection datasource = ConnectionConfigProviderFactory.getConfigProvider().getConnection(databaseName); Connection datasource = ConnectionRepository.getInstance().getByName(databaseName).getConnection();
boolean status = false; boolean status = false;
int count = 3; int count = 3;
//总共给3次连接的机会 //总共给3次连接的机会
while (!status && count > 0) { while (!status && count > 0) {
status = DataOperator.getInstance().testConnection(datasource); try {
count--; ConnectionRepository.getInstance().testConnection(new ConnectionBean(datasource));
status = true;
break;
} catch (Exception e) {
count--;
}
} }
if (!status) { if (!status) {
throw new Exception(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Database_Connection_Failed")); throw new Exception(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Database_Connection_Failed"));

19
designer-realize/src/main/java/com/fanruan/boot/env/DesignEnvComponent.java vendored

@ -26,6 +26,7 @@ import com.fanruan.kv.factory.KVStoreFactory;
import com.fanruan.kv.manager.CarinaKVManager; import com.fanruan.kv.manager.CarinaKVManager;
import com.fanruan.kv.store.KVStore; import com.fanruan.kv.store.KVStore;
import com.fanruan.kv.store.KVStoreHolder; import com.fanruan.kv.store.KVStoreHolder;
import com.fanruan.workplace.http.RepositoryManager;
import com.fr.cbb.dialect.security.InsecurityElementFactory; import com.fr.cbb.dialect.security.InsecurityElementFactory;
import com.fr.cluster.ClusterBridge; import com.fr.cluster.ClusterBridge;
import com.fr.cluster.lock.ClusterLock; import com.fr.cluster.lock.ClusterLock;
@ -48,11 +49,6 @@ import com.fr.config.holder.ValidateConfigManger;
import com.fr.config.impl.ConfConfigProviderImpl; import com.fr.config.impl.ConfConfigProviderImpl;
import com.fr.config.impl.ConfigInsecurityElementProviderImpl; import com.fr.config.impl.ConfigInsecurityElementProviderImpl;
import com.fr.decision.service.context.ServiceContext; import com.fr.decision.service.context.ServiceContext;
import com.fr.decision.webservice.v10.datasource.connection.processor.impl.ConnectionPluginProcessor;
import com.fr.decision.webservice.v10.datasource.connection.processor.impl.ConnectionProcessorFactory;
import com.fr.decision.webservice.v10.datasource.connection.processor.impl.JDBCConnectionProcessor;
import com.fr.decision.webservice.v10.datasource.connection.processor.impl.JDYConnectionProcessor;
import com.fr.decision.webservice.v10.datasource.connection.processor.impl.JNDIConnectionProcessor;
import com.fr.design.backup.EnvBackupHelper; import com.fr.design.backup.EnvBackupHelper;
import com.fr.env.detect.EnvDetectorCenter; import com.fr.env.detect.EnvDetectorCenter;
import com.fr.event.EventDispatcher; import com.fr.event.EventDispatcher;
@ -79,6 +75,7 @@ import com.fr.scheduler.QuartzContext;
import com.fr.scheduler.SchedulerEvent; import com.fr.scheduler.SchedulerEvent;
import com.fr.scheduler.tenant.ScheduleThreadCurrentTenantProvider; import com.fr.scheduler.tenant.ScheduleThreadCurrentTenantProvider;
import com.fr.security.encryption.EncryptionInitialization; import com.fr.security.encryption.EncryptionInitialization;
import com.fr.security.encryption.SystemEncryptionManager;
import com.fr.security.encryption.core.EncryptionScaffold; import com.fr.security.encryption.core.EncryptionScaffold;
import com.fr.security.encryption.provider.SecuritySeedProvider; import com.fr.security.encryption.provider.SecuritySeedProvider;
import com.fr.security.encryption.storage.keys.LoadSeedSecurityKey; import com.fr.security.encryption.storage.keys.LoadSeedSecurityKey;
@ -273,11 +270,11 @@ public class DesignEnvComponent {
private void startFileServer() throws Exception { private void startFileServer() throws Exception {
if (WorkContext.getCurrent().isLocal()) { if (WorkContext.getCurrent().isLocal()) {
// 设计器远程下不需要文件系统,走PublicRepo的接口,本地下走基础的磁盘读写 // 设计器远程下不需要文件系统,走PublicRepo的接口,本地下走基础的磁盘读写
LocalFileRepository localFileRepository = new LocalFileRepository(ProjectConstants.LOCAL_ENV, ServiceContext.getWebInfPath()); LocalFileRepository.getSingleton().setWorkRoot(ServiceContext.getWebInfPath());
ResourceRepository realRepo = RepositoryFactory.getRepo(); ResourceRepository realRepo = RepositoryFactory.getRepo();
FSProperties fsProperties = Carina.properties(FSProperties.class); FSProperties fsProperties = Carina.properties(FSProperties.class);
FileServer.init( FileServer.init(
new ResourceRepositoryWrapper(localFileRepository, StringUtils.EMPTY), new ResourceRepositoryWrapper(LocalFileRepository.getSingleton(), StringUtils.EMPTY),
new ResourceRepositoryWrapper(realRepo, StringUtils.EMPTY), new ResourceRepositoryWrapper(realRepo, StringUtils.EMPTY),
new ResourceRepositoryWrapper(realRepo, StringUtils.EMPTY), new ResourceRepositoryWrapper(realRepo, StringUtils.EMPTY),
new ResourceRepositoryWrapper(realRepo.generateTenantsSharedRepo(fsProperties.getTenantsSharedNamespace()), StringUtils.EMPTY)); new ResourceRepositoryWrapper(realRepo.generateTenantsSharedRepo(fsProperties.getTenantsSharedNamespace()), StringUtils.EMPTY));
@ -383,6 +380,9 @@ public class DesignEnvComponent {
} }
}); });
LoadSeedSecurityKey.getInstance().init(); LoadSeedSecurityKey.getInstance().init();
} else {
// 远程也先写死加解密,放在内存中就好,fbp那边暂时没有提供扩展,两边都是写死的,等他们提供扩展后设计器再适配
SystemEncryptionManager.getInstance().restore();
} }
} }
@ -403,5 +403,10 @@ public class DesignEnvComponent {
private void startEnvPrepare() { private void startEnvPrepare() {
EnvDetectorCenter.getInstance().init(); EnvDetectorCenter.getInstance().init();
if (WorkContext.getCurrent().isLocal()) {
// 如果是切回本地,要初始化成本地仓库
// 如果是切回远程,会在用户创建的时候就同步初始化远程仓库
RepositoryManager.getInstance().initLocalRepository();
}
} }
} }

3
designer-realize/src/main/java/com/fanruan/boot/env/function/DesignDatasourceComponent.java vendored

@ -15,7 +15,9 @@ import com.fr.decision.webservice.v10.datasource.connection.processor.impl.Conne
import com.fr.decision.webservice.v10.datasource.connection.processor.impl.JDBCConnectionProcessor; import com.fr.decision.webservice.v10.datasource.connection.processor.impl.JDBCConnectionProcessor;
import com.fr.decision.webservice.v10.datasource.connection.processor.impl.JDYConnectionProcessor; import com.fr.decision.webservice.v10.datasource.connection.processor.impl.JDYConnectionProcessor;
import com.fr.decision.webservice.v10.datasource.connection.processor.impl.JNDIConnectionProcessor; import com.fr.decision.webservice.v10.datasource.connection.processor.impl.JNDIConnectionProcessor;
import com.fr.design.data.datapane.connect.LocalConnectionSource;
import com.fr.workspace.server.repository.connection.ConnectionWriterShell; import com.fr.workspace.server.repository.connection.ConnectionWriterShell;
import com.fr.workspace.server.repository.connection.LocalConnectionShell;
/** /**
@ -40,6 +42,7 @@ public class DesignDatasourceComponent extends DatasourceComponent {
ConnectionProcessorFactory.register(JNDIConnectionProcessor.KEY); ConnectionProcessorFactory.register(JNDIConnectionProcessor.KEY);
ConnectionProcessorFactory.register(ConnectionPluginProcessor.KEY); ConnectionProcessorFactory.register(ConnectionPluginProcessor.KEY);
ConnectionProcessorFactory.register(JDYConnectionProcessor.KEY); ConnectionProcessorFactory.register(JDYConnectionProcessor.KEY);
Carina.getApplicationContext().singleton(LocalConnectionShell.class).set(new LocalConnectionSource());
} }
/** /**

Loading…
Cancel
Save