Browse Source

REPORT-135233 调整LockInfoOperator

fbp/release
Destiny.Lin 2 months ago
parent
commit
e7cc3647f4
  1. 4
      designer-base/src/main/java/com/fr/design/lock/TemplateLockInfoReSave.java
  2. 19
      designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java
  3. 27
      designer-base/src/main/java/com/fr/design/mainframe/ForbiddenPane.java
  4. 2
      designer-realize/src/main/java/com/fanruan/boot/init/DesignWorkContextComponent.java

4
designer-base/src/main/java/com/fr/design/lock/TemplateLockInfoReSave.java

@ -1,12 +1,12 @@
package com.fr.design.lock; package com.fr.design.lock;
import com.fanruan.repository.TemplateRepository;
import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.JTemplate;
import com.fr.event.Event; import com.fr.event.Event;
import com.fr.event.EventDispatcher; import com.fr.event.EventDispatcher;
import com.fr.event.Listener; import com.fr.event.Listener;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.report.lock.LockInfoOperator;
import com.fr.stable.collections.CollectionUtils; import com.fr.stable.collections.CollectionUtils;
import com.fr.workspace.WorkContext; import com.fr.workspace.WorkContext;
import com.fr.workspace.Workspace; import com.fr.workspace.Workspace;
@ -31,7 +31,7 @@ public class TemplateLockInfoReSave {
return; return;
} }
String[] paths = templates.stream().map(JTemplate::getPath).toArray(String[]::new); String[] paths = templates.stream().map(JTemplate::getPath).toArray(String[]::new);
String[] lockedPath = WorkContext.getCurrent().get(LockInfoOperator.class).lockTemplates(paths); String[] lockedPath = TemplateRepository.getInstance().lockTemplates(paths);
FineLoggerFactory.getLogger().warn("template lock failed:{}", String.join(";", lockedPath)); FineLoggerFactory.getLogger().warn("template lock failed:{}", String.join(";", lockedPath));
} }
}; };

19
designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java

