From ba99611f2e3f285d8458ccc78318001019c65a45 Mon Sep 17 00:00:00 2001 From: "Link.Zhao" Date: Wed, 28 Sep 2022 11:58:40 +0800 Subject: [PATCH 01/14] =?UTF-8?q?REPORT-81246=E3=80=90=E8=BF=90=E8=90=A5?= =?UTF-8?q?=E4=BA=A7=E5=93=81=E5=8C=96=E4=BA=8C=E6=9C=9F10.0=E3=80=91?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E5=95=86=E5=9F=8E=E6=96=AD=E7=BD=91=E5=90=8E?= =?UTF-8?q?=E7=9A=84=E5=88=B7=E6=96=B0=E7=82=B9=E5=87=BB=E6=97=A0=E5=8F=8D?= =?UTF-8?q?=E5=BA=94=EF=BC=88=E8=81=94=E7=BD=91=E5=90=8E=E4=BB=8D=E5=AD=98?= =?UTF-8?q?=E5=9C=A8=E6=8A=A5=E9=94=99=EF=BC=89=20REPORT-81243=E3=80=90?= =?UTF-8?q?=E8=BF=90=E8=90=A5=E4=BA=A7=E5=93=81=E5=8C=96=E4=BA=8C=E6=9C=9F?= =?UTF-8?q?10.0=E3=80=91=E6=A8=A1=E6=9D=BF=E8=B5=84=E6=BA=90=E9=9C=80?= =?UTF-8?q?=E8=A6=81=E5=89=94=E9=99=A411.0=E6=A8=A1=E6=9D=BF=EF=BC=8C10.0?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E5=99=A8=E4=B8=8D=E5=BA=94=E8=AF=A5=E6=A3=80?= =?UTF-8?q?=E7=B4=A2=E5=88=B011.0=E7=9A=84=E8=B5=84=E6=BA=90=20=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0reload=E4=BA=8B=E4=BB=B6=20=E4=BF=AE=E6=94=B9=E8=AF=B7?= =?UTF-8?q?=E6=B1=82=E5=8F=82=E6=95=B0=20=E4=BF=AE=E6=94=B9=E4=BA=91?= =?UTF-8?q?=E7=AB=AF=E5=B8=B8=E9=87=8F=E7=9A=84=E8=8E=B7=E5=8F=96=E6=96=B9?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../alphafine/AlphaFineCloudConstants.java | 65 +++++++++++++++++++ .../alphafine/AlphaFineConstants.java | 48 -------------- .../alphafine/cell/model/BottomModel.java | 4 +- .../alphafine/cell/model/DocumentModel.java | 6 +- .../alphafine/cell/model/PluginModel.java | 6 +- .../alphafine/cell/model/RobotModel.java | 5 +- .../alphafine/component/AlphaFineDialog.java | 3 +- .../alphafine/component/AlphaFineFrame.java | 1 + .../preview/HelpDocumentNoResultPane.java | 4 +- .../preview/NoResultWithLinkPane.java | 3 +- .../alphafine/preview/RobotPreviewPane.java | 3 +- .../search/helper/FineMarketClientHelper.java | 3 +- .../manager/impl/ComplementAdviceManager.java | 3 +- .../manager/impl/DocumentSearchManager.java | 3 +- .../search/manager/impl/HotIssuesManager.java | 5 +- .../manager/impl/PluginSearchManager.java | 6 +- .../impl/ProductNewsSearchManager.java | 5 +- .../manager/impl/RecommendSearchManager.java | 3 +- .../manager/impl/SimilarSearchManager.java | 3 +- .../alphafine/cell/model/ModelTest.java | 6 +- 20 files changed, 106 insertions(+), 79 deletions(-) create mode 100644 designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineCloudConstants.java diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineCloudConstants.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineCloudConstants.java new file mode 100644 index 0000000000..a4cbfb86e5 --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineCloudConstants.java @@ -0,0 +1,65 @@ +package com.fr.design.mainframe.alphafine; + +import com.fr.general.CloudCenter; + +/** + * 需要从云端获取的常量单独放一起 + * 以防AlphaFineConstants被加载时,CloudCenter还没启动,导致常量获取不到。 + * + * @author Link + * @version 11.0 + * Created by Link on 2022/9/28 + */ +public class AlphaFineCloudConstants { + + public static final String PLUGIN_SEARCH_URL = CloudCenter.getInstance().acquireUrlByKind("plugin.searchAPI"); + + public static final String PLUGIN_URL = CloudCenter.getInstance().acquireUrlByKind("af.pluginInfo"); + + public static final String REUSE_URL = CloudCenter.getInstance().acquireUrlByKind("af.reuseInfo"); + + public static final String DOCUMENT_DOC_URL = CloudCenter.getInstance().acquireUrlByKind("af.doc_view"); + + public static final String DOCUMENT_SEARCH_URL = CloudCenter.getInstance().acquireUrlByKind("af.doc_search"); + + public static final String DOCUMENT_INFORMATION_URL = CloudCenter.getInstance().acquireUrlByKind("af.doc_info"); + + public static final String PLUGIN_IMAGE_URL = CloudCenter.getInstance().acquireUrlByKind("af.plugin_image"); + + public static final String CLOUD_SERVER_URL = CloudCenter.getInstance().acquireUrlByKind("af.record"); + + public static final String SEARCH_API = CloudCenter.getInstance().acquireUrlByKind("af.cloud_search"); + + public static final String SIMILAR_SEARCH_URL_PREFIX = CloudCenter.getInstance().acquireUrlByKind("af.similar_search"); + + public static final String COMPLEMENT_ADVICE_SEARCH_URL_PREFIX = CloudCenter.getInstance().acquireUrlByKind("af.advice_search"); + + public static final String ALPHA_HOT_SEARCH = CloudCenter.getInstance().acquireUrlByKind("af.hot_search"); + + public static final String ALPHA_GO_TO_FORUM = CloudCenter.getInstance().acquireUrlByKind("af.go_fourm"); + + public static final String ALPHA_GO_TO_WEB = CloudCenter.getInstance().acquireUrlByKind("af.go_web"); + + public static final String ALPHA_PREVIEW = CloudCenter.getInstance().acquireUrlByKind("af.preview"); + + public static final String ALPHA_CID = CloudCenter.getInstance().acquireUrlByKind("af.cid.new"); + + public static final String ALPHA_CID_USER_GROUP_INFO = CloudCenter.getInstance().acquireUrlByKind("af.cid.user.group.info"); + + private static final String QUICK_START_URL = CloudCenter.getInstance().acquireUrlByKind("af.help.quick.start"); + + private static final String REPORT_LEARNING_PATH = CloudCenter.getInstance().acquireUrlByKind("af.help.report.learning.path"); + + private static final String PARAMETER_LEARNING_PATH = CloudCenter.getInstance().acquireUrlByKind("af.help.param.learning.path"); + + private static final String FILL_LEARNING_PATH = CloudCenter.getInstance().acquireUrlByKind("af.help.fill.learning.path"); + + private static final String API_SUMMARY = CloudCenter.getInstance().acquireUrlByKind("af.help.api.summary"); + + private static final String MONTHLY_DOCUMENT = CloudCenter.getInstance().acquireUrlByKind("af.help.monthly.document"); + + private static final String DEFAULT_RECOMMEND = "[ { \"name\":\"快速入门指南\", \"link\":\"" + QUICK_START_URL + "\" }, { \"name\":\"报表应用学习路径\", \"link\":\"" + REPORT_LEARNING_PATH + "\" }, { \"name\":\"参数应用学习路径\", \"link\":\"" + PARAMETER_LEARNING_PATH + "\" }, { \"name\":\"填报学习路径\", \"link\":\"" + FILL_LEARNING_PATH + "\" }, { \"name\":\"API接口汇总\", \"link\":\"" + API_SUMMARY + "\" }, { \"name\":\"文档月刊\", \"link\":\"" + MONTHLY_DOCUMENT + "\" } ]"; + + public static final String ALPHA_HELP_RECOMMEND = CloudCenter.getInstance().acquireUrlByKind("af.recommend", DEFAULT_RECOMMEND); +} + diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineConstants.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineConstants.java index 935d2d0e35..0fffe30b2d 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineConstants.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineConstants.java @@ -4,7 +4,6 @@ import com.fr.base.extension.FileExtension; import com.fr.base.svg.IconUtils; import com.fr.design.i18n.Toolkit; import com.fr.design.utils.DesignUtils; -import com.fr.general.CloudCenter; import com.fr.general.IOUtils; import javax.swing.Icon; @@ -113,25 +112,6 @@ public class AlphaFineConstants { public static final String ALPHA_HOT_IMAGE_NAME = "alphafine_hot"; - public static final String PLUGIN_SEARCH_URL = CloudCenter.getInstance().acquireUrlByKind("plugin.searchAPI"); - - public static final String PLUGIN_URL = CloudCenter.getInstance().acquireUrlByKind("af.pluginInfo"); - - public static final String REUSE_URL = CloudCenter.getInstance().acquireUrlByKind("af.reuseInfo"); - - - public static final String DOCUMENT_DOC_URL = CloudCenter.getInstance().acquireUrlByKind("af.doc_view"); - - public static final String DOCUMENT_SEARCH_URL = CloudCenter.getInstance().acquireUrlByKind("af.doc_search"); - - public static final String DOCUMENT_INFORMATION_URL = CloudCenter.getInstance().acquireUrlByKind("af.doc_info"); - - public static final String PLUGIN_IMAGE_URL = CloudCenter.getInstance().acquireUrlByKind("af.plugin_image"); - - public static final String CLOUD_SERVER_URL = CloudCenter.getInstance().acquireUrlByKind("af.record"); - - public static final String SEARCH_API = CloudCenter.getInstance().acquireUrlByKind("af.cloud_search"); - public static final String SPECIAL_CHARACTER_REGEX = "[`~!@#$%^&*()+=|{}':;',\\[\\].<>/?~!@#¥%……&*()——+|{}【】';:”“’。,、?]"; public static final String BOTTOM_REGEX_FIRST = "
([\\s\\S]*?)class=\"jiaoyes\">YES
"; @@ -144,36 +124,8 @@ public class AlphaFineConstants { public static final String ALPHA_ROBOT_SEARCH_TOKEN = "K8dl0Np6l0gs"; - public static final String SIMILAR_SEARCH_URL_PREFIX = CloudCenter.getInstance().acquireUrlByKind("af.similar_search"); - - public static final String COMPLEMENT_ADVICE_SEARCH_URL_PREFIX = CloudCenter.getInstance().acquireUrlByKind("af.advice_search"); - - public static final String ALPHA_HOT_SEARCH = CloudCenter.getInstance().acquireUrlByKind("af.hot_search"); - - public static final String ALPHA_GO_TO_FORUM = CloudCenter.getInstance().acquireUrlByKind("af.go_fourm"); - - public static final String ALPHA_GO_TO_WEB = CloudCenter.getInstance().acquireUrlByKind("af.go_web"); - - public static final String ALPHA_PREVIEW = CloudCenter.getInstance().acquireUrlByKind("af.preview"); - - public static final String ALPHA_CID = CloudCenter.getInstance().acquireUrlByKind("af.cid.new"); - - public static final String ALPHA_CID_USER_GROUP_INFO = CloudCenter.getInstance().acquireUrlByKind("af.cid.user.group.info"); - public static final String SEARCH_BY_ID = "?id="; - private static final String QUICK_START_URL = CloudCenter.getInstance().acquireUrlByKind("af.help.quick.start"); - private static final String REPORT_LEARNING_PATH = CloudCenter.getInstance().acquireUrlByKind("af.help.report.learning.path"); - private static final String PARAMETER_LEARNING_PATH = CloudCenter.getInstance().acquireUrlByKind("af.help.param.learning.path"); - private static final String FILL_LEARNING_PATH = CloudCenter.getInstance().acquireUrlByKind("af.help.fill.learning.path"); - private static final String API_SUMMARY = CloudCenter.getInstance().acquireUrlByKind("af.help.api.summary"); - private static final String MONTHLY_DOCUMENT = CloudCenter.getInstance().acquireUrlByKind("af.help.monthly.document"); - - - private static final String DEFAULT_RECOMMEND = "[ { \"name\":\"快速入门指南\", \"link\":\"" + QUICK_START_URL + "\" }, { \"name\":\"报表应用学习路径\", \"link\":\"" + REPORT_LEARNING_PATH + "\" }, { \"name\":\"参数应用学习路径\", \"link\":\"" + PARAMETER_LEARNING_PATH + "\" }, { \"name\":\"填报学习路径\", \"link\":\"" + FILL_LEARNING_PATH + "\" }, { \"name\":\"API接口汇总\", \"link\":\"" + API_SUMMARY + "\" }, { \"name\":\"文档月刊\", \"link\":\"" + MONTHLY_DOCUMENT + "\" } ]"; - - public static final String ALPHA_HELP_RECOMMEND = CloudCenter.getInstance().acquireUrlByKind("af.recommend", DEFAULT_RECOMMEND); - public static final String JAVASCRIPT_PREFIX = "javascript:SendJava"; public static final String CHINESE_CHARACTERS = "[\\u4e00-\\u9fa5]"; diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/BottomModel.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/BottomModel.java index 503a4f413d..2b45394c46 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/BottomModel.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/BottomModel.java @@ -1,6 +1,6 @@ package com.fr.design.mainframe.alphafine.cell.model; -import com.fr.design.mainframe.alphafine.AlphaFineConstants; +import com.fr.design.mainframe.alphafine.AlphaFineCloudConstants; import com.fr.design.mainframe.alphafine.CellType; import com.fr.json.JSONException; import com.fr.json.JSONObject; @@ -48,7 +48,7 @@ public class BottomModel extends AlphaCellModel { @Override public void doAction() { try { - Desktop.getDesktop().browse(new URI(AlphaFineConstants.ALPHA_GO_TO_FORUM)); + Desktop.getDesktop().browse(new URI(AlphaFineCloudConstants.ALPHA_GO_TO_FORUM)); } catch (IOException | URISyntaxException e) { FineLoggerFactory.getLogger().error(e.getMessage()); } 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 7456daffce..17a260488d 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 @@ -1,6 +1,6 @@ package com.fr.design.mainframe.alphafine.cell.model; -import com.fr.design.mainframe.alphafine.AlphaFineConstants; +import com.fr.design.mainframe.alphafine.AlphaFineCloudConstants; import com.fr.design.mainframe.alphafine.CellType; import com.fr.json.JSONObject; import com.fr.log.FineLoggerFactory; @@ -26,8 +26,8 @@ public class DocumentModel extends AlphaCellModel { public DocumentModel(String name, String content, int documentId) { super(name, content, CellType.DOCUMENT); this.documentId = documentId; - this.informationUrl = AlphaFineConstants.DOCUMENT_INFORMATION_URL + documentId; - this.documentUrl = AlphaFineConstants.DOCUMENT_DOC_URL + documentId + ".html"; + this.informationUrl = AlphaFineCloudConstants.DOCUMENT_INFORMATION_URL + documentId; + this.documentUrl = AlphaFineCloudConstants.DOCUMENT_DOC_URL + documentId + ".html"; } public DocumentModel(String name, String content, int documentId, int searchCount) { diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/PluginModel.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/PluginModel.java index 570538cad1..f1f0f44303 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/PluginModel.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/PluginModel.java @@ -1,7 +1,7 @@ package com.fr.design.mainframe.alphafine.cell.model; import com.fr.design.extra.WebViewDlgHelper; -import com.fr.design.mainframe.alphafine.AlphaFineConstants; +import com.fr.design.mainframe.alphafine.AlphaFineCloudConstants; import com.fr.design.mainframe.alphafine.CellType; import com.fr.json.JSONObject; import com.fr.stable.StringUtils; @@ -36,9 +36,9 @@ public class PluginModel extends AlphaCellModel { this.price = price; this.pluginId = pluginId; if (getType() == CellType.PLUGIN) { - this.informationUrl = AlphaFineConstants.PLUGIN_URL + id; + this.informationUrl = AlphaFineCloudConstants.PLUGIN_URL + id; } else { - this.informationUrl = AlphaFineConstants.REUSE_URL + id; + this.informationUrl = AlphaFineCloudConstants.REUSE_URL + id; } } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/RobotModel.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/RobotModel.java index d504b9d859..ed8dc15345 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/RobotModel.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/RobotModel.java @@ -1,5 +1,6 @@ package com.fr.design.mainframe.alphafine.cell.model; +import com.fr.design.mainframe.alphafine.AlphaFineCloudConstants; import com.fr.design.mainframe.alphafine.AlphaFineConstants; import com.fr.design.mainframe.alphafine.CellType; import com.fr.general.http.HttpToolbox; @@ -46,7 +47,7 @@ public class RobotModel extends AlphaCellModel { public static String getContent(String titleStr) { String token = DigestUtils.md5Hex(AlphaFineConstants.ALPHA_ROBOT_SEARCH_TOKEN + titleStr); - String url = AlphaFineConstants.ALPHA_GO_TO_WEB + titleStr + "&token=" + token; + String url = AlphaFineCloudConstants.ALPHA_GO_TO_WEB + titleStr + "&token=" + token; try { String result = HttpToolbox.get(url); @@ -83,7 +84,7 @@ public class RobotModel extends AlphaCellModel { @Override public void doAction() { try { - Desktop.getDesktop().browse(new URI(AlphaFineConstants.ALPHA_PREVIEW + URLEncoder.encode(super.getName(), EncodeConstants.ENCODING_UTF_8))); + Desktop.getDesktop().browse(new URI(AlphaFineCloudConstants.ALPHA_PREVIEW + URLEncoder.encode(super.getName(), EncodeConstants.ENCODING_UTF_8))); } catch (IOException e) { FineLoggerFactory.getLogger().error(e.getMessage()); } catch (URISyntaxException e) { diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java index 4a55d973f0..5a90c71d7f 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java @@ -7,6 +7,7 @@ import com.fr.design.dialog.UIDialog; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.ilable.UILabel; +import com.fr.design.mainframe.alphafine.AlphaFineCloudConstants; import com.fr.design.mainframe.alphafine.AlphaFineConstants; import com.fr.design.mainframe.alphafine.AlphaFineHelper; import com.fr.design.mainframe.alphafine.cell.CellModelHelper; @@ -968,7 +969,7 @@ public class AlphaFineDialog extends UIDialog { String date = new SimpleDateFormat("yyyy-MM-dd").format(Calendar.getInstance().getTime()); para.put("token", CodeUtils.md5Encode(date, StringUtils.EMPTY, "MD5")); para.put("content", object.toString()); - HttpClient httpClient = new HttpClient(AlphaFineConstants.CLOUD_SERVER_URL, para, true); + HttpClient httpClient = new HttpClient(AlphaFineCloudConstants.CLOUD_SERVER_URL, para, true); httpClient.asGet(); if (!httpClient.isServerAlive()) { FineLoggerFactory.getLogger().error("Failed to sent data to server!"); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineFrame.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineFrame.java index 66a300280c..415e8cbf91 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineFrame.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineFrame.java @@ -925,6 +925,7 @@ public class AlphaFineFrame extends JFrame { this.productNewsSearchWorkerManager.doSearch(searchTextBean); this.documentWorkerManager.doSearch(searchTextBean); this.pluginSearchWorkerManager.doSearch(searchTextBean); + this.templateResourceSearchWorkerManager.doSearch(searchTextBean); } /** diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/HelpDocumentNoResultPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/HelpDocumentNoResultPane.java index 961d490e58..a19616f67b 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/HelpDocumentNoResultPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/HelpDocumentNoResultPane.java @@ -3,7 +3,7 @@ package com.fr.design.mainframe.alphafine.preview; import com.fr.design.constants.UIConstants; import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; -import com.fr.design.mainframe.alphafine.AlphaFineConstants; +import com.fr.design.mainframe.alphafine.AlphaFineCloudConstants; import com.fr.design.mainframe.alphafine.AlphaFineHelper; import com.fr.design.utils.BrowseUtils; import com.fr.design.utils.DesignUtils; @@ -98,7 +98,7 @@ public class HelpDocumentNoResultPane extends JPanel { private Map generateMap() { - JSONArray jsonArray = JSONFactory.createJSON(JSON.ARRAY, AlphaFineConstants.ALPHA_HELP_RECOMMEND); + JSONArray jsonArray = JSONFactory.createJSON(JSON.ARRAY, AlphaFineCloudConstants.ALPHA_HELP_RECOMMEND); Map linkMap = new LinkedHashMap<>(); for (int i = 0, len = jsonArray.size(); i < len; i++) { JSONObject json = jsonArray.getJSONObject(i); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/NoResultWithLinkPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/NoResultWithLinkPane.java index 3dc4a44b2a..439320775d 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/NoResultWithLinkPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/NoResultWithLinkPane.java @@ -1,6 +1,7 @@ package com.fr.design.mainframe.alphafine.preview; import com.fr.design.dialog.link.MessageWithLink; +import com.fr.design.mainframe.alphafine.AlphaFineCloudConstants; import com.fr.design.mainframe.alphafine.AlphaFineConstants; import com.fr.design.utils.BrowseUtils; import com.fr.design.utils.DesignUtils; @@ -32,7 +33,7 @@ public class NoResultWithLinkPane extends NoResultPane { String[] para1 = title.split(TAG_A_START); String[] para2 = para1[1].split(TAG_A_END); - MessageWithLink messageWithLink = new MessageWithLink(para1[0], para2[0], AlphaFineConstants.ALPHA_GO_TO_FORUM, para2[1], Color.WHITE, DesignUtils.getDefaultGUIFont().applySize(14), AlphaFineConstants.MEDIUM_GRAY) { + MessageWithLink messageWithLink = new MessageWithLink(para1[0], para2[0], AlphaFineCloudConstants.ALPHA_GO_TO_FORUM, para2[1], Color.WHITE, DesignUtils.getDefaultGUIFont().applySize(14), AlphaFineConstants.MEDIUM_GRAY) { @Override protected void initListener(String link) { diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/RobotPreviewPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/RobotPreviewPane.java index f6a9f70767..e8c85de7d4 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/RobotPreviewPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/RobotPreviewPane.java @@ -3,6 +3,7 @@ package com.fr.design.mainframe.alphafine.preview; import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.itextarea.UITextArea; +import com.fr.design.mainframe.alphafine.AlphaFineCloudConstants; import com.fr.design.mainframe.alphafine.AlphaFineConstants; import com.fr.design.mainframe.alphafine.cell.model.AlphaCellModel; import com.fr.design.mainframe.alphafine.cell.model.RobotModel; @@ -60,7 +61,7 @@ public class RobotPreviewPane extends JPanel { .replaceAll("\\('", StringUtils.EMPTY) .replaceAll("'\\)", StringUtils.EMPTY); try { - Desktop.getDesktop().browse(new URI(AlphaFineConstants.ALPHA_PREVIEW + URLEncoder.encode(s, EncodeConstants.ENCODING_UTF_8))); + Desktop.getDesktop().browse(new URI(AlphaFineCloudConstants.ALPHA_PREVIEW + URLEncoder.encode(s, EncodeConstants.ENCODING_UTF_8))); } catch (IOException | URISyntaxException e1) { FineLoggerFactory.getLogger().error(e1.getMessage()); } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/helper/FineMarketClientHelper.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/helper/FineMarketClientHelper.java index 9aff9f92b9..e52354c94f 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/helper/FineMarketClientHelper.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/helper/FineMarketClientHelper.java @@ -56,6 +56,7 @@ public class FineMarketClientHelper { private static final String CERTIFICATE_PUBLIC_KEY = FineMarketPublicKeyHolder.getInstance().getDefaultKey(); public static final String FINE_MARKET_TEMPLATE_INFO = CloudCenter.getInstance().acquireUrlByKind("market.template.info"); public static final String FINE_MARKET_TEMPLATE_URL = CloudCenter.getInstance().acquireUrlByKind("market.template.url"); + public static final String VERSION = "&version=10.0"; public static final String FILE_DOWNLOAD = "file/download/"; public static final String PACKAGE_DOWNLOAD = "package/download/"; public static final String TEMPLATES_PARENT_PACKAGE = "parent/"; @@ -279,7 +280,7 @@ public class FineMarketClientHelper { } public @Nullable JSONArray getTemplateInfoByName(String name) throws IOException { - String url = FINE_MARKET_TEMPLATE_INFO + NAME_SEARCH + name; + String url = FINE_MARKET_TEMPLATE_INFO + NAME_SEARCH + name + VERSION; String jsonString = HttpToolbox.get(url); JSONObject jsonObject = new JSONObject(jsonString); String responseState = (String) jsonObject.get(RESPONSE_STATE); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ComplementAdviceManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ComplementAdviceManager.java index aa3690cb68..71dc7aff2a 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ComplementAdviceManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ComplementAdviceManager.java @@ -1,6 +1,7 @@ package com.fr.design.mainframe.alphafine.search.manager.impl; import com.fr.design.DesignerEnvManager; +import com.fr.design.mainframe.alphafine.AlphaFineCloudConstants; import com.fr.design.mainframe.alphafine.AlphaFineConstants; import com.fr.design.mainframe.alphafine.AlphaFineHelper; import com.fr.design.mainframe.alphafine.model.SearchResult; @@ -40,7 +41,7 @@ public class ComplementAdviceManager { SearchResult searchResult = new SearchResult(); for (int j = 0; j < searchText.length; j++) { String token = DigestUtils.md5Hex(AlphaFineConstants.ALPHA_ROBOT_SEARCH_TOKEN + searchText[j]); - String url = AlphaFineConstants.COMPLEMENT_ADVICE_SEARCH_URL_PREFIX + "msg=" + searchText[j] + "&token=" + token; + String url = AlphaFineCloudConstants.COMPLEMENT_ADVICE_SEARCH_URL_PREFIX + "msg=" + searchText[j] + "&token=" + token; try { String result = HttpToolbox.get(url); AlphaFineHelper.checkCancel(); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java index 3ea1f2db2f..160661464a 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java @@ -1,6 +1,7 @@ package com.fr.design.mainframe.alphafine.search.manager.impl; import com.fr.design.DesignerEnvManager; +import com.fr.design.mainframe.alphafine.AlphaFineCloudConstants; import com.fr.design.mainframe.alphafine.AlphaFineConstants; import com.fr.design.mainframe.alphafine.AlphaFineHelper; import com.fr.design.mainframe.alphafine.CellType; @@ -69,7 +70,7 @@ public class DocumentSearchManager implements AlphaFineSearchProvider { searchResult = new SearchResult(); for (int j = 0; j < searchText.length; j++) { long start = System.currentTimeMillis(); - String url = AlphaFineConstants.DOCUMENT_SEARCH_URL + searchText[j]; + String url = AlphaFineCloudConstants.DOCUMENT_SEARCH_URL + searchText[j]; try { String result = HttpToolbox.get(url); AlphaFineHelper.checkCancel(); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/HotIssuesManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/HotIssuesManager.java index 749a0a611f..4222a1defc 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/HotIssuesManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/HotIssuesManager.java @@ -1,6 +1,6 @@ package com.fr.design.mainframe.alphafine.search.manager.impl; -import com.fr.design.mainframe.alphafine.AlphaFineConstants; +import com.fr.design.mainframe.alphafine.AlphaFineCloudConstants; import com.fr.design.mainframe.alphafine.AlphaFineHelper; import com.fr.design.mainframe.alphafine.cell.model.MoreModel; import com.fr.design.mainframe.alphafine.cell.model.RobotModel; @@ -11,7 +11,6 @@ import com.fr.json.JSONArray; import com.fr.json.JSONException; import com.fr.json.JSONFactory; import com.fr.json.JSONObject; -import com.fr.json.JSONUtils; import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; @@ -76,7 +75,7 @@ public class HotIssuesManager { public String[][] getHotIssues() { try { - String result = HttpToolbox.get(AlphaFineConstants.ALPHA_HOT_SEARCH); + String result = HttpToolbox.get(AlphaFineCloudConstants.ALPHA_HOT_SEARCH); JSONArray jsonArray = JSONFactory.createJSON(JSON.ARRAY, result); if(jsonArray != null){ for (int i = 0; i < HOT_ITEM_NUM; i++) { diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java index 56f7078b41..78583852f0 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java @@ -1,6 +1,7 @@ package com.fr.design.mainframe.alphafine.search.manager.impl; import com.fr.design.DesignerEnvManager; +import com.fr.design.mainframe.alphafine.AlphaFineCloudConstants; import com.fr.design.mainframe.alphafine.AlphaFineConstants; import com.fr.design.mainframe.alphafine.AlphaFineHelper; import com.fr.design.mainframe.alphafine.CellType; @@ -15,7 +16,6 @@ import com.fr.json.JSONArray; import com.fr.json.JSONObject; import com.fr.log.FineLoggerFactory; import com.fr.plugin.basic.version.Version; -import com.fr.plugin.basic.version.VersionIntervalType; import com.fr.plugin.basic.version.VersionIntervalFactory; import com.fr.stable.ArrayUtils; import com.fr.stable.EncodeConstants; @@ -60,7 +60,7 @@ public class PluginSearchManager implements AlphaFineSearchProvider { int searchCount = object.optInt("searchCount"); String imageUrl = null; try { - imageUrl = isFromCloud ? AlphaFineConstants.PLUGIN_IMAGE_URL + URLEncoder.encode(object.optString("pic").toString().substring(AlphaFineConstants.PLUGIN_IMAGE_URL.length()), "utf8") : object.optString("pic"); + imageUrl = isFromCloud ? AlphaFineCloudConstants.PLUGIN_IMAGE_URL + URLEncoder.encode(object.optString("pic").toString().substring(AlphaFineCloudConstants.PLUGIN_IMAGE_URL.length()), "utf8") : object.optString("pic"); } catch (UnsupportedEncodingException e) { FineLoggerFactory.getLogger().error("plugin icon error: " + e.getMessage()); } @@ -112,7 +112,7 @@ public class PluginSearchManager implements AlphaFineSearchProvider { for (int j = 0; j < searchText.length; j++) { try { String encodedKey = URLEncoder.encode(searchText[j], EncodeConstants.ENCODING_UTF_8); - String url = AlphaFineConstants.PLUGIN_SEARCH_URL + "?keyword=" + encodedKey; + String url = AlphaFineCloudConstants.PLUGIN_SEARCH_URL + "?keyword=" + encodedKey; String result = HttpToolbox.get(url); AlphaFineHelper.checkCancel(); JSONObject jsonObject = new JSONObject(result); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ProductNewsSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ProductNewsSearchManager.java index 97b705fc10..5ebc60060a 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ProductNewsSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ProductNewsSearchManager.java @@ -2,6 +2,7 @@ package com.fr.design.mainframe.alphafine.search.manager.impl; import com.fr.concurrent.NamedThreadFactory; import com.fr.design.DesignerEnvManager; +import com.fr.design.mainframe.alphafine.AlphaFineCloudConstants; import com.fr.design.mainframe.alphafine.AlphaFineConstants; import com.fr.design.mainframe.alphafine.AlphaFineHelper; import com.fr.design.mainframe.alphafine.model.ProductNews; @@ -81,7 +82,7 @@ public class ProductNewsSearchManager { public List getProductNewsList() throws Exception { productNewsList = new ArrayList<>(); idSet = new HashSet<>(); - String jsonStr = HttpToolbox.get(AlphaFineConstants.ALPHA_CID); + String jsonStr = HttpToolbox.get(AlphaFineCloudConstants.ALPHA_CID); AlphaFineHelper.checkCancel(); JSONObject cidJSON = JSONFactory.createJSON(JSON.OBJECT, jsonStr); JSONArray jsonArray = cidJSON.getJSONArray("data"); @@ -149,7 +150,7 @@ public class ProductNewsSearchManager { * 根据用户组id,查询用户组信息(改用户组中的所有设计器id) * */ private Set searchUserGroupInfo(String userGroupId) { - String url = AlphaFineConstants.ALPHA_CID_USER_GROUP_INFO + AlphaFineConstants.SEARCH_BY_ID + userGroupId; + String url = AlphaFineCloudConstants.ALPHA_CID_USER_GROUP_INFO + AlphaFineConstants.SEARCH_BY_ID + userGroupId; Set idSet = new HashSet<>(); try { String jsonStr = HttpToolbox.get(url); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java index ce0d987767..8b03715285 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java @@ -1,6 +1,7 @@ package com.fr.design.mainframe.alphafine.search.manager.impl; import com.fr.design.DesignerEnvManager; +import com.fr.design.mainframe.alphafine.AlphaFineCloudConstants; import com.fr.design.mainframe.alphafine.AlphaFineConstants; import com.fr.design.mainframe.alphafine.AlphaFineHelper; import com.fr.design.mainframe.alphafine.CellType; @@ -59,7 +60,7 @@ public class RecommendSearchManager implements AlphaFineSearchProvider { for (int j = 0; j < searchText.length; j++) { searchText[j] = searchText[j].replaceAll(StringUtils.BLANK, StringUtils.EMPTY); try { - String url = AlphaFineConstants.SEARCH_API + CodeUtils.cjkEncode(searchText[j]); + String url = AlphaFineCloudConstants.SEARCH_API + CodeUtils.cjkEncode(searchText[j]); String result = HttpToolbox.get(url); AlphaFineHelper.checkCancel(); JSONObject jsonObject = new JSONObject(result); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManager.java index f353573b49..884b00c8ce 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManager.java @@ -1,6 +1,7 @@ package com.fr.design.mainframe.alphafine.search.manager.impl; import com.fr.design.DesignerEnvManager; +import com.fr.design.mainframe.alphafine.AlphaFineCloudConstants; import com.fr.design.mainframe.alphafine.AlphaFineConstants; import com.fr.design.mainframe.alphafine.AlphaFineHelper; import com.fr.design.mainframe.alphafine.CellType; @@ -47,7 +48,7 @@ public class SimilarSearchManager implements AlphaFineSearchProvider { SearchResult allModelList = new SearchResult(); for (int j = 0; j < searchText.length; j++) { String token = DigestUtils.md5Hex(AlphaFineConstants.ALPHA_ROBOT_SEARCH_TOKEN + searchText[j]); - String url = AlphaFineConstants.SIMILAR_SEARCH_URL_PREFIX + "msg=" + searchText[j] + "&token=" + token; + String url = AlphaFineCloudConstants.SIMILAR_SEARCH_URL_PREFIX + "msg=" + searchText[j] + "&token=" + token; try { String result = HttpToolbox.get(url); AlphaFineHelper.checkCancel(); diff --git a/designer-realize/src/test/java/com.fr/design/mainframe/alphafine/cell/model/ModelTest.java b/designer-realize/src/test/java/com.fr/design/mainframe/alphafine/cell/model/ModelTest.java index 5d32b85bbd..2b718e37f2 100644 --- a/designer-realize/src/test/java/com.fr/design/mainframe/alphafine/cell/model/ModelTest.java +++ b/designer-realize/src/test/java/com.fr/design/mainframe/alphafine/cell/model/ModelTest.java @@ -1,6 +1,6 @@ package com.fr.design.mainframe.alphafine.cell.model; -import com.fr.design.mainframe.alphafine.AlphaFineConstants; +import com.fr.design.mainframe.alphafine.AlphaFineCloudConstants; import com.fr.design.mainframe.alphafine.CellType; import com.fr.json.JSONException; import com.fr.json.JSONObject; @@ -14,8 +14,8 @@ public class ModelTest { Assert.assertEquals("name", documentModel.getName()); Assert.assertEquals("content", documentModel.getContent()); Assert.assertEquals(1, documentModel.getDocumentId()); - Assert.assertEquals(AlphaFineConstants.DOCUMENT_DOC_URL + documentModel.getDocumentId() + ".html", documentModel.getDocumentUrl()); - Assert.assertEquals(AlphaFineConstants.DOCUMENT_INFORMATION_URL + documentModel.getDocumentId(), documentModel.getInformationUrl()); + Assert.assertEquals(AlphaFineCloudConstants.DOCUMENT_DOC_URL + documentModel.getDocumentId() + ".html", documentModel.getDocumentUrl()); + Assert.assertEquals(AlphaFineCloudConstants.DOCUMENT_INFORMATION_URL + documentModel.getDocumentId(), documentModel.getInformationUrl()); Assert.assertEquals(documentModel.getStoreInformation(), documentModel.getInformationUrl()); Assert.assertEquals(CellType.DOCUMENT, documentModel.getType()); Assert.assertEquals(true, documentModel.hasAction()); From 787ed070ab2ced2a87ce5c1208215a752a4f6551 Mon Sep 17 00:00:00 2001 From: "Link.Zhao" Date: Wed, 28 Sep 2022 15:06:07 +0800 Subject: [PATCH 02/14] =?UTF-8?q?REPORT-81246=E3=80=90=E8=BF=90=E8=90=A5?= =?UTF-8?q?=E4=BA=A7=E5=93=81=E5=8C=96=E4=BA=8C=E6=9C=9F10.0=E3=80=91?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E5=95=86=E5=9F=8E=E6=96=AD=E7=BD=91=E5=90=8E?= =?UTF-8?q?=E7=9A=84=E5=88=B7=E6=96=B0=E7=82=B9=E5=87=BB=E6=97=A0=E5=8F=8D?= =?UTF-8?q?=E5=BA=94=EF=BC=88=E8=81=94=E7=BD=91=E5=90=8E=E4=BB=8D=E5=AD=98?= =?UTF-8?q?=E5=9C=A8=E6=8A=A5=E9=94=99)=20=E4=BF=AE=E6=94=B9=E4=BA=91?= =?UTF-8?q?=E7=AB=AF=E5=B8=B8=E9=87=8F=E7=9A=84=E8=8E=B7=E5=8F=96=E6=96=B9?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../alphafine/AlphaFineCloudConstants.java | 195 +++++++++++++----- .../alphafine/cell/model/BottomModel.java | 2 +- .../alphafine/cell/model/DocumentModel.java | 4 +- .../alphafine/cell/model/PluginModel.java | 4 +- .../alphafine/cell/model/RobotModel.java | 4 +- .../alphafine/component/AlphaFineDialog.java | 2 +- .../preview/HelpDocumentNoResultPane.java | 2 +- .../preview/NoResultWithLinkPane.java | 2 +- .../alphafine/preview/RobotPreviewPane.java | 2 +- .../manager/impl/ComplementAdviceManager.java | 2 +- .../manager/impl/DocumentSearchManager.java | 2 +- .../search/manager/impl/HotIssuesManager.java | 2 +- .../manager/impl/PluginSearchManager.java | 4 +- .../impl/ProductNewsSearchManager.java | 4 +- .../manager/impl/RecommendSearchManager.java | 2 +- .../manager/impl/SimilarSearchManager.java | 2 +- .../alphafine/cell/model/ModelTest.java | 4 +- 17 files changed, 167 insertions(+), 72 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineCloudConstants.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineCloudConstants.java index a4cbfb86e5..7c21b2d6c7 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineCloudConstants.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineCloudConstants.java @@ -4,7 +4,7 @@ import com.fr.general.CloudCenter; /** * 需要从云端获取的常量单独放一起 - * 以防AlphaFineConstants被加载时,CloudCenter还没启动,导致常量获取不到。 + * 每次获取的时候都去加载一次 * * @author Link * @version 11.0 @@ -12,54 +12,149 @@ import com.fr.general.CloudCenter; */ public class AlphaFineCloudConstants { - public static final String PLUGIN_SEARCH_URL = CloudCenter.getInstance().acquireUrlByKind("plugin.searchAPI"); - - public static final String PLUGIN_URL = CloudCenter.getInstance().acquireUrlByKind("af.pluginInfo"); - - public static final String REUSE_URL = CloudCenter.getInstance().acquireUrlByKind("af.reuseInfo"); - - public static final String DOCUMENT_DOC_URL = CloudCenter.getInstance().acquireUrlByKind("af.doc_view"); - - public static final String DOCUMENT_SEARCH_URL = CloudCenter.getInstance().acquireUrlByKind("af.doc_search"); - - public static final String DOCUMENT_INFORMATION_URL = CloudCenter.getInstance().acquireUrlByKind("af.doc_info"); - - public static final String PLUGIN_IMAGE_URL = CloudCenter.getInstance().acquireUrlByKind("af.plugin_image"); - - public static final String CLOUD_SERVER_URL = CloudCenter.getInstance().acquireUrlByKind("af.record"); - - public static final String SEARCH_API = CloudCenter.getInstance().acquireUrlByKind("af.cloud_search"); - - public static final String SIMILAR_SEARCH_URL_PREFIX = CloudCenter.getInstance().acquireUrlByKind("af.similar_search"); - - public static final String COMPLEMENT_ADVICE_SEARCH_URL_PREFIX = CloudCenter.getInstance().acquireUrlByKind("af.advice_search"); - - public static final String ALPHA_HOT_SEARCH = CloudCenter.getInstance().acquireUrlByKind("af.hot_search"); - - public static final String ALPHA_GO_TO_FORUM = CloudCenter.getInstance().acquireUrlByKind("af.go_fourm"); - - public static final String ALPHA_GO_TO_WEB = CloudCenter.getInstance().acquireUrlByKind("af.go_web"); - - public static final String ALPHA_PREVIEW = CloudCenter.getInstance().acquireUrlByKind("af.preview"); - - public static final String ALPHA_CID = CloudCenter.getInstance().acquireUrlByKind("af.cid.new"); - - public static final String ALPHA_CID_USER_GROUP_INFO = CloudCenter.getInstance().acquireUrlByKind("af.cid.user.group.info"); - - private static final String QUICK_START_URL = CloudCenter.getInstance().acquireUrlByKind("af.help.quick.start"); - - private static final String REPORT_LEARNING_PATH = CloudCenter.getInstance().acquireUrlByKind("af.help.report.learning.path"); - - private static final String PARAMETER_LEARNING_PATH = CloudCenter.getInstance().acquireUrlByKind("af.help.param.learning.path"); - - private static final String FILL_LEARNING_PATH = CloudCenter.getInstance().acquireUrlByKind("af.help.fill.learning.path"); - - private static final String API_SUMMARY = CloudCenter.getInstance().acquireUrlByKind("af.help.api.summary"); - - private static final String MONTHLY_DOCUMENT = CloudCenter.getInstance().acquireUrlByKind("af.help.monthly.document"); - - private static final String DEFAULT_RECOMMEND = "[ { \"name\":\"快速入门指南\", \"link\":\"" + QUICK_START_URL + "\" }, { \"name\":\"报表应用学习路径\", \"link\":\"" + REPORT_LEARNING_PATH + "\" }, { \"name\":\"参数应用学习路径\", \"link\":\"" + PARAMETER_LEARNING_PATH + "\" }, { \"name\":\"填报学习路径\", \"link\":\"" + FILL_LEARNING_PATH + "\" }, { \"name\":\"API接口汇总\", \"link\":\"" + API_SUMMARY + "\" }, { \"name\":\"文档月刊\", \"link\":\"" + MONTHLY_DOCUMENT + "\" } ]"; - - public static final String ALPHA_HELP_RECOMMEND = CloudCenter.getInstance().acquireUrlByKind("af.recommend", DEFAULT_RECOMMEND); + /** + * get PluginSearchUrl + */ + public static String getPluginSearchUrl() { + return CloudCenter.getInstance().acquireUrlByKind("plugin.searchAPI"); + } + + /** + * get PLUGIN_URL + */ + public static String getPluginUrl() { + return CloudCenter.getInstance().acquireUrlByKind("af.pluginInfo"); + } + + /** + * get REUSE_URL + */ + public static String getReuseUrl() { + return CloudCenter.getInstance().acquireUrlByKind("af.reuseInfo"); + } + + /** + * get DOCUMENT_DOC_URL + */ + public static String getDocumentDocUrl() { + return CloudCenter.getInstance().acquireUrlByKind("af.doc_view"); + } + + /** + * get DOCUMENT_SEARCH_URL + */ + public static String getDocumentSearchUrl() { + return CloudCenter.getInstance().acquireUrlByKind("af.doc_search"); + } + + /** + * get DOCUMENT_INFORMATION_URL + */ + public static String getDocumentInformationUrl() { + return CloudCenter.getInstance().acquireUrlByKind("af.doc_info"); + } + + /** + * get PLUGIN_IMAGE_URL + */ + public static String getPluginImageUrl() { + return CloudCenter.getInstance().acquireUrlByKind("af.plugin_image"); + } + + /** + * get CLOUD_SERVER_URL + */ + public static String getCloudServerUrl() { + return CloudCenter.getInstance().acquireUrlByKind("af.record"); + } + + /** + * get SEARCH_API + */ + public static String getSearchApi() { + return CloudCenter.getInstance().acquireUrlByKind("af.cloud_search"); + } + + /** + * get SIMILAR_SEARCH_URL_PREFIX + */ + public static String getSimilarSearchUrlPrefix() { + return CloudCenter.getInstance().acquireUrlByKind("af.similar_search"); + } + + /** + * get COMPLEMENT_ADVICE_SEARCH_URL_PREFIX + */ + public static String getComplementAdviceSearchUrlPrefix() { + return CloudCenter.getInstance().acquireUrlByKind("af.advice_search"); + } + + /** + * get ALPHA_HOT_SEARCH + */ + public static String getAlphaHotSearch() { + return CloudCenter.getInstance().acquireUrlByKind("af.hot_search"); + } + + /** + * get ALPHA_GO_TO_FORUM + */ + public static String getAlphaGoToForum() { + return CloudCenter.getInstance().acquireUrlByKind("af.go_fourm"); + } + + /** + * get ALPHA_GO_TO_WEB + */ + public static String getAlphaGoToWeb() { + return CloudCenter.getInstance().acquireUrlByKind("af.go_web"); + } + + /** + * get ALPHA_PREVIEW + */ + public static String getAlphaPreview() { + return CloudCenter.getInstance().acquireUrlByKind("af.preview"); + } + + /** + * get ALPHA_CID + */ + public static String getAlphaCid() { + return CloudCenter.getInstance().acquireUrlByKind("af.cid.new"); + } + + /** + * get ALPHA_CID_USER_GROUP_INFO + */ + public static String getAlphaCidUserGroupInfo() { + return CloudCenter.getInstance().acquireUrlByKind("af.cid.user.group.info"); + } + + /** + * get ALPHA_HELP_RECOMMEND + */ + public static String getAlphaHelpRecommend() { + String QUICK_START_URL = CloudCenter.getInstance().acquireUrlByKind("af.help.quick.start"); + + String REPORT_LEARNING_PATH = CloudCenter.getInstance().acquireUrlByKind("af.help.report.learning.path"); + + String PARAMETER_LEARNING_PATH = CloudCenter.getInstance().acquireUrlByKind("af.help.param.learning.path"); + + String FILL_LEARNING_PATH = CloudCenter.getInstance().acquireUrlByKind("af.help.fill.learning.path"); + + String API_SUMMARY = CloudCenter.getInstance().acquireUrlByKind("af.help.api.summary"); + + String MONTHLY_DOCUMENT = CloudCenter.getInstance().acquireUrlByKind("af.help.monthly.document"); + + String DEFAULT_RECOMMEND = "[ {\"name\":\"快速入门指南\", \"link\":\"" + QUICK_START_URL + "\"}," + + "{\"name\":\"报表应用学习路径\", \"link\":\"" + REPORT_LEARNING_PATH + "\"}," + + "{\"name\":\"参数应用学习路径\", \"link\":\"" + PARAMETER_LEARNING_PATH + "\"}," + + "{\"name\":\"填报学习路径\", \"link\":\"" + FILL_LEARNING_PATH + "\"}," + + "{\"name\":\"API接口汇总\", \"link\":\"" + API_SUMMARY + "\"}," + + "{\"name\":\"文档月刊\", \"link\":\"" + MONTHLY_DOCUMENT + "\"} ]"; + + return CloudCenter.getInstance().acquireUrlByKind("af.recommend", DEFAULT_RECOMMEND); + } } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/BottomModel.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/BottomModel.java index 2b45394c46..800c3f71d5 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/BottomModel.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/BottomModel.java @@ -48,7 +48,7 @@ public class BottomModel extends AlphaCellModel { @Override public void doAction() { try { - Desktop.getDesktop().browse(new URI(AlphaFineCloudConstants.ALPHA_GO_TO_FORUM)); + Desktop.getDesktop().browse(new URI(AlphaFineCloudConstants.getAlphaGoToForum())); } catch (IOException | URISyntaxException e) { FineLoggerFactory.getLogger().error(e.getMessage()); } 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 17a260488d..a61f5d9579 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 @@ -26,8 +26,8 @@ public class DocumentModel extends AlphaCellModel { public DocumentModel(String name, String content, int documentId) { super(name, content, CellType.DOCUMENT); this.documentId = documentId; - this.informationUrl = AlphaFineCloudConstants.DOCUMENT_INFORMATION_URL + documentId; - this.documentUrl = AlphaFineCloudConstants.DOCUMENT_DOC_URL + documentId + ".html"; + this.informationUrl = AlphaFineCloudConstants.getDocumentInformationUrl() + documentId; + this.documentUrl = AlphaFineCloudConstants.getDocumentDocUrl() + documentId + ".html"; } public DocumentModel(String name, String content, int documentId, int searchCount) { diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/PluginModel.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/PluginModel.java index f1f0f44303..8de053807d 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/PluginModel.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/PluginModel.java @@ -36,9 +36,9 @@ public class PluginModel extends AlphaCellModel { this.price = price; this.pluginId = pluginId; if (getType() == CellType.PLUGIN) { - this.informationUrl = AlphaFineCloudConstants.PLUGIN_URL + id; + this.informationUrl = AlphaFineCloudConstants.getPluginUrl() + id; } else { - this.informationUrl = AlphaFineCloudConstants.REUSE_URL + id; + this.informationUrl = AlphaFineCloudConstants.getReuseUrl() + id; } } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/RobotModel.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/RobotModel.java index ed8dc15345..80f610f4eb 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/RobotModel.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/RobotModel.java @@ -47,7 +47,7 @@ public class RobotModel extends AlphaCellModel { public static String getContent(String titleStr) { String token = DigestUtils.md5Hex(AlphaFineConstants.ALPHA_ROBOT_SEARCH_TOKEN + titleStr); - String url = AlphaFineCloudConstants.ALPHA_GO_TO_WEB + titleStr + "&token=" + token; + String url = AlphaFineCloudConstants.getAlphaGoToWeb() + titleStr + "&token=" + token; try { String result = HttpToolbox.get(url); @@ -84,7 +84,7 @@ public class RobotModel extends AlphaCellModel { @Override public void doAction() { try { - Desktop.getDesktop().browse(new URI(AlphaFineCloudConstants.ALPHA_PREVIEW + URLEncoder.encode(super.getName(), EncodeConstants.ENCODING_UTF_8))); + Desktop.getDesktop().browse(new URI(AlphaFineCloudConstants.getAlphaPreview() + URLEncoder.encode(super.getName(), EncodeConstants.ENCODING_UTF_8))); } catch (IOException e) { FineLoggerFactory.getLogger().error(e.getMessage()); } catch (URISyntaxException e) { diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java index 5a90c71d7f..e1b4dcbd19 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java @@ -969,7 +969,7 @@ public class AlphaFineDialog extends UIDialog { String date = new SimpleDateFormat("yyyy-MM-dd").format(Calendar.getInstance().getTime()); para.put("token", CodeUtils.md5Encode(date, StringUtils.EMPTY, "MD5")); para.put("content", object.toString()); - HttpClient httpClient = new HttpClient(AlphaFineCloudConstants.CLOUD_SERVER_URL, para, true); + HttpClient httpClient = new HttpClient(AlphaFineCloudConstants.getCloudServerUrl(), para, true); httpClient.asGet(); if (!httpClient.isServerAlive()) { FineLoggerFactory.getLogger().error("Failed to sent data to server!"); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/HelpDocumentNoResultPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/HelpDocumentNoResultPane.java index a19616f67b..b793cf52c9 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/HelpDocumentNoResultPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/HelpDocumentNoResultPane.java @@ -98,7 +98,7 @@ public class HelpDocumentNoResultPane extends JPanel { private Map generateMap() { - JSONArray jsonArray = JSONFactory.createJSON(JSON.ARRAY, AlphaFineCloudConstants.ALPHA_HELP_RECOMMEND); + JSONArray jsonArray = JSONFactory.createJSON(JSON.ARRAY, AlphaFineCloudConstants.getAlphaHelpRecommend()); Map linkMap = new LinkedHashMap<>(); for (int i = 0, len = jsonArray.size(); i < len; i++) { JSONObject json = jsonArray.getJSONObject(i); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/NoResultWithLinkPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/NoResultWithLinkPane.java index 439320775d..ebfdd99c4c 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/NoResultWithLinkPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/NoResultWithLinkPane.java @@ -33,7 +33,7 @@ public class NoResultWithLinkPane extends NoResultPane { String[] para1 = title.split(TAG_A_START); String[] para2 = para1[1].split(TAG_A_END); - MessageWithLink messageWithLink = new MessageWithLink(para1[0], para2[0], AlphaFineCloudConstants.ALPHA_GO_TO_FORUM, para2[1], Color.WHITE, DesignUtils.getDefaultGUIFont().applySize(14), AlphaFineConstants.MEDIUM_GRAY) { + MessageWithLink messageWithLink = new MessageWithLink(para1[0], para2[0], AlphaFineCloudConstants.getAlphaGoToForum(), para2[1], Color.WHITE, DesignUtils.getDefaultGUIFont().applySize(14), AlphaFineConstants.MEDIUM_GRAY) { @Override protected void initListener(String link) { diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/RobotPreviewPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/RobotPreviewPane.java index e8c85de7d4..6732e2205e 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/RobotPreviewPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/RobotPreviewPane.java @@ -61,7 +61,7 @@ public class RobotPreviewPane extends JPanel { .replaceAll("\\('", StringUtils.EMPTY) .replaceAll("'\\)", StringUtils.EMPTY); try { - Desktop.getDesktop().browse(new URI(AlphaFineCloudConstants.ALPHA_PREVIEW + URLEncoder.encode(s, EncodeConstants.ENCODING_UTF_8))); + Desktop.getDesktop().browse(new URI(AlphaFineCloudConstants.getAlphaPreview() + URLEncoder.encode(s, EncodeConstants.ENCODING_UTF_8))); } catch (IOException | URISyntaxException e1) { FineLoggerFactory.getLogger().error(e1.getMessage()); } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ComplementAdviceManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ComplementAdviceManager.java index 71dc7aff2a..09ec7f7aa4 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ComplementAdviceManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ComplementAdviceManager.java @@ -41,7 +41,7 @@ public class ComplementAdviceManager { SearchResult searchResult = new SearchResult(); for (int j = 0; j < searchText.length; j++) { String token = DigestUtils.md5Hex(AlphaFineConstants.ALPHA_ROBOT_SEARCH_TOKEN + searchText[j]); - String url = AlphaFineCloudConstants.COMPLEMENT_ADVICE_SEARCH_URL_PREFIX + "msg=" + searchText[j] + "&token=" + token; + String url = AlphaFineCloudConstants.getComplementAdviceSearchUrlPrefix() + "msg=" + searchText[j] + "&token=" + token; try { String result = HttpToolbox.get(url); AlphaFineHelper.checkCancel(); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java index 160661464a..9ef4c7c3df 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java @@ -70,7 +70,7 @@ public class DocumentSearchManager implements AlphaFineSearchProvider { searchResult = new SearchResult(); for (int j = 0; j < searchText.length; j++) { long start = System.currentTimeMillis(); - String url = AlphaFineCloudConstants.DOCUMENT_SEARCH_URL + searchText[j]; + String url = AlphaFineCloudConstants.getDocumentSearchUrl() + searchText[j]; try { String result = HttpToolbox.get(url); AlphaFineHelper.checkCancel(); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/HotIssuesManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/HotIssuesManager.java index 4222a1defc..0e29a44c63 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/HotIssuesManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/HotIssuesManager.java @@ -75,7 +75,7 @@ public class HotIssuesManager { public String[][] getHotIssues() { try { - String result = HttpToolbox.get(AlphaFineCloudConstants.ALPHA_HOT_SEARCH); + String result = HttpToolbox.get(AlphaFineCloudConstants.getAlphaHotSearch()); JSONArray jsonArray = JSONFactory.createJSON(JSON.ARRAY, result); if(jsonArray != null){ for (int i = 0; i < HOT_ITEM_NUM; i++) { diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java index 78583852f0..ea4f359370 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java @@ -60,7 +60,7 @@ public class PluginSearchManager implements AlphaFineSearchProvider { int searchCount = object.optInt("searchCount"); String imageUrl = null; try { - imageUrl = isFromCloud ? AlphaFineCloudConstants.PLUGIN_IMAGE_URL + URLEncoder.encode(object.optString("pic").toString().substring(AlphaFineCloudConstants.PLUGIN_IMAGE_URL.length()), "utf8") : object.optString("pic"); + imageUrl = isFromCloud ? AlphaFineCloudConstants.getPluginImageUrl() + URLEncoder.encode(object.optString("pic").toString().substring(AlphaFineCloudConstants.getPluginImageUrl().length()), "utf8") : object.optString("pic"); } catch (UnsupportedEncodingException e) { FineLoggerFactory.getLogger().error("plugin icon error: " + e.getMessage()); } @@ -112,7 +112,7 @@ public class PluginSearchManager implements AlphaFineSearchProvider { for (int j = 0; j < searchText.length; j++) { try { String encodedKey = URLEncoder.encode(searchText[j], EncodeConstants.ENCODING_UTF_8); - String url = AlphaFineCloudConstants.PLUGIN_SEARCH_URL + "?keyword=" + encodedKey; + String url = AlphaFineCloudConstants.getPluginSearchUrl() + "?keyword=" + encodedKey; String result = HttpToolbox.get(url); AlphaFineHelper.checkCancel(); JSONObject jsonObject = new JSONObject(result); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ProductNewsSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ProductNewsSearchManager.java index 5ebc60060a..1ee765c5a6 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ProductNewsSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ProductNewsSearchManager.java @@ -82,7 +82,7 @@ public class ProductNewsSearchManager { public List getProductNewsList() throws Exception { productNewsList = new ArrayList<>(); idSet = new HashSet<>(); - String jsonStr = HttpToolbox.get(AlphaFineCloudConstants.ALPHA_CID); + String jsonStr = HttpToolbox.get(AlphaFineCloudConstants.getAlphaCid()); AlphaFineHelper.checkCancel(); JSONObject cidJSON = JSONFactory.createJSON(JSON.OBJECT, jsonStr); JSONArray jsonArray = cidJSON.getJSONArray("data"); @@ -150,7 +150,7 @@ public class ProductNewsSearchManager { * 根据用户组id,查询用户组信息(改用户组中的所有设计器id) * */ private Set searchUserGroupInfo(String userGroupId) { - String url = AlphaFineCloudConstants.ALPHA_CID_USER_GROUP_INFO + AlphaFineConstants.SEARCH_BY_ID + userGroupId; + String url = AlphaFineCloudConstants.getAlphaCidUserGroupInfo() + AlphaFineConstants.SEARCH_BY_ID + userGroupId; Set idSet = new HashSet<>(); try { String jsonStr = HttpToolbox.get(url); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java index 8b03715285..11dc5424f9 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java @@ -60,7 +60,7 @@ public class RecommendSearchManager implements AlphaFineSearchProvider { for (int j = 0; j < searchText.length; j++) { searchText[j] = searchText[j].replaceAll(StringUtils.BLANK, StringUtils.EMPTY); try { - String url = AlphaFineCloudConstants.SEARCH_API + CodeUtils.cjkEncode(searchText[j]); + String url = AlphaFineCloudConstants.getSearchApi() + CodeUtils.cjkEncode(searchText[j]); String result = HttpToolbox.get(url); AlphaFineHelper.checkCancel(); JSONObject jsonObject = new JSONObject(result); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManager.java index 884b00c8ce..8dee8df0d6 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManager.java @@ -48,7 +48,7 @@ public class SimilarSearchManager implements AlphaFineSearchProvider { SearchResult allModelList = new SearchResult(); for (int j = 0; j < searchText.length; j++) { String token = DigestUtils.md5Hex(AlphaFineConstants.ALPHA_ROBOT_SEARCH_TOKEN + searchText[j]); - String url = AlphaFineCloudConstants.SIMILAR_SEARCH_URL_PREFIX + "msg=" + searchText[j] + "&token=" + token; + String url = AlphaFineCloudConstants.getSimilarSearchUrlPrefix() + "msg=" + searchText[j] + "&token=" + token; try { String result = HttpToolbox.get(url); AlphaFineHelper.checkCancel(); diff --git a/designer-realize/src/test/java/com.fr/design/mainframe/alphafine/cell/model/ModelTest.java b/designer-realize/src/test/java/com.fr/design/mainframe/alphafine/cell/model/ModelTest.java index 2b718e37f2..8de69db5c0 100644 --- a/designer-realize/src/test/java/com.fr/design/mainframe/alphafine/cell/model/ModelTest.java +++ b/designer-realize/src/test/java/com.fr/design/mainframe/alphafine/cell/model/ModelTest.java @@ -14,8 +14,8 @@ public class ModelTest { Assert.assertEquals("name", documentModel.getName()); Assert.assertEquals("content", documentModel.getContent()); Assert.assertEquals(1, documentModel.getDocumentId()); - Assert.assertEquals(AlphaFineCloudConstants.DOCUMENT_DOC_URL + documentModel.getDocumentId() + ".html", documentModel.getDocumentUrl()); - Assert.assertEquals(AlphaFineCloudConstants.DOCUMENT_INFORMATION_URL + documentModel.getDocumentId(), documentModel.getInformationUrl()); + Assert.assertEquals(AlphaFineCloudConstants.getDocumentDocUrl() + documentModel.getDocumentId() + ".html", documentModel.getDocumentUrl()); + Assert.assertEquals(AlphaFineCloudConstants.getDocumentInformationUrl() + documentModel.getDocumentId(), documentModel.getInformationUrl()); Assert.assertEquals(documentModel.getStoreInformation(), documentModel.getInformationUrl()); Assert.assertEquals(CellType.DOCUMENT, documentModel.getType()); Assert.assertEquals(true, documentModel.hasAction()); From 1eb13c5e5d91a8963a95f6ef15ecffe3ec109649 Mon Sep 17 00:00:00 2001 From: "Link.Zhao" Date: Wed, 28 Sep 2022 15:08:55 +0800 Subject: [PATCH 03/14] =?UTF-8?q?REPORT-81246=E3=80=90=E8=BF=90=E8=90=A5?= =?UTF-8?q?=E4=BA=A7=E5=93=81=E5=8C=96=E4=BA=8C=E6=9C=9F10.0=E3=80=91?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E5=95=86=E5=9F=8E=E6=96=AD=E7=BD=91=E5=90=8E?= =?UTF-8?q?=E7=9A=84=E5=88=B7=E6=96=B0=E7=82=B9=E5=87=BB=E6=97=A0=E5=8F=8D?= =?UTF-8?q?=E5=BA=94=EF=BC=88=E8=81=94=E7=BD=91=E5=90=8E=E4=BB=8D=E5=AD=98?= =?UTF-8?q?=E5=9C=A8=E6=8A=A5=E9=94=99)=20=E4=BF=AE=E6=94=B9=E4=BA=91?= =?UTF-8?q?=E7=AB=AF=E5=B8=B8=E9=87=8F=E7=9A=84=E8=8E=B7=E5=8F=96=E6=96=B9?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../alphafine/AlphaFineCloudConstants.java | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineCloudConstants.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineCloudConstants.java index 7c21b2d6c7..dce765bbf6 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineCloudConstants.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineCloudConstants.java @@ -135,26 +135,26 @@ public class AlphaFineCloudConstants { * get ALPHA_HELP_RECOMMEND */ public static String getAlphaHelpRecommend() { - String QUICK_START_URL = CloudCenter.getInstance().acquireUrlByKind("af.help.quick.start"); + String quickStartUrl = CloudCenter.getInstance().acquireUrlByKind("af.help.quick.start"); - String REPORT_LEARNING_PATH = CloudCenter.getInstance().acquireUrlByKind("af.help.report.learning.path"); + String reportLearningPath = CloudCenter.getInstance().acquireUrlByKind("af.help.report.learning.path"); - String PARAMETER_LEARNING_PATH = CloudCenter.getInstance().acquireUrlByKind("af.help.param.learning.path"); + String parameterLearningPath = CloudCenter.getInstance().acquireUrlByKind("af.help.param.learning.path"); - String FILL_LEARNING_PATH = CloudCenter.getInstance().acquireUrlByKind("af.help.fill.learning.path"); + String fillLearningPath = CloudCenter.getInstance().acquireUrlByKind("af.help.fill.learning.path"); - String API_SUMMARY = CloudCenter.getInstance().acquireUrlByKind("af.help.api.summary"); + String apiSummary = CloudCenter.getInstance().acquireUrlByKind("af.help.api.summary"); - String MONTHLY_DOCUMENT = CloudCenter.getInstance().acquireUrlByKind("af.help.monthly.document"); + String monthlyDocument = CloudCenter.getInstance().acquireUrlByKind("af.help.monthly.document"); - String DEFAULT_RECOMMEND = "[ {\"name\":\"快速入门指南\", \"link\":\"" + QUICK_START_URL + "\"}," + - "{\"name\":\"报表应用学习路径\", \"link\":\"" + REPORT_LEARNING_PATH + "\"}," + - "{\"name\":\"参数应用学习路径\", \"link\":\"" + PARAMETER_LEARNING_PATH + "\"}," + - "{\"name\":\"填报学习路径\", \"link\":\"" + FILL_LEARNING_PATH + "\"}," + - "{\"name\":\"API接口汇总\", \"link\":\"" + API_SUMMARY + "\"}," + - "{\"name\":\"文档月刊\", \"link\":\"" + MONTHLY_DOCUMENT + "\"} ]"; + String defaultRecommend = "[ {\"name\":\"快速入门指南\", \"link\":\"" + quickStartUrl + "\"}," + + "{\"name\":\"报表应用学习路径\", \"link\":\"" + reportLearningPath + "\"}," + + "{\"name\":\"参数应用学习路径\", \"link\":\"" + parameterLearningPath + "\"}," + + "{\"name\":\"填报学习路径\", \"link\":\"" + fillLearningPath + "\"}," + + "{\"name\":\"API接口汇总\", \"link\":\"" + apiSummary + "\"}," + + "{\"name\":\"文档月刊\", \"link\":\"" + monthlyDocument + "\"} ]"; - return CloudCenter.getInstance().acquireUrlByKind("af.recommend", DEFAULT_RECOMMEND); + return CloudCenter.getInstance().acquireUrlByKind("af.recommend", defaultRecommend); } } From 1dc48debd7936bf0bfe0c072cbf82195a0befc0f Mon Sep 17 00:00:00 2001 From: "Leo.Qin" Date: Wed, 28 Sep 2022 17:45:23 +0800 Subject: [PATCH 04/14] =?UTF-8?q?REPORT-80940=20IOFileAttrMark=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E9=97=AE=E9=A2=98=20=E3=80=90=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E5=8E=9F=E5=9B=A0=E3=80=91=E6=8F=92=E4=BB=B6=E5=90=AF=E7=94=A8?= =?UTF-8?q?=E5=90=8E=E6=9C=AA=E5=88=B7=E6=96=B0=20=E3=80=90=E6=94=B9?= =?UTF-8?q?=E5=8A=A8=E6=80=9D=E8=B7=AF=E3=80=91=E6=8F=92=E4=BB=B6=E5=90=AF?= =?UTF-8?q?=E7=94=A8=E5=90=8E=E5=88=B7=E6=96=B0=EF=BC=9B=E4=BF=AE=E6=94=B9?= =?UTF-8?q?AttrMap=E4=B8=ADkey=E6=A0=87=E7=AD=BE=20=E3=80=90review?= =?UTF-8?q?=E5=BB=BA=E8=AE=AE=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/file/HistoryTemplateListCache.java | 33 +++---------------- 1 file changed, 4 insertions(+), 29 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java index c00f8bb44f..f6a97428ef 100644 --- a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java +++ b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java @@ -446,13 +446,10 @@ public class HistoryTemplateListCache implements CallbackEvent { for (int i = 0; i < size; i++) { JTemplate template = historyList.get(i); FILE file = template.getEditingFILE(); - boolean needReload = context == null || needReloadTemplate(context, template); - if (needReload) { - FILE stashFile = template.templateToStashFile(); - if (stashFile != null) { - FineLoggerFactory.getLogger().info("{} is being reloaded", file.getName()); - template.refreshResource(stashFile); - } + FILE stashFile = template.templateToStashFile(); + if (stashFile != null) { + FineLoggerFactory.getLogger().info("{} is being reloaded", file.getName()); + template.refreshResource(stashFile); } } FineLoggerFactory.getLogger().info("Plugin env change reload all template ended"); @@ -474,28 +471,6 @@ public class HistoryTemplateListCache implements CallbackEvent { _reloadAllEditingTemplate(null); } - private boolean needReloadTemplate(PluginContext context, JTemplate template) { - BaseBook baseBook = template.getTarget(); - if (baseBook != null) { - String name = template.getEditingFILE().getName(); - String pluginId = context.getID(); - long start = System.currentTimeMillis(); - Set set = ClassHelper.getClassLoadersByFilter(baseBook, ClassFilter.getInstance()); - FineLoggerFactory.getLogger().info("{} find plugin classloader spend: {} ms", name, (System.currentTimeMillis() - start)); - if (set != null) { - for (ClassLoader classLoader : set) { - if (ComparatorUtils.equals(pluginId, PluginManager.detectLeakingPlugin(classLoader))) { - return true; - } - } - } else { - // set为null说明 检测classloader 这里返回true直接刷新 兜底行为 - return true; - } - } - return false; - } - public void replaceCurrentEditingTemplate(JTemplate jt) { int index = contains(this.editingTemplate); this.editingTemplate = jt; From 79222622f94c0bdae304deacd0930526ced4ee0e Mon Sep 17 00:00:00 2001 From: "Link.Zhao" Date: Wed, 28 Sep 2022 21:53:04 +0800 Subject: [PATCH 05/14] =?UTF-8?q?REPORT-81246=E3=80=90=E8=BF=90=E8=90=A5?= =?UTF-8?q?=E4=BA=A7=E5=93=81=E5=8C=96=E4=BA=8C=E6=9C=9F10.0=E3=80=91?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E5=95=86=E5=9F=8E=E6=96=AD=E7=BD=91=E5=90=8E?= =?UTF-8?q?=E7=9A=84=E5=88=B7=E6=96=B0=E7=82=B9=E5=87=BB=E6=97=A0=E5=8F=8D?= =?UTF-8?q?=E5=BA=94=EF=BC=88=E8=81=94=E7=BD=91=E5=90=8E=E4=BB=8D=E5=AD=98?= =?UTF-8?q?=E5=9C=A8=E6=8A=A5=E9=94=99)=20=E4=BF=AE=E6=94=B9pr?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../alphafine/AlphaFineCloudConstants.java | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineCloudConstants.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineCloudConstants.java index dce765bbf6..e1bd50a89b 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineCloudConstants.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineCloudConstants.java @@ -13,14 +13,14 @@ import com.fr.general.CloudCenter; public class AlphaFineCloudConstants { /** - * get PluginSearchUrl + * 插件搜索api */ public static String getPluginSearchUrl() { return CloudCenter.getInstance().acquireUrlByKind("plugin.searchAPI"); } /** - * get PLUGIN_URL + * 插件信息api */ public static String getPluginUrl() { return CloudCenter.getInstance().acquireUrlByKind("af.pluginInfo"); @@ -41,21 +41,21 @@ public class AlphaFineCloudConstants { } /** - * get DOCUMENT_SEARCH_URL + * 获取文档搜索api */ public static String getDocumentSearchUrl() { return CloudCenter.getInstance().acquireUrlByKind("af.doc_search"); } /** - * get DOCUMENT_INFORMATION_URL + * 文档信息api */ public static String getDocumentInformationUrl() { return CloudCenter.getInstance().acquireUrlByKind("af.doc_info"); } /** - * get PLUGIN_IMAGE_URL + * 插件图标api */ public static String getPluginImageUrl() { return CloudCenter.getInstance().acquireUrlByKind("af.plugin_image"); @@ -90,14 +90,14 @@ public class AlphaFineCloudConstants { } /** - * get ALPHA_HOT_SEARCH + * 获取热门问题 */ public static String getAlphaHotSearch() { return CloudCenter.getInstance().acquireUrlByKind("af.hot_search"); } /** - * get ALPHA_GO_TO_FORUM + * 跳转论坛api */ public static String getAlphaGoToForum() { return CloudCenter.getInstance().acquireUrlByKind("af.go_fourm"); @@ -118,21 +118,21 @@ public class AlphaFineCloudConstants { } /** - * get ALPHA_CID + * cid系统的产品动态api */ public static String getAlphaCid() { return CloudCenter.getInstance().acquireUrlByKind("af.cid.new"); } /** - * get ALPHA_CID_USER_GROUP_INFO + * cid系统的用户组信息api */ public static String getAlphaCidUserGroupInfo() { return CloudCenter.getInstance().acquireUrlByKind("af.cid.user.group.info"); } /** - * get ALPHA_HELP_RECOMMEND + * 获取默认推荐的帮助文档 */ public static String getAlphaHelpRecommend() { String quickStartUrl = CloudCenter.getInstance().acquireUrlByKind("af.help.quick.start"); From 73f15873a37da38134bebf60dddc12d46a0a8070 Mon Sep 17 00:00:00 2001 From: "Leo.Qin" Date: Thu, 29 Sep 2022 10:09:10 +0800 Subject: [PATCH 06/14] =?UTF-8?q?REPORT-80940=20IOFileAttrMark=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E9=97=AE=E9=A2=98=20=E3=80=90=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E5=8E=9F=E5=9B=A0=E3=80=91=E6=8F=92=E4=BB=B6=E5=90=AF=E7=94=A8?= =?UTF-8?q?=E5=90=8E=E6=9C=AA=E5=88=B7=E6=96=B0=20=E3=80=90=E6=94=B9?= =?UTF-8?q?=E5=8A=A8=E6=80=9D=E8=B7=AF=E3=80=91=E6=8F=92=E4=BB=B6=E5=90=AF?= =?UTF-8?q?=E7=94=A8=E5=90=8E=E5=88=B7=E6=96=B0=EF=BC=9B=E4=BF=AE=E6=94=B9?= =?UTF-8?q?AttrMap=E4=B8=ADkey=E6=A0=87=E7=AD=BE=20=E3=80=90review?= =?UTF-8?q?=E5=BB=BA=E8=AE=AE=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/file/HistoryTemplateListCache.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java index f6a97428ef..3d23b31621 100644 --- a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java +++ b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java @@ -445,6 +445,8 @@ public class HistoryTemplateListCache implements CallbackEvent { int size = historyList.size(); for (int i = 0; i < size; i++) { JTemplate template = historyList.get(i); + // 判断刷新逻辑比较耗时,且可能出现插件安装后误判导致不刷新 + // 插件安装/启用场景比较少,因此插件安装/启用后每次均进行刷新 FILE file = template.getEditingFILE(); FILE stashFile = template.templateToStashFile(); if (stashFile != null) { From 7bd960abc9b96e1fd37857583130253010c498a7 Mon Sep 17 00:00:00 2001 From: "Link.Zhao" Date: Thu, 29 Sep 2022 11:07:21 +0800 Subject: [PATCH 07/14] =?UTF-8?q?REPORT-81246=E3=80=90=E8=BF=90=E8=90=A5?= =?UTF-8?q?=E4=BA=A7=E5=93=81=E5=8C=96=E4=BA=8C=E6=9C=9F10.0=E3=80=91?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E5=95=86=E5=9F=8E=E6=96=AD=E7=BD=91=E5=90=8E?= =?UTF-8?q?=E7=9A=84=E5=88=B7=E6=96=B0=E7=82=B9=E5=87=BB=E6=97=A0=E5=8F=8D?= =?UTF-8?q?=E5=BA=94=EF=BC=88=E8=81=94=E7=BD=91=E5=90=8E=E4=BB=8D=E5=AD=98?= =?UTF-8?q?=E5=9C=A8=E6=8A=A5=E9=94=99)=20url=E7=BC=96=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../search/helper/FineMarketClientHelper.java | 15 ++++++++++----- .../manager/impl/ComplementAdviceManager.java | 11 +++++++++-- .../search/manager/impl/SimilarSearchManager.java | 10 ++++++++-- 3 files changed, 27 insertions(+), 9 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/helper/FineMarketClientHelper.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/helper/FineMarketClientHelper.java index e52354c94f..6ebdfe20a8 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/helper/FineMarketClientHelper.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/helper/FineMarketClientHelper.java @@ -1,5 +1,6 @@ package com.fr.design.mainframe.alphafine.search.helper; +import com.fr.base.login.ClientHelper; import com.fr.design.DesignerEnvManager; import com.fr.design.extra.PluginConstants; import com.fr.design.mainframe.alphafine.download.FineMarketDownloadManager; @@ -12,6 +13,7 @@ import com.fr.json.JSONObject; import com.fr.log.FineLoggerFactory; import com.fr.market.key.FineMarketPublicKeyHolder; import com.fr.security.SecurityToolbox; +import com.fr.stable.EncodeConstants; import com.fr.stable.StableUtils; import com.fr.third.org.apache.http.HttpEntity; import com.fr.third.org.apache.http.HttpException; @@ -56,12 +58,13 @@ public class FineMarketClientHelper { private static final String CERTIFICATE_PUBLIC_KEY = FineMarketPublicKeyHolder.getInstance().getDefaultKey(); public static final String FINE_MARKET_TEMPLATE_INFO = CloudCenter.getInstance().acquireUrlByKind("market.template.info"); public static final String FINE_MARKET_TEMPLATE_URL = CloudCenter.getInstance().acquireUrlByKind("market.template.url"); - public static final String VERSION = "&version=10.0"; + public static final String VERSION = "version"; + public static final String CURRENT_VERSION = "10.0"; public static final String FILE_DOWNLOAD = "file/download/"; public static final String PACKAGE_DOWNLOAD = "package/download/"; public static final String TEMPLATES_PARENT_PACKAGE = "parent/"; public static final String TEMPLATES_TAGS = "filter"; - public static final String NAME_SEARCH = "?searchKeyword="; + public static final String NAME_SEARCH = "searchKeyword"; public static final String RESPONSE_STATE = "state"; public static final String RESPONSE_SUCCESS = "ok"; @@ -280,8 +283,10 @@ public class FineMarketClientHelper { } public @Nullable JSONArray getTemplateInfoByName(String name) throws IOException { - String url = FINE_MARKET_TEMPLATE_INFO + NAME_SEARCH + name + VERSION; - String jsonString = HttpToolbox.get(url); + Map params = new HashMap<>(); + params.put(NAME_SEARCH, name); + params.put(VERSION, CURRENT_VERSION); + String jsonString = HttpToolbox.get(FINE_MARKET_TEMPLATE_INFO, params); JSONObject jsonObject = new JSONObject(jsonString); String responseState = (String) jsonObject.get(RESPONSE_STATE); if (RESPONSE_SUCCESS.equals(responseState)) { @@ -335,7 +340,7 @@ public class FineMarketClientHelper { * */ private void initTags() throws IOException { tags = new HashMap<>(); - String url = FINE_MARKET_TEMPLATE_INFO + TEMPLATES_TAGS; + String url = FINE_MARKET_TEMPLATE_INFO + ClientHelper.urlEncode(TEMPLATES_TAGS, EncodeConstants.ENCODING_UTF_8); String jsonString = HttpToolbox.get(url); JSONObject jsonObject = new JSONObject(jsonString); String responseState = (String) jsonObject.get(RESPONSE_STATE); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ComplementAdviceManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ComplementAdviceManager.java index 09ec7f7aa4..288477e5ab 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ComplementAdviceManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ComplementAdviceManager.java @@ -1,5 +1,6 @@ package com.fr.design.mainframe.alphafine.search.manager.impl; +import com.fr.base.login.ClientHelper; import com.fr.design.DesignerEnvManager; import com.fr.design.mainframe.alphafine.AlphaFineCloudConstants; import com.fr.design.mainframe.alphafine.AlphaFineConstants; @@ -7,8 +8,13 @@ import com.fr.design.mainframe.alphafine.AlphaFineHelper; import com.fr.design.mainframe.alphafine.model.SearchResult; import com.fr.general.http.HttpToolbox; import com.fr.log.FineLoggerFactory; +import com.fr.stable.EncodeConstants; import com.fr.third.org.apache.commons.codec.digest.DigestUtils; +import java.net.URLEncoder; +import java.util.HashMap; +import java.util.Map; + /** * @author alex.sung created on 2018/7/23. @@ -40,8 +46,9 @@ public class ComplementAdviceManager { if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isNeedIntelligentCustomerService()) { SearchResult searchResult = new SearchResult(); for (int j = 0; j < searchText.length; j++) { - String token = DigestUtils.md5Hex(AlphaFineConstants.ALPHA_ROBOT_SEARCH_TOKEN + searchText[j]); - String url = AlphaFineCloudConstants.getComplementAdviceSearchUrlPrefix() + "msg=" + searchText[j] + "&token=" + token; + String msg = ClientHelper.urlEncode(searchText[j], EncodeConstants.ENCODING_UTF_8); + String token = DigestUtils.md5Hex(AlphaFineConstants.ALPHA_ROBOT_SEARCH_TOKEN + msg); + String url = AlphaFineCloudConstants.getComplementAdviceSearchUrlPrefix() + "msg=" + msg + "&token=" + ClientHelper.urlEncode(token, EncodeConstants.ENCODING_UTF_8); try { String result = HttpToolbox.get(url); AlphaFineHelper.checkCancel(); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManager.java index 8dee8df0d6..009857e82f 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManager.java @@ -1,5 +1,6 @@ package com.fr.design.mainframe.alphafine.search.manager.impl; +import com.fr.base.login.ClientHelper; import com.fr.design.DesignerEnvManager; import com.fr.design.mainframe.alphafine.AlphaFineCloudConstants; import com.fr.design.mainframe.alphafine.AlphaFineConstants; @@ -13,8 +14,12 @@ import com.fr.general.http.HttpToolbox; import com.fr.json.JSONObject; import com.fr.log.FineLoggerFactory; import com.fr.stable.ArrayUtils; +import com.fr.stable.EncodeConstants; import com.fr.third.org.apache.commons.codec.digest.DigestUtils; +import java.util.HashMap; +import java.util.Map; + /** * Created by alex.sung on 2018/8/3. */ @@ -47,8 +52,9 @@ public class SimilarSearchManager implements AlphaFineSearchProvider { } SearchResult allModelList = new SearchResult(); for (int j = 0; j < searchText.length; j++) { - String token = DigestUtils.md5Hex(AlphaFineConstants.ALPHA_ROBOT_SEARCH_TOKEN + searchText[j]); - String url = AlphaFineCloudConstants.getSimilarSearchUrlPrefix() + "msg=" + searchText[j] + "&token=" + token; + String msg = ClientHelper.urlEncode(searchText[j], EncodeConstants.ENCODING_UTF_8); + String token = DigestUtils.md5Hex(AlphaFineConstants.ALPHA_ROBOT_SEARCH_TOKEN + msg); + String url = AlphaFineCloudConstants.getSimilarSearchUrlPrefix() + "msg=" + msg + "&token=" + ClientHelper.urlEncode(token, EncodeConstants.ENCODING_UTF_8); try { String result = HttpToolbox.get(url); AlphaFineHelper.checkCancel(); From f4df13ed7c414a6db6046a535ced4bac58754736 Mon Sep 17 00:00:00 2001 From: "Link.Zhao" Date: Thu, 29 Sep 2022 11:08:36 +0800 Subject: [PATCH 08/14] =?UTF-8?q?REPORT-81246=E3=80=90=E8=BF=90=E8=90=A5?= =?UTF-8?q?=E4=BA=A7=E5=93=81=E5=8C=96=E4=BA=8C=E6=9C=9F10.0=E3=80=91?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E5=95=86=E5=9F=8E=E6=96=AD=E7=BD=91=E5=90=8E?= =?UTF-8?q?=E7=9A=84=E5=88=B7=E6=96=B0=E7=82=B9=E5=87=BB=E6=97=A0=E5=8F=8D?= =?UTF-8?q?=E5=BA=94=EF=BC=88=E8=81=94=E7=BD=91=E5=90=8E=E4=BB=8D=E5=AD=98?= =?UTF-8?q?=E5=9C=A8=E6=8A=A5=E9=94=99)=20url=E7=BC=96=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../alphafine/search/manager/impl/ComplementAdviceManager.java | 3 --- .../alphafine/search/manager/impl/SimilarSearchManager.java | 3 --- 2 files changed, 6 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ComplementAdviceManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ComplementAdviceManager.java index 288477e5ab..55c153f364 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ComplementAdviceManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ComplementAdviceManager.java @@ -11,9 +11,6 @@ import com.fr.log.FineLoggerFactory; import com.fr.stable.EncodeConstants; import com.fr.third.org.apache.commons.codec.digest.DigestUtils; -import java.net.URLEncoder; -import java.util.HashMap; -import java.util.Map; /** diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManager.java index 009857e82f..0689d24ea8 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManager.java @@ -17,9 +17,6 @@ import com.fr.stable.ArrayUtils; import com.fr.stable.EncodeConstants; import com.fr.third.org.apache.commons.codec.digest.DigestUtils; -import java.util.HashMap; -import java.util.Map; - /** * Created by alex.sung on 2018/8/3. */ From 4b196aa95c03902fe1c291899930e6ad6cdcace7 Mon Sep 17 00:00:00 2001 From: "Link.Zhao" Date: Thu, 29 Sep 2022 11:32:46 +0800 Subject: [PATCH 09/14] =?UTF-8?q?REPORT-81246=E3=80=90=E8=BF=90=E8=90=A5?= =?UTF-8?q?=E4=BA=A7=E5=93=81=E5=8C=96=E4=BA=8C=E6=9C=9F10.0=E3=80=91?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E5=95=86=E5=9F=8E=E6=96=AD=E7=BD=91=E5=90=8E?= =?UTF-8?q?=E7=9A=84=E5=88=B7=E6=96=B0=E7=82=B9=E5=87=BB=E6=97=A0=E5=8F=8D?= =?UTF-8?q?=E5=BA=94=EF=BC=88=E8=81=94=E7=BD=91=E5=90=8E=E4=BB=8D=E5=AD=98?= =?UTF-8?q?=E5=9C=A8=E6=8A=A5=E9=94=99)=20=E6=8F=90=E5=8F=96=E5=B8=B8?= =?UTF-8?q?=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../alphafine/AlphaFineCloudConstants.java | 74 +++++++++++++------ 1 file changed, 50 insertions(+), 24 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineCloudConstants.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineCloudConstants.java index e1bd50a89b..eadfe84acb 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineCloudConstants.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineCloudConstants.java @@ -12,140 +12,166 @@ import com.fr.general.CloudCenter; */ public class AlphaFineCloudConstants { + + private static final String PLUGIN_SEARCH_API = "plugin.searchAPI"; + private static final String AF_PLUGIN_INFO = "af.pluginInfo"; + private static final String AF_REUSE_INFO = "af.reuseInfo"; + private static final String AF_DOC_VIEW = "af.doc_view"; + private static final String AF_DOC_SEARCH = "af.doc_search"; + private static final String AF_DOC_INFO = "af.doc_info"; + private static final String AF_PLUGIN_IMAGE = "af.plugin_image"; + private static final String AF_RECORD = "af.record"; + private static final String AF_CLOUD_SEARCH = "af.cloud_search"; + private static final String AF_SIMILAR_SEARCH = "af.similar_search"; + private static final String AF_ADVICE_SEARCH = "af.advice_search"; + private static final String AF_HOT_SEARCH = "af.hot_search"; + private static final String AF_GO_FORUM = "af.go_fourm"; + private static final String AF_GO_WEB = "af.go_web"; + private static final String AF_PREVIEW = "af.preview"; + private static final String AF_CID_NEW = "af.cid.new"; + private static final String AF_CID_USER_GROUP_INFO = "af.cid.user.group.info"; + private static final String AF_HELP_QUICK_START = "af.help.quick.start"; + private static final String AF_HELP_REPORT_LEARNING_PATH = "af.help.report.learning.path"; + private static final String AF_HELP_PARAM_LEARNING_PATH = "af.help.param.learning.path"; + private static final String AF_HELP_FILL_LEARNING_PATH = "af.help.fill.learning.path"; + private static final String AF_HELP_API_SUMMARY = "af.help.api.summary"; + private static final String AF_HELP_MONTHLY_DOCUMENT = "af.help.monthly.document"; + private static final String AF_RECOMMEND = "af.recommend"; + /** * 插件搜索api */ public static String getPluginSearchUrl() { - return CloudCenter.getInstance().acquireUrlByKind("plugin.searchAPI"); + return CloudCenter.getInstance().acquireUrlByKind(PLUGIN_SEARCH_API); } /** * 插件信息api */ public static String getPluginUrl() { - return CloudCenter.getInstance().acquireUrlByKind("af.pluginInfo"); + return CloudCenter.getInstance().acquireUrlByKind(AF_PLUGIN_INFO); } /** * get REUSE_URL */ public static String getReuseUrl() { - return CloudCenter.getInstance().acquireUrlByKind("af.reuseInfo"); + return CloudCenter.getInstance().acquireUrlByKind(AF_REUSE_INFO); } /** * get DOCUMENT_DOC_URL */ public static String getDocumentDocUrl() { - return CloudCenter.getInstance().acquireUrlByKind("af.doc_view"); + return CloudCenter.getInstance().acquireUrlByKind(AF_DOC_VIEW); } /** * 获取文档搜索api */ public static String getDocumentSearchUrl() { - return CloudCenter.getInstance().acquireUrlByKind("af.doc_search"); + return CloudCenter.getInstance().acquireUrlByKind(AF_DOC_SEARCH); } /** * 文档信息api */ public static String getDocumentInformationUrl() { - return CloudCenter.getInstance().acquireUrlByKind("af.doc_info"); + return CloudCenter.getInstance().acquireUrlByKind(AF_DOC_INFO); } /** * 插件图标api */ public static String getPluginImageUrl() { - return CloudCenter.getInstance().acquireUrlByKind("af.plugin_image"); + return CloudCenter.getInstance().acquireUrlByKind(AF_PLUGIN_IMAGE); } /** * get CLOUD_SERVER_URL */ public static String getCloudServerUrl() { - return CloudCenter.getInstance().acquireUrlByKind("af.record"); + return CloudCenter.getInstance().acquireUrlByKind(AF_RECORD); } /** * get SEARCH_API */ public static String getSearchApi() { - return CloudCenter.getInstance().acquireUrlByKind("af.cloud_search"); + return CloudCenter.getInstance().acquireUrlByKind(AF_CLOUD_SEARCH); } /** * get SIMILAR_SEARCH_URL_PREFIX */ public static String getSimilarSearchUrlPrefix() { - return CloudCenter.getInstance().acquireUrlByKind("af.similar_search"); + return CloudCenter.getInstance().acquireUrlByKind(AF_SIMILAR_SEARCH); } /** * get COMPLEMENT_ADVICE_SEARCH_URL_PREFIX */ public static String getComplementAdviceSearchUrlPrefix() { - return CloudCenter.getInstance().acquireUrlByKind("af.advice_search"); + return CloudCenter.getInstance().acquireUrlByKind(AF_ADVICE_SEARCH); } /** * 获取热门问题 */ public static String getAlphaHotSearch() { - return CloudCenter.getInstance().acquireUrlByKind("af.hot_search"); + return CloudCenter.getInstance().acquireUrlByKind(AF_HOT_SEARCH); } /** * 跳转论坛api */ public static String getAlphaGoToForum() { - return CloudCenter.getInstance().acquireUrlByKind("af.go_fourm"); + return CloudCenter.getInstance().acquireUrlByKind(AF_GO_FORUM); } /** * get ALPHA_GO_TO_WEB */ public static String getAlphaGoToWeb() { - return CloudCenter.getInstance().acquireUrlByKind("af.go_web"); + return CloudCenter.getInstance().acquireUrlByKind(AF_GO_WEB); } /** * get ALPHA_PREVIEW */ public static String getAlphaPreview() { - return CloudCenter.getInstance().acquireUrlByKind("af.preview"); + return CloudCenter.getInstance().acquireUrlByKind(AF_PREVIEW); } /** * cid系统的产品动态api */ public static String getAlphaCid() { - return CloudCenter.getInstance().acquireUrlByKind("af.cid.new"); + return CloudCenter.getInstance().acquireUrlByKind(AF_CID_NEW); } /** * cid系统的用户组信息api */ public static String getAlphaCidUserGroupInfo() { - return CloudCenter.getInstance().acquireUrlByKind("af.cid.user.group.info"); + return CloudCenter.getInstance().acquireUrlByKind(AF_CID_USER_GROUP_INFO); } /** * 获取默认推荐的帮助文档 */ public static String getAlphaHelpRecommend() { - String quickStartUrl = CloudCenter.getInstance().acquireUrlByKind("af.help.quick.start"); + String quickStartUrl = CloudCenter.getInstance().acquireUrlByKind(AF_HELP_QUICK_START); - String reportLearningPath = CloudCenter.getInstance().acquireUrlByKind("af.help.report.learning.path"); + String reportLearningPath = CloudCenter.getInstance().acquireUrlByKind(AF_HELP_REPORT_LEARNING_PATH); - String parameterLearningPath = CloudCenter.getInstance().acquireUrlByKind("af.help.param.learning.path"); + String parameterLearningPath = CloudCenter.getInstance().acquireUrlByKind(AF_HELP_PARAM_LEARNING_PATH); - String fillLearningPath = CloudCenter.getInstance().acquireUrlByKind("af.help.fill.learning.path"); + String fillLearningPath = CloudCenter.getInstance().acquireUrlByKind(AF_HELP_FILL_LEARNING_PATH); - String apiSummary = CloudCenter.getInstance().acquireUrlByKind("af.help.api.summary"); + String apiSummary = CloudCenter.getInstance().acquireUrlByKind(AF_HELP_API_SUMMARY); - String monthlyDocument = CloudCenter.getInstance().acquireUrlByKind("af.help.monthly.document"); + String monthlyDocument = CloudCenter.getInstance().acquireUrlByKind(AF_HELP_MONTHLY_DOCUMENT); String defaultRecommend = "[ {\"name\":\"快速入门指南\", \"link\":\"" + quickStartUrl + "\"}," + "{\"name\":\"报表应用学习路径\", \"link\":\"" + reportLearningPath + "\"}," + @@ -154,7 +180,7 @@ public class AlphaFineCloudConstants { "{\"name\":\"API接口汇总\", \"link\":\"" + apiSummary + "\"}," + "{\"name\":\"文档月刊\", \"link\":\"" + monthlyDocument + "\"} ]"; - return CloudCenter.getInstance().acquireUrlByKind("af.recommend", defaultRecommend); + return CloudCenter.getInstance().acquireUrlByKind(AF_RECOMMEND, defaultRecommend); } } From 86391d401a60c03e9b0dd14fa2e47f1463f03967 Mon Sep 17 00:00:00 2001 From: kerry Date: Thu, 29 Sep 2022 15:17:28 +0800 Subject: [PATCH 10/14] =?UTF-8?q?REPORT-79537=20=E5=86=B3=E7=AD=96?= =?UTF-8?q?=E6=8A=A5=E8=A1=A8=E3=80=8B=E7=BB=9D=E5=AF=B9=E5=B8=83=E5=B1=80?= =?UTF-8?q?=E8=87=AA=E9=80=82=E5=BA=94=E3=80=8B=E7=89=B9=E5=AE=9A=E6=93=8D?= =?UTF-8?q?=E4=BD=9C=E4=B8=8Bbody=E5=AE=BD=E5=BA=A6=E7=AA=81=E7=84=B6?= =?UTF-8?q?=E5=8F=980=E4=B8=94=E6=97=A0=E6=B3=95=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../beans/adapters/layout/FRCardMainBorderLayoutAdapter.java | 5 ++++- .../designer/beans/adapters/layout/FRFitLayoutAdapter.java | 5 +++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRCardMainBorderLayoutAdapter.java b/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRCardMainBorderLayoutAdapter.java index 13910f7d41..057baa9a31 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRCardMainBorderLayoutAdapter.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRCardMainBorderLayoutAdapter.java @@ -73,7 +73,10 @@ public class FRCardMainBorderLayoutAdapter extends FRBorderLayoutAdapter { FormDesigner formDesigner = WidgetPropertyPane.getInstance().getEditingFormDesigner(); AddingModel model = formDesigner.getAddingModel(); - model.setAddedIllegal(true); + if (model != null) { + model.setAddedIllegal(true); + } + return true; } else { return false; diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java b/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java index c893268ba1..8800bb6490 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java @@ -11,6 +11,7 @@ import com.fr.design.designer.beans.painters.FRFitLayoutPainter; import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreatorUtils; import com.fr.design.designer.creator.XLayoutContainer; +import com.fr.design.designer.creator.XWAbsoluteBodyLayout; import com.fr.design.designer.creator.XWAbsoluteLayout; import com.fr.design.designer.creator.XWFitLayout; import com.fr.design.designer.creator.cardlayout.XWCardLayout; @@ -339,6 +340,10 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter { */ @Override public void fix(XCreator creator) { + //XWAbsoluteBodyLayout作为body不允许在Fit布局中调整尺寸 + if(creator.acceptType(XWAbsoluteBodyLayout.class)){ + return; + } //拖拽组件原大小、位置 Rectangle backupBound = creator.getBackupBound(); backupBound.x -= container.getX(); From 3fb2f05bf72a76c80dc2af5100e510bbb9a3d963 Mon Sep 17 00:00:00 2001 From: "Link.Zhao" Date: Thu, 29 Sep 2022 16:23:49 +0800 Subject: [PATCH 11/14] =?UTF-8?q?REPORT-81246=E3=80=90=E8=BF=90=E8=90=A5?= =?UTF-8?q?=E4=BA=A7=E5=93=81=E5=8C=96=E4=BA=8C=E6=9C=9F10.0=E3=80=91?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E5=95=86=E5=9F=8E=E6=96=AD=E7=BD=91=E5=90=8E?= =?UTF-8?q?=E7=9A=84=E5=88=B7=E6=96=B0=E7=82=B9=E5=87=BB=E6=97=A0=E5=8F=8D?= =?UTF-8?q?=E5=BA=94=EF=BC=88=E8=81=94=E7=BD=91=E5=90=8E=E4=BB=8D=E5=AD=98?= =?UTF-8?q?=E5=9C=A8=E6=8A=A5=E9=94=99)=20=E8=A7=84=E8=8C=83=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=201=E3=80=81=E6=B7=BB=E5=8A=A0=E6=B3=A8=E9=87=8A=202?= =?UTF-8?q?=E3=80=81=E6=8B=BC=E6=8E=A5json=E5=AD=97=E7=AC=A6=E4=B8=B2?= =?UTF-8?q?=E8=BD=AC=E4=B8=BAjson=E5=AF=B9=E8=B1=A1=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../alphafine/AlphaFineCloudConstants.java | 61 ++++++++++--------- 1 file changed, 33 insertions(+), 28 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineCloudConstants.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineCloudConstants.java index eadfe84acb..537984470c 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineCloudConstants.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineCloudConstants.java @@ -1,6 +1,11 @@ package com.fr.design.mainframe.alphafine; +import com.fr.design.i18n.Toolkit; import com.fr.general.CloudCenter; +import com.fr.json.JSONArray; + +import java.util.HashMap; +import java.util.Map; /** * 需要从云端获取的常量单独放一起 @@ -38,6 +43,9 @@ public class AlphaFineCloudConstants { private static final String AF_HELP_MONTHLY_DOCUMENT = "af.help.monthly.document"; private static final String AF_RECOMMEND = "af.recommend"; + private static final String LINK_NAME = "name"; + private static final String LINK_URL = "link"; + /** * 插件搜索api */ @@ -53,14 +61,14 @@ public class AlphaFineCloudConstants { } /** - * get REUSE_URL + * 获取组件信息api */ public static String getReuseUrl() { return CloudCenter.getInstance().acquireUrlByKind(AF_REUSE_INFO); } /** - * get DOCUMENT_DOC_URL + * 获取帮助文档url */ public static String getDocumentDocUrl() { return CloudCenter.getInstance().acquireUrlByKind(AF_DOC_VIEW); @@ -88,28 +96,28 @@ public class AlphaFineCloudConstants { } /** - * get CLOUD_SERVER_URL + * 获取云端接口,用于上传alphafine搜索记录 */ public static String getCloudServerUrl() { return CloudCenter.getInstance().acquireUrlByKind(AF_RECORD); } /** - * get SEARCH_API + * 获取搜索api,输入搜索词,返回fr的相关功能 */ public static String getSearchApi() { return CloudCenter.getInstance().acquireUrlByKind(AF_CLOUD_SEARCH); } /** - * get SIMILAR_SEARCH_URL_PREFIX + * 获取模糊搜索api前缀,输入搜索词,返回alphaFine相关内容,插件,文档,功能等 */ public static String getSimilarSearchUrlPrefix() { return CloudCenter.getInstance().acquireUrlByKind(AF_SIMILAR_SEARCH); } /** - * get COMPLEMENT_ADVICE_SEARCH_URL_PREFIX + * 补全建议搜索结果 api,与AF_SIMILAR_SEARCH接口类似,但是返回的信息更全 */ public static String getComplementAdviceSearchUrlPrefix() { return CloudCenter.getInstance().acquireUrlByKind(AF_ADVICE_SEARCH); @@ -130,14 +138,14 @@ public class AlphaFineCloudConstants { } /** - * get ALPHA_GO_TO_WEB + * 推荐搜索api,输入搜索词,返回猜你想搜的内容(html格式) */ public static String getAlphaGoToWeb() { return CloudCenter.getInstance().acquireUrlByKind(AF_GO_WEB); } /** - * get ALPHA_PREVIEW + * 帆软智能客服页面url */ public static String getAlphaPreview() { return CloudCenter.getInstance().acquireUrlByKind(AF_PREVIEW); @@ -161,26 +169,23 @@ public class AlphaFineCloudConstants { * 获取默认推荐的帮助文档 */ public static String getAlphaHelpRecommend() { - String quickStartUrl = CloudCenter.getInstance().acquireUrlByKind(AF_HELP_QUICK_START); - - String reportLearningPath = CloudCenter.getInstance().acquireUrlByKind(AF_HELP_REPORT_LEARNING_PATH); - - String parameterLearningPath = CloudCenter.getInstance().acquireUrlByKind(AF_HELP_PARAM_LEARNING_PATH); - - String fillLearningPath = CloudCenter.getInstance().acquireUrlByKind(AF_HELP_FILL_LEARNING_PATH); - - String apiSummary = CloudCenter.getInstance().acquireUrlByKind(AF_HELP_API_SUMMARY); - - String monthlyDocument = CloudCenter.getInstance().acquireUrlByKind(AF_HELP_MONTHLY_DOCUMENT); - - String defaultRecommend = "[ {\"name\":\"快速入门指南\", \"link\":\"" + quickStartUrl + "\"}," + - "{\"name\":\"报表应用学习路径\", \"link\":\"" + reportLearningPath + "\"}," + - "{\"name\":\"参数应用学习路径\", \"link\":\"" + parameterLearningPath + "\"}," + - "{\"name\":\"填报学习路径\", \"link\":\"" + fillLearningPath + "\"}," + - "{\"name\":\"API接口汇总\", \"link\":\"" + apiSummary + "\"}," + - "{\"name\":\"文档月刊\", \"link\":\"" + monthlyDocument + "\"} ]"; - - return CloudCenter.getInstance().acquireUrlByKind(AF_RECOMMEND, defaultRecommend); + String[][] links = new String[][]{ + {Toolkit.i18nText("Fine-Design_Report_AlphaFine_Doc_Quick_Start"), CloudCenter.getInstance().acquireUrlByKind(AF_HELP_QUICK_START)}, + {Toolkit.i18nText("Fine-Design_Report_AlphaFine_Doc_Report_Learning"), CloudCenter.getInstance().acquireUrlByKind(AF_HELP_REPORT_LEARNING_PATH)}, + {Toolkit.i18nText("Fine-Design_Report_AlphaFine_Doc_Parameter_Learning"), CloudCenter.getInstance().acquireUrlByKind(AF_HELP_PARAM_LEARNING_PATH)}, + {Toolkit.i18nText("Fine-Design_Report_AlphaFine_Doc_Fill_Learning"), CloudCenter.getInstance().acquireUrlByKind(AF_HELP_FILL_LEARNING_PATH)}, + {Toolkit.i18nText("Fine-Design_Report_AlphaFine_Doc_Api_Summary"), CloudCenter.getInstance().acquireUrlByKind(AF_HELP_API_SUMMARY)}, + {Toolkit.i18nText("Fine-Design_Report_AlphaFine_Doc_Monthly_Document"), CloudCenter.getInstance().acquireUrlByKind(AF_HELP_MONTHLY_DOCUMENT)} + }; + JSONArray jsonArray = new JSONArray(); + for (String[] link : links) { + Map map = new HashMap<>(); + map.put(LINK_NAME, link[0]); + map.put(LINK_URL, link[1]); + jsonArray.put(map); + } + + return CloudCenter.getInstance().acquireUrlByKind(AF_RECOMMEND, jsonArray.toString()); } } From 03d2a236e2097e0ee0992fc9e2455e1d55bb02b9 Mon Sep 17 00:00:00 2001 From: "Link.Zhao" Date: Fri, 30 Sep 2022 11:33:18 +0800 Subject: [PATCH 12/14] =?UTF-8?q?REPORT-81246=E3=80=90=E8=BF=90=E8=90=A5?= =?UTF-8?q?=E4=BA=A7=E5=93=81=E5=8C=96=E4=BA=8C=E6=9C=9F10.0=E3=80=91?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E5=95=86=E5=9F=8E=E6=96=AD=E7=BD=91=E5=90=8E?= =?UTF-8?q?=E7=9A=84=E5=88=B7=E6=96=B0=E7=82=B9=E5=87=BB=E6=97=A0=E5=8F=8D?= =?UTF-8?q?=E5=BA=94=EF=BC=88=E8=81=94=E7=BD=91=E5=90=8E=E4=BB=8D=E5=AD=98?= =?UTF-8?q?=E5=9C=A8=E6=8A=A5=E9=94=99=EF=BC=89=20=E5=85=B6=E5=AE=9E?= =?UTF-8?q?=E8=81=94=E7=BD=91=E5=90=8E=E8=83=BD=E5=88=B7=E6=96=B0=E7=9A=84?= =?UTF-8?q?=EF=BC=8C=E5=8F=AA=E6=98=AF=E6=B2=A1=E6=9C=89=E9=87=8D=E8=BD=BD?= =?UTF-8?q?=E5=8A=A8=E7=94=BB=20=E6=B7=BB=E5=8A=A0=E4=BA=86=E9=87=8D?= =?UTF-8?q?=E8=BD=BD=E5=8A=A8=E7=94=BB=20=E4=BF=AE=E6=94=B9=E4=BA=86?= =?UTF-8?q?=E8=AF=B7=E6=B1=82=E5=8F=82=E6=95=B0=E7=9A=84=E7=BC=96=E7=A0=81?= =?UTF-8?q?=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/alphafine/component/AlphaFineFrame.java | 2 +- .../search/helper/FineMarketClientHelper.java | 11 ++++------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineFrame.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineFrame.java index 415e8cbf91..5d984dca39 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineFrame.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineFrame.java @@ -920,7 +920,7 @@ public class AlphaFineFrame extends JFrame { if (StringUtils.isEmpty(text)) { return; } - searchLoadingPane = new SearchLoadingPane(); + initSearchLoadingPane(); SearchTextBean searchTextBean = new SearchTextBean(text, segmentationResult); this.productNewsSearchWorkerManager.doSearch(searchTextBean); this.documentWorkerManager.doSearch(searchTextBean); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/helper/FineMarketClientHelper.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/helper/FineMarketClientHelper.java index 6ebdfe20a8..fc07d79f42 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/helper/FineMarketClientHelper.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/helper/FineMarketClientHelper.java @@ -58,13 +58,12 @@ public class FineMarketClientHelper { private static final String CERTIFICATE_PUBLIC_KEY = FineMarketPublicKeyHolder.getInstance().getDefaultKey(); public static final String FINE_MARKET_TEMPLATE_INFO = CloudCenter.getInstance().acquireUrlByKind("market.template.info"); public static final String FINE_MARKET_TEMPLATE_URL = CloudCenter.getInstance().acquireUrlByKind("market.template.url"); - public static final String VERSION = "version"; - public static final String CURRENT_VERSION = "10.0"; + public static final String VERSION = "&version=10.0"; public static final String FILE_DOWNLOAD = "file/download/"; public static final String PACKAGE_DOWNLOAD = "package/download/"; public static final String TEMPLATES_PARENT_PACKAGE = "parent/"; public static final String TEMPLATES_TAGS = "filter"; - public static final String NAME_SEARCH = "searchKeyword"; + public static final String NAME_SEARCH = "?searchKeyword="; public static final String RESPONSE_STATE = "state"; public static final String RESPONSE_SUCCESS = "ok"; @@ -283,10 +282,8 @@ public class FineMarketClientHelper { } public @Nullable JSONArray getTemplateInfoByName(String name) throws IOException { - Map params = new HashMap<>(); - params.put(NAME_SEARCH, name); - params.put(VERSION, CURRENT_VERSION); - String jsonString = HttpToolbox.get(FINE_MARKET_TEMPLATE_INFO, params); + String url = FINE_MARKET_TEMPLATE_INFO + NAME_SEARCH + ClientHelper.urlEncode(name, EncodeConstants.ENCODING_UTF_8) + VERSION; + String jsonString = HttpToolbox.get(url); JSONObject jsonObject = new JSONObject(jsonString); String responseState = (String) jsonObject.get(RESPONSE_STATE); if (RESPONSE_SUCCESS.equals(responseState)) { From dbf2bdfe1ae985f61fea9e362c953933b86e4b79 Mon Sep 17 00:00:00 2001 From: "Link.Zhao" Date: Fri, 30 Sep 2022 11:34:33 +0800 Subject: [PATCH 13/14] =?UTF-8?q?REPORT-81246=E3=80=90=E8=BF=90=E8=90=A5?= =?UTF-8?q?=E4=BA=A7=E5=93=81=E5=8C=96=E4=BA=8C=E6=9C=9F10.0=E3=80=91?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E5=95=86=E5=9F=8E=E6=96=AD=E7=BD=91=E5=90=8E?= =?UTF-8?q?=E7=9A=84=E5=88=B7=E6=96=B0=E7=82=B9=E5=87=BB=E6=97=A0=E5=8F=8D?= =?UTF-8?q?=E5=BA=94=EF=BC=88=E8=81=94=E7=BD=91=E5=90=8E=E4=BB=8D=E5=AD=98?= =?UTF-8?q?=E5=9C=A8=E6=8A=A5=E9=94=99=EF=BC=89=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../alphafine/search/helper/FineMarketClientHelper.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/helper/FineMarketClientHelper.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/helper/FineMarketClientHelper.java index fc07d79f42..c62f98fce7 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/helper/FineMarketClientHelper.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/helper/FineMarketClientHelper.java @@ -281,6 +281,10 @@ public class FineMarketClientHelper { } } + + /** + * 通过名字搜索模板信息 + */ public @Nullable JSONArray getTemplateInfoByName(String name) throws IOException { String url = FINE_MARKET_TEMPLATE_INFO + NAME_SEARCH + ClientHelper.urlEncode(name, EncodeConstants.ENCODING_UTF_8) + VERSION; String jsonString = HttpToolbox.get(url); From 170dfee97412253078da645a5ae876fccf12c6d3 Mon Sep 17 00:00:00 2001 From: "Link.Zhao" Date: Fri, 30 Sep 2022 14:19:02 +0800 Subject: [PATCH 14/14] =?UTF-8?q?REPORT-75093=20=E8=BF=90=E8=90=A5?= =?UTF-8?q?=E4=BA=A7=E5=93=81=E5=8C=96=E4=BA=8C=E6=9C=9F=20=E9=80=82?= =?UTF-8?q?=E9=85=8D=E5=9F=8B=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/alphafine/cell/model/PluginModel.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/PluginModel.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/PluginModel.java index 8de053807d..84ee2e30f9 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/PluginModel.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/PluginModel.java @@ -102,7 +102,15 @@ public class PluginModel extends AlphaCellModel { if (StringUtils.isBlank(this.pluginId) || !WorkContext.getCurrent().isLocal()) { return; } - WebViewDlgHelper.createPluginDialog(getName()); + openPluginStore(getName()); + } + + /** + * 打开插件商城 + * 方便埋点 + */ + private void openPluginStore(String name) { + WebViewDlgHelper.createPluginDialog(name); } @Override