Browse Source

Merging in latest from upstream (DESIGN/design:refs/heads/release/10.0)

* commit '02e71445c1b5070cc8d871d3a5294f62f2bb9d62':
  无
  CORE-116 fr_username->fine_username等对应的修改,KMS上补充文档,老的保持兼容
  REPORT-9246 设计器中有好多配置修改操作 中夹杂了很多的业务逻辑,将业务逻辑和配置修改剥离出来,Configurations.update操作中尽量只包含修改配置的步骤
  CORE-113 Session管理中心改进+删除侵入性强的日志代码,待重构,不影响基本功能
  DEC-3146 新平台浏览器设置成英文的后台会报NPE 1、整理所有国际化加载相关的代码,统一到core中去加载 2、懒加载:Locale懒加载,文件懒加载 3、后添加的文件覆盖先加载的(即默认插件的国际化可以覆盖原始的国际化) 4、支持remove操作,禁用掉插件后国际化自动清除
  REPORT-9757 【阻塞】磁盘文件选择框的路径少了一个字母=>调整代码
  REPORT-9757 【阻塞】磁盘文件选择框的路径少了一个字母
  REPORT-97399
  REPORT-97399
  REPORT-97399
  REPORT-97399
  REPORT-9734 填报页面设置sheet标签页国际化有问题
master
Hzzz 7 years ago
parent
commit
760a21e7fe
  1. 61
      designer-base/src/main/java/com/fr/design/actions/file/LocalePane.java
  2. 36
      designer-base/src/main/java/com/fr/design/actions/server/ConnectionListAction.java
  3. 20
      designer-base/src/main/java/com/fr/design/actions/server/GlobalParameterAction.java
  4. 42
      designer-base/src/main/java/com/fr/design/actions/server/GlobalTableDataAction.java
  5. 18
      designer-base/src/main/java/com/fr/design/actions/server/ProcedureListAction.java
  6. 29
      designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionComboBoxPanel.java
  7. 132
      designer-base/src/main/java/com/fr/design/formula/VariableResolverAdapter.java
  8. 24
      designer-base/src/main/java/com/fr/file/FileFILE.java
  9. 16
      designer-realize/src/main/java/com/fr/design/actions/report/ReportWebAttrAction.java
  10. 20
      designer-realize/src/main/java/com/fr/design/actions/server/WidgetManagerAction.java
  11. 3
      designer-realize/src/main/java/com/fr/design/dscolumn/SelectedDataColumnPane.java
  12. 12
      designer-realize/src/main/java/com/fr/design/mainframe/errorinfo/ErrorInfoLogAppender.java
  13. 2
      designer-realize/src/main/java/com/fr/design/webattr/WebCssPane.java
  14. 2
      designer-realize/src/main/java/com/fr/design/webattr/WebJsPane.java
  15. 2
      designer-realize/src/main/java/com/fr/design/webattr/WriteToolBarPane.java
  16. 2
      designer-realize/src/main/java/com/fr/design/webattr/WriteWebSettingPane.java

61
designer-base/src/main/java/com/fr/design/actions/file/LocalePane.java

