Browse Source

REPORT-135233 调整FileNodes

fbp/merge
Destiny.Lin 3 months ago
parent
commit
bfdd0b52bd
  1. 7
      designer-base/src/main/java/com/fr/design/actions/file/LocalePane.java
  2. 4
      designer-base/src/main/java/com/fr/design/file/TemplateDirTreePane.java
  3. 2
      designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java
  4. 3
      designer-base/src/main/java/com/fr/design/file/impl/DefaultTemplateResource.java
  5. 10
      designer-base/src/main/java/com/fr/design/gui/itree/filetree/EnvFileTree.java
  6. 3
      designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileNodeComparator.java
  7. 3
      designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileNodeConstants.java
  8. 5
      designer-base/src/main/java/com/fr/design/gui/itree/filetree/TemplateDirTree.java
  9. 5
      designer-base/src/main/java/com/fr/design/gui/itree/filetree/TemplateFileTree.java
  10. 4
      designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java
  11. 3
      designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java
  12. 3
      designer-base/src/main/java/com/fr/file/FILEChooserPane.java
  13. 4
      designer-base/src/main/java/com/fr/file/FileNodeFILE.java
  14. 14
      designer-base/src/main/java/com/fr/nx/app/designer/transform/ui/TransformFileTree.java
  15. 18
      designer-realize/src/main/java/com/fanruan/boot/init/DesignWorkContextComponent.java
  16. 23
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/FileSearchManager.java

7
designer-base/src/main/java/com/fr/design/actions/file/LocalePane.java

