Browse Source

Pull request #9930: REPORT-79344【运营产品化二期】埋点暂不生效

Merge in DESIGN/design from ~LINK.ZHAO/design:final/11.0 to final/11.0

* commit 'ca77f7a2cddc9a020cbeac98f1f6694b9688c9cb':
  REPORT-79344【运营产品化二期】埋点暂不生效 修改pr
  REPORT-79344【运营产品化二期】埋点暂不生效 修改部分埋点
new-design
Link.Zhao-赵展 2 years ago
parent
commit
7788fb8c48
  1. 6
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/action/StartUseAction.java
  2. 14
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/DocumentModel.java
  3. 13
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/model/TemplateResource.java
  4. 4
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/TemplateResourceSearchManager.java

6
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/action/StartUseAction.java

@ -2,7 +2,6 @@ package com.fr.design.mainframe.alphafine.action;
import com.fr.common.util.Strings; import com.fr.common.util.Strings;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.DesignerFrameFileDealerPane;
import com.fr.design.mainframe.alphafine.AlphaFineHelper; import com.fr.design.mainframe.alphafine.AlphaFineHelper;
import com.fr.design.mainframe.alphafine.download.FineMarketConstants; import com.fr.design.mainframe.alphafine.download.FineMarketConstants;
import com.fr.design.mainframe.alphafine.download.FineMarketDownloadManager; import com.fr.design.mainframe.alphafine.download.FineMarketDownloadManager;
@ -80,8 +79,13 @@ public class StartUseAction implements ActionListener {
} }
// 打开模板 // 打开模板
if (fileNeedOpen == null) {
//有可能压缩包解压出来还是压缩包
FineLoggerFactory.getLogger().error("AlphaFine open resource error: " + fileName);
} else {
DesignerContext.getDesignerFrame().openTemplate(new FileFILE(fileNeedOpen)); DesignerContext.getDesignerFrame().openTemplate(new FileFILE(fileNeedOpen));
} }
}
private File getFirstCptOrFrm(File[] files) { private File getFirstCptOrFrm(File[] files) {

14
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/DocumentModel.java

@ -2,11 +2,10 @@ package com.fr.design.mainframe.alphafine.cell.model;
import com.fr.design.mainframe.alphafine.AlphaFineConstants; import com.fr.design.mainframe.alphafine.AlphaFineConstants;
import com.fr.design.mainframe.alphafine.CellType; import com.fr.design.mainframe.alphafine.CellType;
import com.fr.log.FineLoggerFactory;
import com.fr.json.JSONException;
import com.fr.json.JSONObject; import com.fr.json.JSONObject;
import com.fr.log.FineLoggerFactory;
import java.awt.*; import java.awt.Desktop;
import java.io.IOException; import java.io.IOException;
import java.net.URI; import java.net.URI;
import java.net.URISyntaxException; import java.net.URISyntaxException;
@ -60,8 +59,15 @@ public class DocumentModel extends AlphaCellModel {
@Override @Override
public void doAction() { public void doAction() {
openInBrowser(getDocumentUrl());
}
/**
* 方便埋点
* */
void openInBrowser(String url) {
try { try {
Desktop.getDesktop().browse(new URI(getDocumentUrl())); Desktop.getDesktop().browse(new URI(url));
} catch (IOException e) { } catch (IOException e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e); FineLoggerFactory.getLogger().error(e.getMessage(), e);
} catch (URISyntaxException e) { } catch (URISyntaxException e) {

13
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/model/TemplateResource.java

@ -63,6 +63,7 @@ public class TemplateResource {
private String fileName; private String fileName;
private int pkgSize; private int pkgSize;
private List<String> recommendSearchKey; private List<String> recommendSearchKey;
private boolean embed;
public static List<TemplateResource> createByJson(JSONArray jsonArray) { public static List<TemplateResource> createByJson(JSONArray jsonArray) {
List<TemplateResource> list = new ArrayList<>(); List<TemplateResource> list = new ArrayList<>();
@ -158,6 +159,18 @@ public class TemplateResource {
return this; return this;
} }
/**
* 判断是否为内置模板资源
* */
public boolean isEmbed() {
return embed;
}
public void setEmbed(boolean embed) {
this.embed = embed;
}
public String getName() { public String getName() {
return name; return name;
} }

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

@ -69,7 +69,9 @@ public class TemplateResourceSearchManager {
List<TemplateResource> resourceList = new ArrayList<>(); List<TemplateResource> resourceList = new ArrayList<>();
JSONArray jsonArray = getEmbedResourceJSONArray(); JSONArray jsonArray = getEmbedResourceJSONArray();
for (int i = 0; i < jsonArray.size(); i++) { for (int i = 0; i < jsonArray.size(); i++) {
resourceList.add(TemplateResource.createByJson(jsonArray.getJSONObject(i))); TemplateResource resource = TemplateResource.createByJson(jsonArray.getJSONObject(i));
resource.setEmbed(true);
resourceList.add(resource);
} }
return resourceList; return resourceList;
} }

Loading…
Cancel
Save