Browse Source

Pull request #14808: REPORT-134411 DataOperatorProvider接口适配Connection & REPORT-134321 【fr-fbp回归】设计器和服务器网络不通,远程报错未知错误

Merge in DESIGN/design from ~DESTINY.LIN/design:fbp/release to fbp/release

* commit 'ff99fd361f4c971f525b4b778f153031bbb8fb06':
  REPORT-134411 DataOperatorProvider接口适配Connection
  REPORT-134321 【fr-fbp回归】设计器和服务器网络不通,远程报错未知错误
fbp/merge
Destiny.Lin-林锦龙 4 months ago
parent
commit
6744580fa9
  1. 3
      designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java
  2. 10
      designer-base/src/main/java/com/fr/design/actions/server/GlobalTableDataAction.java
  3. 19
      designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java
  4. 9
      designer-base/src/main/java/com/fr/design/data/datapane/preview/ConnectionInfoBeanHelper.java
  5. 6
      designer-base/src/main/java/com/fr/design/gui/ilist/TableViewList.java

3
designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java

@ -180,8 +180,9 @@ public class EnvChangeEntrance {
private boolean doSwitch2Env(final String envName, PopTipStrategy strategy) { private boolean doSwitch2Env(final String envName, PopTipStrategy strategy) {
DesignerWorkspaceInfo selectedEnv = getSelectedEnv(envName); DesignerWorkspaceInfo selectedEnv = getSelectedEnv(envName);
EnvBackupHelper.getInstance().backup();
try { try {
EnvBackupHelper.getInstance().backup();
Workspace workspace = DesignerWorkspaceGenerator.generate(selectedEnv); Workspace workspace = DesignerWorkspaceGenerator.generate(selectedEnv);
if (notValid(workspace, selectedEnv)) { if (notValid(workspace, selectedEnv)) {
return false; return false;

10
designer-base/src/main/java/com/fr/design/actions/server/GlobalTableDataAction.java

@ -25,6 +25,7 @@ import com.fr.esd.event.DSMapping;
import com.fr.esd.event.DsNameTarget; import com.fr.esd.event.DsNameTarget;
import com.fr.esd.event.StrategyEventsNotifier; import com.fr.esd.event.StrategyEventsNotifier;
import com.fr.log.FineLoggerFactory;
import com.fr.report.LockItem; import com.fr.report.LockItem;
import com.fr.security.encryption.transmission.TransmissionEncryptionManager; import com.fr.security.encryption.transmission.TransmissionEncryptionManager;
import com.fr.workspace.server.repository.connection.ConnectionRepository; import com.fr.workspace.server.repository.connection.ConnectionRepository;
@ -86,14 +87,13 @@ public class GlobalTableDataAction extends UpdateAction implements ResponseDataS
final List<ServerDataSetBean> beans = TableDataRepository.getInstance().getAllTableData(); final List<ServerDataSetBean> beans = TableDataRepository.getInstance().getAllTableData();
final Map<String, Connection> connectionMap = ConnectionInfoBeanHelper.createConnectionMap(ConnectionRepository.getInstance().getAll()); final Map<String, Connection> connectionMap = ConnectionInfoBeanHelper.createConnectionMap(ConnectionRepository.getInstance().getAll());
final Map<String, TableData> tableDataMap = new HashMap<>(); final Map<String, TableData> tableDataMap = new HashMap<>();
try { for (ServerDataSetBean bean : beans) {
for (ServerDataSetBean bean : beans) { try {
tableDataMap.put(bean.getDatasetName() , TableDataBeanHelper.getTableDataSet(connectionMap, bean.getDatasetType(), bean.getDatasetData())); tableDataMap.put(bean.getDatasetName() , TableDataBeanHelper.getTableDataSet(connectionMap, bean.getDatasetType(), bean.getDatasetData()));
} catch (Exception e) {
FineLoggerFactory.getLogger().error("[TableData] getTableData :{} failed!", bean.getDatasetName(), e);
} }
} catch (Exception e) {
throw new RuntimeException(e);
} }
final TableDataManagerPane globalTableDataPane = new TableDataManagerPane() { final TableDataManagerPane globalTableDataPane = new TableDataManagerPane() {
public void complete() { public void complete() {
populate(tableDataMap); populate(tableDataMap);

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

@ -349,25 +349,6 @@ public class ConnectionListPane extends JListControlPane implements ConnectionSh
} }
} }
private boolean saveByOldWay(List<String> removedConnNames, List<ConnectionBean> addedOrUpdatedConnections) {
final int remaining = ConnectionConfigProviderFactory.getConfigProvider().getRemainingCon(removedConnNames.size(), addedOrUpdatedConnections.size());
try {
removedConnNames.forEach(n -> ConnectionConfigWriterFactory.getConfigWriter().removeConnection(n));
int innerRemaining = remaining;
for (ConnectionBean cb : addedOrUpdatedConnections) {
if (innerRemaining > 0) {
ConnectionConfigWriterFactory.getConfigWriter().addConnectionWithoutCheck(cb.getName(), cb.getConnection());
innerRemaining--;
} else {
break;
}
}
return true;
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
return false;
}
public static void showDialog(Window parent) { public static void showDialog(Window parent) {
final Map<String, Connection> connectionMap = ConnectionInfoBeanHelper.createConnectionMap(ConnectionRepository.getInstance().getAll()); final Map<String, Connection> connectionMap = ConnectionInfoBeanHelper.createConnectionMap(ConnectionRepository.getInstance().getAll());

9
designer-base/src/main/java/com/fr/design/data/datapane/preview/ConnectionInfoBeanHelper.java

@ -82,16 +82,19 @@ public class ConnectionInfoBeanHelper {
* 根据bean创建连接 * 根据bean创建连接
*/ */
public static Connection createConnection(ConnectionInfoBean infoBean) { public static Connection createConnection(ConnectionInfoBean infoBean) {
Connection connection = null;
try { try {
if (JDBCConnectionProcessor.KEY.acceptConnectionTypes().contains(infoBean.getConnectionType())) { if (JDBCConnectionProcessor.KEY.acceptConnectionTypes().contains(infoBean.getConnectionType())) {
return createJDBCConnection(infoBean); connection = createJDBCConnection(infoBean);
} else { } else {
return ConnectionProcessorFactory.createConnection(infoBean, true); connection = ConnectionProcessorFactory.createConnection(infoBean, true);
} }
connection.setConnectionName(infoBean.getConnectionName());
} catch (Exception e) { } catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e); FineLoggerFactory.getLogger().error(e.getMessage(), e);
return null; return connection;
} }
return connection;
} }
/** /**

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

@ -144,7 +144,7 @@ public class TableViewList extends UIList {
} }
private void clearCache(Connection datasource) { private void clearCache(Connection datasource) {
String[] schemas = DataCoreUtils.getDatabaseSchema(datasource); String[] schemas = DataCoreUtils.getDatabaseSchemaByName(datasource);
schemas = (schemas == null || schemas.length == 0) ? new String[]{null} : schemas; schemas = (schemas == null || schemas.length == 0) ? new String[]{null} : schemas;
for (String schema : schemas) { for (String schema : schemas) {
doClearCache(datasource, schema); doClearCache(datasource, schema);
@ -172,12 +172,12 @@ public class TableViewList extends UIList {
if (datasource == null) { if (datasource == null) {
return defaultListModel; return defaultListModel;
} }
String[] schemas = DataCoreUtils.getDatabaseSchema(datasource); String[] schemas = DataCoreUtils.getDatabaseSchemaByName(datasource);
searchFilter = searchFilter.toLowerCase(); searchFilter = searchFilter.toLowerCase();
boolean isOracleSystemSpace = DesignerEnvManager.getEnvManager().isOracleSystemSpace(); boolean isOracleSystemSpace = DesignerEnvManager.getEnvManager().isOracleSystemSpace();
// oracle不勾选显示所有表,则只显示用户下的(包括存储过程和table表) // oracle不勾选显示所有表,则只显示用户下的(包括存储过程和table表)
DataBaseDetail detail = DataOperator.getInstance().getDataBaseDetail(datasource, isOracleSystemSpace); DataBaseDetail detail = DataOperator.getInstance().getDataBaseDetail(databaseName, isOracleSystemSpace);
if (ArrayUtils.isNotEmpty(detail.getSchemas())) { if (ArrayUtils.isNotEmpty(detail.getSchemas())) {
schemas = detail.getSchemas(); schemas = detail.getSchemas();
} }

Loading…
Cancel
Save