@ -4,14 +4,14 @@
package com.fr.design.actions.file;
import com.fr.base.FRContext;
import com.fanruan.entity.template.TemplateListBean;
import com.fanruan.repository.TemplateRepository;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.frpane.UITabbedPane;
import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.file.filetree.FileNode;
import com.fr.general.GeneralUtils;
import com.fr.locale.InterProviderFactory;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.ArrayUtils;
@ -153,8 +153,7 @@ public class LocalePane extends BasicPane {
}
private void initCustomProperties() throws Exception {
FileNode[] fileNodes = FRContext.getFileNodes().list(ProjectConstants.LOCALE_NAME);
FileNode[] fileNodes = TemplateRepository.getInstance().list(new TemplateListBean(ProjectConstants.LOCALE_NAME));
if (ArrayUtils.getLength(fileNodes) == 0) {
return;
}

4
designer-base/src/main/java/com/fr/design/file/TemplateDirTreePane.java

@ -1,6 +1,6 @@
package com.fr.design.file;
import com.fr.base.FRContext;
import com.fanruan.repository.TemplateRepository;
import com.fr.design.border.FineBorderFactory;
import com.fr.design.gui.itree.filetree.TemplateDirTree;
import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode;
@ -74,7 +74,7 @@ public class TemplateDirTreePane extends JPanel {
* 刷新
*/
public void refreshDockingView() {
templateDirTree.setFileNodeFilter(new IOFileNodeFilter(FRContext.getFileNodes().getSupportedTypes()));
templateDirTree.setFileNodeFilter(new IOFileNodeFilter(TemplateRepository.getInstance().getSupportedTypes()));
templateDirTree.refreshEnv();
}

2
designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java

@ -63,7 +63,7 @@ import java.util.Set;
import java.util.concurrent.ExecutionException;
import java.util.stream.Collectors;
import com.fr.workspace.server.repository.template.TemplateRepository;
import com.fanruan.repository.TemplateRepository;
import com.fr.workspace.server.vcs.VcsOperator;
import org.jetbrains.annotations.Nullable;

3
designer-base/src/main/java/com/fr/design/file/impl/DefaultTemplateResource.java

@ -2,8 +2,7 @@ package com.fr.design.file.impl;
import com.fr.file.FILE;
import com.fr.workspace.WorkContext;
import com.fr.workspace.server.lock.TplOperator;
import com.fr.workspace.server.repository.template.TemplateRepository;
import com.fanruan.repository.TemplateRepository;
import java.io.ByteArrayInputStream;
import java.io.InputStream;

10
designer-base/src/main/java/com/fr/design/gui/itree/filetree/EnvFileTree.java

@ -1,6 +1,7 @@
package com.fr.design.gui.itree.filetree;
import com.fr.base.FRContext;
import com.fanruan.entity.template.TemplateListBean;
import com.fanruan.repository.TemplateRepository;
import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode;
import com.fr.design.gui.itree.refreshabletree.RefreshableJTree;
import com.fr.design.i18n.Toolkit;
@ -11,13 +12,12 @@ import com.fr.log.FineLoggerFactory;
import com.fr.stable.CoreConstants;
import com.fr.stable.StableUtils;
import com.fr.workspace.WorkContext;
import com.fr.workspace.server.repository.template.TemplateRepository;
import javax.swing.JTree;
import javax.swing.*;
import javax.swing.tree.DefaultTreeCellRenderer;
import javax.swing.tree.DefaultTreeModel;
import javax.swing.tree.TreePath;
import java.awt.Component;
import java.awt.*;
import java.io.File;
import java.util.Arrays;
import java.util.HashMap;
@ -188,7 +188,7 @@ public class EnvFileTree extends RefreshableJTree {
FileNode[] resFns = null;
try {
resFns = WorkContext.getCurrent() == null ? new FileNode[0] : FRContext.getFileNodes().list(filePath);
resFns = WorkContext.getCurrent() == null ? new FileNode[0] : TemplateRepository.getInstance().list(new TemplateListBean(filePath));
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}

3
designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileNodeComparator.java

@ -1,8 +1,7 @@
package com.fr.design.gui.itree.filetree;
import com.fr.base.FRContext;
import com.fr.file.filetree.FileNode;
import com.fr.workspace.server.repository.template.TemplateRepository;
import com.fanruan.repository.TemplateRepository;
import java.io.Serializable;
import java.util.Arrays;

3
designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileNodeConstants.java

@ -1,6 +1,5 @@
package com.fr.design.gui.itree.filetree;
import com.fr.base.FRContext;
import com.fr.base.extension.FileExtension;
import com.fr.general.GeneralContext;
import com.fr.plugin.context.PluginContext;
@ -10,7 +9,7 @@ import com.fr.plugin.observer.PluginEvent;
import com.fr.plugin.observer.PluginEventListener;
import com.fr.report.ExtraReportClassManager;
import com.fr.report.fun.ReportSupportedFileProvider;
import com.fr.workspace.server.repository.template.TemplateRepository;
import com.fanruan.repository.TemplateRepository;
import java.util.Arrays;
import java.util.LinkedHashSet;

5
designer-base/src/main/java/com/fr/design/gui/itree/filetree/TemplateDirTree.java

@ -1,11 +1,10 @@
package com.fr.design.gui.itree.filetree;
import com.fr.base.FRContext;
import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode;
import com.fr.design.mainframe.manager.search.TemplateDirTreeSearchManager;
import com.fr.file.filetree.FileNode;
import com.fr.workspace.server.entity.template.TemplateListBean;
import com.fr.workspace.server.repository.template.TemplateRepository;
import com.fanruan.entity.template.TemplateListBean;
import com.fanruan.repository.TemplateRepository;
import java.util.Arrays;
import java.util.Map;

5
designer-base/src/main/java/com/fr/design/gui/itree/filetree/TemplateFileTree.java

@ -1,6 +1,5 @@
package com.fr.design.gui.itree.filetree;
import com.fr.base.FRContext;
import com.fr.base.extension.FileExtension;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.file.NodeAuthProcessor;
@ -13,8 +12,8 @@ import com.fr.stable.ArrayUtils;
import com.fr.stable.StableUtils;
import com.fr.stable.collections.CollectionUtils;
import com.fr.stable.project.ProjectConstants;
import com.fr.workspace.server.entity.template.TemplateListBean;
import com.fr.workspace.server.repository.template.TemplateRepository;
import com.fanruan.entity.template.TemplateListBean;
import com.fanruan.repository.TemplateRepository;
import javax.swing.text.Position;
import javax.swing.tree.DefaultTreeModel;

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

@ -52,7 +52,6 @@ import com.fr.event.Event;
import com.fr.file.filetree.FileNode;
import com.fr.general.ComparatorUtils;
import com.fr.general.GeneralContext;
import com.fr.general.IOUtils;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.context.PluginContext;
import com.fr.plugin.injectable.PluginModule;
@ -67,8 +66,7 @@ import com.fr.stable.project.ProjectConstants;
import com.fr.third.org.apache.commons.io.FilenameUtils;
import com.fr.workspace.WorkContext;
import com.fr.report.lock.LockInfoOperator;
import com.fr.workspace.server.repository.template.TemplateRepository;
import com.fanruan.repository.TemplateRepository;
import javax.swing.BorderFactory;
import javax.swing.JDialog;

3
designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java

@ -101,9 +101,8 @@ import com.fr.stable.core.UUID;
import com.fr.widgettheme.designer.WidgetThemeDisplayAction;
import com.fr.workspace.WorkContext;
import com.fr.workspace.server.lock.TplOperator;
import com.fr.workspace.server.repository.WorkplaceConstants;
import com.fr.workspace.server.repository.connection.ConnectionRepository;
import com.fr.workspace.server.repository.template.TemplateRepository;
import com.fanruan.repository.TemplateRepository;
import javax.swing.BorderFactory;
import javax.swing.Icon;

3
designer-base/src/main/java/com/fr/file/FILEChooserPane.java

@ -22,7 +22,6 @@ import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.file.NodeAuthProcessor;
import com.fr.design.fun.ReportSupportedFileUIProvider;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ibutton.UIButtonUI;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.DefaultCompletionFilter;
@ -55,7 +54,7 @@ import com.fr.stable.project.ProjectConstants;
import com.fr.workspace.WorkContext;
import com.fr.workspace.Workspace;
import com.fr.workspace.WorkspaceEvent;
import com.fr.workspace.server.repository.template.TemplateRepository;
import com.fanruan.repository.TemplateRepository;
import javax.swing.AbstractAction;
import javax.swing.AbstractListModel;

4
designer-base/src/main/java/com/fr/file/FileNodeFILE.java

@ -23,9 +23,9 @@ import com.fr.workspace.WorkContext;
import com.fr.workspace.Workspace;
import com.fr.workspace.WorkspaceEvent;
import com.fr.workspace.server.entity.WorkResourceTempRenameStream;
import com.fr.workspace.server.entity.template.TemplateListBean;
import com.fanruan.entity.template.TemplateListBean;
import com.fr.workspace.server.repository.system.WorkspaceSystemInfo;
import com.fr.workspace.server.repository.template.TemplateRepository;
import com.fanruan.repository.TemplateRepository;
import javax.swing.*;
import java.io.InputStream;

14
designer-base/src/main/java/com/fr/nx/app/designer/transform/ui/TransformFileTree.java

@ -1,6 +1,7 @@
package com.fr.nx.app.designer.transform.ui;
import com.fr.base.FRContext;
import com.fanruan.entity.template.TemplateListBean;
import com.fanruan.repository.TemplateRepository;
import com.fr.base.extension.FileExtension;
import com.fr.design.gui.itree.checkboxtree.CheckBoxTree;
import com.fr.design.gui.itree.checkboxtree.CheckBoxTreeCellRenderer;
@ -10,13 +11,12 @@ import com.fr.design.remote.ui.tree.FileAuthorityTree;
import com.fr.file.filetree.FileNode;
import com.fr.general.ComparatorUtils;
import com.fr.nx.app.designer.transform.BatchTransformUtil;
import com.fr.stable.StringUtils;
import javax.swing.tree.DefaultTreeModel;
import javax.swing.tree.TreeCellRenderer;
import javax.swing.tree.TreePath;
import java.awt.AlphaComposite;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.*;
import java.awt.event.MouseEvent;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
@ -166,10 +166,8 @@ public class TransformFileTree extends FileAuthorityTree {
for (String temp : this.filter.getSupportedTypes()) {
supportTypes.add(FileExtension.parse(temp));
}
FileNode[] fileNodes = FRContext.getFileNodes().list(
path,
supportTypes.toArray(new FileExtension[supportTypes.size()])
);
TemplateListBean bean = new TemplateListBean(path, StringUtils.EMPTY, supportTypes.toArray(new FileExtension[supportTypes.size()]), false, true, false);
FileNode[] fileNodes = TemplateRepository.getInstance().list(bean);
return BatchTransformUtil.filterTransformedFile(fileNodes, transformedList);
}

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

@ -1,5 +1,6 @@
package com.fanruan.boot.init;
import com.fanruan.boot.RepositorySourceRegister;
import com.fanruan.carina.Carina;
import com.fanruan.carina.annotions.DependsOn;
import com.fanruan.carina.annotions.FineComponent;
@ -7,18 +8,14 @@ import com.fanruan.carina.annotions.Start;
import com.fanruan.carina.annotions.Stop;
import com.fanruan.carina.annotions.Supplemental;
import com.fanruan.plugin.autonomy.AutonomyClassManagerGroup;
import com.fanruan.repository.TemplateRepository;
import com.fanruan.workplace.conetxt.CompatiblePool;
import com.fanruan.workplace.http.HttpConstants;
import com.fanruan.workplace.http.RepositoryManager;
import com.fanruan.workplace.http.WorkspaceHeartBeatShell;
import com.fanruan.workplace.http.exception.DefaultRemoteExceptionHandler;
import com.fr.report.UnLockedHandler;
import com.fr.workspace.engine.exception.RemoteDesignLoginLockHandler;
import com.fr.workspace.engine.exception.RemoteDesignNoAuthHandler;
import com.fr.workspace.engine.exception.RemoteDesignPasswordNeedUpdateHandler;
import com.fr.workspace.engine.exception.RemoteDesignPasswordStrengthHandler;
import com.fr.workspace.engine.exception.RemoteDesignUserPwdErrorHandler;
import com.fanruan.workplace.http.exception.RemoteExceptionConvert;
import com.fanruan.workplace.network.RemoteNetworkRepository;
import com.fanruan.workplace.standard.ServerInfo;
import com.fanruan.workplace.standard.ServerInfoOperator;
import com.fr.base.io.FileAssistUtils;
@ -38,6 +35,7 @@ import com.fr.file.filetree.FileNodes;
import com.fr.file.filetree.LocalFileNodes;
import com.fr.general.build.BuildInfoOperator;
import com.fr.general.build.impl.BuildInfoOperatorImpl;
import com.fr.report.UnLockedHandler;
import com.fr.security.encryption.storage.StorageEncryptors;
import com.fr.security.encryption.storage.StorageTransfer;
import com.fr.stable.StringUtils;
@ -50,6 +48,11 @@ import com.fr.workspace.engine.FineWorkspaceFactory;
import com.fr.workspace.engine.base.FineObjectPool;
import com.fr.workspace.engine.client.heartbeart.FineWorkspaceHeartbeat;
import com.fr.workspace.engine.client.heartbeart.WorkspaceHeartbeat;
import com.fr.workspace.engine.exception.RemoteDesignLoginLockHandler;
import com.fr.workspace.engine.exception.RemoteDesignNoAuthHandler;
import com.fr.workspace.engine.exception.RemoteDesignPasswordNeedUpdateHandler;
import com.fr.workspace.engine.exception.RemoteDesignPasswordStrengthHandler;
import com.fr.workspace.engine.exception.RemoteDesignUserPwdErrorHandler;
import com.fr.workspace.engine.exception.RemoteDriverUnExistHandler;
import com.fr.workspace.engine.exception.RemoteProcedureErrorHandler;
import com.fr.workspace.engine.resource.FineWorkResource;
@ -60,7 +63,6 @@ import com.fr.workspace.resource.WorkResource;
import com.fr.workspace.server.repository.authority.RemoteAuthorityRepository;
import com.fr.workspace.server.repository.compatible.CompatibleConnectionOperator;
import com.fr.workspace.server.repository.compatible.register.CompatibleRegister;
import com.fanruan.workplace.network.RemoteNetworkRepository;
import com.fr.workspace.server.repository.config.ConfigRepository;
import com.fr.workspace.server.repository.connection.ConnectionRepository;
import com.fr.workspace.server.repository.plugin.PluginRepository;
@ -68,7 +70,6 @@ import com.fr.workspace.server.repository.resource.PublicResourceRepository;
import com.fr.workspace.server.repository.resource.WorkResourceRepository;
import com.fr.workspace.server.repository.system.SystemInfoRepository;
import com.fr.workspace.server.repository.tabledata.TableDataRepository;
import com.fr.workspace.server.repository.template.TemplateRepository;
import com.fr.workspace.server.repository.vcs.VcsRepository;
import com.fr.workspace.server.repository.widget.ShareRepository;
@ -94,6 +95,7 @@ public class DesignWorkContextComponent {
public void prepare() {
supplementalExtra();
supplementalCommon();
RepositorySourceRegister.registerRepositorySource();
}

23
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/FileSearchManager.java

@ -1,6 +1,5 @@
package com.fr.design.mainframe.alphafine.search.manager.impl;
import com.fr.base.FRContext;
import com.fr.base.extension.FileExtension;
import com.fr.design.DesignerEnvManager;
import com.fr.design.actions.help.alphafine.AlphaFineConstants;
@ -12,14 +11,12 @@ import com.fr.design.mainframe.alphafine.model.SearchResult;
import com.fr.design.mainframe.alphafine.search.SearchTextBean;
import com.fr.design.mainframe.alphafine.search.manager.fun.AlphaFineSearchProvider;
import com.fr.file.filetree.FileNode;
import com.fr.file.filetree.FileNodes;
import com.fr.general.ComparatorUtils;
import com.fr.json.JSONObject;
import com.fr.rpc.ExceptionHandler;
import com.fr.rpc.RPCInvokerExceptionInfo;
import com.fr.stable.StringUtils;
import com.fr.stable.project.ProjectConstants;
import com.fr.workspace.WorkContext;
import com.fanruan.entity.template.TemplateListBean;
import com.fanruan.repository.TemplateRepository;
import java.util.List;
@ -83,12 +80,8 @@ public class FileSearchManager implements AlphaFineSearchProvider {
return lessModelList;
}
AlphaFineHelper.checkCancel();
fileNodes = WorkContext.getCurrent().get(FileNodes.class, new ExceptionHandler() {
@Override
public Object callHandler(RPCInvokerExceptionInfo exceptionInfo) {
return FRContext.getFileNodes().list(ProjectConstants.REPORTLETS_NAME, AlphaFineConstants.FILE_EXTENSIONS, true);
}
}).list(ProjectConstants.REPORTLETS_NAME, AlphaFineConstants.FILE_EXTENSIONS, true, false);
TemplateListBean bean = new TemplateListBean(ProjectConstants.REPORTLETS_NAME, StringUtils.EMPTY, AlphaFineConstants.FILE_EXTENSIONS, true, false, false);
fileNodes = TemplateRepository.getInstance().list(bean);
isContainCpt = true;
isContainFrm = true;
doSearch(this.searchText);
@ -161,12 +154,8 @@ public class FileSearchManager implements AlphaFineSearchProvider {
*/
private void doFileContentSearch(String searchText) {
if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isContainFileContent()) {
FileNode[] fileNodes = WorkContext.getCurrent().get(FileNodes.class, new ExceptionHandler() {
@Override
public Object callHandler(RPCInvokerExceptionInfo exceptionInfo) {
return FRContext.getFileNodes().filterFiles(searchText, ProjectConstants.REPORTLETS_NAME, new FileExtension[]{FileExtension.CPT, FileExtension.FRM}, true);
}
}).filterFiles(searchText, ProjectConstants.REPORTLETS_NAME, new FileExtension[]{FileExtension.CPT, FileExtension.FRM}, true, false);
TemplateListBean bean = new TemplateListBean(ProjectConstants.REPORTLETS_NAME, searchText, new FileExtension[]{FileExtension.CPT, FileExtension.FRM}, true, false, false);
FileNode[] fileNodes = TemplateRepository.getInstance().filterFiles(bean);
for (FileNode node : fileNodes) {
FileModel model = new FileModel(node.getName(), node.getEnvPath());
if (!AlphaFineHelper.getFilterResult().contains(model) && !filterModelList.contains(model)) {

Loading…
Cancel
Save