@ -12,10 +12,10 @@ import com.fr.design.gui.itextfield.UITextField;
import com.fr.file.filetree.FileNode; import com.fr.file.filetree.FileNode;
import com.fr.general.GeneralUtils; import com.fr.general.GeneralUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.locale.InterProviderFactory;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.StableUtils; import com.fr.stable.StableUtils;
import com.fr.stable.bridge.StableFactory;
import com.fr.stable.project.ProjectConstants; import com.fr.stable.project.ProjectConstants;
import com.fr.workspace.WorkContext; import com.fr.workspace.WorkContext;
import com.fr.workspace.resource.WorkResourceOutputStream; import com.fr.workspace.resource.WorkResourceOutputStream;
@ -37,7 +37,6 @@ import java.util.List;
import java.util.Locale; import java.util.Locale;
import java.util.Map; import java.util.Map;
import java.util.Properties; import java.util.Properties;
import java.util.ResourceBundle;
import java.util.Set; import java.util.Set;
import java.util.Vector; import java.util.Vector;
@ -121,43 +120,26 @@ public class LocalePane extends BasicPane {
} }
private void initPredefinedProperties() { private void initPredefinedProperties() {
Map<Locale, String> supportLocaleMap = Inter.getSupportLocaleMap(); Map<Locale, String> supportLocaleMap = InterProviderFactory.getProvider().getSupportLocaleMap();
String[] localeFiles = StableFactory.getLocaleFiles(); Map<String, String> map;
List<String> sortKeys = new ArrayList<String>(); List<String> sortKeys = new ArrayList<String>();
for (String path : localeFiles) { map = InterProviderFactory.getProvider().getLocalBundle(Locale.SIMPLIFIED_CHINESE).getMap();
ResourceBundle chineseBundle = loadResourceBundle(path, Locale.SIMPLIFIED_CHINESE); sortKeys.addAll(map.keySet());
sortKeys.addAll(chineseBundle.keySet());
}
Collections.sort(sortKeys); Collections.sort(sortKeys);
Map<Locale, List<ResourceBundle>> localeResourceBundleMap = new HashMap<Locale, List<ResourceBundle>>();
for (Map.Entry<Locale, String> entry : supportLocaleMap.entrySet()) {
Locale locale = entry.getKey();
List<ResourceBundle> list = new ArrayList<>();
for (String path : localeFiles) {
ResourceBundle chineseBundle = loadResourceBundle(path, locale);
list.add(chineseBundle);
}
localeResourceBundleMap.put(locale, list);
}
Map<Locale, Vector<String>> data = new HashMap<Locale, Vector<String>>(); Map<Locale, Vector<String>> data = new HashMap<Locale, Vector<String>>();
for (Map.Entry<Locale, List<ResourceBundle>> entry : localeResourceBundleMap.entrySet()) { for (Locale locale : supportLocaleMap.keySet()) {
Vector<String> column = new Vector<String>(); Vector<String> column = new Vector<String>();
List<ResourceBundle> rbs = entry.getValue();
for (String key : sortKeys) { for (String key : sortKeys) {
column.add(readText(rbs, key)); column.add(InterProviderFactory.getProvider().getLocText(key));
} }
data.put(entry.getKey(), column); data.put(locale, column);
} }
Vector<String> keyVector = new Vector<String>(); Vector<String> keyVector = new Vector<String>();
keyVector.addAll(sortKeys); keyVector.addAll(sortKeys);
@ -167,20 +149,7 @@ public class LocalePane extends BasicPane {
predefineTableModel.addColumn(entry.getKey().getDisplayName(), entry.getValue()); predefineTableModel.addColumn(entry.getKey().getDisplayName(), entry.getValue());
} }
} }
private String readText(List<ResourceBundle> rbs, String key) {
for (ResourceBundle rb : rbs) {
if (rb.containsKey(key)) {
return rb.getString(key);
}
}
return null;
}
private ResourceBundle loadResourceBundle(String dir, Locale locale) {
return ResourceBundle.getBundle(dir, locale, Inter.class.getClassLoader());
}
private void initCustomProperties() throws Exception { private void initCustomProperties() throws Exception {
FileNode[] fileNodes = FRContext.getFileNodes().list(ProjectConstants.LOCALE_NAME); FileNode[] fileNodes = FRContext.getFileNodes().list(ProjectConstants.LOCALE_NAME);

36
designer-base/src/main/java/com/fr/design/actions/server/ConnectionListAction.java

@ -1,7 +1,6 @@
package com.fr.design.actions.server; package com.fr.design.actions.server;
import com.fr.config.Configuration;
import com.fr.data.impl.Connection; import com.fr.data.impl.Connection;
import com.fr.design.actions.UpdateAction; import com.fr.design.actions.UpdateAction;
import com.fr.design.data.datapane.connect.ConnectionManagerPane; import com.fr.design.data.datapane.connect.ConnectionManagerPane;
@ -16,10 +15,11 @@ import com.fr.file.ConnectionConfig;
import com.fr.general.IOUtils; import com.fr.general.IOUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.locale.InterProviderFactory; import com.fr.locale.InterProviderFactory;
import com.fr.transaction.CallBackAdaptor;
import com.fr.transaction.Configurations; import com.fr.transaction.Configurations;
import com.fr.transaction.Worker; import com.fr.transaction.WorkerFacade;
import javax.swing.*; import javax.swing.KeyStroke;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.util.Map; import java.util.Map;
@ -74,26 +74,27 @@ public class ConnectionListAction extends UpdateAction {
final BasicDialog databaseListDialog = databaseManagerPane.showLargeWindow(designerFrame, null); final BasicDialog databaseListDialog = databaseManagerPane.showLargeWindow(designerFrame, null);
databaseListDialog.addDialogActionListener(new DialogActionAdapter() { databaseListDialog.addDialogActionListener(new DialogActionAdapter() {
public void doOk() { public void doOk() {
Configurations.update(new Worker() { if (!databaseManagerPane.isNamePermitted()) {
databaseListDialog.setDoOKSucceed(false);
return;
}
Configurations.modify(new WorkerFacade(ConnectionConfig.class) {
@Override @Override
public void run() { public void run() {
if (!databaseManagerPane.isNamePermitted()) { databaseManagerPane.update(datasourceManager);
databaseListDialog.setDoOKSucceed(false);
return;
}
if (!doWithDatasourceManager(datasourceManager, databaseManagerPane, databaseListDialog)) {
//如果更新失败,则不关闭对话框,也不写xml文件,并且将对话框定位在请重命名的那个对象页面
return;
}
DesignerContext.getDesignerBean("databasename").refreshBeanElement();
} }
}.addCallBack(new CallBackAdaptor() {
@Override @Override
public Class<? extends Configuration>[] targets() { public boolean beforeCommit() {
return new Class[]{ConnectionConfig.class}; //如果更新失败,则不关闭对话框,也不写xml文件,并且将对话框定位在请重命名的那个对象页面
return doWithDatasourceManager(datasourceManager, databaseManagerPane, databaseListDialog);
} }
});
@Override
public void afterCommit() {
DesignerContext.getDesignerBean("databasename").refreshBeanElement();
}
}));
} }
}); });
databaseListDialog.setVisible(true); databaseListDialog.setVisible(true);
@ -109,7 +110,6 @@ public class ConnectionListAction extends UpdateAction {
* @return boolean 是否更新成功 * @return boolean 是否更新成功
*/ */
public static boolean doWithDatasourceManager(ConnectionConfig datasourceManager, ConnectionShowPane connectionShowPane, BasicDialog databaseListDialog) { public static boolean doWithDatasourceManager(ConnectionConfig datasourceManager, ConnectionShowPane connectionShowPane, BasicDialog databaseListDialog) {
connectionShowPane.update(datasourceManager);
boolean isFailed = false; boolean isFailed = false;
//存在请重命名则不能更新 //存在请重命名则不能更新
int index = isConnectionMapContainsRename(datasourceManager); int index = isConnectionMapContainsRename(datasourceManager);

20
designer-base/src/main/java/com/fr/design/actions/server/GlobalParameterAction.java

@ -5,7 +5,6 @@ package com.fr.design.actions.server;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.base.ParameterConfig; import com.fr.base.ParameterConfig;
import com.fr.config.Configuration;
import com.fr.config.ServerPreferenceConfig; import com.fr.config.ServerPreferenceConfig;
import com.fr.design.DesignModelAdapter; import com.fr.design.DesignModelAdapter;
import com.fr.design.actions.UpdateAction; import com.fr.design.actions.UpdateAction;
@ -16,10 +15,11 @@ import com.fr.design.mainframe.DesignerFrame;
import com.fr.design.menu.MenuKeySet; import com.fr.design.menu.MenuKeySet;
import com.fr.design.parameter.ParameterManagerPane; import com.fr.design.parameter.ParameterManagerPane;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.transaction.CallBackAdaptor;
import com.fr.transaction.Configurations; import com.fr.transaction.Configurations;
import com.fr.transaction.Worker; import com.fr.transaction.WorkerFacade;
import javax.swing.*; import javax.swing.KeyStroke;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
@ -49,23 +49,21 @@ public class GlobalParameterAction extends UpdateAction {
parameterManagerPane.populate(ParameterConfig.getInstance().getGlobalParameters()); parameterManagerPane.populate(ParameterConfig.getInstance().getGlobalParameters());
parameterManagerDialog.addDialogActionListener(new DialogActionAdapter() { parameterManagerDialog.addDialogActionListener(new DialogActionAdapter() {
public void doOk() { public void doOk() {
Configurations.update(new Worker() { Configurations.modify(new WorkerFacade(ServerPreferenceConfig.class) {
@Override @Override
public void run() { public void run() {
//apply new parameter list.
parameterManagerPane.update(); parameterManagerPane.update();
}
}.addCallBack(new CallBackAdaptor() {
@Override
public void afterCommit() {
DesignModelAdapter<?, ?> model = DesignModelAdapter.getCurrentModelAdapter(); DesignModelAdapter<?, ?> model = DesignModelAdapter.getCurrentModelAdapter();
if (model != null) { if (model != null) {
model.parameterChanged(); model.parameterChanged();
} }
parameterManagerDialog.setDoOKSucceed(!parameterManagerPane.isContainsRename()); parameterManagerDialog.setDoOKSucceed(!parameterManagerPane.isContainsRename());
} }
}));
@Override
public Class<? extends Configuration>[] targets() {
return new Class[]{ServerPreferenceConfig.class};
}
});
} }
}); });

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

@ -21,10 +21,12 @@ import com.fr.file.ProcedureConfig;
import com.fr.file.TableDataConfig; import com.fr.file.TableDataConfig;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.locale.InterProviderFactory; import com.fr.locale.InterProviderFactory;
import com.fr.transaction.CallBackAdaptor;
import com.fr.transaction.Configurations; import com.fr.transaction.Configurations;
import com.fr.transaction.Worker; import com.fr.transaction.Worker;
import com.fr.transaction.WorkerFacade;
import javax.swing.*; import javax.swing.KeyStroke;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
@ -92,33 +94,35 @@ public class GlobalTableDataAction extends UpdateAction implements ResponseDataS
globalTableDataDialog.addDialogActionListener(new DialogActionAdapter() { globalTableDataDialog.addDialogActionListener(new DialogActionAdapter() {
@Override @Override
public void doOk() { public void doOk() {
Configurations.update(new Worker() { if (!globalTableDataPane.isNamePermitted()) {
globalTableDataDialog.setDoOKSucceed(false);
return;
}
DesignTableDataManager.clearGlobalDs();
Configurations.modify(new WorkerFacade(TableDataConfig.class) {
@Override @Override
public void run() { public void run() {
if (!globalTableDataPane.isNamePermitted()) {
globalTableDataDialog.setDoOKSucceed(false);
return;
}
DesignTableDataManager.clearGlobalDs();
globalTableDataPane.update(tableDataConfig); globalTableDataPane.update(tableDataConfig);
if (!doWithDatasourceManager(tableDataConfig, globalTableDataPane, globalTableDataDialog)) {
//如果更新失败,则不关闭对话框,也不写xml文件,并且将对话框定位在请重命名的那个对象页面
return;
}
// 刷新共有数据集
TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter());
fireDSChanged(globalTableDataPane.getDsChangedNameMap());
} }
}.addCallBack(new CallBackAdaptor() {
@Override @Override
public Class<? extends Configuration>[] targets() { public boolean beforeCommit() {
return new Class[]{TableDataConfig.class}; //如果更新失败,则不关闭对话框,也不写xml文件,并且将对话框定位在请重命名的那个对象页面
return doWithDatasourceManager(tableDataConfig, globalTableDataPane, globalTableDataDialog);
} }
});
@Override
public void afterCommit() {
// 刷新共有数据集
TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter());
fireDSChanged(globalTableDataPane.getDsChangedNameMap());
}
}));
} }
}); });
globalTableDataDialog.setVisible(true); globalTableDataDialog.setVisible(true);

18
designer-base/src/main/java/com/fr/design/actions/server/ProcedureListAction.java

@ -1,7 +1,6 @@
package com.fr.design.actions.server; package com.fr.design.actions.server;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.config.Configuration;
import com.fr.design.DesignModelAdapter; import com.fr.design.DesignModelAdapter;
import com.fr.design.actions.UpdateAction; import com.fr.design.actions.UpdateAction;
import com.fr.design.data.DesignTableDataManager; import com.fr.design.data.DesignTableDataManager;
@ -13,8 +12,9 @@ import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.DesignerFrame; import com.fr.design.mainframe.DesignerFrame;
import com.fr.file.ProcedureConfig; import com.fr.file.ProcedureConfig;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.transaction.CallBackAdaptor;
import com.fr.transaction.Configurations; import com.fr.transaction.Configurations;
import com.fr.transaction.Worker; import com.fr.transaction.WorkerFacade;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
@ -44,20 +44,18 @@ public class ProcedureListAction extends UpdateAction {
BasicDialog databaseListDialog = databaseManagerPane.showLargeWindow(designerFrame, null); BasicDialog databaseListDialog = databaseManagerPane.showLargeWindow(designerFrame, null);
databaseListDialog.addDialogActionListener(new DialogActionAdapter() { databaseListDialog.addDialogActionListener(new DialogActionAdapter() {
public void doOk() { public void doOk() {
Configurations.update(new Worker() { DesignTableDataManager.clearGlobalDs();
Configurations.modify(new WorkerFacade(ProcedureConfig.class) {
@Override @Override
public void run() { public void run() {
DesignTableDataManager.clearGlobalDs();
databaseManagerPane.update(procedureConfig); databaseManagerPane.update(procedureConfig);
TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter());
} }
}.addCallBack(new CallBackAdaptor() {
@Override @Override
public Class<? extends Configuration>[] targets() { public void afterCommit() {
return new Class[]{ProcedureConfig.class}; TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter());
} }
}); }));
} }
}); });
databaseListDialog.setVisible(true); databaseListDialog.setVisible(true);

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

@ -1,7 +1,5 @@
package com.fr.design.data.datapane.connect; package com.fr.design.data.datapane.connect;
import com.fr.base.FRContext;
import com.fr.config.Configuration;
import com.fr.data.impl.AbstractDatabaseConnection; import com.fr.data.impl.AbstractDatabaseConnection;
import com.fr.data.impl.Connection; import com.fr.data.impl.Connection;
import com.fr.data.impl.NameDatabaseConnection; import com.fr.data.impl.NameDatabaseConnection;
@ -13,11 +11,12 @@ import com.fr.design.mainframe.DesignerContext;
import com.fr.file.ConnectionConfig; import com.fr.file.ConnectionConfig;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.transaction.CallBackAdaptor;
import com.fr.transaction.Configurations; import com.fr.transaction.Configurations;
import com.fr.transaction.Worker; import com.fr.transaction.WorkerFacade;
import com.fr.workspace.WorkContext; import com.fr.workspace.WorkContext;
import javax.swing.*; import javax.swing.SwingUtilities;
import java.awt.event.ItemEvent; import java.awt.event.ItemEvent;
import java.awt.event.ItemListener; import java.awt.event.ItemListener;
import java.util.ArrayList; import java.util.ArrayList;
@ -100,22 +99,24 @@ public class ConnectionComboBoxPanel extends ItemEditableComboBoxPanel {
connectionListDialog.setDoOKSucceed(false); connectionListDialog.setDoOKSucceed(false);
return; return;
} }
Configurations.update(new Worker() {
Configurations.modify(new WorkerFacade(ConnectionConfig.class) {
@Override @Override
public void run() { public void run() {
if (!ConnectionListAction.doWithDatasourceManager(connectionConfig, connectionListPane, connectionListPane.update(connectionConfig);
connectionListDialog)) { }
//如果更新失败,则不关闭对话框,也不写xml文件,并且将对话框定位在请重命名的那个对象页面 }.addCallBack(new CallBackAdaptor() {
return; @Override
} public boolean beforeCommit() {
DesignerContext.getDesignerBean("databasename").refreshBeanElement(); //如果更新失败,则不关闭对话框,也不写xml文件,并且将对话框定位在请重命名的那个对象页面
return ConnectionListAction.doWithDatasourceManager(connectionConfig, connectionListPane, connectionListDialog);
} }
@Override @Override
public Class<? extends Configuration>[] targets() { public void afterCommit() {
return new Class[]{ConnectionConfig.class}; DesignerContext.getDesignerBean("databasename").refreshBeanElement();
} }
}); }));
} }
}); });

