diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/action/StartUseAction.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/action/StartUseAction.java index de813883f8..4a7375f74e 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/action/StartUseAction.java +++ b/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)); + } } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/DocumentModel.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/DocumentModel.java index e83b4be764..7456daffce 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/DocumentModel.java +++ b/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) { diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/model/TemplateResource.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/model/TemplateResource.java index 56cc25a0c0..b7ace8a3fc 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/model/TemplateResource.java +++ b/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 recommendSearchKey; + private boolean embed; public static List createByJson(JSONArray jsonArray) { List 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; } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/TemplateResourceSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/TemplateResourceSearchManager.java index 2a8c767518..61dceaa008 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/TemplateResourceSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/TemplateResourceSearchManager.java @@ -69,7 +69,9 @@ public class TemplateResourceSearchManager { List 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; } diff --git a/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java b/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java index 0f7a614052..b69eda7993 100644 --- a/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java +++ b/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java @@ -161,6 +161,7 @@ public class DesignerActivator extends Activator implements Prepare { private LogHandler logHandler = null; private static final String PLUGIN_EXPORT_IMAGE_SETTING = "com.fr.plugin.exportimagesettings.v11"; + private static final String PICTURE_WIDGET_PLUGIN_ID = "com.fr.plugin.widget.picture.v11"; private final Once pushUpdateTask = new Once(new Runnable() { @Override public void run() { @@ -553,6 +554,7 @@ public class DesignerActivator extends Activator implements Prepare { private void prepareDefaultEmbedPluginInfo() { addMutable(PluginEmbedInfo.KEY, DefaultPluginEmbedInfo.create(PLUGIN_EXPORT_IMAGE_SETTING)); + addMutable(PluginEmbedInfo.KEY, DefaultPluginEmbedInfo.create(PICTURE_WIDGET_PLUGIN_ID)); } private void startBBSLoginAuthServer() {