Browse Source

REPORT-52928 埋点只统计有特殊配置的组件

feature/10.0
kuangshuai 4 years ago
parent
commit
c21154e1fc
  1. 14
      designer-form/src/main/java/com/fr/design/mainframe/JForm.java
  2. 16
      designer-realize/src/main/java/com/fr/design/share/SharableInitManager.java
  3. 49
      designer-realize/src/main/java/com/fr/design/share/SharableManager.java
  4. 5
      designer-realize/src/main/java/com/fr/design/share/utils/EffectItemUtils.java
  5. 2
      designer-realize/src/main/java/com/fr/start/MainDesigner.java
  6. 4
      designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java

14
designer-form/src/main/java/com/fr/design/mainframe/JForm.java

@ -346,20 +346,6 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm<F
if (jt == null) {
return;
}
int useCount = 0;
if (!jt.getProcessInfo().isTestTemplate()) {
JForm jForm = (JForm) jt;
XLayoutContainer root = jForm.getFormDesign().getRootComponent();
List<XCreator> xCreators = ShareComponentUtils.getHelpConfigXCreatorList(root);
JSONArray helpConfigUseInfo = ComponentCollector.getInstance().getHelpConfigUseInfoWithTemplate(jt.getTarget().getTemplateID());
for (XCreator xCreator : xCreators) {
if (helpConfigUseInfo.contains(ShareComponentUtils.getWidgetId(xCreator.toData()))) {
useCount++;
}
}
ComponentCollector.getInstance().collectHelpConfigInfo(jt.getTarget().getTemplateID(), xCreators.size(), useCount);
}
}
});

16
designer-realize/src/main/java/com/fr/design/share/SharableInitManager.java

@ -1,16 +0,0 @@
package com.fr.design.share;
import com.fr.design.base.clipboard.ClipboardFilter;
import com.fr.design.mainframe.share.collect.SharableCollectorManager;
import com.fr.design.mainframe.share.encrypt.clipboard.impl.EncryptSelectionClipboardHandler;
import com.fr.design.mainframe.share.encrypt.clipboard.impl.EncryptTransferableClipboardHandler;
import com.fr.design.mainframe.share.util.SharableXMLUtils;
public class SharableInitManager {
public static void start() {
SharableXMLUtils.registerSharableReadHelper();
SharableCollectorManager.getInstance().execute();
ClipboardFilter.registerClipboardHandler(EncryptSelectionClipboardHandler.getInstance());
ClipboardFilter.registerClipboardHandler(EncryptTransferableClipboardHandler.getInstance());
}
}

49
designer-realize/src/main/java/com/fr/design/share/SharableManager.java

@ -0,0 +1,49 @@
package com.fr.design.share;
import com.fr.design.base.clipboard.ClipboardFilter;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.designer.creator.XLayoutContainer;
import com.fr.design.mainframe.JForm;
import com.fr.design.mainframe.JTemplate;
import com.fr.design.mainframe.share.collect.ComponentCollector;
import com.fr.design.mainframe.share.collect.SharableCollectorManager;
import com.fr.design.mainframe.share.encrypt.clipboard.impl.EncryptSelectionClipboardHandler;
import com.fr.design.mainframe.share.encrypt.clipboard.impl.EncryptTransferableClipboardHandler;
import com.fr.design.mainframe.share.util.SharableXMLUtils;
import com.fr.design.mainframe.share.util.ShareComponentUtils;
import com.fr.design.share.utils.EffectItemUtils;
import com.fr.json.JSONArray;
import java.util.List;
public class SharableManager {
public static void start() {
SharableXMLUtils.registerSharableReadHelper();
SharableCollectorManager.getInstance().execute();
ClipboardFilter.registerClipboardHandler(EncryptSelectionClipboardHandler.getInstance());
ClipboardFilter.registerClipboardHandler(EncryptTransferableClipboardHandler.getInstance());
}
public static void saveTemplate(JTemplate jt) {
if (jt instanceof JForm) {
int showCount = 0;
int useCount = 0;
if (!jt.getProcessInfo().isTestTemplate()) {
JForm jForm = (JForm) jt;
XLayoutContainer root = jForm.getFormDesign().getRootComponent();
List<XCreator> xCreators = ShareComponentUtils.getHelpConfigXCreatorList(root);
JSONArray helpConfigUseInfo = ComponentCollector.getInstance().getHelpConfigUseInfoWithTemplate(jForm.getTarget().getTemplateID());
for (XCreator xCreator : xCreators) {
if (EffectItemUtils.hasEffectItem(xCreator.toData())) {
showCount ++;
if (helpConfigUseInfo.contains(ShareComponentUtils.getWidgetId(xCreator.toData()))) {
useCount++;
}
}
}
ComponentCollector.getInstance().collectHelpConfigInfo(jForm.getTarget().getTemplateID(), showCount, useCount);
}
}
}
}

5
designer-realize/src/main/java/com/fr/design/share/utils/EffectItemUtils.java

@ -19,4 +19,9 @@ public class EffectItemUtils {
}
return effectItemGroupList;
}
public static boolean hasEffectItem(Widget widget) {
EffectItemGroup effectItemGroup = new EffectItemGroup(widget);
return effectItemGroup.getEffectItems().size() > 0;
}
}

2
designer-realize/src/main/java/com/fr/start/MainDesigner.java

@ -38,6 +38,7 @@ import com.fr.design.module.ChartEmptyDataStyleAction;
import com.fr.design.module.ChartPreStyleAction;
import com.fr.design.module.DesignModuleFactory;
import com.fr.design.monitor.DesignerLifecycleMonitorContext;
import com.fr.design.share.SharableManager;
import com.fr.design.utils.concurrent.ThreadFactoryBuilder;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.event.Event;
@ -235,6 +236,7 @@ public class MainDesigner extends BaseDesigner {
jt.stopEditing();
jt.saveDirectly();
jt.requestFocus();
SharableManager.saveTemplate(jt);
}
});
}

4
designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java

@ -61,7 +61,7 @@ import com.fr.design.os.impl.SupportOSImpl;
import com.fr.design.parameter.FormParameterReader;
import com.fr.design.parameter.ParameterPropertyPane;
import com.fr.design.parameter.WorkBookParameterReader;
import com.fr.design.share.SharableInitManager;
import com.fr.design.share.SharableManager;
import com.fr.design.share.ui.config.ShareConfigPane;
import com.fr.design.share.ui.generate.ShareGeneratePane;
import com.fr.design.update.actions.RecoverForDesigner;
@ -207,7 +207,7 @@ public class DesignerActivator extends Activator {
designerRegister();
InformationCollector.getInstance().collectStartTime();
SharableInitManager.start();
SharableManager.start();
}
private void createPluginListener() {

Loading…
Cancel
Save