|
|
@ -5,6 +5,8 @@ import com.fr.base.ParameterHelper; |
|
|
|
import com.fr.data.core.db.TableProcedure; |
|
|
|
import com.fr.data.core.db.TableProcedure; |
|
|
|
import com.fr.data.impl.Connection; |
|
|
|
import com.fr.data.impl.Connection; |
|
|
|
import com.fr.data.impl.DBTableData; |
|
|
|
import com.fr.data.impl.DBTableData; |
|
|
|
|
|
|
|
import com.fr.data.impl.JDBCDatabaseConnection; |
|
|
|
|
|
|
|
import com.fr.data.impl.JNDIDatabaseConnection; |
|
|
|
import com.fr.data.impl.NameDatabaseConnection; |
|
|
|
import com.fr.data.impl.NameDatabaseConnection; |
|
|
|
import com.fr.design.ExtraDesignClassManager; |
|
|
|
import com.fr.design.ExtraDesignClassManager; |
|
|
|
import com.fr.design.actions.UpdateAction; |
|
|
|
import com.fr.design.actions.UpdateAction; |
|
|
@ -119,8 +121,8 @@ public class DBTableDataPane extends AbstractTableDataPane<DBTableData> { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
protected void filter(Connection connection, String conName, List<String> nameList) { |
|
|
|
protected void filter(Connection connection, String conName, List<String> nameList) { |
|
|
|
connection.addConnection(nameList, conName, new Class[]{ |
|
|
|
connection.addConnection(nameList, conName, new Class[]{ |
|
|
|
com.fr.data.impl.JDBCDatabaseConnection.class, |
|
|
|
JDBCDatabaseConnection.class, |
|
|
|
com.fr.data.impl.JNDIDatabaseConnection.class |
|
|
|
JNDIDatabaseConnection.class |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -258,14 +260,14 @@ public class DBTableDataPane extends AbstractTableDataPane<DBTableData> { |
|
|
|
toolBarDef.addShortCut(this.dbTableDataMenuHandler.createQueryAction()); |
|
|
|
toolBarDef.addShortCut(this.dbTableDataMenuHandler.createQueryAction()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
UILabel esdSettingsLabel = new UILabel(Toolkit.i18nText("ESD_DBTableData-Pane-Cache-Settings")); |
|
|
|
UILabel esdSettingsLabel = new UILabel(Toolkit.i18nText("Fine-Design_ESD_Cache_Settings")); |
|
|
|
this.configFromList = new UIComboBox(ConfigFrom.values()); |
|
|
|
this.configFromList = new UIComboBox(ConfigFrom.values()); |
|
|
|
this.esdEnabled = new UICheckBox(Toolkit.i18nText("ESD_DBTableData-Pane-Enable-Cache")); |
|
|
|
this.esdEnabled = new UICheckBox(Toolkit.i18nText("Fine-Design_ESD_Enable_Cache")); |
|
|
|
this.barErrorTips = new UILabel(); |
|
|
|
this.barErrorTips = new UILabel(); |
|
|
|
this.barErrorTips.setForeground(Color.RED); |
|
|
|
this.barErrorTips.setForeground(Color.RED); |
|
|
|
this.barErrorTips.setVisible(false); |
|
|
|
this.barErrorTips.setVisible(false); |
|
|
|
|
|
|
|
|
|
|
|
esdSettingsBtn = new UIButton(Toolkit.i18nText("ESD_DBTableData-Pane-Strategy-Config")); |
|
|
|
esdSettingsBtn = new UIButton(Toolkit.i18nText("Fine-Design_ESD_Strategy_Config")); |
|
|
|
|
|
|
|
|
|
|
|
esdSettingsBtn.addActionListener(new ActionListener() { |
|
|
|
esdSettingsBtn.addActionListener(new ActionListener() { |
|
|
|
|
|
|
|
|
|
|
@ -301,12 +303,7 @@ public class DBTableDataPane extends AbstractTableDataPane<DBTableData> { |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
this.configFromList.setSelectedIndex(DBTableDataPane.ConfigFrom.GLOBAL.getIndex()); |
|
|
|
this.configFromList.setSelectedIndex(DBTableDataPane.ConfigFrom.GLOBAL.getIndex()); |
|
|
|
this.configFromList.addActionListener(new ActionListener() { |
|
|
|
this.configFromList.addActionListener(e -> setEsdEnabled()); |
|
|
|
@Override |
|
|
|
|
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
|
|
|
|
setEsdEnabled(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UIToolbar editToolBar = ToolBarDef.createJToolBar(); |
|
|
|
UIToolbar editToolBar = ToolBarDef.createJToolBar(); |
|
|
|
toolBarDef.updateToolBar(editToolBar); |
|
|
|
toolBarDef.updateToolBar(editToolBar); |
|
|
@ -405,7 +402,6 @@ public class DBTableDataPane extends AbstractTableDataPane<DBTableData> { |
|
|
|
|
|
|
|
|
|
|
|
Connection db = dbTableData.getDatabase(); |
|
|
|
Connection db = dbTableData.getDatabase(); |
|
|
|
String query = dbTableData.getQuery(); |
|
|
|
String query = dbTableData.getQuery(); |
|
|
|
boolean isShare = dbTableData.isShare(); |
|
|
|
|
|
|
|
this.pageQuery = dbTableData.getPageQuerySql(); |
|
|
|
this.pageQuery = dbTableData.getPageQuerySql(); |
|
|
|
this.connectionTableProcedurePane.setSelectedDatabaseConnection(db); |
|
|
|
this.connectionTableProcedurePane.setSelectedDatabaseConnection(db); |
|
|
|
this.sqlTextPane.setText(query); |
|
|
|
this.sqlTextPane.setText(query); |
|
|
@ -433,19 +429,19 @@ public class DBTableDataPane extends AbstractTableDataPane<DBTableData> { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected StrategyConfig mapStrategyConfig(DBTableData dbTableData) { |
|
|
|
protected StrategyConfig mapStrategyConfig(DBTableData dbTableData) { |
|
|
|
//获取配置,如果是模版数据集,dbTableData实例应该是ESDBTableData,如果是服务器数据集是DBTableData
|
|
|
|
//获取配置,如果是模版数据集,dbTableData实例应该是DBTableData,如果是服务器数据集是DBTableData
|
|
|
|
StrategyConfig strategyConfig = null; |
|
|
|
StrategyConfig strategyConfig = null; |
|
|
|
if (dbTableData instanceof DBTableData) { |
|
|
|
if (dbTableData != null) { |
|
|
|
//设置保存数据集的事件检查钩子
|
|
|
|
//设置保存数据集的事件检查钩子
|
|
|
|
String tplPath = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getEditingFILE().getPath(); |
|
|
|
String tplPath = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getEditingFILE().getPath(); |
|
|
|
|
|
|
|
|
|
|
|
//新建模版此时不存在,不需要注册钩子
|
|
|
|
//新建模版此时不存在,不需要注册钩子
|
|
|
|
if (((DBTableData) dbTableData).getXmlSavedHook() == null && WorkContext.getWorkResource().exist(tplPath)) { |
|
|
|
if (dbTableData.getXmlSavedHook() == null && WorkContext.getWorkResource().exist(tplPath)) { |
|
|
|
((DBTableData) dbTableData).setXmlSavedHook(new ESDBTableDataSavedHook(tplPath, (DBTableData) dbTableData)); |
|
|
|
dbTableData.setXmlSavedHook(new DBTableDataSavedHook(tplPath, dbTableData)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//获取当前的缓存配置,没有就创建一份
|
|
|
|
//获取当前的缓存配置,没有就创建一份
|
|
|
|
String dsName = ((DBTableData) this.dbTableData).getDsName(); |
|
|
|
String dsName = this.dbTableData.getDsName(); |
|
|
|
strategyConfig = DesignerStrategyConfigUtils.getStrategyConfig(dsName); |
|
|
|
strategyConfig = DesignerStrategyConfigUtils.getStrategyConfig(dsName); |
|
|
|
if (strategyConfig == null && dbTableData.isShare()) { |
|
|
|
if (strategyConfig == null && dbTableData.isShare()) { |
|
|
|
strategyConfig = StrategyConfigHelper.createStrategyConfig(true, false, true); |
|
|
|
strategyConfig = StrategyConfigHelper.createStrategyConfig(true, false, true); |
|
|
@ -603,9 +599,9 @@ public class DBTableDataPane extends AbstractTableDataPane<DBTableData> { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
enum ConfigFrom { |
|
|
|
enum ConfigFrom { |
|
|
|
GLOBAL(0, Toolkit.i18nText("ESD_DBTableData-Pane-Use-Global-Settings")), |
|
|
|
GLOBAL(0, Toolkit.i18nText("Fine-Design_ESD_Use_Global_Settings")), |
|
|
|
|
|
|
|
|
|
|
|
INDIVIDUAL(1, Toolkit.i18nText("ESD_DBTableData-Pane-Use-Individual-Settings")); |
|
|
|
INDIVIDUAL(1, Toolkit.i18nText("Fine-Design_ESD_Use_Individual_Settings")); |
|
|
|
|
|
|
|
|
|
|
|
int index; |
|
|
|
int index; |
|
|
|
|
|
|
|
|
|
|
@ -637,7 +633,7 @@ public class DBTableDataPane extends AbstractTableDataPane<DBTableData> { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static class ESDBTableDataSavedHook implements XMLSavedHook<DBTableData> { |
|
|
|
private static class DBTableDataSavedHook implements XMLSavedHook<DBTableData> { |
|
|
|
|
|
|
|
|
|
|
|
private static final long serialVersionUID = 4925391747683335372L; |
|
|
|
private static final long serialVersionUID = 4925391747683335372L; |
|
|
|
|
|
|
|
|
|
|
@ -648,11 +644,11 @@ public class DBTableDataPane extends AbstractTableDataPane<DBTableData> { |
|
|
|
|
|
|
|
|
|
|
|
private String origQuery; |
|
|
|
private String origQuery; |
|
|
|
|
|
|
|
|
|
|
|
public ESDBTableDataSavedHook(String tplPath, DBTableData origESDBTableData) { |
|
|
|
public DBTableDataSavedHook(String tplPath, DBTableData origDBTableData) { |
|
|
|
this.tplPath = tplPath; |
|
|
|
this.tplPath = tplPath; |
|
|
|
this.origName = origESDBTableData.getDsName(); |
|
|
|
this.origName = origDBTableData.getDsName(); |
|
|
|
this.origConnection = origESDBTableData.getDatabase().toString(); |
|
|
|
this.origConnection = origDBTableData.getDatabase().toString(); |
|
|
|
this.origQuery = origESDBTableData.getQuery(); |
|
|
|
this.origQuery = origDBTableData.getQuery(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|