@ -1,5 +1,6 @@
package com.fr.design.mainframe; package com.fr.design.mainframe;
import com.fanruan.repository.TemplateRepository;
import com.fine.theme.icon.LazyIcon; import com.fine.theme.icon.LazyIcon;
import com.fine.theme.utils.FineLayoutBuilder; import com.fine.theme.utils.FineLayoutBuilder;
import com.fine.theme.utils.FineUIStyle; import com.fine.theme.utils.FineUIStyle;
@ -58,7 +59,6 @@ import com.fr.plugin.injectable.PluginModule;
import com.fr.plugin.manage.PluginFilter; import com.fr.plugin.manage.PluginFilter;
import com.fr.plugin.observer.PluginEvent; import com.fr.plugin.observer.PluginEvent;
import com.fr.plugin.observer.PluginEventListener; import com.fr.plugin.observer.PluginEventListener;
import com.fr.report.lock.LockInfoOperator;
import com.fr.stable.CoreConstants; import com.fr.stable.CoreConstants;
import com.fr.stable.StableUtils; import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
@ -66,21 +66,10 @@ import com.fr.stable.project.ProjectConstants;
import com.fr.third.org.apache.commons.io.FilenameUtils; import com.fr.third.org.apache.commons.io.FilenameUtils;
import com.fr.workspace.WorkContext; import com.fr.workspace.WorkContext;
import com.fanruan.repository.TemplateRepository; import javax.swing.*;
import javax.swing.BorderFactory;
import javax.swing.JDialog;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener; import javax.swing.event.DocumentListener;
import java.awt.BorderLayout; import java.awt.*;
import java.awt.CardLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.awt.event.KeyAdapter; import java.awt.event.KeyAdapter;
@ -250,7 +239,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
new Object[] {Toolkit.i18nText("Fine_Design_Template_UnLock_I_Known"), Toolkit.i18nText("Fine-Design_Basic_Button_Cancel")}, null); new Object[] {Toolkit.i18nText("Fine_Design_Template_UnLock_I_Known"), Toolkit.i18nText("Fine-Design_Basic_Button_Cancel")}, null);
if (option == JOptionPane.YES_OPTION) { if (option == JOptionPane.YES_OPTION) {
String path = StableUtils.pathJoin(ProjectConstants.REPORTLETS_NAME, TemplateTreePane.getInstance().getTemplateFileTree().getSelectedTemplatePath()); String path = StableUtils.pathJoin(ProjectConstants.REPORTLETS_NAME, TemplateTreePane.getInstance().getTemplateFileTree().getSelectedTemplatePath());
boolean success = WorkContext.getCurrent().get(LockInfoOperator.class).unLockTpl(path); boolean success = TemplateRepository.getInstance().unLockTpl(path);
if (success) { if (success) {
FileNode fileNode = TemplateTreePane.getInstance().getFileNode(); FileNode fileNode = TemplateTreePane.getInstance().getFileNode();
refreshRightToolBarBy(fileNode); refreshRightToolBarBy(fileNode);

27
designer-base/src/main/java/com/fr/design/mainframe/ForbiddenPane.java

@ -1,5 +1,6 @@
package com.fr.design.mainframe; package com.fr.design.mainframe;
import com.fanruan.repository.TemplateRepository;
import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.DesignSizeI18nManager; import com.fr.design.i18n.DesignSizeI18nManager;
@ -8,25 +9,10 @@ import com.fr.design.mainframe.guide.base.GuideView;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.IOUtils; import com.fr.general.IOUtils;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.report.lock.LockInfoOperator; import com.fr.workspace.base.UserInfo;
import com.fr.workspace.WorkContext;
import javax.swing.*;
import javax.swing.ImageIcon; import java.awt.*;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.SwingWorker;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.LayoutManager;
import java.awt.RenderingHints;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
@ -125,7 +111,8 @@ public class ForbiddenPane extends JPanel {
@Override @Override
protected Boolean doInBackground() throws Exception { protected Boolean doInBackground() throws Exception {
return WorkContext.getCurrent().get(LockInfoOperator.class).isTplLocked(template.getEditingFILE().getPath()); UserInfo info = TemplateRepository.getInstance().showLockInfo(template.getEditingFILE().getPath());
return info.getTplLocked();
} }
@Override @Override

2
designer-realize/src/main/java/com/fanruan/boot/init/DesignWorkContextComponent.java

@ -28,7 +28,6 @@ import com.fr.design.env.HttpWorkspaceConnector;
import com.fr.env.operator.CommonOperatorImpl; import com.fr.env.operator.CommonOperatorImpl;
import com.fr.esd.core.remote.ESDConfigEventOperator; import com.fr.esd.core.remote.ESDConfigEventOperator;
import com.fr.esd.core.remote.ESDConfigEventOperatorImpl; import com.fr.esd.core.remote.ESDConfigEventOperatorImpl;
import com.fr.file.ConnectionOperator;
import com.fr.file.TableDataOperator; import com.fr.file.TableDataOperator;
import com.fr.file.TableDataOperatorImpl; import com.fr.file.TableDataOperatorImpl;
import com.fr.file.filetree.FileNodes; import com.fr.file.filetree.FileNodes;
@ -178,7 +177,6 @@ public class DesignWorkContextComponent {
WorkRPCRegister.wrap(WorkRPCType.Compatible, TableDataOperator.class, TableDataOperatorImpl.getInstance()), WorkRPCRegister.wrap(WorkRPCType.Compatible, TableDataOperator.class, TableDataOperatorImpl.getInstance()),
WorkRPCRegister.wrap(FileAssistUtilsOperator.class, new FileAssistUtils()), WorkRPCRegister.wrap(FileAssistUtilsOperator.class, new FileAssistUtils()),
WorkRPCRegister.wrap(TableDataOperator.class, TableDataOperatorImpl.getInstance()), WorkRPCRegister.wrap(TableDataOperator.class, TableDataOperatorImpl.getInstance()),
WorkRPCRegister.wrap(ConnectionOperator.class, CompatibleConnectionOperator.getInstance()),
WorkRPCRegister.wrap(BuildInfoOperator.class, new BuildInfoOperatorImpl()) WorkRPCRegister.wrap(BuildInfoOperator.class, new BuildInfoOperatorImpl())
); );
} }

Loading…
Cancel
Save