Browse Source

Merge pull request #31 in BA/design from ~RICHIE/design:dev to dev

* commit '38e38a990f42ec8dbe246ddcfb97a9420d6a7f5f':
  统一管理地址
  统一管理地址
master
eason 9 years ago
parent
commit
38c05fda18
  1. 3
      designer/src/com/fr/design/mainframe/ActiveKeyGenerator.java
  2. 6
      designer/src/com/fr/design/mainframe/InformationCollector.java
  3. 14
      designer/src/com/fr/design/mainframe/bbs/BBSConstants.java
  4. 3
      designer/src/com/fr/design/mainframe/bbs/BBSDialog.java
  5. 9
      designer/src/com/fr/design/mainframe/bbs/UserInfoLabel.java
  6. 3
      designer/src/com/fr/design/report/share/ShareButton.java
  7. 2
      designer_base/designer_base.iml
  8. 3
      designer_base/src/com/fr/design/actions/help/ForumAction.java
  9. 16
      designer_base/src/com/fr/design/extra/PluginConstants.java
  10. 10
      designer_base/src/com/fr/design/extra/PluginHelper.java
  11. 17
      designer_base/src/com/fr/design/extra/PluginManagerPane.java
  12. 5
      designer_base/src/com/fr/design/extra/PluginsReaderFromStore.java

3
designer/src/com/fr/design/mainframe/ActiveKeyGenerator.java

