Browse Source

Merge pull request #8 in BA/design from ~NEIL/design:dev to dev

* commit '1b04cb32a8f3b2c6d05a8aa5b2dabe31c69619f6':
  utf8
  连接远程env插件加载接口
  jdk1.7
master
neil 9 years ago
parent
commit
bafe31399b
  1. 14
      designer_base/src/com/fr/design/ExtraDesignClassManager.java
  2. 24
      designer_base/src/com/fr/design/fun/DesignerEnvProcessor.java
  3. 18
      designer_base/src/com/fr/design/fun/impl/AbstractDesignerEnvProcessor.java
  4. 14
      designer_base/src/com/fr/env/RemoteEnv.java
  5. 2
      designer_chart/src/com/fr/design/mainframe/chart/gui/type/AbstractChartTypePane.java

14
designer_base/src/com/fr/design/ExtraDesignClassManager.java

@ -124,6 +124,18 @@ public class ExtraDesignClassManager extends XMLFileManager implements ExtraDesi
private Set<HyperlinkProvider> hyperlinkGroupProviders; private Set<HyperlinkProvider> 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 { public void addSupportDesignApps(Level level, PluginSimplify simplify) throws Exception {
validAPILevel(level, App.CURRENT_LEVEL, simplify.getPluginName()); validAPILevel(level, App.CURRENT_LEVEL, simplify.getPluginName());
App provider = (App) level; App provider = (App) level;
@ -783,6 +795,8 @@ public class ExtraDesignClassManager extends XMLFileManager implements ExtraDesi
addHyperlinkProvider(impl, simplify); addHyperlinkProvider(impl, simplify);
} else if (tagName.equals(App.MARK_STRING)) { } else if (tagName.equals(App.MARK_STRING)) {
addSupportDesignApps(impl, simplify); addSupportDesignApps(impl, simplify);
} else if (tagName.equals(DesignerEnvProcessor.XML_TAG)) {
setEnvProcessor(impl, simplify);
} }
} catch (PluginInvalidLevelException e) { } catch (PluginInvalidLevelException e) {
PluginMessage.remindUpdate(e.getMessage()); PluginMessage.remindUpdate(e.getMessage());

24
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);
}

18
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;
}
}

14
designer_base/src/com/fr/env/RemoteEnv.java vendored

@ -11,8 +11,10 @@ import com.fr.data.impl.storeproc.StoreProcedure;
import com.fr.dav.DavXMLUtils; import com.fr.dav.DavXMLUtils;
import com.fr.dav.UserBaseEnv; import com.fr.dav.UserBaseEnv;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.dialog.InformationWarnPane; import com.fr.design.dialog.InformationWarnPane;
import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.fun.DesignerEnvProcessor;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.DesignerFrameFileDealerPane; import com.fr.design.mainframe.DesignerFrameFileDealerPane;
import com.fr.design.mainframe.loghandler.DesignerLogHandler; 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.JSONException;
import com.fr.json.JSONObject; import com.fr.json.JSONObject;
import com.fr.plugin.Plugin; import com.fr.plugin.Plugin;
import com.fr.plugin.PluginLoader;
import com.fr.stable.*; import com.fr.stable.*;
import com.fr.stable.file.XMLFileManagerProvider; import com.fr.stable.file.XMLFileManagerProvider;
import com.fr.stable.project.ProjectConstants; 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 { private boolean testConnection(boolean needMessage, boolean isRegisteServer, Component parentComponent) throws Exception {
extraChangeEnvPara();
HashMap<String, String> para = new HashMap<String, String>(); HashMap<String, String> para = new HashMap<String, String>();
para.put("op", "fr_remote_design"); para.put("op", "fr_remote_design");
para.put("cmd", "test_server_connection"); para.put("cmd", "test_server_connection");
@ -378,6 +383,15 @@ public class RemoteEnv implements Env {
} }
} }
private void extraChangeEnvPara() {
//在env连接之前, 加载一下不依赖env的插件. 看看需不需要改变参数.
PluginLoader.init();
DesignerEnvProcessor envProcessor = ExtraDesignClassManager.getInstance().getEnvProcessor();
if (envProcessor != null) {
this.path = envProcessor.changeEnvPathBeforeConnect(user, password, path);
}
}
private void setHttpsParas() { private void setHttpsParas() {
if (path.startsWith(HTTPS_PREFIX) && System.getProperty(CERT_KEY) == null) { if (path.startsWith(HTTPS_PREFIX) && System.getProperty(CERT_KEY) == null) {
DesignerEnvManager envManager = DesignerEnvManager.getEnvManager(); DesignerEnvManager envManager = DesignerEnvManager.getEnvManager();

2
designer_chart/src/com/fr/design/mainframe/chart/gui/type/AbstractChartTypePane.java

@ -113,7 +113,7 @@ public abstract class AbstractChartTypePane extends FurtherBasicBeanPane<Chart>{
} }
private List<ChartImagePane> createImagePaneList(String[] iconPaths, String[] tipNames) { private List<ChartImagePane> createImagePaneList(String[] iconPaths, String[] tipNames) {
List<ChartImagePane> list = new ArrayList<>(); List<ChartImagePane> list = new ArrayList<ChartImagePane>();
int iconLen = iconPaths.length; int iconLen = iconPaths.length;
int tipLen = tipNames.length; int tipLen = tipNames.length;
for(int i = 0, len = Math.min(iconLen, tipLen); i < len; i++) { for(int i = 0, len = Math.min(iconLen, tipLen); i < len; i++) {

Loading…
Cancel
Save