Browse Source

Merge pull request #36 in PF/design from ~KERRY/design-pf:9.0 to 9.0

* commit '679087e1207719911c548e32b5fc82a265d0e26b':
  PMD
  PMD
  REPORT-2354 将平台的插件管理和设计器的插件管理统一起来
  REPORT-2354 将平台的插件管理和设计器的插件管理统一起来
master
superman 8 years ago
parent
commit
5fc9fda12b
  1. 52
      designer_base/src/com/fr/design/extra/PluginOperateUtils.java
  2. 7
      designer_base/src/com/fr/design/extra/PluginWebBridge.java
  3. 2
      designer_base/src/com/fr/design/extra/exe/callback/ModifyStatusCallback.java
  4. 1
      designer_base/src/com/fr/design/locale/designer.properties
  5. 3
      designer_base/src/com/fr/design/locale/designer_en_US.properties
  6. 3
      designer_base/src/com/fr/design/locale/designer_ja_JP.properties
  7. 3
      designer_base/src/com/fr/design/locale/designer_ko_KR.properties
  8. 3
      designer_base/src/com/fr/design/locale/designer_zh_CN.properties
  9. 3
      designer_base/src/com/fr/design/locale/designer_zh_TW.properties

52
designer_base/src/com/fr/design/extra/PluginOperateUtils.java

