From f3f16b295e72bca4fa5ad22fd1c52b94707919a7 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Mon, 29 Jul 2024 09:59:58 +0800 Subject: [PATCH 1/2] =?UTF-8?q?Revert=20"REPORT-120151=20feat:=20=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=20forkId=20=E5=92=8C=E7=9B=B8=E5=85=B3=E5=9F=8B?= =?UTF-8?q?=E7=82=B9"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 127b792fd524c4e0fcf29bcc58bd1ec5fa6f5b73. --- .../java/com/fr/design/mainframe/JTemplate.java | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java index c9ca4260e8..960ffe92a9 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java @@ -7,7 +7,6 @@ import com.fr.base.extension.FileExtension; import com.fr.base.info.TemplateSaveInfoContext; import com.fr.base.io.BaseBook; import com.fr.base.iofile.attr.DesignBanCopyAttrMark; -import com.fr.base.iofile.attr.ForkIdAttrMark; import com.fr.base.iofile.attr.TemplateIdAttrMark; import com.fr.base.iofile.attr.TemplateThemeAttrMark; import com.fr.base.svg.IconUtils; @@ -344,18 +343,6 @@ public abstract class JTemplate> generateTemplateId(); } - /** - * 如果没有 forkId, 则计算 forkId - * 要求在 templateId, 创建后执行。 - */ - protected void computeForkIdIfAbsent() { - - ForkIdAttrMark forkIdAttrMark = this.template.getAttrMark(ForkIdAttrMark.XML_TAG); - if (forkIdAttrMark == null || StringUtils.isEmpty(forkIdAttrMark.getForkId())) { - this.template.addAttrMark(new ForkIdAttrMark(this.template.getTemplateID())); - } - } - /** * 收集图表信息 */ @@ -984,7 +971,6 @@ public abstract class JTemplate> } // 在保存之前,初始化 templateID generateNewTemplateIdForSaveAs(); - computeForkIdIfAbsent(); this.editingFILE = editingFILE; TemplateSaveInfoContext.getInstance().startCollect(template); @@ -1854,8 +1840,6 @@ public abstract class JTemplate> } // 在保存之前,初始化 templateID generateNewTemplateIdForSaveAs(); - computeForkIdIfAbsent(); - this.editingFILE = editingFILE; boolean result = this.saveToNewRealFile(oldName); if (result) { From c6bd38198b585d0892e6c2aa57f3069d27dfdd8f Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Mon, 29 Jul 2024 10:47:37 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=97=A0jira=E4=BB=BB=E5=8A=A1=EF=BC=8C?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=89=93=E5=8C=85=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/EnvChangeEntrance.java | 2 +- .../preview/sql/PreviewPerformedSqlPane.java | 2 +- .../java/com/fr/design/file/TemplateTreePane.java | 12 ++++++++++++ .../main/java/com/fr/design/utils/TemplateUtils.java | 1 - .../fr/design/versioncheck/VersionCheckUtils.java | 2 +- .../java/com/fr/start/server/FineEmbedServer.java | 3 --- .../fanruan/boot/env/DesignEnvChooseComponent.java | 10 ++++++++++ .../src/main/java/com/fr/start/SplashContext.java | 3 --- .../fr/start/module/DesignerWorkspaceActivator.java | 8 ++++---- 9 files changed, 29 insertions(+), 14 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java index ca659e5f34..4761002648 100644 --- a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java +++ b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java @@ -440,7 +440,7 @@ public class EnvChangeEntrance { Set localServiceSet = FineObjectPool.getInstance().getServerPool().keySet(); try { - JSONArray serviceArray = new FunctionalHttpRequest(info).getServiceList(info); + JSONArray serviceArray = new FunctionalHttpRequest(info).getServiceList(); for (int i = 0; i < serviceArray.size(); i++) { try { Class clazz = Class.forName((String) serviceArray.get(i)); diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/sql/PreviewPerformedSqlPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/sql/PreviewPerformedSqlPane.java index 4228f5c8da..de784ceb10 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/sql/PreviewPerformedSqlPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/sql/PreviewPerformedSqlPane.java @@ -253,7 +253,7 @@ public class PreviewPerformedSqlPane extends JDialog implements ActionListener { private static Parameter[] processParameters(DBTableData tableData, Calculator calculator) { ParameterProvider[] parameters = tableData.getParameters(); if (parameters == null || parameters.length == 0) { - tableData.setParameters(ParameterHelper.analyze4Parameters(tableData.getQueryWithoutComments(), false)); + tableData.setParameters(ParameterHelper.analyze4Parameters(tableData.getQuery(), false)); return new Parameter[0]; } return Parameter.providers2Parameter(Calculator.processParameters(calculator, parameters)); diff --git a/designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java b/designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java index d60a45135d..b91ac522d0 100644 --- a/designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java +++ b/designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java @@ -515,6 +515,18 @@ public class TemplateTreePane extends JPanel implements FileOperations { return reportletsTree.getSelectedFileNode(); } + + /** + * 是否需要展示锁定信息 + */ + public static boolean needShowLockInfo(String lock, String selectedFilePath, FileNode node) { + boolean getLockInfo = LockInfoUtils.isCompatibleOperator() || LockInfoUtils.unableGetLockInfo(); + if (!getLockInfo) { + UserInfo info = TemplateRepository.getInstance().showLockInfo(selectedFilePath); + return info.getTplUnLocked() ? (lock != null && !lock.equals(node.getUserID())) : info.getTplLocked(); + } + return false; + } public void setToolbarStateChangeListener(FileToolbarStateChangeListener listener) { this.toolBarStateChangeListener = listener; } diff --git a/designer-base/src/main/java/com/fr/design/utils/TemplateUtils.java b/designer-base/src/main/java/com/fr/design/utils/TemplateUtils.java index efaef8695f..ff0afe1e9a 100644 --- a/designer-base/src/main/java/com/fr/design/utils/TemplateUtils.java +++ b/designer-base/src/main/java/com/fr/design/utils/TemplateUtils.java @@ -16,7 +16,6 @@ import com.fr.log.FineLoggerFactory; import com.fr.stable.ArrayUtils; import com.fr.stable.CoreConstants; import com.fanruan.product.ProductConstants; -import com.fr.stable.ProductConstants; import com.fr.stable.StringUtils; import com.fr.workspace.WorkContext; import com.fr.workspace.server.lock.TplOperator; diff --git a/designer-base/src/main/java/com/fr/design/versioncheck/VersionCheckUtils.java b/designer-base/src/main/java/com/fr/design/versioncheck/VersionCheckUtils.java index 69ca667bb6..0d10600b64 100644 --- a/designer-base/src/main/java/com/fr/design/versioncheck/VersionCheckUtils.java +++ b/designer-base/src/main/java/com/fr/design/versioncheck/VersionCheckUtils.java @@ -230,7 +230,7 @@ public class VersionCheckUtils { Set localServiceSet = FineObjectPool.getInstance().getServerPool().keySet(); try { - JSONArray serviceArray = new FunctionalHttpRequest(info).getServiceList(info); + JSONArray serviceArray = new FunctionalHttpRequest(info).getServiceList(); for (int i = 0; i < serviceArray.size(); i++) { try { Class clazz = Class.forName((String) serviceArray.get(i)); diff --git a/designer-base/src/main/java/com/fr/start/server/FineEmbedServer.java b/designer-base/src/main/java/com/fr/start/server/FineEmbedServer.java index 13f708e588..fc3d2a4e46 100644 --- a/designer-base/src/main/java/com/fr/start/server/FineEmbedServer.java +++ b/designer-base/src/main/java/com/fr/start/server/FineEmbedServer.java @@ -3,8 +3,6 @@ package com.fr.start.server; import com.fanruan.carina.Carina; import com.fr.event.EventDispatcher; import com.fr.workspace.WorkContext; -import com.fr.module.ModuleContext; -import com.fr.plugin.listener.SpecialPluginEvent; /** * Created by juhaoyu on 2018/6/6. @@ -22,7 +20,6 @@ public abstract class FineEmbedServer { public synchronized static void start() throws Exception { if (!isRunning()) { onStarting = true; - EventDispatcher.fire(SpecialPluginEvent.WITH_SERVER_AND_NOT_START_IN_REMOTE); EventDispatcher.fire(EmbedServerEvent.BeforeStart); DesignEmbedHelper.start(); onStarting = false; diff --git a/designer-realize/src/main/java/com/fanruan/boot/env/DesignEnvChooseComponent.java b/designer-realize/src/main/java/com/fanruan/boot/env/DesignEnvChooseComponent.java index 35bbba6819..d655e511f1 100644 --- a/designer-realize/src/main/java/com/fanruan/boot/env/DesignEnvChooseComponent.java +++ b/designer-realize/src/main/java/com/fanruan/boot/env/DesignEnvChooseComponent.java @@ -93,6 +93,12 @@ import com.fr.workspace.server.theme.ThemedCellBorderFeature; import com.fr.workspace.server.vcs.CompatibleVcsOperator; import com.fr.workspace.server.vcs.VcsOperator; import com.fr.workspace.server.vcs.VcsOperatorProxy; +import com.fr.workspace.server.vcs.v2.move.CompatibleVcsMoveOperator; +import com.fr.workspace.server.vcs.v2.move.VcsMoveOperator; +import com.fr.workspace.server.vcs.v2.move.VcsMoveOperatorImpl; +import com.fr.workspace.server.vcs.v2.scheduler.CompatibleAutoCleanOperator; +import com.fr.workspace.server.vcs.v2.scheduler.VcsAutoCleanOperator; +import com.fr.workspace.server.vcs.v2.scheduler.VcsAutoCleanService; import org.jetbrains.annotations.NotNull; /** @@ -265,6 +271,10 @@ public class DesignEnvChooseComponent extends ResourceAffiliate { WorkRPCRegister.wrap(EncryptOperator.class, new FineEncryptOperator()), WorkRPCRegister.wrap(VcsOperator.class, new VcsOperatorProxy()), WorkRPCRegister.wrap(WorkRPCType.Compatible, VcsOperator.class, new CompatibleVcsOperator()), + WorkRPCRegister.wrap(VcsMoveOperator.class, VcsMoveOperatorImpl.getInstance()), + WorkRPCRegister.wrap(WorkRPCType.Compatible, VcsMoveOperator.class, new CompatibleVcsMoveOperator()), + WorkRPCRegister.wrap(VcsAutoCleanOperator.class, VcsAutoCleanService.getInstance()), + WorkRPCRegister.wrap(WorkRPCType.Compatible, VcsAutoCleanOperator.class, new CompatibleAutoCleanOperator()), WorkRPCRegister.wrap(TemplateChecker.class, new TemplateCheckerImpl()), WorkRPCRegister.wrap(ShareComponentOperator.class, new DefaultShareComponentOperator()), WorkRPCRegister.wrap(ShareEmbeddedConverter.class, new DefaultShareEmbeddedConverter()), diff --git a/designer-realize/src/main/java/com/fr/start/SplashContext.java b/designer-realize/src/main/java/com/fr/start/SplashContext.java index c52726045d..f7f5f3d4f4 100644 --- a/designer-realize/src/main/java/com/fr/start/SplashContext.java +++ b/designer-realize/src/main/java/com/fr/start/SplashContext.java @@ -11,9 +11,6 @@ import com.fr.event.Listener; import com.fr.event.Null; import com.fr.general.GeneralContext; import com.fr.general.locale.image.I18nImage; -import com.fr.module.ModuleEvent; -import com.fr.general.locale.LocaleCenter; -import com.fr.general.locale.LocaleMark; import com.fr.stable.StringUtils; import java.util.Locale; diff --git a/designer-realize/src/main/java/com/fr/start/module/DesignerWorkspaceActivator.java b/designer-realize/src/main/java/com/fr/start/module/DesignerWorkspaceActivator.java index 2fd4a532c8..44fcfb24c3 100644 --- a/designer-realize/src/main/java/com/fr/start/module/DesignerWorkspaceActivator.java +++ b/designer-realize/src/main/java/com/fr/start/module/DesignerWorkspaceActivator.java @@ -105,11 +105,11 @@ public class DesignerWorkspaceActivator extends Activator { if (current.isLocal()) { ExecutorService service = newSingleThreadExecutor( new NamedThreadFactory("DesignerWorkspaceActivator")); - service.submit(new Runnable() { - - @Override - public void run() { + service.submit(() -> { + try { FineEmbedServer.start(); + } catch (Exception e) { + throw new RuntimeException(e); } }); service.shutdown();