diff --git a/designer_base/src/com/fr/dependservice/PluginService.java b/designer_base/src/com/fr/dependservice/PluginService.java deleted file mode 100644 index 0ba4895cb..000000000 --- a/designer_base/src/com/fr/dependservice/PluginService.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.fr.dependservice; - -import com.fr.base.FRContext; -import com.fr.general.FRLogger; -import com.fr.plugin.dependence.PluginServiceCreator; - -import java.util.HashMap; - -/** - * Created by hufan on 2016/9/9. - */ -public abstract class PluginService implements PluginServiceCreator { - @Override - public String remoteServiceAction(String req) throws Exception { - HashMap para = new HashMap(); - para.put("op", "fr_remote_design"); - para.put("cmd", "design_get_plugin_service_data"); - para.put("serviceID", getServiceID()); - para.put("req", req); - return PluginServiceUtils.getDataFormRemote(para); - } - /** - * 服务ID - * @return - */ - protected abstract String getServiceID(); - - /** - * 获取数据 - * @param req - * @return - */ - @Override - public String fetchServiceData(String req) throws Exception { - return FRContext.getCurrentEnv().pluginServiceAction(this, req); - } -} diff --git a/designer_base/src/com/fr/dependservice/PluginServiceUtils.java b/designer_base/src/com/fr/dependservice/PluginServiceUtils.java deleted file mode 100644 index b5304aa72..000000000 --- a/designer_base/src/com/fr/dependservice/PluginServiceUtils.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.fr.dependservice; - -import com.fr.base.FRContext; -import com.fr.env.RemoteEnv; -import com.fr.general.IOUtils; - -import java.io.InputStream; -import java.util.HashMap; - -/** - * Created by hufan on 2016/9/9. - */ -public class PluginServiceUtils { - public static String getDataFormRemote(HashMap para) throws Exception { - InputStream inputStream = ((RemoteEnv)FRContext.getCurrentEnv()).getDataFormRemote(para); - return IOUtils.inputStream2String(inputStream); - } -} diff --git a/designer_base/src/com/fr/env/RemoteEnv.java b/designer_base/src/com/fr/env/RemoteEnv.java index 927743012..3085991d4 100644 --- a/designer_base/src/com/fr/env/RemoteEnv.java +++ b/designer_base/src/com/fr/env/RemoteEnv.java @@ -32,6 +32,7 @@ import com.fr.plugin.PluginLicense; import com.fr.plugin.PluginLicenseManager; import com.fr.plugin.PluginLoader; import com.fr.plugin.dependence.PluginServiceCreator; +import com.fr.plugin.dependence.PluginServiceManager; import com.fr.stable.*; import com.fr.stable.file.XMLFileManagerProvider; import com.fr.stable.project.ProjectConstants; @@ -2081,16 +2082,26 @@ public class RemoteEnv implements Env { } @Override - public String pluginServiceAction(PluginServiceCreator service, String req) throws Exception { - return service.remoteServiceAction(req); + public String pluginServiceAction(String serviceID, String req) throws Exception { + PluginServiceCreator service = PluginServiceManager.getService(serviceID); + if (service == null){ + return null; + } + HashMap para = new HashMap(); + para.put("op", "fr_remote_design"); + para.put("cmd", "design_get_plugin_service_data"); + para.put("serviceID", service.getServiceID()); + para.put("req", req); + InputStream inputStream = getDataFormRemote(para); + return IOUtils.inputStream2String(inputStream); } /** * 远程不启动,使用虚拟服务 - * @param service + * @param serviceID */ @Override - public void pluginServiceStart(PluginServiceCreator service){ + public void pluginServiceStart(String serviceID){ } @Override @@ -2105,7 +2116,7 @@ public class RemoteEnv implements Env { * @return * @throws Exception */ - public InputStream getDataFormRemote(HashMap para) throws Exception { + private InputStream getDataFormRemote(HashMap para) throws Exception { HttpClient client = createHttpMethod(para); //jim :加上user,远程设计点击预览时传递用户角色信息 return execute4InputStream(client); }