Browse Source

Pull request #11327: REPORT-88826 设计器新增不支持的数据库类型未受到限制

Merge in DESIGN/design from ~LEO.QIN/design:release/11.0 to release/11.0

* commit '4da40ee14d3532bdde8e57fb632ccb64f1f80e6b':
  REPORT-88826 修改类实现
  REPORT-88826 修改类名
  REPORT-88826 设计器新增不支持的数据库类型未受到限制 封装DataBaseNotSupportedException用于rpc调用
  REPORT-89171 设计器新增不支持的数据库类型未受到限制 【问题原因】未考虑远程设计下,获取服务器的lic信息 【改动思路】增加rpc接口,获取服务器lic是否限制数据库类型
  REPORT-88826 设计器新增不支持的数据库类型未受到限制 【问题原因】未考虑远程设计下,获取服务器的lic信息 【改动思路】增加rpc接口,获取服务器lic是否限制数据库类型
  REPORT-88365 决策报表,单元格插入数据列,单元格元素页面有异常 【问题原因】单选时默认将cellDSColumnAdvancedPane的visible设为true,导致显示异常 【改动思路】结合cellDSColumnAdvancedPane的原始visible状态及单元格的单选多选状态再进行设置
newui
Leo.Qin-覃宇攀 2 years ago
parent
commit
9a8ecba9a3
  1. 8
      designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java
  2. 20
      designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionManagerPane.java

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

@ -22,7 +22,6 @@ import com.fr.file.ConnectionConfig;
import com.fr.file.ConnectionOperator; import com.fr.file.ConnectionOperator;
import com.fr.general.NameObject; import com.fr.general.NameObject;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.regist.FRCoreContext;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.Nameable; import com.fr.stable.Nameable;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
@ -30,6 +29,7 @@ import com.fr.stable.core.PropertyChangeAdapter;
import com.fr.transaction.Configurations; import com.fr.transaction.Configurations;
import com.fr.transaction.WorkerFacade; import com.fr.transaction.WorkerFacade;
import com.fr.workspace.WorkContext; import com.fr.workspace.WorkContext;
import com.fr.workspace.server.database.DataBaseTypeOperator;
import java.awt.Window; import java.awt.Window;
import java.sql.SQLException; import java.sql.SQLException;
@ -115,6 +115,8 @@ public class ConnectionListPane extends JListControlPane implements ConnectionSh
/** /**
* 创建菜单项 * 创建菜单项
* <p>
* 方法中获取limitDatabaseType使用了远程rpc调用可能会比较耗时
* *
* @return 菜单项 * @return 菜单项
*/ */
@ -132,8 +134,8 @@ public class ConnectionListPane extends JListControlPane implements ConnectionSh
DatabaseConnectionPane.JNDI.class DatabaseConnectionPane.JNDI.class
); );
NameableCreator[] creators; NameableCreator[] creators;
if (FRCoreContext.getLicense().limitDatabaseType()) { if (WorkContext.getCurrent().get(DataBaseTypeOperator.class).limitDatabaseType()) {
// 不支持JDNI,屏蔽接口 // 不支持JNDI,屏蔽接口
creators = new NameableCreator[]{jdbc}; creators = new NameableCreator[]{jdbc};
} else { } else {
creators = new NameableCreator[]{jdbc, jndi}; creators = new NameableCreator[]{jdbc, jndi};

20
designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionManagerPane.java

@ -1,14 +1,17 @@
package com.fr.design.data.datapane.connect; package com.fr.design.data.datapane.connect;
import com.fr.data.impl.Connection; import com.fr.data.impl.Connection;
import com.fr.data.impl.JDBCDatabaseConnection;
import com.fr.design.gui.frpane.LoadingBasicPane; import com.fr.design.gui.frpane.LoadingBasicPane;
import com.fr.design.gui.ilist.ListModelElement; import com.fr.design.gui.ilist.ListModelElement;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.file.ConnectionConfig; import com.fr.file.ConnectionConfig;
import com.fr.general.NameObject; import com.fr.general.NameObject;
import com.fr.license.database.DatabaseTypeValidateUtil;
import com.fr.license.exception.DataBaseNotSupportedException; import com.fr.license.exception.DataBaseNotSupportedException;
import com.fr.stable.Nameable; import com.fr.stable.Nameable;
import com.fr.workspace.WorkContext;
import com.fr.workspace.server.database.DataBaseTypeOperator;
import com.fr.workspace.server.database.DatabaseResultBean;
import javax.swing.JPanel; import javax.swing.JPanel;
import java.awt.BorderLayout; import java.awt.BorderLayout;
@ -73,14 +76,13 @@ public class ConnectionManagerPane extends LoadingBasicPane implements Connectio
ListModelElement selectedValue = this.connectionListPane.getSelectedValue(); ListModelElement selectedValue = this.connectionListPane.getSelectedValue();
if (selectedValue != null) { if (selectedValue != null) {
Nameable wrapper = selectedValue.wrapper; Nameable wrapper = selectedValue.wrapper;
try { Connection connection = (Connection) ((NameObject) wrapper).getObject();
Connection connection = (Connection) ((NameObject) wrapper).getObject(); // 仅校验jdbc连接,其他插件数据连接不进行校验
DatabaseTypeValidateUtil.validateDatabaseType(connection.getDriver(), connection.feature()); if (connection instanceof JDBCDatabaseConnection) {
} catch (DataBaseNotSupportedException e) { DatabaseResultBean bean = WorkContext.getCurrent().get(DataBaseTypeOperator.class).validateDatabaseType(connection.getDriver(), connection.feature());
// 仅抛出数据库类型不支持异常 if (bean.equals(DatabaseResultBean.DefaultBean())) {
throw e; throw new DataBaseNotSupportedException(bean.getMsg());
} catch (Exception e) { }
// ignore
} }
} }
} }

Loading…
Cancel
Save