|
|
@ -1,10 +1,14 @@ |
|
|
|
package com.fr.design.actions.help.alphafine; |
|
|
|
package com.fr.design.actions.help.alphafine; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.fr.design.i18n.Toolkit; |
|
|
|
import com.fr.general.CloudCenter; |
|
|
|
import com.fr.general.CloudCenter; |
|
|
|
|
|
|
|
import com.fr.json.JSONArray; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.HashMap; |
|
|
|
|
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 需要从云端获取的常量单独放一起 |
|
|
|
* 云端变量统一管理 |
|
|
|
* 以防AlphaFineConstants被加载时,CloudCenter还没启动,导致常量获取不到。 |
|
|
|
|
|
|
|
* |
|
|
|
* |
|
|
|
* @author Link |
|
|
|
* @author Link |
|
|
|
* @version 11.0 |
|
|
|
* @version 11.0 |
|
|
@ -12,55 +16,185 @@ import com.fr.general.CloudCenter; |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public class AlphaFineCloudConstants { |
|
|
|
public class AlphaFineCloudConstants { |
|
|
|
|
|
|
|
|
|
|
|
public static final String PLUGIN_SEARCH_URL = CloudCenter.getInstance().acquireUrlByKind("plugin.searchAPI"); |
|
|
|
private static final String PLUGIN_SEARCH_API = "plugin.searchAPI"; |
|
|
|
|
|
|
|
private static final String PLUGIN_ALL_SEARCH_API = "plugin.all.searchAPI"; |
|
|
|
public static final String SEARCH_ALL_PLUGIN_URL = CloudCenter.getInstance().acquireUrlByKind("plugin.all.searchAPI"); |
|
|
|
private static final String AF_PLUGIN_INFO = "af.pluginInfo"; |
|
|
|
|
|
|
|
private static final String AF_REUSE_INFO = "af.reuseInfo"; |
|
|
|
public static final String PLUGIN_URL = CloudCenter.getInstance().acquireUrlByKind("af.pluginInfo"); |
|
|
|
private static final String AF_DOC_VIEW = "af.doc_view"; |
|
|
|
|
|
|
|
private static final String AF_DOC_SEARCH = "af.doc_search"; |
|
|
|
public static final String REUSE_URL = CloudCenter.getInstance().acquireUrlByKind("af.reuseInfo"); |
|
|
|
private static final String AF_DOC_INFO = "af.doc_info"; |
|
|
|
|
|
|
|
private static final String AF_PLUGIN_IMAGE = "af.plugin_image"; |
|
|
|
public static final String DOCUMENT_DOC_URL = CloudCenter.getInstance().acquireUrlByKind("af.doc_view"); |
|
|
|
private static final String AF_RECORD = "af.record"; |
|
|
|
|
|
|
|
private static final String AF_CLOUD_SEARCH = "af.cloud_search"; |
|
|
|
public static final String DOCUMENT_SEARCH_URL = CloudCenter.getInstance().acquireUrlByKind("af.doc_search"); |
|
|
|
private static final String AF_SIMILAR_SEARCH = "af.similar_search"; |
|
|
|
|
|
|
|
private static final String AF_ADVICE_SEARCH = "af.advice_search"; |
|
|
|
public static final String DOCUMENT_INFORMATION_URL = CloudCenter.getInstance().acquireUrlByKind("af.doc_info"); |
|
|
|
private static final String AF_HOT_SEARCH = "af.hot_search"; |
|
|
|
|
|
|
|
private static final String AF_GO_FORUM = "af.go_fourm"; |
|
|
|
public static final String PLUGIN_IMAGE_URL = CloudCenter.getInstance().acquireUrlByKind("af.plugin_image"); |
|
|
|
private static final String AF_GO_WEB = "af.go_web"; |
|
|
|
|
|
|
|
private static final String AF_PREVIEW = "af.preview"; |
|
|
|
public static final String CLOUD_SERVER_URL = CloudCenter.getInstance().acquireUrlByKind("af.record"); |
|
|
|
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"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static final String LINK_NAME = "name"; |
|
|
|
|
|
|
|
private static final String LINK_URL = "link"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 获取插件搜索api |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public static String getPluginSearchUrl() { |
|
|
|
|
|
|
|
return CloudCenter.getInstance().acquireUrlByKind(PLUGIN_SEARCH_API); |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
public static final String SEARCH_API = CloudCenter.getInstance().acquireUrlByKind("af.cloud_search"); |
|
|
|
/** |
|
|
|
|
|
|
|
* 帆软市场里全部插件api |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public static String getSearchAllPluginUrl() { |
|
|
|
|
|
|
|
return CloudCenter.getInstance().acquireUrlByKind(PLUGIN_ALL_SEARCH_API); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static final String SIMILAR_SEARCH_URL_PREFIX = CloudCenter.getInstance().acquireUrlByKind("af.similar_search"); |
|
|
|
/** |
|
|
|
|
|
|
|
* 获取插件信息api |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public static String getPluginUrl() { |
|
|
|
|
|
|
|
return CloudCenter.getInstance().acquireUrlByKind(AF_PLUGIN_INFO); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static final String COMPLEMENT_ADVICE_SEARCH_URL_PREFIX = CloudCenter.getInstance().acquireUrlByKind("af.advice_search"); |
|
|
|
/** |
|
|
|
|
|
|
|
* 获取组件信息api |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public static String getReuseUrl() { |
|
|
|
|
|
|
|
return CloudCenter.getInstance().acquireUrlByKind(AF_REUSE_INFO); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static final String ALPHA_HOT_SEARCH = CloudCenter.getInstance().acquireUrlByKind("af.hot_search"); |
|
|
|
/** |
|
|
|
|
|
|
|
* 获取帮助文档url |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public static String getDocumentDocUrl() { |
|
|
|
|
|
|
|
return CloudCenter.getInstance().acquireUrlByKind(AF_DOC_VIEW); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static final String ALPHA_GO_TO_FORUM = CloudCenter.getInstance().acquireUrlByKind("af.go_fourm"); |
|
|
|
/** |
|
|
|
|
|
|
|
* 帮助文档搜索api |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public static String getDocumentSearchUrl() { |
|
|
|
|
|
|
|
return CloudCenter.getInstance().acquireUrlByKind(AF_DOC_SEARCH); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static final String ALPHA_GO_TO_WEB = CloudCenter.getInstance().acquireUrlByKind("af.go_web"); |
|
|
|
/** |
|
|
|
|
|
|
|
* 帮助文档信息api |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public static String getDocumentInformationUrl() { |
|
|
|
|
|
|
|
return CloudCenter.getInstance().acquireUrlByKind(AF_DOC_INFO); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static final String ALPHA_PREVIEW = CloudCenter.getInstance().acquireUrlByKind("af.preview"); |
|
|
|
/** |
|
|
|
|
|
|
|
* 插件图片api |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public static String getPluginImageUrl() { |
|
|
|
|
|
|
|
return CloudCenter.getInstance().acquireUrlByKind(AF_PLUGIN_IMAGE); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static final String ALPHA_CID = CloudCenter.getInstance().acquireUrlByKind("af.cid.new"); |
|
|
|
/** |
|
|
|
|
|
|
|
* 获取云端接口,用于上传alphafine搜索记录 |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public static String getCloudServerUrl() { |
|
|
|
|
|
|
|
return CloudCenter.getInstance().acquireUrlByKind(AF_RECORD); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static final String ALPHA_CID_USER_GROUP_INFO = CloudCenter.getInstance().acquireUrlByKind("af.cid.user.group.info"); |
|
|
|
/** |
|
|
|
|
|
|
|
* 获取搜索api,输入搜索词,返回fr的相关功能 |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public static String getSearchApi() { |
|
|
|
|
|
|
|
return CloudCenter.getInstance().acquireUrlByKind(AF_CLOUD_SEARCH); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private static final String QUICK_START_URL = CloudCenter.getInstance().acquireUrlByKind("af.help.quick.start"); |
|
|
|
/** |
|
|
|
|
|
|
|
* 获取模糊搜索api前缀,输入搜索词,返回alphaFine相关内容,插件,文档,功能等 |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public static String getSimilarSearchUrlPrefix() { |
|
|
|
|
|
|
|
return CloudCenter.getInstance().acquireUrlByKind(AF_SIMILAR_SEARCH); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private static final String REPORT_LEARNING_PATH = CloudCenter.getInstance().acquireUrlByKind("af.help.report.learning.path"); |
|
|
|
/** |
|
|
|
|
|
|
|
* 补全建议搜索结果 api,与AF_SIMILAR_SEARCH接口类似,但是返回的信息更全 |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public static String getComplementAdviceSearchUrlPrefix() { |
|
|
|
|
|
|
|
return CloudCenter.getInstance().acquireUrlByKind(AF_ADVICE_SEARCH); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private static final String PARAMETER_LEARNING_PATH = CloudCenter.getInstance().acquireUrlByKind("af.help.param.learning.path"); |
|
|
|
/** |
|
|
|
|
|
|
|
* 获取热门问题 |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public static String getAlphaHotSearch() { |
|
|
|
|
|
|
|
return CloudCenter.getInstance().acquireUrlByKind(AF_HOT_SEARCH); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private static final String FILL_LEARNING_PATH = CloudCenter.getInstance().acquireUrlByKind("af.help.fill.learning.path"); |
|
|
|
/** |
|
|
|
|
|
|
|
* 跳转论坛url |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public static String getAlphaGoToForum() { |
|
|
|
|
|
|
|
return CloudCenter.getInstance().acquireUrlByKind(AF_GO_FORUM); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private static final String API_SUMMARY = CloudCenter.getInstance().acquireUrlByKind("af.help.api.summary"); |
|
|
|
/** |
|
|
|
|
|
|
|
* 推荐搜索api,输入搜索词,返回猜你想搜的内容(html格式) |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public static String getAlphaGoToWeb() { |
|
|
|
|
|
|
|
return CloudCenter.getInstance().acquireUrlByKind(AF_GO_WEB); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private static final String MONTHLY_DOCUMENT = CloudCenter.getInstance().acquireUrlByKind("af.help.monthly.document"); |
|
|
|
/** |
|
|
|
|
|
|
|
* 帆软智能客服页面url |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public static String getAlphaPreview() { |
|
|
|
|
|
|
|
return CloudCenter.getInstance().acquireUrlByKind(AF_PREVIEW); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
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 + "\" } ]"; |
|
|
|
/** |
|
|
|
|
|
|
|
* cid系统的产品动态api |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public static String getAlphaCid() { |
|
|
|
|
|
|
|
return CloudCenter.getInstance().acquireUrlByKind(AF_CID_NEW); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static final String ALPHA_HELP_RECOMMEND = CloudCenter.getInstance().acquireUrlByKind("af.recommend", DEFAULT_RECOMMEND); |
|
|
|
/** |
|
|
|
|
|
|
|
* cid系统的 用户组信息api |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public static String getAlphaCidUserGroupInfo() { |
|
|
|
|
|
|
|
return CloudCenter.getInstance().acquireUrlByKind(AF_CID_USER_GROUP_INFO); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static String getDefaultRecommend() { |
|
|
|
|
|
|
|
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<String, String> map = new HashMap<>(); |
|
|
|
|
|
|
|
map.put(LINK_NAME, link[0]); |
|
|
|
|
|
|
|
map.put(LINK_URL, link[1]); |
|
|
|
|
|
|
|
jsonArray.put(map); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return jsonArray.toString(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 获取默认推荐帮助文档url |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public static String getAlphaHelpRecommend() { |
|
|
|
|
|
|
|
return CloudCenter.getInstance().acquireUrlByKind(AF_RECOMMEND, getDefaultRecommend()); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|