@ -2,6 +2,7 @@ package com.fr.design.mainframe;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
import com.fr.design.mainframe.bbs.BBSConstants; import com.fr.design.mainframe.bbs.BBSConstants;
import com.fr.general.SiteCenter;
import com.fr.general.http.HttpClient; import com.fr.general.http.HttpClient;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.stable.core.UUID; import com.fr.stable.core.UUID;
@ -101,7 +102,7 @@ public class ActiveKeyGenerator {
para.put("uuid", envManager.getUUID()); para.put("uuid", envManager.getUUID());
para.put("key", key); para.put("key", key);
para.put("username", envManager.getBBSName()); para.put("username", envManager.getBBSName());
HttpClient hc = new HttpClient(BBSConstants.VERIFY_URL, para); HttpClient hc = new HttpClient(SiteCenter.getInstance().acquireUrlByKind("verify.code"), para);
if (timeout != -1) { if (timeout != -1) {
hc.setTimeout(timeout); hc.setTimeout(timeout);
} }

6
designer/src/com/fr/design/mainframe/InformationCollector.java

@ -51,8 +51,6 @@ public class InformationCollector implements XMLReadable, XMLWriter {
private static final String XML_KEY = "ActiveKey"; private static final String XML_KEY = "ActiveKey";
private static final String XML_OS = "OS"; private static final String XML_OS = "OS";
public static final String FUNCTIONS_INFO = "http://feedback.finedevelop.com:3000/monitor/function/record";
public static final String USER_INFO = "http://feedback.finedevelop.com:3000/monitor/userinfo/record";
public static final String TABLE_NAME = "fr_functionrecord"; public static final String TABLE_NAME = "fr_functionrecord";
public static final String FUNC_COLUMNNAME = "func"; public static final String FUNC_COLUMNNAME = "func";
@ -154,7 +152,7 @@ public class InformationCollector implements XMLReadable, XMLWriter {
return; return;
} }
byte[] content = getJSONContentAsByte(); byte[] content = getJSONContentAsByte();
HttpClient hc = new HttpClient(USER_INFO); HttpClient hc = new HttpClient(SiteCenter.getInstance().acquireUrlByKind("user.info"));
hc.setContent(content); hc.setContent(content);
if (!hc.isServerAlive()) { if (!hc.isServerAlive()) {
return; return;
@ -192,7 +190,7 @@ public class InformationCollector implements XMLReadable, XMLWriter {
DBUtils.closeConnection(conn); DBUtils.closeConnection(conn);
} }
HttpClient httpClient = new HttpClient(FUNCTIONS_INFO); HttpClient httpClient = new HttpClient(SiteCenter.getInstance().acquireUrlByKind("functions.info"));
httpClient.setContent(content); httpClient.setContent(content);
httpClient.setTimeout(5000); httpClient.setTimeout(5000);

14
designer/src/com/fr/design/mainframe/bbs/BBSConstants.java

@ -14,20 +14,6 @@ import java.util.Properties;
*/ */
public class BBSConstants { public class BBSConstants {
//获取当前登陆用户未读取消息条数
public static final String GET_MESSAGE_URL = loadAttribute("GET_MESSAGE_URL", "http://feedback.finedevelop.com:3000/bbs/message/count");
//默认打开的论坛窗口
public static final String DEFAULT_URL = loadAttribute("DEFAULT_URL", "http://bbs.finereport.com/home.php?mod=space&do=pm");
//默认模板分享的url
public static final String SHARE_URL = loadAttribute("SHARE_URL", "http://bbs.finereport.com/");
//收集设计器的信息url
public static final String COLLECT_URL = loadAttribute("COLLECT_URL", "http://bbs.finereport.com/");
//在线验证激活码
public static final String VERIFY_URL = loadAttribute("VERIFY_URL", "http://bbs.finereport.com/");
//获取论坛更新信息, 判断是否需要弹窗
public static final String UPDATE_INFO_URL = loadAttribute("UPDATE_INFO_URL", "http://bbs.finereport.com/");
//论坛手机版
public static final String BBS_MOBILE_MOD = loadAttribute("BBS_MOBILE_MOD", "http://bbs.finereport.com/forum.php?mobile=1");
//判断是否更新的关键字 //判断是否更新的关键字
public static final String UPDATE_KEY = loadAttribute("UPDATE_KEY", "newIsPopup"); public static final String UPDATE_KEY = loadAttribute("UPDATE_KEY", "newIsPopup");

3
designer/src/com/fr/design/mainframe/bbs/BBSDialog.java

@ -5,6 +5,7 @@ import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.FRLogger; import com.fr.general.FRLogger;
import com.fr.general.SiteCenter;
import javafx.application.Platform; import javafx.application.Platform;
import javafx.beans.value.ChangeListener; import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue; import javafx.beans.value.ObservableValue;
@ -96,7 +97,7 @@ public class BBSDialog extends UIDialog {
{ {
disableLink(eng); disableLink(eng);
// webView好像默认以手机版显示网页,浏览器里过滤掉这个跳转 // webView好像默认以手机版显示网页,浏览器里过滤掉这个跳转
if(ComparatorUtils.equals(newValue, url) || ComparatorUtils.equals(newValue, BBSConstants.BBS_MOBILE_MOD)){ if(ComparatorUtils.equals(newValue, url) || ComparatorUtils.equals(newValue, SiteCenter.getInstance().acquireUrlByKind("bbs.mobile"))){
return; return;
} }
openUrlAtLocalWebBrowser(eng,newValue); openUrlAtLocalWebBrowser(eng,newValue);

9
designer/src/com/fr/design/mainframe/bbs/UserInfoLabel.java

@ -11,6 +11,7 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.DateUtils; import com.fr.general.DateUtils;
import com.fr.general.SiteCenter;
import com.fr.general.http.HttpClient; import com.fr.general.http.HttpClient;
import com.fr.stable.EncodeConstants; import com.fr.stable.EncodeConstants;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
@ -112,7 +113,7 @@ public class UserInfoLabel extends UILabel{
FRContext.getLogger().error(e.getMessage()); FRContext.getLogger().error(e.getMessage());
} }
HttpClient hc = new HttpClient(BBSConstants.UPDATE_INFO_URL); HttpClient hc = new HttpClient(SiteCenter.getInstance().acquireUrlByKind("bbs.popup"));
if (!hc.isServerAlive()){ if (!hc.isServerAlive()){
return; return;
} }
@ -124,7 +125,7 @@ public class UserInfoLabel extends UILabel{
try { try {
BBSDialog bbsLabel = new BBSDialog(DesignerContext.getDesignerFrame()); BBSDialog bbsLabel = new BBSDialog(DesignerContext.getDesignerFrame());
bbsLabel.showWindow(BBSConstants.UPDATE_INFO_URL); bbsLabel.showWindow(SiteCenter.getInstance().acquireUrlByKind("bbs.popup"));
DesignerEnvManager.getEnvManager().setLastShowBBSNewsTime(DateUtils.DATEFORMAT2.format(new Date())); DesignerEnvManager.getEnvManager().setLastShowBBSNewsTime(DateUtils.DATEFORMAT2.format(new Date()));
} catch (Throwable e) { } catch (Throwable e) {
@ -181,7 +182,7 @@ public class UserInfoLabel extends UILabel{
while(StringUtils.isNotEmpty(DesignerEnvManager.getEnvManager().getBBSName())){ while(StringUtils.isNotEmpty(DesignerEnvManager.getEnvManager().getBBSName())){
HashMap<String, String> para = new HashMap<String, String>(); HashMap<String, String> para = new HashMap<String, String>();
para.put("username", encode(encode(userName))); para.put("username", encode(encode(userName)));
HttpClient getMessage = new HttpClient(BBSConstants.GET_MESSAGE_URL, para); HttpClient getMessage = new HttpClient(SiteCenter.getInstance().acquireUrlByKind("bbs.message"), para);
getMessage.asGet(); getMessage.asGet();
if(getMessage.isServerAlive()){ if(getMessage.isServerAlive()){
try { try {
@ -243,7 +244,7 @@ public class UserInfoLabel extends UILabel{
public void mouseClicked(MouseEvent e) { public void mouseClicked(MouseEvent e) {
if(StringUtils.isNotEmpty(userName)){ if(StringUtils.isNotEmpty(userName)){
try { try {
Desktop.getDesktop().browse(new URI(BBSConstants.DEFAULT_URL)); Desktop.getDesktop().browse(new URI(SiteCenter.getInstance().acquireUrlByKind("bbs.default")));
} catch (Exception exp) { } catch (Exception exp) {
} }

3
designer/src/com/fr/design/report/share/ShareButton.java

@ -20,6 +20,7 @@ import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.file.FILE; import com.fr.file.FILE;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.general.NameObject; import com.fr.general.NameObject;
import com.fr.general.SiteCenter;
import com.fr.io.exporter.ImageExporter; import com.fr.io.exporter.ImageExporter;
import com.fr.main.TemplateWorkBook; import com.fr.main.TemplateWorkBook;
import com.fr.main.workbook.ResultWorkBook; import com.fr.main.workbook.ResultWorkBook;
@ -56,7 +57,7 @@ public class ShareButton extends UIButton{
//打开论坛, url可在bbs.properties中配置 //打开论坛, url可在bbs.properties中配置
private void openBBS(){ private void openBBS(){
try { try {
Desktop.getDesktop().browse(new URI(BBSConstants.SHARE_URL)); Desktop.getDesktop().browse(new URI(SiteCenter.getInstance().acquireUrlByKind("bbs.share")));
} catch (Exception e1) { } catch (Exception e1) {
FRContext.getLogger().error(e1.getMessage()); FRContext.getLogger().error(e1.getMessage());
} }

2
designer_base/designer_base.iml

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4"> <module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="false"> <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/../../../env/8.0/WebReport/WEB-INF/classes" /> <output url="file://$MODULE_DIR$/../../env/WebReport/WEB-INF/classes" />
<content url="file://$MODULE_DIR$"> <content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content> </content>

3
designer_base/src/com/fr/design/actions/help/ForumAction.java

@ -9,6 +9,7 @@ import com.fr.base.FRContext;
import com.fr.design.actions.UpdateAction; import com.fr.design.actions.UpdateAction;
import com.fr.design.menu.MenuKeySet; import com.fr.design.menu.MenuKeySet;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.general.SiteCenter;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.*; import javax.swing.*;
@ -38,7 +39,7 @@ public class ForumAction extends UpdateAction {
* @param e 事件 * @param e 事件
*/ */
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
String url = "http://bbs.finereport.com/"; String url = SiteCenter.getInstance().acquireUrlByKind("bbs");
if (StringUtils.isEmpty(url)) { if (StringUtils.isEmpty(url)) {
FRContext.getLogger().info("The URL is empty!"); FRContext.getLogger().info("The URL is empty!");
return; return;

16
designer_base/src/com/fr/design/extra/PluginConstants.java

@ -7,22 +7,6 @@ package com.fr.design.extra;
*/ */
public class PluginConstants { public class PluginConstants {
public static final String PLUGIN_INSTALL_INFO = "http://feedback.finedevelop.com:3000/plugin";
/**
* 获取所有插件的服务器地址
*/
public static final String PLUGIN_STORE_URL = "http://shop.finereport.com/ShopServer?pg=all_plugin";
/**
* 获取插件更新信息的服务器地址
*/
public static final String PLUGIN_CHECK_UPDATE_URL = "http://shop.finereport.com/ShopServer?pg=all_plugin";
/**
* 插件下载服务器地址
*/
public static final String PLUGIN_DOWNLOAD_URL = "http://shop.finereport.com/ShopServer?pg=plugin";
public static final int BYTES_NUM = 1024; public static final int BYTES_NUM = 1024;

10
designer_base/src/com/fr/design/extra/PluginHelper.java

@ -3,11 +3,7 @@ package com.fr.design.extra;
import com.fr.base.Env; import com.fr.base.Env;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
import com.fr.general.ComparatorUtils; import com.fr.general.*;
import com.fr.general.FRLogger;
import com.fr.general.GeneralUtils;
import com.fr.general.IOUtils;
import com.fr.general.Inter;
import com.fr.general.http.HttpClient; import com.fr.general.http.HttpClient;
import com.fr.plugin.Plugin; import com.fr.plugin.Plugin;
import com.fr.plugin.PluginLoader; import com.fr.plugin.PluginLoader;
@ -73,7 +69,7 @@ public class PluginHelper {
map.put("id", id); map.put("id", id);
map.put("username", username); map.put("username", username);
map.put("password", password); map.put("password", password);
HttpClient httpClient = new HttpClient(PluginConstants.PLUGIN_DOWNLOAD_URL, map); HttpClient httpClient = new HttpClient(SiteCenter.getInstance().acquireUrlByKind("plugin.download"), map);
String resText = httpClient.getResponseText(); String resText = httpClient.getResponseText();
String charSet = EncodeConstants.ENCODING_UTF_8; String charSet = EncodeConstants.ENCODING_UTF_8;
resText = URLDecoder.decode(URLDecoder.decode(resText, charSet), charSet); resText = URLDecoder.decode(URLDecoder.decode(resText, charSet), charSet);
@ -288,7 +284,7 @@ public class PluginHelper {
map.put("detail", plugin.toJSONObject().toString()); map.put("detail", plugin.toJSONObject().toString());
map.put("build", GeneralUtils.readBuildNO()); map.put("build", GeneralUtils.readBuildNO());
//第三个参数encode, nodejs服务器那边如果参数不encode, 带了空格会报错, 直接用urlconnection也是一样, jetty没能还原. //第三个参数encode, nodejs服务器那边如果参数不encode, 带了空格会报错, 直接用urlconnection也是一样, jetty没能还原.
HttpClient httpClient = new HttpClient(PluginConstants.PLUGIN_INSTALL_INFO, map, true); HttpClient httpClient = new HttpClient(SiteCenter.getInstance().acquireUrlByKind("plugin.install"), map, true);
httpClient.setTimeout(TIME_OUT); httpClient.setTimeout(TIME_OUT);
httpClient.asGet(); httpClient.asGet();
return httpClient.getResponseText(); return httpClient.getResponseText();

17
designer_base/src/com/fr/design/extra/PluginManagerPane.java

@ -37,14 +37,15 @@ public class PluginManagerPane extends BasicPane {
public PluginManagerPane() { public PluginManagerPane() {
setLayout(new BorderLayout()); setLayout(new BorderLayout());
if (StableUtils.isDebug()) { // if (StableUtils.isDebug()) {
URL url = ClassLoader.getSystemResource(""); // URL url = ClassLoader.getSystemResource("");
String installHome = url.getPath(); // String installHome = url.getPath();
PluginWebPane webPane = new PluginWebPane(installHome); // PluginWebPane webPane = new PluginWebPane(installHome);
add(webPane, BorderLayout.CENTER); // add(webPane, BorderLayout.CENTER);
} else { // } else {
initTraditionalStore(); //
} // }
initTraditionalStore();
} }
private void initTraditionalStore() { private void initTraditionalStore() {

5
designer_base/src/com/fr/design/extra/PluginsReaderFromStore.java

@ -2,6 +2,7 @@ package com.fr.design.extra;
import com.fr.general.GeneralUtils; import com.fr.general.GeneralUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.general.SiteCenter;
import com.fr.general.http.HttpClient; import com.fr.general.http.HttpClient;
import com.fr.json.JSONArray; import com.fr.json.JSONArray;
import com.fr.json.JSONException; import com.fr.json.JSONException;
@ -32,7 +33,7 @@ public class PluginsReaderFromStore {
public static Plugin[] readPlugins() throws Exception { public static Plugin[] readPlugins() throws Exception {
String resText; String resText;
try { try {
HttpClient httpClient = new HttpClient(PluginConstants.PLUGIN_STORE_URL); HttpClient httpClient = new HttpClient(SiteCenter.getInstance().acquireUrlByKind("plugin.store"));
resText = httpClient.getResponseText(); resText = httpClient.getResponseText();
String charSet = EncodeConstants.ENCODING_UTF_8; String charSet = EncodeConstants.ENCODING_UTF_8;
resText = URLDecoder.decode(URLDecoder.decode(resText, charSet), charSet); resText = URLDecoder.decode(URLDecoder.decode(resText, charSet), charSet);
@ -70,7 +71,7 @@ public class PluginsReaderFromStore {
para.put("plugins", PluginLoader.getLoader().pluginsToString()); para.put("plugins", PluginLoader.getLoader().pluginsToString());
//只有当前设计器的jar高于插件新版本需要的jarTime时, 才提示更新该插件. //只有当前设计器的jar高于插件新版本需要的jarTime时, 才提示更新该插件.
para.put("jarTime", GeneralUtils.readBuildNO()); para.put("jarTime", GeneralUtils.readBuildNO());
HttpClient httpClient = new HttpClient(PluginConstants.PLUGIN_CHECK_UPDATE_URL, para); HttpClient httpClient = new HttpClient(SiteCenter.getInstance().acquireUrlByKind("plugin.update"), para);
resText = httpClient.getResponseText(); resText = httpClient.getResponseText();
String charSet = EncodeConstants.ENCODING_UTF_8; String charSet = EncodeConstants.ENCODING_UTF_8;
resText = URLDecoder.decode(URLDecoder.decode(resText, charSet), charSet); resText = URLDecoder.decode(URLDecoder.decode(resText, charSet), charSet);

Loading…
Cancel
Save