Browse Source

Merge remote-tracking branch 'origin/release/11.0' into release/11.0

release/11.0
Jimmy.Zheng 2 years ago
parent
commit
9e421e45ff
  1. 8
      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

8
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.design.mainframe.DesignerContext;
import com.fr.design.mainframe.DesignerFrameFileDealerPane;
import com.fr.design.mainframe.alphafine.AlphaFineHelper;
import com.fr.design.mainframe.alphafine.download.FineMarketConstants;
import com.fr.design.mainframe.alphafine.download.FineMarketDownloadManager;
@ -80,7 +79,12 @@ public class StartUseAction implements ActionListener {
}
// 打开模板
DesignerContext.getDesignerFrame().openTemplate(new FileFILE(fileNeedOpen));
if (fileNeedOpen == null) {
//有可能压缩包解压出来还是压缩包
FineLoggerFactory.getLogger().error("AlphaFine open resource error: " + fileName);
} else {
DesignerContext.getDesignerFrame().openTemplate(new FileFILE(fileNeedOpen));
}
}

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.CellType;
import com.fr.log.FineLoggerFactory;
import com.fr.json.JSONException;
import com.fr.json.JSONObject;
import com.fr.log.FineLoggerFactory;
import java.awt.*;
import java.awt.Desktop;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
@ -60,8 +59,15 @@ public class DocumentModel extends AlphaCellModel {
@Override
public void doAction() {
openInBrowser(getDocumentUrl());
}
/**
* 方便埋点
* */
void openInBrowser(String url) {
try {
Desktop.getDesktop().browse(new URI(getDocumentUrl()));
Desktop.getDesktop().browse(new URI(url));
} catch (IOException e) {
FineLoggerFactory.getLogger().error(e.getMessage(), 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 int pkgSize;
private List<String> recommendSearchKey;
private boolean embed;
public static List<TemplateResource> createByJson(JSONArray jsonArray) {
List<TemplateResource> list = new ArrayList<>();
@ -158,6 +159,18 @@ public class TemplateResource {
return this;
}
/**
* 判断是否为内置模板资源
* */
public boolean isEmbed() {
return embed;
}
public void setEmbed(boolean embed) {
this.embed = embed;
}
public String getName() {
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<>();
JSONArray jsonArray = getEmbedResourceJSONArray();
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;
}

Loading…
Cancel
Save