diff --git a/designer-base/src/main/java/com/fr/design/env/DesignerWorkspaceGenerator.java b/designer-base/src/main/java/com/fr/design/env/DesignerWorkspaceGenerator.java index 1174a8a73b..7494bba258 100644 --- a/designer-base/src/main/java/com/fr/design/env/DesignerWorkspaceGenerator.java +++ b/designer-base/src/main/java/com/fr/design/env/DesignerWorkspaceGenerator.java @@ -11,20 +11,20 @@ public class DesignerWorkspaceGenerator { public static Workspace generate(DesignerWorkspaceInfo config) throws Exception { - if (config == null || config.getType() == null) { - return null; - } + if (config == null || config.getType() == null) { + return null; + } - Workspace workspace = null; - switch (config.getType()) { - case Local: { - workspace = WorkContext.getFactory().build(config.getPath()); - break; - } - case Remote: { - WorkspaceClient client = WorkContext.getConnector().connect(config.getConnection()); - if (client != null) { - workspace = new RemoteWorkspace(client, config.getConnection()); + Workspace workspace = null; + switch (config.getType()) { + case Local: { + workspace = WorkContext.getFactory().build(config.getPath()); + break; + } + case Remote: { + WorkspaceClient client = WorkContext.getConnector().connect(config.getConnection()); + if (client != null) { + workspace = new RemoteWorkspace(client, config.getConnection()); } break; } diff --git a/designer-sdk/src/main/java/com/fr/sdk/designer/FineDesignUtils.java b/designer-sdk/src/main/java/com/fr/sdk/designer/FineDesignUtils.java index ea60edf74f..7de2f3c2d5 100644 --- a/designer-sdk/src/main/java/com/fr/sdk/designer/FineDesignUtils.java +++ b/designer-sdk/src/main/java/com/fr/sdk/designer/FineDesignUtils.java @@ -1,80 +1,80 @@ -package com.fr.sdk.designer; - -import com.fr.config.activator.ConfigurationActivator; -import com.fr.design.env.DesignerWorkspaceGenerator; -import com.fr.design.env.RemoteDesignerWorkspaceInfo; -import com.fr.log.FineLoggerFactory; -import com.fr.module.Activator; -import com.fr.module.Module; -import com.fr.module.tool.ActivatorToolBox; -import com.fr.report.ReportActivator; -import com.fr.report.RestrictionActivator; -import com.fr.report.module.ReportBaseActivator; -import com.fr.scheduler.SchedulerActivator; -import com.fr.sdk.server.shell.ModuleShell; -import com.fr.serialization.SerializationActivator; -import com.fr.stable.StringUtils; -import com.fr.startup.WorkspaceRegister; -import com.fr.store.StateServerActivator; -import com.fr.workspace.WorkContext; -import com.fr.workspace.connect.WorkspaceConnectionInfo; -import com.fr.workspace.engine.WorkspaceActivator; -import com.fr.workspace.server.ServerWorkspaceRegister; - -/** - * 设计器SDK模块工具类,用来放一些设计器相关插件开发过程中常用的工具函数 - */ -public class FineDesignUtils { - - /** - * 创建一个连接远程服务器的模块 - * @param remoteUrl 远程服务器地址 - * @param username 用户名 - * @param password 密码 - * @return 模块代理对象 使用ModuleShell的start和stop控制模块启停 - */ - public static ModuleShell createRemoteServerModule(String remoteUrl, String username, String password) { - return createRemoteServerModule(remoteUrl, username, password, StringUtils.EMPTY, StringUtils.EMPTY); - } - - /** - * 创建一个连接远程服务器的模块 - * @param remoteUrl 远程服务器地址 - * @param username 用户名 - * @param password 密码 - * @param certPath https证书路径 - * @param certSecretKey 证书秘钥 - * @return 模块代理对象 使用ModuleShell的start和stop控制模块启停 - */ - public static ModuleShell createRemoteServerModule(final String remoteUrl, final String username, final String password, final String certPath, final String certSecretKey) { - Module module = ActivatorToolBox.simpleLink( - new WorkspaceActivator(), - new SerializationActivator(), - new Activator() { - @Override - public void start() { - WorkspaceConnectionInfo connectionInfo = new WorkspaceConnectionInfo(remoteUrl, username, password, certPath, certSecretKey); - try { - WorkContext.switchTo(DesignerWorkspaceGenerator.generate(RemoteDesignerWorkspaceInfo.create(connectionInfo))); - } catch (Exception e) { - FineLoggerFactory.getLogger().error(e.getMessage(),e); - } - } - - @Override - public void stop() { - - } - }, - new ConfigurationActivator(), - new StateServerActivator(), - new SchedulerActivator(), - new ReportBaseActivator(), - new RestrictionActivator(), - new ReportActivator(), - new WorkspaceRegister(), - new ServerWorkspaceRegister() - ); - return new ModuleShell(module); - } -} \ No newline at end of file +//package com.fr.sdk.designer; +// +//import com.fr.config.activator.ConfigurationActivator; +//import com.fr.design.env.DesignerWorkspaceGenerator; +//import com.fr.design.env.RemoteDesignerWorkspaceInfo; +//import com.fr.log.FineLoggerFactory; +//import com.fr.module.Activator; +//import com.fr.module.Module; +//import com.fr.module.tool.ActivatorToolBox; +//import com.fr.report.ReportActivator; +//import com.fr.report.RestrictionActivator; +//import com.fr.report.module.ReportBaseActivator; +//import com.fr.scheduler.SchedulerActivator; +//import com.fr.sdk.server.shell.ModuleShell; +//import com.fr.serialization.SerializationActivator; +//import com.fr.stable.StringUtils; +//import com.fr.startup.WorkspaceRegister; +//import com.fr.store.StateServerActivator; +//import com.fr.workspace.WorkContext; +//import com.fr.workspace.connect.WorkspaceConnectionInfo; +//import com.fr.workspace.engine.WorkspaceActivator; +//import com.fr.workspace.server.ServerWorkspaceRegister; +// +///** +// * 设计器SDK模块工具类,用来放一些设计器相关插件开发过程中常用的工具函数 +// */ +//public class FineDesignUtils { +// +// /** +// * 创建一个连接远程服务器的模块 +// * @param remoteUrl 远程服务器地址 +// * @param username 用户名 +// * @param password 密码 +// * @return 模块代理对象 使用ModuleShell的start和stop控制模块启停 +// */ +// public static ModuleShell createRemoteServerModule(String remoteUrl, String username, String password) { +// return createRemoteServerModule(remoteUrl, username, password, StringUtils.EMPTY, StringUtils.EMPTY); +// } +// +// /** +// * 创建一个连接远程服务器的模块 +// * @param remoteUrl 远程服务器地址 +// * @param username 用户名 +// * @param password 密码 +// * @param certPath https证书路径 +// * @param certSecretKey 证书秘钥 +// * @return 模块代理对象 使用ModuleShell的start和stop控制模块启停 +// */ +// public static ModuleShell createRemoteServerModule(final String remoteUrl, final String username, final String password, final String certPath, final String certSecretKey) { +// Module module = ActivatorToolBox.simpleLink( +// new WorkspaceActivator(), +// new SerializationActivator(), +// new Activator() { +// @Override +// public void start() { +// WorkspaceConnectionInfo connectionInfo = new WorkspaceConnectionInfo(remoteUrl, username, password, certPath, certSecretKey); +// try { +// WorkContext.switchTo(DesignerWorkspaceGenerator.generate(RemoteDesignerWorkspaceInfo.create(connectionInfo))); +// } catch (Exception e) { +// FineLoggerFactory.getLogger().error(e.getMessage(),e); +// } +// } +// +// @Override +// public void stop() { +// +// } +// }, +// new ConfigurationActivator(), +// new StateServerActivator(), +// new SchedulerActivator(), +// new ReportBaseActivator(), +// new RestrictionActivator(), +// new ReportActivator(), +// new WorkspaceRegister(), +// new ServerWorkspaceRegister() +// ); +// return new ModuleShell(module); +// } +//} \ No newline at end of file