132
designer-base/src/main/java/com/fr/design/formula/VariableResolverAdapter.java

@ -3,10 +3,10 @@ package com.fr.design.formula;
import com.fr.base.Parameter; import com.fr.base.Parameter;
import com.fr.base.ParameterConfig; import com.fr.base.ParameterConfig;
import com.fr.design.DesignModelAdapter; import com.fr.design.DesignModelAdapter;
import com.fr.general.web.ParameterConstants;
import com.fr.plugin.ExtraClassManager; import com.fr.plugin.ExtraClassManager;
import com.fr.script.ScriptConstants; import com.fr.script.ScriptConstants;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.Constants;
import com.fr.stable.fun.BuiltInParametersProvider; import com.fr.stable.fun.BuiltInParametersProvider;
import com.fr.stable.script.CalculatorProvider; import com.fr.stable.script.CalculatorProvider;
@ -15,91 +15,93 @@ import java.util.List;
import java.util.Set; import java.util.Set;
public abstract class VariableResolverAdapter implements VariableResolver { public abstract class VariableResolverAdapter implements VariableResolver {
private static final int TABLE_DATA_PARA = 0; private static final int TABLE_DATA_PARA = 0;
private static final int REPORT_DATA_PARA = 1; private static final int REPORT_DATA_PARA = 1;
/** /**
* 获取模板内置的一些参数 * 获取模板内置的一些参数
* *
* @return 内置参数 * @return 内置参数
*/ */
public String[] resolveCurReportVariables() { public String[] resolveCurReportVariables() {
String [] variables = new String[] { ScriptConstants.SUMMARY_TAG + "page_number", String[] variables = new String[]{
ScriptConstants.SUMMARY_TAG + "totalPage_number", ScriptConstants.SUMMARY_TAG + "page_number",
// 下面是权限相关的参数 ScriptConstants.SUMMARY_TAG + "totalPage_number",
ScriptConstants.DETAIL_TAG + Constants.P.PRIVILEGE_USERNAME, ScriptConstants.DETAIL_TAG + Constants.P.PRIVILEGE_AUTHORITY, // 下面是权限相关的参数
ScriptConstants.DETAIL_TAG + Constants.P.PRIVILEGE_DEPARTMETN_AND_POST, ScriptConstants.DETAIL_TAG + ParameterConstants.FINE_USERNAME,
// 空值参数 ScriptConstants.DETAIL_TAG + ParameterConstants.FINE_ROLE,
"NULL", "NOFILTER", ScriptConstants.DETAIL_TAG + ParameterConstants.FINE_POSITION,
// request变量 // 空值参数
CalculatorProvider.REPORT_NAME, CalculatorProvider.FORMLET_NAME, CalculatorProvider.SERVLET_URL, CalculatorProvider.SERVER_SCHEMA, CalculatorProvider.SERVER_NAME, "NULL", "NOFILTER",
CalculatorProvider.SERVER_PORT, CalculatorProvider.SERVER_URL, CalculatorProvider.CONTEXT_PATH, CalculatorProvider.SESSION_ID // request变量
}; CalculatorProvider.REPORT_NAME, CalculatorProvider.FORMLET_NAME, CalculatorProvider.SERVLET_URL, CalculatorProvider.SERVER_SCHEMA, CalculatorProvider.SERVER_NAME,
Set<BuiltInParametersProvider> set = ExtraClassManager.getInstance().getArray(BuiltInParametersProvider.XML_TAG); CalculatorProvider.SERVER_PORT, CalculatorProvider.SERVER_URL, CalculatorProvider.CONTEXT_PATH, CalculatorProvider.SESSION_ID
for (BuiltInParametersProvider provider : set) { };
return (String[]) ArrayUtils.addAll(variables, new String []{ Set<BuiltInParametersProvider> set = ExtraClassManager.getInstance().getArray(BuiltInParametersProvider.XML_TAG);
ScriptConstants.DETAIL_TAG + provider.getParametersName() for (BuiltInParametersProvider provider : set) {
}); return (String[]) ArrayUtils.addAll(variables, new String[]{
} ScriptConstants.DETAIL_TAG + provider.getParametersName()
return variables; });
} }
return variables;
private Parameter[] getCurrentModeParameters(int type) { }
Parameter[] parameters = null;
if(DesignModelAdapter.getCurrentModelAdapter() == null) { private Parameter[] getCurrentModeParameters(int type) {
parameters = new Parameter[0]; Parameter[] parameters = null;
} else { if (DesignModelAdapter.getCurrentModelAdapter() == null) {
if(type == TABLE_DATA_PARA) { parameters = new Parameter[0];
parameters = DesignModelAdapter.getCurrentModelAdapter().getTableDataParameters(); } else {
} else if(type == REPORT_DATA_PARA){ if (type == TABLE_DATA_PARA) {
parameters = DesignModelAdapter.getCurrentModelAdapter().getReportParameters(); parameters = DesignModelAdapter.getCurrentModelAdapter().getTableDataParameters();
} } else if (type == REPORT_DATA_PARA) {
} parameters = DesignModelAdapter.getCurrentModelAdapter().getReportParameters();
return parameters; }
} }
return parameters;
}
/** /**
* 获取数据集参数 * 获取数据集参数
* *
* @return 所有参数 * @return 所有参数
*/ */
public String[] resolveTableDataParameterVariables() { public String[] resolveTableDataParameterVariables() {
Parameter[] parameters = getCurrentModeParameters(TABLE_DATA_PARA); Parameter[] parameters = getCurrentModeParameters(TABLE_DATA_PARA);
String[] parameterNames = new String[parameters.length]; String[] parameterNames = new String[parameters.length];
for (int i = 0; i < parameters.length; i++) { for (int i = 0; i < parameters.length; i++) {
parameterNames[i] = ScriptConstants.DETAIL_TAG + parameters[i].getName(); parameterNames[i] = ScriptConstants.DETAIL_TAG + parameters[i].getName();
} }
return parameterNames; return parameterNames;
} }
/** /**
* 获取模板参数 * 获取模板参数
* *
* @return 所有参数 * @return 所有参数
*/ */
public String[] resolveReportParameterVariables() { public String[] resolveReportParameterVariables() {
Parameter[] parameters = getCurrentModeParameters(REPORT_DATA_PARA); Parameter[] parameters = getCurrentModeParameters(REPORT_DATA_PARA);
String[] parameterNames = new String[parameters.length]; String[] parameterNames = new String[parameters.length];
for (int i = 0; i < parameters.length; i++) { for (int i = 0; i < parameters.length; i++) {
parameterNames[i] = ScriptConstants.DETAIL_TAG + parameters[i].getName(); parameterNames[i] = ScriptConstants.DETAIL_TAG + parameters[i].getName();
} }
return parameterNames; return parameterNames;
} }
/** /**
* 获取全局参数 * 获取全局参数
* *
* @return 所有参数 * @return 所有参数
*/ */
public String[] resolveGlobalParameterVariables() { public String[] resolveGlobalParameterVariables() {
// 加上全局的参数 // 加上全局的参数
Parameter[] globalParameters = ParameterConfig.getInstance().getGlobalParameters(); Parameter[] globalParameters = ParameterConfig.getInstance().getGlobalParameters();
List<String> variablesList = new ArrayList<String>(); List<String> variablesList = new ArrayList<String>();
for (int i = 0; i < (globalParameters == null ? 0 : globalParameters.length); i++) { for (int i = 0; i < (globalParameters == null ? 0 : globalParameters.length); i++) {
variablesList.add(ScriptConstants.DETAIL_TAG + (globalParameters[i]).getName()); variablesList.add(ScriptConstants.DETAIL_TAG + (globalParameters[i]).getName());
} }
return variablesList.toArray(new String[variablesList.size()]); return variablesList.toArray(new String[variablesList.size()]);
} }
} }

