From b6bfe287e78db00590810056e08986647b424709 Mon Sep 17 00:00:00 2001 From: ju Date: Tue, 5 Jun 2018 10:19:59 +0800 Subject: [PATCH 1/3] =?UTF-8?q?BI-23374=20=E3=80=90=E7=9B=B4=E8=BF=9E?= =?UTF-8?q?=E9=9B=86=E7=BE=A4=E3=80=91=E6=8D=A2=E4=B8=8A6-5=E7=9A=84?= =?UTF-8?q?=E5=B9=B3=E5=8F=B0jar=E5=8C=85=EF=BC=8C=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E7=AE=A1=E7=90=86=E5=91=98=E5=AF=86=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/start/module/DesignerEnvProvider.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-realize/src/com/fr/start/module/DesignerEnvProvider.java b/designer-realize/src/com/fr/start/module/DesignerEnvProvider.java index 20417b2fba..65d37eca60 100644 --- a/designer-realize/src/com/fr/start/module/DesignerEnvProvider.java +++ b/designer-realize/src/com/fr/start/module/DesignerEnvProvider.java @@ -6,7 +6,6 @@ import com.fr.base.StoreProcedureParameter; import com.fr.base.TableData; import com.fr.base.env.serializer.OldSerializerAdapter; import com.fr.base.env.serializer.ProcedureDataModelSerializer; -import com.fr.base.env.user.LocalUserCenter; import com.fr.base.env.user.RemoteUserCenter; import com.fr.base.operator.connection.DataConnectionOperator; import com.fr.base.operator.connection.LocalDataConnectionOperator; @@ -27,6 +26,7 @@ import com.fr.general.ComparatorUtils; import com.fr.module.Activator; import com.fr.start.EnvSwitcher; import com.fr.start.StartServer; +import com.fr.startup.opeartors.LocalUserCenter; import java.io.InputStream; import java.io.OutputStream; From 010699d1cf681e3b738916f66ac187c44dbab7c0 Mon Sep 17 00:00:00 2001 From: hzzz Date: Tue, 5 Jun 2018 11:11:17 +0800 Subject: [PATCH 2/3] fix --- .../design/gui/itree/filetree/TemplateFileTree.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/designer-base/src/com/fr/design/gui/itree/filetree/TemplateFileTree.java b/designer-base/src/com/fr/design/gui/itree/filetree/TemplateFileTree.java index d04992876c..650712bb0f 100644 --- a/designer-base/src/com/fr/design/gui/itree/filetree/TemplateFileTree.java +++ b/designer-base/src/com/fr/design/gui/itree/filetree/TemplateFileTree.java @@ -1,11 +1,9 @@ package com.fr.design.gui.itree.filetree; import com.fr.base.Env; -import com.fr.core.env.EnvContext; +import com.fr.base.operator.file.FileOperator; import com.fr.core.env.proxy.EnvProxy; -import com.fr.core.env.resource.EnvConfigUtils; import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode; -import com.fr.env.operator.file.TplFileOperator; import com.fr.file.filetree.FileNode; import com.fr.log.FineLoggerFactory; import com.fr.stable.ArrayUtils; @@ -103,10 +101,9 @@ public class TemplateFileTree extends EnvFileTree { return null; } - public FileNode[] listFile(String path) { - String username = EnvConfigUtils.getUsername(EnvContext.currentEnv()); - String extra = EnvProxy.get(TplFileOperator.class).readExtraResourcePath(path); - return EnvProxy.get(TplFileOperator.class).list(username, extra, path); + public FileNode[] listFile(String path) throws Exception { + String extra = EnvProxy.get(FileOperator.class).readExtraResourcePath(path); + return EnvProxy.get(FileOperator.class).list(extra, path); } /* From b56e415f12cbda23e61ccb3dc49302d1707c6ddc Mon Sep 17 00:00:00 2001 From: ju Date: Tue, 5 Jun 2018 11:39:56 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=20=E5=8D=95?= =?UTF-8?q?=E5=85=83=E6=B5=8B=E8=AF=95+env=E6=B3=A8=E5=86=8C=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E4=B8=80=E6=AC=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/start/module/DesignerEnvProvider.java | 264 ++++++++++-------- 1 file changed, 144 insertions(+), 120 deletions(-) diff --git a/designer-realize/src/com/fr/start/module/DesignerEnvProvider.java b/designer-realize/src/com/fr/start/module/DesignerEnvProvider.java index 65d37eca60..68e7a4c9a1 100644 --- a/designer-realize/src/com/fr/start/module/DesignerEnvProvider.java +++ b/designer-realize/src/com/fr/start/module/DesignerEnvProvider.java @@ -7,12 +7,6 @@ import com.fr.base.TableData; import com.fr.base.env.serializer.OldSerializerAdapter; import com.fr.base.env.serializer.ProcedureDataModelSerializer; import com.fr.base.env.user.RemoteUserCenter; -import com.fr.base.operator.connection.DataConnectionOperator; -import com.fr.base.operator.connection.LocalDataConnectionOperator; -import com.fr.base.operator.file.FileOperator; -import com.fr.base.operator.file.LocalFileOperator; -import com.fr.core.env.operator.envinfo.EnvInfoOperator; -import com.fr.core.env.operator.envinfo.LocalEnvInfoOperator; import com.fr.core.env.operator.user.UserCenter; import com.fr.core.env.proxy.EnvProxy; import com.fr.data.core.db.TableProcedure; @@ -26,7 +20,6 @@ import com.fr.general.ComparatorUtils; import com.fr.module.Activator; import com.fr.start.EnvSwitcher; import com.fr.start.StartServer; -import com.fr.startup.opeartors.LocalUserCenter; import java.io.InputStream; import java.io.OutputStream; @@ -50,151 +43,182 @@ public class DesignerEnvProvider extends Activator { } } } + initDesignerEnv(); + getRoot().setSingleton(EnvSwitcher.class, new EnvSwitcher()); - - initEnvOperators(); - //设置好环境即可,具体跟环境有关的模块会自动调用 getRoot().getSingleton(EnvSwitcher.class).switch2LastEnv(); } - - @Override - public void stop() { - //清空模块 - getRoot().removeSingleton(EnvSwitcher.class); - } - - private void initEnvOperators() { + + private void initDesignerEnv() { + addSerializers(); - EnvProxy.addLocalService(FileOperator.class, new LocalFileOperator()); - EnvProxy.addLocalService(DataConnectionOperator.class, new LocalDataConnectionOperator()); - EnvProxy.addLocalService(EnvInfoOperator.class, new LocalEnvInfoOperator()); - EnvProxy.addLocalService(UserCenter.class, new LocalUserCenter()); EnvProxy.addRemoteService(UserCenter.class, new RemoteUserCenter()); } - + + private void addSerializers() { + EnvProxy.addSerializer(ProcedureDataModel[].class, new ProcedureDataModelSerializer()); - + EnvProxy.addSerializer(ModifiedTable.class, new OldSerializerAdapter( - new OldSerializerAdapter.OldSerializer() { - @Override - public void serializer(ModifiedTable obj, OutputStream out) throws Exception { - DavXMLUtils.writeXMLModifiedTables(obj, out); - } - }, - new OldSerializerAdapter.OldDeserializer() { - @Override - public ModifiedTable desializer(InputStream in) throws Exception { - return DavXMLUtils.readXMLModifiedTables(in); - } + new OldSerializerAdapter.OldSerializer() { + + @Override + public void serializer(ModifiedTable obj, OutputStream out) throws Exception { + + DavXMLUtils.writeXMLModifiedTables(obj, out); + } + }, + new OldSerializerAdapter.OldDeserializer() { + + @Override + public ModifiedTable deserializer(InputStream in) throws Exception { + + return DavXMLUtils.readXMLModifiedTables(in); } + } )); - + EnvProxy.addSerializer(com.fr.data.impl.Connection.class, new OldSerializerAdapter( - new OldSerializerAdapter.OldSerializer() { - @Override - public void serializer(Connection obj, OutputStream out) { - DavXMLUtils.writeXMLFileDatabaseConnection(obj, out); - } - }, - new OldSerializerAdapter.OldDeserializer() { - @Override - public Connection desializer(InputStream in) throws Exception { - return DavXMLUtils.readXMLDatabaseConnection(in); - } + new OldSerializerAdapter.OldSerializer() { + + @Override + public void serializer(Connection obj, OutputStream out) { + + DavXMLUtils.writeXMLFileDatabaseConnection(obj, out); + } + }, + new OldSerializerAdapter.OldDeserializer() { + + @Override + public Connection deserializer(InputStream in) throws Exception { + + return DavXMLUtils.readXMLDatabaseConnection(in); } + } )); - + EnvProxy.addSerializer(FileNode[].class, new OldSerializerAdapter( - new OldSerializerAdapter.OldSerializer() { - @Override - public void serializer(FileNode[] obj, OutputStream out) { - DavXMLUtils.writeXMLFileNodes(obj, out); - } - }, - new OldSerializerAdapter.OldDeserializer() { - @Override - public FileNode[] desializer(InputStream in) { - return DavXMLUtils.readXMLFileNodes(in); - } + new OldSerializerAdapter.OldSerializer() { + + @Override + public void serializer(FileNode[] obj, OutputStream out) { + + DavXMLUtils.writeXMLFileNodes(obj, out); + } + }, + new OldSerializerAdapter.OldDeserializer() { + + @Override + public FileNode[] deserializer(InputStream in) { + + return DavXMLUtils.readXMLFileNodes(in); } + } )); - + EnvProxy.addSerializer(TableProcedure[].class, new OldSerializerAdapter( - new OldSerializerAdapter.OldSerializer() { - @Override - public void serializer(TableProcedure[] obj, OutputStream out) { - DavXMLUtils.writeXMLFileSQLTable(obj, out); - } - }, - new OldSerializerAdapter.OldDeserializer() { - @Override - public TableProcedure[] desializer(InputStream in) throws Exception { - return DavXMLUtils.readXMLSQLTables(in); - } + new OldSerializerAdapter.OldSerializer() { + + @Override + public void serializer(TableProcedure[] obj, OutputStream out) { + + DavXMLUtils.writeXMLFileSQLTable(obj, out); } + }, + new OldSerializerAdapter.OldDeserializer() { + + @Override + public TableProcedure[] deserializer(InputStream in) throws Exception { + + return DavXMLUtils.readXMLSQLTables(in); + } + } )); - + EnvProxy.addSerializer(TableData.class, new OldSerializerAdapter( - new OldSerializerAdapter.OldSerializer() { - @Override - public void serializer(TableData obj, OutputStream out) { - DavXMLUtils.writeXMLFileTableData(obj, out); - } - }, - new OldSerializerAdapter.OldDeserializer() { - @Override - public TableData desializer(InputStream in) throws Exception { - return DavXMLUtils.readXMLTableData(in); - } + new OldSerializerAdapter.OldSerializer() { + + @Override + public void serializer(TableData obj, OutputStream out) { + + DavXMLUtils.writeXMLFileTableData(obj, out); } + }, + new OldSerializerAdapter.OldDeserializer() { + + @Override + public TableData deserializer(InputStream in) throws Exception { + + return DavXMLUtils.readXMLTableData(in); + } + } )); - + EnvProxy.addSerializer(Parameter[].class, new OldSerializerAdapter( - new OldSerializerAdapter.OldSerializer() { - @Override - public void serializer(Parameter[] obj, OutputStream out) { - DavXMLUtils.writeXMLFileParameters(obj, out); - } - }, - new OldSerializerAdapter.OldDeserializer() { - @Override - public Parameter[] desializer(InputStream in) throws Exception { - return DavXMLUtils.readXMLParameters(in); - } + new OldSerializerAdapter.OldSerializer() { + + @Override + public void serializer(Parameter[] obj, OutputStream out) { + + DavXMLUtils.writeXMLFileParameters(obj, out); + } + }, + new OldSerializerAdapter.OldDeserializer() { + + @Override + public Parameter[] deserializer(InputStream in) throws Exception { + + return DavXMLUtils.readXMLParameters(in); } + } )); - + EnvProxy.addSerializer(StoreProcedure.class, new OldSerializerAdapter( - new OldSerializerAdapter.OldSerializer() { - @Override - public void serializer(StoreProcedure obj, OutputStream out) { - DavXMLUtils.writeXMLFileStoreProcedure(obj, out); - } - }, - new OldSerializerAdapter.OldDeserializer() { - @Override - public StoreProcedure desializer(InputStream in) throws Exception { - return DavXMLUtils.readXMLStoreProcedure(in); - } + new OldSerializerAdapter.OldSerializer() { + + @Override + public void serializer(StoreProcedure obj, OutputStream out) { + + DavXMLUtils.writeXMLFileStoreProcedure(obj, out); + } + }, + new OldSerializerAdapter.OldDeserializer() { + + @Override + public StoreProcedure deserializer(InputStream in) throws Exception { + + return DavXMLUtils.readXMLStoreProcedure(in); } + } )); - + EnvProxy.addSerializer(StoreProcedureParameter[].class, new OldSerializerAdapter( - new OldSerializerAdapter.OldSerializer() { - @Override - public void serializer(StoreProcedureParameter[] obj, OutputStream out) { - DavXMLUtils.writeXMLFileParameters(obj, out); - } - }, - new OldSerializerAdapter.OldDeserializer() { - @Override - public StoreProcedureParameter[] desializer(InputStream in) throws Exception { - return DavXMLUtils.readXMLStoreProcedureParameters(in); - } + new OldSerializerAdapter.OldSerializer() { + + @Override + public void serializer(StoreProcedureParameter[] obj, OutputStream out) { + + DavXMLUtils.writeXMLFileParameters(obj, out); + } + }, + new OldSerializerAdapter.OldDeserializer() { + + @Override + public StoreProcedureParameter[] deserializer(InputStream in) throws Exception { + + return DavXMLUtils.readXMLStoreProcedureParameters(in); } + } )); } - + + @Override + public void stop() { + //清空模块 + getRoot().removeSingleton(EnvSwitcher.class); + } + + }