From 6af31a0874306d175f7ba13b049a65f8feaf1581 Mon Sep 17 00:00:00 2001 From: neil <459208047@qq.com> Date: Tue, 29 Mar 2016 11:09:40 +0800 Subject: [PATCH 1/3] jdk1.7 --- .../design/mainframe/chart/gui/type/AbstractChartTypePane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/type/AbstractChartTypePane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/type/AbstractChartTypePane.java index 7493afd03..0afd0cd60 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/type/AbstractChartTypePane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/type/AbstractChartTypePane.java @@ -113,7 +113,7 @@ public abstract class AbstractChartTypePane extends FurtherBasicBeanPane{ } private List createImagePaneList(String[] iconPaths, String[] tipNames) { - List list = new ArrayList<>(); + List list = new ArrayList(); int iconLen = iconPaths.length; int tipLen = tipNames.length; for(int i = 0, len = Math.min(iconLen, tipLen); i < len; i++) { From 50bc5178648f65040408c64e78f17c25b888d29b Mon Sep 17 00:00:00 2001 From: neil <459208047@qq.com> Date: Thu, 31 Mar 2016 17:43:53 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E8=BF=9E=E6=8E=A5=E8=BF=9C=E7=A8=8Benv?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=E5=8A=A0=E8=BD=BD=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/ExtraDesignClassManager.java | 14 +++++++++++ .../fr/design/fun/DesignerEnvProcessor.java | 24 +++++++++++++++++++ .../impl/AbstractDesignerEnvProcessor.java | 18 ++++++++++++++ designer_base/src/com/fr/env/RemoteEnv.java | 14 +++++++++++ 4 files changed, 70 insertions(+) create mode 100644 designer_base/src/com/fr/design/fun/DesignerEnvProcessor.java create mode 100644 designer_base/src/com/fr/design/fun/impl/AbstractDesignerEnvProcessor.java diff --git a/designer_base/src/com/fr/design/ExtraDesignClassManager.java b/designer_base/src/com/fr/design/ExtraDesignClassManager.java index 9e557519d..72d5269b0 100644 --- a/designer_base/src/com/fr/design/ExtraDesignClassManager.java +++ b/designer_base/src/com/fr/design/ExtraDesignClassManager.java @@ -124,6 +124,18 @@ public class ExtraDesignClassManager extends XMLFileManager implements ExtraDesi private Set hyperlinkGroupProviders; + private DesignerEnvProcessor envProcessor; + + + public DesignerEnvProcessor getEnvProcessor() { + return envProcessor; + } + + public void setEnvProcessor(Level level, PluginSimplify simplify) throws Exception { + validAPILevel(level, DesignerEnvProcessor.CURRENT_LEVEL, simplify.getPluginName()); + envProcessor = (DesignerEnvProcessor) level; + } + public void addSupportDesignApps(Level level, PluginSimplify simplify) throws Exception { validAPILevel(level, App.CURRENT_LEVEL, simplify.getPluginName()); App provider = (App) level; @@ -783,6 +795,8 @@ public class ExtraDesignClassManager extends XMLFileManager implements ExtraDesi addHyperlinkProvider(impl, simplify); } else if (tagName.equals(App.MARK_STRING)) { addSupportDesignApps(impl, simplify); + } else if (tagName.equals(DesignerEnvProcessor.XML_TAG)) { + setEnvProcessor(impl, simplify); } } catch (PluginInvalidLevelException e) { PluginMessage.remindUpdate(e.getMessage()); diff --git a/designer_base/src/com/fr/design/fun/DesignerEnvProcessor.java b/designer_base/src/com/fr/design/fun/DesignerEnvProcessor.java new file mode 100644 index 000000000..c43c23f1e --- /dev/null +++ b/designer_base/src/com/fr/design/fun/DesignerEnvProcessor.java @@ -0,0 +1,24 @@ +package com.fr.design.fun; + +import com.fr.stable.fun.Level; + +/** + * 在env加载之前, 修改env参数的接口 + * 如: https [需要在加载之前设置系统证书]; + * cas [需要动态获取sessionid来修改path] + * + * Created by Administrator on 2016/3/31/0031. + */ +public interface DesignerEnvProcessor extends Level{ + + String XML_TAG = "DesignerEnvProcessor"; + int CURRENT_LEVEL = 1; + + /** + * 在远程env连接之前, 修改env的path, 以通过权限认证. 如果之前没有jsessionid, 那么就加上, 如果有了, 就更新成新的. + * 如: localhost:8080/WebReport/ReportServer? -> localhost:8080/WebReport/ReportServer?jsessionid=abcdegf; + * + * @return 修改后的jsessionid + */ + String changeEnvPathBeforeConnect(String userName, String password, String path); +} diff --git a/designer_base/src/com/fr/design/fun/impl/AbstractDesignerEnvProcessor.java b/designer_base/src/com/fr/design/fun/impl/AbstractDesignerEnvProcessor.java new file mode 100644 index 000000000..1c07a37db --- /dev/null +++ b/designer_base/src/com/fr/design/fun/impl/AbstractDesignerEnvProcessor.java @@ -0,0 +1,18 @@ +package com.fr.design.fun.impl; + +import com.fr.design.fun.DesignerEnvProcessor; + +/** + * Created by Administrator on 2016/3/31/0031. + */ +public abstract class AbstractDesignerEnvProcessor implements DesignerEnvProcessor { + + public int currentAPILevel() { + return CURRENT_LEVEL; + } + + public String changeEnvPathBeforeConnect(String userName, String password, String path){ + return path; + } + +} diff --git a/designer_base/src/com/fr/env/RemoteEnv.java b/designer_base/src/com/fr/env/RemoteEnv.java index 0e0c93460..b146e146f 100644 --- a/designer_base/src/com/fr/env/RemoteEnv.java +++ b/designer_base/src/com/fr/env/RemoteEnv.java @@ -11,8 +11,10 @@ import com.fr.data.impl.storeproc.StoreProcedure; import com.fr.dav.DavXMLUtils; import com.fr.dav.UserBaseEnv; import com.fr.design.DesignerEnvManager; +import com.fr.design.ExtraDesignClassManager; import com.fr.design.dialog.InformationWarnPane; import com.fr.design.file.HistoryTemplateListPane; +import com.fr.design.fun.DesignerEnvProcessor; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerFrameFileDealerPane; import com.fr.design.mainframe.loghandler.DesignerLogHandler; @@ -26,6 +28,7 @@ import com.fr.json.JSONArray; import com.fr.json.JSONException; import com.fr.json.JSONObject; import com.fr.plugin.Plugin; +import com.fr.plugin.PluginLoader; import com.fr.stable.*; import com.fr.stable.file.XMLFileManagerProvider; import com.fr.stable.project.ProjectConstants; @@ -330,6 +333,8 @@ public class RemoteEnv implements Env { private boolean testConnection(boolean needMessage, boolean isRegisteServer, Component parentComponent) throws Exception { + extraChangeEnvPara(); + HashMap para = new HashMap(); para.put("op", "fr_remote_design"); para.put("cmd", "test_server_connection"); @@ -378,6 +383,15 @@ public class RemoteEnv implements Env { } } + private void extraChangeEnvPara() { + //鍦╡nv杩炴帴涔嬪墠, 鍔犺浇涓涓嬩笉渚濊禆env鐨勬彃浠. 鐪嬬湅闇涓嶉渶瑕佹敼鍙樺弬鏁. + PluginLoader.init(); + DesignerEnvProcessor envProcessor = ExtraDesignClassManager.getInstance().getEnvProcessor(); + if (envProcessor != null) { + this.path = envProcessor.changeEnvPathBeforeConnect(user, password, path); + } + } + private void setHttpsParas() { if (path.startsWith(HTTPS_PREFIX) && System.getProperty(CERT_KEY) == null) { DesignerEnvManager envManager = DesignerEnvManager.getEnvManager(); From 1b04cb32a8f3b2c6d05a8aa5b2dabe31c69619f6 Mon Sep 17 00:00:00 2001 From: neil <459208047@qq.com> Date: Thu, 31 Mar 2016 17:46:47 +0800 Subject: [PATCH 3/3] utf8 --- .../src/com/fr/design/fun/DesignerEnvProcessor.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/designer_base/src/com/fr/design/fun/DesignerEnvProcessor.java b/designer_base/src/com/fr/design/fun/DesignerEnvProcessor.java index c43c23f1e..805a074b4 100644 --- a/designer_base/src/com/fr/design/fun/DesignerEnvProcessor.java +++ b/designer_base/src/com/fr/design/fun/DesignerEnvProcessor.java @@ -3,9 +3,9 @@ package com.fr.design.fun; import com.fr.stable.fun.Level; /** - * 在env加载之前, 修改env参数的接口 - * 如: https [需要在加载之前设置系统证书]; - * cas [需要动态获取sessionid来修改path] + * 鍦╡nv鍔犺浇涔嬪墠, 淇敼env鍙傛暟鐨勬帴鍙 + * 濡: https [闇瑕佸湪鍔犺浇涔嬪墠璁剧疆绯荤粺璇佷功]; + * cas [闇瑕佸姩鎬佽幏鍙杝essionid鏉ヤ慨鏀筽ath] * * Created by Administrator on 2016/3/31/0031. */ @@ -15,10 +15,10 @@ public interface DesignerEnvProcessor extends Level{ int CURRENT_LEVEL = 1; /** - * 在远程env连接之前, 修改env的path, 以通过权限认证. 如果之前没有jsessionid, 那么就加上, 如果有了, 就更新成新的. - * 如: localhost:8080/WebReport/ReportServer? -> localhost:8080/WebReport/ReportServer?jsessionid=abcdegf; + * 鍦ㄨ繙绋媏nv杩炴帴涔嬪墠, 淇敼env鐨刾ath, 浠ラ氳繃鏉冮檺璁よ瘉. 濡傛灉涔嬪墠娌℃湁jsessionid, 閭d箞灏卞姞涓, 濡傛灉鏈変簡, 灏辨洿鏂版垚鏂扮殑. + * 濡: localhost:8080/WebReport/ReportServer? -> localhost:8080/WebReport/ReportServer?jsessionid=abcdegf; * - * @return 修改后的jsessionid + * @return 淇敼鍚庣殑jsessionid */ String changeEnvPathBeforeConnect(String userName, String password, String path); }