24
designer-base/src/main/java/com/fr/file/FileFILE.java

@ -1,23 +1,22 @@
package com.fr.file; package com.fr.file;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.ArrayList;
import javax.swing.Icon;
import javax.swing.filechooser.FileSystemView;
import com.fr.base.io.XMLEncryptUtils; import com.fr.base.io.XMLEncryptUtils;
import com.fr.design.gui.itree.filetree.FileComparator; import com.fr.design.gui.itree.filetree.FileComparator;
import com.fr.design.gui.itree.filetree.FileTreeIcon; import com.fr.design.gui.itree.filetree.FileTreeIcon;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.FRLogManager; import com.fr.general.SessionLocalManager;
import com.fr.stable.StableUtils; import com.fr.stable.StableUtils;
import com.fr.stable.project.ProjectConstants; import com.fr.stable.project.ProjectConstants;
import javax.swing.*;
import javax.swing.filechooser.FileSystemView;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.ArrayList;
public class FileFILE implements FILE { public class FileFILE implements FILE {
private File file; private File file;
@ -199,12 +198,11 @@ public class FileFILE implements FILE {
if (file == null || !file.exists()) { if (file == null || !file.exists()) {
return null; return null;
} }
FRLogManager.declareResourceWriteStart(file.getAbsolutePath());
java.io.OutputStream out = null; java.io.OutputStream out = null;
try { try {
out = new FileOutputStream(file); out = new FileOutputStream(file);
} catch (Exception e) { } catch (Exception e) {
throw FRLogManager.createLogPackedException(e); throw SessionLocalManager.createLogPackedException(e);
} }
return out; return out;
} }

16
designer-realize/src/main/java/com/fr/design/actions/report/ReportWebAttrAction.java

@ -3,7 +3,6 @@
*/ */
package com.fr.design.actions.report; package com.fr.design.actions.report;
import com.fr.config.Configuration;
import com.fr.design.actions.JWorkBookAction; import com.fr.design.actions.JWorkBookAction;
import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.DialogActionAdapter;
@ -13,8 +12,9 @@ import com.fr.design.menu.KeySetUtils;
import com.fr.design.webattr.ReportWebAttrPane; import com.fr.design.webattr.ReportWebAttrPane;
import com.fr.general.IOUtils; import com.fr.general.IOUtils;
import com.fr.main.TemplateWorkBook; import com.fr.main.TemplateWorkBook;
import com.fr.transaction.CallBackAdaptor;
import com.fr.transaction.Configurations; import com.fr.transaction.Configurations;
import com.fr.transaction.Worker; import com.fr.transaction.WorkerFacade;
import com.fr.web.attr.ReportWebAttr; import com.fr.web.attr.ReportWebAttr;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
@ -56,19 +56,17 @@ public class ReportWebAttrAction extends JWorkBookAction {
dialog.addDialogActionListener(new DialogActionAdapter() { dialog.addDialogActionListener(new DialogActionAdapter() {
@Override @Override
public void doOk() { public void doOk() {
Configurations.update(new Worker() { Configurations.modify(new WorkerFacade(ReportWebAttr.class) {
@Override @Override
public void run() { public void run() {
wbTpl.setReportWebAttr(reportWebAttrPane.update()); wbTpl.setReportWebAttr(reportWebAttrPane.update());
jwb.fireTargetModified();
} }
}.addCallBack(new CallBackAdaptor() {
@Override @Override
public Class<? extends Configuration>[] targets() { public void afterCommit() {
return new Class[]{ReportWebAttr.class}; jwb.fireTargetModified();
} }
}); }));
} }
}); });

20
designer-realize/src/main/java/com/fr/design/actions/server/WidgetManagerAction.java

@ -1,7 +1,6 @@
package com.fr.design.actions.server; package com.fr.design.actions.server;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.config.Configuration;
import com.fr.design.DesignModelAdapter; import com.fr.design.DesignModelAdapter;
import com.fr.design.actions.UpdateAction; import com.fr.design.actions.UpdateAction;
import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicDialog;
@ -12,10 +11,11 @@ import com.fr.design.menu.MenuKeySet;
import com.fr.design.webattr.WidgetManagerPane; import com.fr.design.webattr.WidgetManagerPane;
import com.fr.form.ui.WidgetInfoConfig; import com.fr.form.ui.WidgetInfoConfig;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.transaction.CallBackAdaptor;
import com.fr.transaction.Configurations; import com.fr.transaction.Configurations;
import com.fr.transaction.Worker; import com.fr.transaction.WorkerFacade;
import javax.swing.*; import javax.swing.KeyStroke;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
public class WidgetManagerAction extends UpdateAction { public class WidgetManagerAction extends UpdateAction {
@ -45,22 +45,22 @@ public class WidgetManagerAction extends UpdateAction {
BasicDialog widgetConfigDialog = widgetManagerPane.showLargeWindow(designerFrame, new DialogActionAdapter() { BasicDialog widgetConfigDialog = widgetManagerPane.showLargeWindow(designerFrame, new DialogActionAdapter() {
@Override @Override
public void doOk() { public void doOk() {
Configurations.update(new Worker() {
Configurations.modify(new WorkerFacade(WidgetInfoConfig.class) {
@Override @Override
public void run() { public void run() {
widgetManagerPane.update(widgetManager); widgetManagerPane.update(widgetManager);
}
}.addCallBack(new CallBackAdaptor() {
@Override
public void afterCommit() {
DesignModelAdapter model = DesignModelAdapter.getCurrentModelAdapter(); DesignModelAdapter model = DesignModelAdapter.getCurrentModelAdapter();
if (model != null) { if (model != null) {
model.widgetConfigChanged(); model.widgetConfigChanged();
} }
designerFrame.getSelectedJTemplate().refreshToolArea(); designerFrame.getSelectedJTemplate().refreshToolArea();
} }
}));
@Override
public Class<? extends Configuration>[] targets() {
return new Class[]{WidgetInfoConfig.class};
}
});
} }
}); });

3
designer-realize/src/main/java/com/fr/design/dscolumn/SelectedDataColumnPane.java

@ -88,6 +88,7 @@ public class SelectedDataColumnPane extends BasicPane {
private static final Pattern COLUMN_NAME_PATTERN = Pattern.compile("[^\\d]"); private static final Pattern COLUMN_NAME_PATTERN = Pattern.compile("[^\\d]");
/** /**
* 数据集下拉框变动后修改数据列下拉框加载状态的监听器 * 数据集下拉框变动后修改数据列下拉框加载状态的监听器
*/ */
@ -236,6 +237,8 @@ public class SelectedDataColumnPane extends BasicPane {
ps = dsColumn.getParameters(); ps = dsColumn.getParameters();
addListener(); addListener();
//重新设置需要加载
columnNameComboBox.setLoaded(false);
} }
/** /**

12
designer-realize/src/main/java/com/fr/design/mainframe/errorinfo/ErrorInfoLogAppender.java

@ -4,19 +4,19 @@ import com.fr.base.io.IOFile;
import com.fr.base.io.XMLReadHelper; import com.fr.base.io.XMLReadHelper;
import com.fr.config.MarketConfig; import com.fr.config.MarketConfig;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
import com.fr.general.FRLogManager; import com.fr.general.SessionLocalManager;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.general.LogDuration;
import com.fr.stable.StableUtils; import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.stable.project.ProjectConstants; import com.fr.stable.project.ProjectConstants;
import com.fr.stable.web.SessionProvider;
import com.fr.stable.xml.XMLPrintWriter; import com.fr.stable.xml.XMLPrintWriter;
import com.fr.stable.xml.XMLableReader; import com.fr.stable.xml.XMLableReader;
import com.fr.third.apache.log4j.AppenderSkeleton; import com.fr.third.apache.log4j.AppenderSkeleton;
import com.fr.third.apache.log4j.Level; import com.fr.third.apache.log4j.Level;
import com.fr.third.apache.log4j.spi.LoggingEvent; import com.fr.third.apache.log4j.spi.LoggingEvent;
import com.fr.web.core.SessionDealWith; import com.fr.web.core.SessionPoolManager;
import com.fr.web.core.SessionIDInfor; import com.fr.web.core.TemplateSessionIDInfo;
import com.fr.workspace.WorkContext; import com.fr.workspace.WorkContext;
import java.io.ByteArrayInputStream; import java.io.ByteArrayInputStream;
@ -96,13 +96,13 @@ public class ErrorInfoLogAppender extends AppenderSkeleton {
} }
private String readTemplateID() { private String readTemplateID() {
LogDuration logDuration = FRLogManager.getSession(); SessionProvider logDuration = SessionLocalManager.getSession();
if (logDuration == null) { if (logDuration == null) {
return StringUtils.EMPTY; return StringUtils.EMPTY;
} }
String sessionID = logDuration.getSessionID(); String sessionID = logDuration.getSessionID();
SessionIDInfor infor = SessionDealWith.getSessionIDInfor(sessionID); TemplateSessionIDInfo infor = SessionPoolManager.getSessionIDInfor(sessionID, TemplateSessionIDInfo.class);
if (infor == null) { if (infor == null) {
return StringUtils.EMPTY; return StringUtils.EMPTY;
} }

2
designer-realize/src/main/java/com/fr/design/webattr/WebCssPane.java

@ -85,7 +85,7 @@ public class WebCssPane extends BasicPane {
if (!"css".equalsIgnoreCase(fileType)) { if (!"css".equalsIgnoreCase(fileType)) {
return; return;
} }
localText.setText(file.getPath().substring(1)); localText.setText(file.getPath());
centerPane.setAddEnabled(true); centerPane.setAddEnabled(true);
} }

2
designer-realize/src/main/java/com/fr/design/webattr/WebJsPane.java

@ -173,7 +173,7 @@ public class WebJsPane extends BasicPane {
if (!"js".equalsIgnoreCase(fileType)) { if (!"js".equalsIgnoreCase(fileType)) {
return; return;
} }
localText.setText(file.getPath().substring(1)); localText.setText(file.getPath());
editingPane.setAddEnabled(true); editingPane.setAddEnabled(true);
} }

2
designer-realize/src/main/java/com/fr/design/webattr/WriteToolBarPane.java

@ -41,7 +41,7 @@ public class WriteToolBarPane extends AbstractEditToolBarPane {
private DragToolBarPane dragToolbarPane; private DragToolBarPane dragToolbarPane;
private UIRadioButton topRadioButton = new UIRadioButton(Inter.getLocText("FR-Designer_Top")); private UIRadioButton topRadioButton = new UIRadioButton(Inter.getLocText("FR-Designer_Top"));
private UIRadioButton bottomRadioButton = new UIRadioButton(Inter.getLocText("FR-Designer_Bottom")); private UIRadioButton bottomRadioButton = new UIRadioButton(Inter.getLocText("FR-Designer_Bottom"));
private UILabel sheetShowLocationLabel = new UILabel("sheet" + Inter.getLocText(new String[]{"Label", "Page_Number", "Display position"}) + ":"); private UILabel sheetShowLocationLabel = new UILabel(Inter.getLocText("Fine-Designer_Sheet_Label_Page_Display_Position"));
private UIRadioButton centerRadioButton = new UIRadioButton(Inter.getLocText("FR-Designer_Center_Display")); private UIRadioButton centerRadioButton = new UIRadioButton(Inter.getLocText("FR-Designer_Center_Display"));
private UIRadioButton leftRadioButton = new UIRadioButton(Inter.getLocText("FR-Designer_Left_Display")); private UIRadioButton leftRadioButton = new UIRadioButton(Inter.getLocText("FR-Designer_Left_Display"));
private UILabel rptShowLocationLabel = new UILabel(Inter.getLocText("FR-Designer_Report_Show_Location") + ":", UILabel.LEFT); private UILabel rptShowLocationLabel = new UILabel(Inter.getLocText("FR-Designer_Report_Show_Location") + ":", UILabel.LEFT);

2
designer-realize/src/main/java/com/fr/design/webattr/WriteWebSettingPane.java

@ -56,7 +56,7 @@ public class WriteWebSettingPane extends WebSettingPane<WebWrite> {
//sheet标签页显示位置 //sheet标签页显示位置
topRadioButton = new UIRadioButton(Inter.getLocText("FR-Designer_Top")); topRadioButton = new UIRadioButton(Inter.getLocText("FR-Designer_Top"));
bottomRadioButton = new UIRadioButton(Inter.getLocText("FR-Designer_Bottom")); bottomRadioButton = new UIRadioButton(Inter.getLocText("FR-Designer_Bottom"));
sheetShowLocationLabel = new UILabel("sheet" + Inter.getLocText(new String[]{"Label", "Page_Number", "Display position"}) + ":", UILabel.LEFT); sheetShowLocationLabel = new UILabel(Inter.getLocText("Fine-Designer_Sheet_Label_Page_Display_Position"), UILabel.LEFT);
ButtonGroup buttonGroup = new ButtonGroup(); ButtonGroup buttonGroup = new ButtonGroup();
bottomRadioButton.setSelected(true); bottomRadioButton.setSelected(true);
buttonGroup.add(topRadioButton); buttonGroup.add(topRadioButton);

Loading…
Cancel
Save