From 3c76cc3c04b0b27811c288c733e52b5b0a3bb09c Mon Sep 17 00:00:00 2001 From: richie Date: Fri, 8 Jun 2018 21:23:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=20=E5=8E=BB?= =?UTF-8?q?=E6=8E=89writeXMLFileManager=E7=9B=B8=E5=85=B3=E7=9A=84?= =?UTF-8?q?=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../style/color/ColorSelectConfigManager.java | 12 ----- designer-base/src/com/fr/env/RemoteEnv.java | 47 +------------------ 2 files changed, 1 insertion(+), 58 deletions(-) diff --git a/designer-base/src/com/fr/design/style/color/ColorSelectConfigManager.java b/designer-base/src/com/fr/design/style/color/ColorSelectConfigManager.java index 80e1048b70..8121607783 100644 --- a/designer-base/src/com/fr/design/style/color/ColorSelectConfigManager.java +++ b/designer-base/src/com/fr/design/style/color/ColorSelectConfigManager.java @@ -3,7 +3,6 @@ package com.fr.design.style.color; import com.fr.base.FRContext; import com.fr.file.XMLFileManager; import com.fr.general.ComparatorUtils; -import com.fr.log.FineLoggerFactory; import com.fr.general.GeneralContext; import com.fr.stable.EnvChangedListener; import com.fr.stable.xml.XMLPrintWriter; @@ -96,11 +95,6 @@ public class ColorSelectConfigManager extends XMLFileManager implements ColorSel if (colors != null && !colors.isEmpty()) { manager.setColorsToFile(colors); } - try { - FRContext.getCurrentEnv().writeResource(manager); - } catch (Exception e) { - FineLoggerFactory.getLogger().error(e.getMessage()); - } } @@ -115,7 +109,6 @@ public class ColorSelectConfigManager extends XMLFileManager implements ColorSel ColorSelectConfigManager manager = new ColorSelectConfigManager(); XMLTools.readInputStreamXML(manager, input); configManager = manager; - FRContext.getCurrentEnv().writeResource(configManager); } @@ -131,11 +124,6 @@ public class ColorSelectConfigManager extends XMLFileManager implements ColorSel } return configManager; } - - - public boolean writeResource() throws Exception { - return FRContext.getCurrentEnv().writeResource(ColorSelectConfigManager.getProviderInstance()); - } public String fileName() { return "recentcolors.xml"; diff --git a/designer-base/src/com/fr/env/RemoteEnv.java b/designer-base/src/com/fr/env/RemoteEnv.java index 2f6b872e43..12bf84e3bd 100644 --- a/designer-base/src/com/fr/env/RemoteEnv.java +++ b/designer-base/src/com/fr/env/RemoteEnv.java @@ -11,13 +11,13 @@ import com.fr.common.rpc.netty.MessageSendExecutor; import com.fr.common.rpc.netty.RemoteCallClient; import com.fr.core.env.EnvConstants; import com.fr.core.env.EnvContext; -import com.fr.design.env.RemoteEnvConfig; import com.fr.data.TableDataSource; import com.fr.data.impl.EmbeddedTableData; import com.fr.data.impl.storeproc.StoreProcedure; import com.fr.dav.AbstractEnv; import com.fr.dav.DavXMLUtils; import com.fr.design.DesignerEnvManager; +import com.fr.design.env.RemoteEnvConfig; import com.fr.design.mainframe.DesignerContext; import com.fr.file.CacheManager; import com.fr.file.ConnectionConfig; @@ -26,8 +26,6 @@ import com.fr.general.CommonIOUtils; import com.fr.general.ComparatorUtils; import com.fr.general.IOUtils; import com.fr.general.Inter; -import com.fr.general.LogRecordTime; -import com.fr.general.LogUtils; import com.fr.general.http.HttpToolbox; import com.fr.io.utils.ResourceIOUtils; import com.fr.json.JSONArray; @@ -44,9 +42,7 @@ import com.fr.stable.ProductConstants; import com.fr.stable.StableUtils; import com.fr.stable.StringUtils; import com.fr.stable.SvgProvider; -import com.fr.stable.file.XMLFileManagerProvider; import com.fr.stable.project.ProjectConstants; -import com.fr.stable.xml.XMLTools; import com.fr.third.guava.base.Strings; import com.fr.third.guava.collect.ImmutableMap; import com.fr.web.ResourceConstants; @@ -639,47 +635,6 @@ public class RemoteEnv extends AbstractEnv implements DesignAut return true; } - /** - * 写报表运行环境所需的配置文件 - * - * @param mgr 管理各个资源文件的管理器 - * @return 写入xml成功返回true - * @throws Exception 写入xml错误则抛出此异常 - */ - @Override - public boolean writeResource(XMLFileManagerProvider mgr) throws Exception { - testServerConnection(); - - HashMap para = new HashMap<>(); - para.put("op", "fr_remote_design"); - para.put("cmd", "design_save_resource"); - para.put("resource", mgr.fileName()); - para.put("class_name", mgr.getClass().getName()); - para.put("current_uid", this.getUserID()); - para.put("currentUsername", this.getUser()); - - // alex:通过ByteArrayOutputStream将mgr写成字节流 - Bytes2ServerOutputStream out = new Bytes2ServerOutputStream(para); - XMLTools.writeOutputStreamXML(mgr, out); - - try { - String res = stream2String( - filterInputStream( - RemoteEnvUtils.simulateRPCByHttpPost(out.getOut().toByteArray(), out.nameValuePairs, false, this) - ) - ); - if (StringUtils.isNotEmpty(res)) { - JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Already_exist") + res); - return false; - } - } catch (Exception e) { - FineLoggerFactory.getLogger().error(e.getMessage()); - return false; - } - - return true; - } - /** * 写文件 *