@ -112,16 +112,15 @@ public class PluginOperateUtils {
@Override
public void run() {
try {
// HttpClient httpClient = new HttpClient(SiteCenter.getInstance().acquireUrlByKind("plugin.plist") + "&keyword=" + keyword);
if(StringUtils.isBlank(keyword)){
if (StringUtils.isBlank(keyword)) {
getRecommendPlugins(jsCallback);
return;
}
HttpClient httpClient = new HttpClient("http://shop.finereport.com/searchApi?type=all" + "&keyword=" + keyword);
HttpClient httpClient = new HttpClient(SiteCenter.getInstance().acquireUrlByKind("shop.plugin.store") + "&keyword=" + keyword);
httpClient.asGet();
String result = httpClient.getResponseText();
JSONObject jsonObject = new JSONObject(result);
JSONArray jsonArray = jsonObject.getJSONArray("result");
JSONArray jsonArray = jsonObject.getJSONArray("result");
jsCallback.execute(jsonArray.toString());
} catch (Exception e) {
FRLogger.getLogger().error(e.getMessage());
@ -135,40 +134,39 @@ public class PluginOperateUtils {
new Thread(new Runnable() {
@Override
public void run() {
// String plistUrl = SiteCenter.getInstance().acquireUrlByKind("plugin.plist");
String plistUrl = "http://shop.finereport.com/plugins" + "?";
String plistUrl = SiteCenter.getInstance().acquireUrlByKind("shop.plugin.plist") + "?";
boolean getRecommend = StringUtils.isEmpty(category) && StringUtils.isEmpty(seller) && StringUtils.isEmpty(fee);
if (getRecommend) {
getRecommendPlugins(jsCallback);
return;
}
if (StringUtils.isNotBlank(plistUrl)) {
StringBuilder url = new StringBuilder();
url.append(plistUrl);
dealParams(url, category, seller, fee);
try {
HttpClient httpClient = new HttpClient(url.toString());
httpClient.asGet();
String result = httpClient.getResponseText();
JSONObject resultJSONObject = new JSONObject(result);
JSONArray resultArr = resultJSONObject.getJSONArray("result");
jsCallback.execute(resultArr.toString());
} catch (Exception e) {
FRLogger.getLogger().error(e.getMessage());
if (StringUtils.isNotBlank(plistUrl)) {
StringBuilder url = new StringBuilder();
url.append(plistUrl);
dealParams(url, category, seller, fee);
try {
HttpClient httpClient = new HttpClient(url.toString());
httpClient.asGet();
String result = httpClient.getResponseText();
JSONObject resultJSONObject = new JSONObject(result);
JSONArray resultArr = resultJSONObject.getJSONArray("result");
jsCallback.execute(resultArr.toString());
} catch (Exception e) {
FRLogger.getLogger().error(e.getMessage());
}
} else {
String result = PluginConstants.CONNECTION_404;
jsCallback.execute(result);
}
} else {
String result = PluginConstants.CONNECTION_404;
jsCallback.execute(result);
}
}
}).start();
}
public static void getRecommendPlugins(JSCallback jsCallback){
String plistUrl = "http://shop.finereport.com/ShopServer?pg=feature";
public static void getRecommendPlugins(JSCallback jsCallback) {
String plistUrl = SiteCenter.getInstance().acquireUrlByKind("shop.plugin.feature");
try {
HttpClient httpClient = new HttpClient(plistUrl.toString());
String result = httpClient.getResponseText();
@ -179,7 +177,7 @@ public class PluginOperateUtils {
}
public static void dealParams(StringBuilder url, String category, String seller, String fee){
public static void dealParams(StringBuilder url, String category, String seller, String fee) {
if (StringUtils.isNotBlank(category)) {
url.append("cid=").append(category.split("-")[1]);
} else {
@ -216,7 +214,7 @@ public class PluginOperateUtils {
@Override
public void run() {
String result;
String url = "http://shop.finereport.com/shopServer?pg=category";
String url = SiteCenter.getInstance().acquireUrlByKind("shop.plugin.category");
if (url != null) {
HttpClient httpClient = new HttpClient(url);
result = httpClient.getResponseText();

7
designer_base/src/com/fr/design/extra/PluginWebBridge.java

@ -44,6 +44,8 @@ public class PluginWebBridge {
private UILabel uiLabel;
private static final String DESIGNERI18PREFIX = "FR-Designer-";
/**
* 动作枚举
*/
@ -513,9 +515,8 @@ public class PluginWebBridge {
/**
* 国际化
*/
public void parseI18(final String key, final JSObject callback){
JSCallback jsCallback = new JSCallback(webEngine, callback);
jsCallback.execute(Inter.getLocText("FR-Designer-" + key));
public String parseI18(final String key){
return Inter.getLocText(DESIGNERI18PREFIX + key);
}
/**

2
designer_base/src/com/fr/design/extra/exe/callback/ModifyStatusCallback.java

@ -21,7 +21,7 @@ public class ModifyStatusCallback implements PluginTaskCallback{
public void done(PluginTaskResult result) {
if (result.isSuccess()) {
jsCallback.execute("success");
String modifyMessage = isActive ? Inter.getLocText("FR-Designer-Plugin_Actived") : Inter.getLocText("FR-Designer-Plugin_Disabled");
String modifyMessage = isActive ? Inter.getLocText("FR-Designer-Plugin_Disabled") : Inter.getLocText("FR-Designer-Plugin_Actived");
JOptionPane.showMessageDialog(null, modifyMessage);
} else {
JOptionPane.showMessageDialog(null, result.getMessage(), Inter.getLocText("FR-Designer-Plugin_Warning"), JOptionPane.ERROR_MESSAGE);

1
designer_base/src/com/fr/design/locale/designer.properties

@ -2009,6 +2009,7 @@ FR-Designer-Alphafine_No_Remind=
FR-Designer-Plugin_Install_Success=
FR-Designer-Plugin_Install_Failed=
FR-Designer-Plugin_Install_Dependence=
FR-Designer-Plugin-Install_Package=
FR-Designer-Plugin_Delete_Dependence=
FR-Designer-Plugin_Delete_Success=
FR-Designer-Plugin_Delete_Failed=

3
designer_base/src/com/fr/design/locale/designer_en_US.properties

@ -2004,9 +2004,10 @@ FR-Designer_AlphaFine_Latest=Recent
FR-Designer_AlphaFine_ShowLess=show less
FR-Designer_Alphafine=AlphaFine
FR-Designer-Alphafine_No_Remind=don't remind
FR-Designer-Plugin_Install_Success=
Designer-Plugin_Install_Success=
FR-Designer-Plugin_Install_Failed=
FR-Designer-Plugin_Install_Dependence=
FR-Designer-Plugin-Install_Package=
FR-Designer-Plugin_Delete_Dependence=
FR-Designer-Plugin_Delete_Success=
FR-Designer-Plugin_Delete_Failed=

3
designer_base/src/com/fr/design/locale/designer_ja_JP.properties

@ -1982,9 +1982,10 @@ FR-Base_UnSignIn=\ \u672A\u30ED\u30B0\u30A4\u30F3
Every=\u6BCF
CellWrite-Preview_Cell_Content=\u30BB\u30EB\u306E\u5185\u5BB9\u3092\u30D7\u30EC\u30D3\u30E5\u30FC\u3059\u308B
FormulaD-Data_Fields=\u30C7\u30FC\u30BF\u30D5\u30A3\u30FC\u30EB\u30C9
FR-Designer-Plugin_Install_Success=
Designer-Plugin_Install_Success=
FR-Designer-Plugin_Install_Failed=
FR-Designer-Plugin_Install_Dependence=
FR-Designer-Plugin-Install_Package=
FR-Designer-Plugin_Delete_Dependence=
FR-Designer-Plugin_Delete_Success=
FR-Designer-Plugin_Delete_Failed=

3
designer_base/src/com/fr/design/locale/designer_ko_KR.properties

@ -1983,9 +1983,10 @@ FR-Base_UnSignIn=\uC544\uC9C1 \uB4F1\uB85D
Every=\uAC01
CellWrite-Preview_Cell_Content=\uC140\uB0B4\uC6A9\uBBF8\uB9AC\uBCF4\uAE30
FormulaD-Data_Fields=\uB370\uC774\uD130\uD56D\uBAA9
FR-Designer-Plugin_Install_Success=
Designer-Plugin_Install_Success=
FR-Designer-Plugin_Install_Failed=
FR-Designer-Plugin_Install_Dependence=
FR-Designer-Plugin-Install_Package=
FR-Designer-Plugin_Delete_Dependence=
FR-Designer-Plugin_Delete_Success=
FR-Designer-Plugin_Delete_Failed=

3
designer_base/src/com/fr/design/locale/designer_zh_CN.properties

@ -2003,6 +2003,7 @@ FR-Designer-Alphafine_No_Remind=\u4E0D\u518D\u63D0\u793A
FR-Designer-Plugin_Install_Success=\u63D2\u4EF6\u5B89\u88C5\u6210\u529F
FR-Designer-Plugin_Install_Failed=\u63D2\u4EF6\u5B89\u88C5\u5931\u8D25
FR-Designer-Plugin_Install_Dependence=\u662F\u5426\u5B89\u88C5\u4F9D\u8D56\u73AF\u5883
FR-Designer-Plugin-Install_Package=\u63D2\u4EF6\u5B89\u88C5\u5305
FR-Designer-Plugin_Delete_Dependence=\u662F\u5426\u5220\u9664\u4F9D\u8D56\u73AF\u5883
FR-Designer-Plugin_Delete_Success=\u63D2\u4EF6\u5220\u9664\u6210\u529F
FR-Designer-Plugin_Delete_Failed=\u63D2\u4EF6\u5220\u9664\u5931\u8D25
@ -2071,4 +2072,4 @@ FR-Designer-Plugin-Store_Finereport=\u5E06\u8F6F
FR-Designer-Plugin-Store_Version=\u7248\u672C
FR-Designer-Plugin-Store_Developer=\u5F00\u53D1\u8005
FR-Designer-Plugin-Store_Jar=jar\u5305
FS-Plugin-Store_Disconnected=\u65E0\u6CD5\u8FDE\u63A5\u5E94\u7528\u4E2D\u5FC3
FR-Designer-Plugin-Store_Disconnected=\u65E0\u6CD5\u8FDE\u63A5\u5E94\u7528\u4E2D\u5FC3

3
designer_base/src/com/fr/design/locale/designer_zh_TW.properties

@ -2000,9 +2000,10 @@ FR-Designer_AlphaFine_ShowLess=\u6536\u8D77
FR-Designer_Alphafine=AlphaFine\u667A\u80FD\u641C\u7D22
FR-Designer_AlphaFine_ShowAll=\u986F\u793A\u5168\u90E8
FR-Designer-Alphafine_No_Remind=\u4E0D\u518D\u63D0\u793A
FR-Designer-Plugin_Install_Success=
Designer-Plugin_Install_Success=
FR-Designer-Plugin_Install_Failed=
FR-Designer-Plugin_Install_Dependence=
FR-Designer-Plugin-Install_Package=
FR-Designer-Plugin_Delete_Dependence=
FR-Designer-Plugin_Delete_Success=
FR-Designer-Plugin_Delete_Failed=

Loading…
Cancel
Save