Browse Source

Merge branch 'release/10.0' of http://cloud.finedevelop.com:2015/scm/~zheng/C-design into release/10.0

bugfix/10.0
zheng 6 years ago
parent
commit
46938326e2
  1. 9
      designer-base/src/main/java/com/fr/design/actions/file/WebPreviewUtils.java
  2. 8
      designer-base/src/main/java/com/fr/design/extra/PluginConstants.java
  3. 7
      designer-base/src/main/java/com/fr/design/extra/WebViewDlgHelper.java
  4. 6
      designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java
  5. 47
      designer-base/src/main/java/com/fr/design/gui/ilist/TableViewList.java
  6. 37
      designer-base/src/main/java/com/fr/design/gui/itree/filetree/TemplateFileTree.java
  7. 2
      designer-chart/src/main/java/com/fr/van/chart/DownloadOnlineSourcesHelper.java
  8. 5
      designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java
  9. 7
      designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapPlotPane.java
  10. 8
      designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ParaMobileDefinePane.java

9
designer-base/src/main/java/com/fr/design/actions/file/WebPreviewUtils.java

@ -1,6 +1,5 @@
package com.fr.design.actions.file;
import com.fr.base.extension.FileExtension;
import com.fr.base.vcs.DesignerMode;
import com.fr.design.fun.PreviewProvider;
import com.fr.design.mainframe.DesignerContext;
@ -11,7 +10,6 @@ import com.fr.file.FileNodeFILE;
import com.fr.general.GeneralUtils;
import com.fr.general.web.ParameterConstants;
import com.fr.stable.project.ProjectConstants;
import com.fr.stable.web.AbstractWebletCreator;
import javax.swing.JOptionPane;
import java.util.Collections;
@ -90,13 +88,6 @@ public final class WebPreviewUtils {
java.util.List<String> parameterNameList = new java.util.ArrayList<String>();
java.util.List<String> parameterValueList = new java.util.ArrayList<String>();
// 暂时屏蔽cptx直接访问
if (path.endsWith(FileExtension.CPTX.getSuffix())) {
path = path.substring(0, path.length() - 1);
parameterNameList.add(AbstractWebletCreator.FORMAT);
parameterValueList.add(AbstractWebletCreator.X);
}
parameterNameList.add(actionType);
parameterValueList.add(path);
if (map != null) {

8
designer-base/src/main/java/com/fr/design/extra/PluginConstants.java

@ -1,14 +1,14 @@
package com.fr.design.extra;
import com.fr.stable.StableUtils;
import com.fr.workspace.WorkContext;
/**
* Created by ibm on 2017/5/25.
*/
public class PluginConstants {
public static final int BYTES_NUM = 1024;
private static final String TEMP_PATH = System.getProperty("user.dir") + "/tmp";
public static final String DOWNLOAD_PATH = System.getProperty("user.dir") + "/download";
//插件依赖的下载位置
public static final String DEPENDENCE_DOWNLOAD_PATH = System.getProperty("user.dir") + "/download/dependence";
public static final String DOWNLOAD_PATH = StableUtils.pathJoin(WorkContext.getCurrent().getPath() + "/cache");
public static final String TEMP_FILE = "temp.zip";
public static final String CONNECTION_404 = "404";

7
designer-base/src/main/java/com/fr/design/extra/WebViewDlgHelper.java

@ -16,6 +16,7 @@ import com.fr.json.JSONObject;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.PluginStoreConstants;
import com.fr.plugin.PluginVerifyException;
import com.fr.stable.CommonUtils;
import com.fr.stable.EnvChangedListener;
import com.fr.stable.ProductConstants;
import com.fr.stable.StableUtils;
@ -280,7 +281,11 @@ public class WebViewDlgHelper {
try {
if (get()) {
IOUtils.unzip(new File(StableUtils.pathJoin(PluginConstants.DOWNLOAD_PATH, PluginConstants.TEMP_FILE)), installHome);
File scriptZip = new File(StableUtils.pathJoin(PluginConstants.DOWNLOAD_PATH, PluginConstants.TEMP_FILE));
if(scriptZip.exists()){
IOUtils.unzip(scriptZip, installHome);
CommonUtils.deleteFile(scriptZip);
}
PluginStoreConstants.refreshProps(); // 下载完刷新一下版本号等
JOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Shop_Installed"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tool_Tips"), JOptionPane.INFORMATION_MESSAGE);
}

6
designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java

@ -372,6 +372,12 @@ public class HistoryTemplateListCache implements CallbackEvent {
JTemplate<?, ?> template = JTemplateFactory.createJTemplate(stashedFile);
if (template != null) {
historyList.set(i, template);
// 替换当前正在编辑的模板,使用添加并激活的方式,以便使用统一的入口来处理监听事件
if (isCurrentEditingFile(template.getPath())) {
DesignerContext.getDesignerFrame().addAndActivateJTemplate(template);
setCurrentEditingTemplate(template);
FineLoggerFactory.getLogger().info("Env Change Current Editing Template.");
}
}
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);

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

@ -4,8 +4,8 @@ import com.fr.base.BaseUtils;
import com.fr.base.FRContext;
import com.fr.data.core.DataCoreUtils;
import com.fr.data.core.db.TableProcedure;
import com.fr.data.core.db.dialect.DialectFactory;
import com.fr.data.core.db.dialect.OracleDialect;
import com.fr.data.core.db.dialect.base.key.check.DataBaseDetail;
import com.fr.data.core.db.dialect.base.key.check.DataBaseType;
import com.fr.data.impl.Connection;
import com.fr.data.operator.DataOperator;
import com.fr.design.DesignerEnvManager;
@ -13,7 +13,7 @@ import com.fr.design.constants.UIConstants;
import com.fr.design.mainframe.dnd.SerializableTransferable;
import com.fr.file.ConnectionConfig;
import com.fr.general.ComparatorUtils;
import com.fr.stable.ArrayUtils;
import com.fr.stable.StringUtils;
import javax.swing.*;
@ -138,21 +138,16 @@ public class TableViewList extends UIList {
String[] schemas = DataCoreUtils.getDatabaseSchema(datasource);
searchFilter = searchFilter.toLowerCase();
boolean isOracle = DataOperator.getInstance().isOracle(datasource);
boolean isOracleSystemSpace = DesignerEnvManager.getEnvManager().isOracleSystemSpace();
// oracleb不勾选显示所有表,则只显示用户下的(包括存储过程和table表)
if (isOracle && !isOracleSystemSpace) {
java.sql.Connection connection = datasource.createConnection();
OracleDialect orcDialect = (OracleDialect)DialectFactory.generateDialect(connection);
schemas = new String[]{orcDialect.getOracleCurrentUserSchema(connection)};
// oracle不勾选显示所有表,则只显示用户下的(包括存储过程和table表)
DataBaseDetail detail = DataOperator.getInstance().getDataBaseDetail(datasource, isOracleSystemSpace);
if (ArrayUtils.isNotEmpty(detail.getSchemas())) {
schemas = detail.getSchemas();
}
if (typesFilter.length == 1 && ComparatorUtils.equals(typesFilter[0], TableProcedure.PROCEDURE)) {
return processStoreProcedure(defaultListModel, schemas, datasource, isOracle, searchFilter);
return processStoreProcedure(defaultListModel, schemas, datasource, DataBaseType.ORACLE.equals(detail.getType()), searchFilter);
} else {
return processTableAndView(defaultListModel, schemas, datasource, searchFilter, isOracle, typesFilter);
return processTableAndView(defaultListModel, schemas, datasource, searchFilter, DataBaseType.ORACLE.equals(detail.getType()), typesFilter);
}
}
@ -182,7 +177,7 @@ public class TableViewList extends UIList {
if (!isOracle) {
String schema = null;
for (String type : typesFilter) {
//非oracle数据库,默认都是显示所有表的,参数为true
//非oracle数据库,默认都是显示所有表的,参数为true
TableProcedure[] sqlTables = DataCoreUtils.getTables(datasource, type, schema, true);
for (int i = 0; i < sqlTables.length; i++) {
if (isBlank || sqlTables[i].getName().toLowerCase().indexOf(searchFilter) != -1) {
@ -192,17 +187,17 @@ public class TableViewList extends UIList {
}
} else {
for (String type : typesFilter) {
for (String schema : schemas) {
TableProcedure[] sqlTables = DataCoreUtils.getTables(datasource, type, schema, isOracleSystemSpace);
// oracle的表名加上模式
for (int i = 0; i < sqlTables.length; i++) {
TableProcedure ta = sqlTables[i];
String name = ta.getSchema() + '.' + ta.getName();
if (isBlank || name.toLowerCase().indexOf(searchFilter) != -1) {
defaultListModel.addElement(sqlTables[i]);
}
}
}
for (String schema : schemas) {
TableProcedure[] sqlTables = DataCoreUtils.getTables(datasource, type, schema, isOracleSystemSpace);
// oracle的表名加上模式
for (int i = 0; i < sqlTables.length; i++) {
TableProcedure ta = sqlTables[i];
String name = ta.getSchema() + '.' + ta.getName();
if (isBlank || name.toLowerCase().indexOf(searchFilter) != -1) {
defaultListModel.addElement(sqlTables[i]);
}
}
}
}
}
return defaultListModel;

37
designer-base/src/main/java/com/fr/design/gui/itree/filetree/TemplateFileTree.java

@ -2,8 +2,10 @@ package com.fr.design.gui.itree.filetree;
import com.fr.base.FRContext;
import com.fr.base.extension.FileExtension;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.file.NodeAuthProcessor;
import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode;
import com.fr.design.mainframe.App;
import com.fr.file.filetree.FileNode;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.ArrayUtils;
@ -15,7 +17,9 @@ import javax.swing.tree.DefaultTreeModel;
import javax.swing.tree.TreePath;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
/*
* 显示Env下的reportlets目录下面的所有cpt文件
@ -124,9 +128,28 @@ public class TemplateFileTree extends EnvFileTree {
}
public FileNode[] listFile(String path) {
// 支持插件扩展, 先从env的filter拿, 再从插件拿
Set<FileExtension> supportTypes = createFileExtensionFilter();
return FRContext.getFileNodes().list(
path,
new FileExtension[]{FileExtension.CPT, FileExtension.FRM, FileExtension.CHT, FileExtension.XLS, FileExtension.XLSX});
supportTypes.toArray(new FileExtension[supportTypes.size()])
);
}
private Set<FileExtension> createFileExtensionFilter() {
Set<FileExtension> supportTypes = new HashSet<FileExtension>();
if (filter != null) {
for (String temp : filter.getSupportedTypes()) {
supportTypes.add(FileExtension.parse(temp));
}
}
Set<App> apps = ExtraDesignClassManager.getInstance().getArray(App.MARK_STRING);
for (App temp : apps) {
for (String extendsion : temp.defaultExtensions()) {
supportTypes.add(FileExtension.parse(extendsion));
}
}
return supportTypes;
}
/*
@ -205,18 +228,6 @@ public class TemplateFileTree extends EnvFileTree {
if (fileNodes == null) {
fileNodes = new FileNode[0];
}
// 用FileNodeFilter过滤一下
if (filter != null) {
List<FileNode> list = new ArrayList<FileNode>();
for (FileNode fileNode : fileNodes) {
if (filter.accept(fileNode)) {
list.add(fileNode);
}
}
fileNodes = list.toArray(new FileNode[list.size()]);
}
Arrays.sort(fileNodes, new FileNodeComparator(FRContext.getFileNodes().getSupportedTypes()));
return fileNodes;

2
designer-chart/src/main/java/com/fr/van/chart/DownloadOnlineSourcesHelper.java

@ -10,6 +10,7 @@ import com.fr.general.IOUtils;
import com.fr.general.CloudCenter;
import com.fr.general.http.HttpClient;
import com.fr.plugin.chart.DownloadSourcesEvent;
import com.fr.stable.CommonUtils;
import com.fr.stable.StableUtils;
import com.fr.workspace.WorkContext;
@ -140,6 +141,7 @@ public class DownloadOnlineSourcesHelper implements DownloadSourcesEvent {
if (result) {
//安装文件
IOUtils.unZipFilesGBK(temp, StableUtils.pathJoin(WorkContext.getCurrent().getPath(), siteInfo.localDir));
CommonUtils.deleteFile(file);
}
} else {
result = false;

5
designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java

@ -109,6 +109,7 @@ public abstract class AbstractVanChartTypePane extends AbstractChartTypePane{
resetTitleAttr(chart);
//重置监控刷新选项
resetRefreshMoreLabelAttr((VanChart)chart);
resetFilterDefinition(chart);
}
@ -118,6 +119,10 @@ public abstract class AbstractVanChartTypePane extends AbstractChartTypePane{
chart.setTitle(vanChartPlot.getDefaultTitle());
}
//重置数据配置
protected void resetFilterDefinition(Chart chart){
}
//重置监控刷新面板
protected void resetRefreshMoreLabelAttr(VanChart chart){

7
designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapPlotPane.java

@ -6,10 +6,10 @@ import com.fr.chart.chartattr.Plot;
import com.fr.design.mainframe.chart.gui.type.ChartImagePane;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.chart.base.VanChartTools;
import com.fr.plugin.chart.map.MapIndependentVanChart;
import com.fr.plugin.chart.map.VanChartMapPlot;
import com.fr.plugin.chart.map.data.VanMapDefinition;
import com.fr.plugin.chart.map.server.CompatibleGEOJSONHelper;
import com.fr.van.chart.designer.type.AbstractVanChartTypePane;
@ -129,6 +129,11 @@ public class VanChartMapPlotPane extends AbstractVanChartTypePane {
}
@Override
protected void resetFilterDefinition(Chart chart) {
chart.setFilterDefinition(new VanMapDefinition());
}
protected void resetAttr(Plot plot) {
sourceChoosePane.resetComponentValue((VanChartMapPlot) plot);
}

8
designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ParaMobileDefinePane.java

@ -21,7 +21,6 @@ import com.fr.form.ui.container.WParameterLayout;
import com.fr.form.ui.container.WSortLayout;
import com.fr.general.ComparatorUtils;
import com.fr.general.SiteCenter;
import com.fr.json.JSONException;
import com.fr.log.FineLoggerFactory;
import com.fr.report.ExtraReportClassManager;
import com.fr.report.fun.MobileParamStyleProvider;
@ -109,9 +108,9 @@ public class ParaMobileDefinePane extends MobileWidgetDefinePane {
Item[] items = new Item[pluginCreators.size() + 1];
MobileParamStyleProvider provider = new DefaultMobileParamStyle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Default"));
items[0] = new Item(provider.descriptor(), provider);
for (int i = 0; i < pluginCreators.size(); i++) {
provider = pluginCreators.iterator().next();
items[i + 1] = new Item(provider.descriptor(), provider);
int i = 1;
for (MobileParamStyleProvider mobileParamStyleProvider : pluginCreators) {
items[i++] = new Item(mobileParamStyleProvider.descriptor(), mobileParamStyleProvider);
}
return items;
}
@ -161,6 +160,7 @@ public class ParaMobileDefinePane extends MobileWidgetDefinePane {
private UIComboBox getParamLocationComboBox() {
items = getItems();
UIComboBox paramLocationComoBox = new UIComboBox(items);
paramLocationComoBox.addItemListener(new ItemListener() {
@Override

Loading…
Cancel
Save