Browse Source

Merge pull request #1381 in BA/design from ~DANIEL/finereport_design:release/9.0 to release/9.0

* commit 'ceaaec6137e89879fbdd6b6cd35290841c8a4a74':
  PFC-1053
  PFC-1053
master
superman 7 years ago
parent
commit
5fb2d05ded
  1. 1
      build.9.0.gradle
  2. 88
      designer/src/com/fr/design/mainframe/InformationCollector.java
  3. 6
      designer_base/src/com/fr/design/extra/LoginWebBridge.java
  4. 15
      designer_base/src/com/fr/design/extra/PluginWebBridge.java

1
build.9.0.gradle

@ -15,6 +15,7 @@ task appletJar<<{
fileset(dir:"${basicDir}/report/build/classes/main")
fileset(dir:"${basicDir}/platform/build/classes/main")
}
unjar(src:"${libDir}/fr-core-9.0.jar",dest:"./tmp")
unjar(src:"${libDir}/fr-third-9.0.jar",dest:"./tmp")
unjar(src:"${libDir}/servlet-api.jar",dest:"./tmp")
jar(jarfile:"build/libs/fr-applet-9.0.jar"){

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

@ -3,7 +3,7 @@
*/
package com.fr.design.mainframe;
import com.fr.base.ConfigManager;
import com.fr.base.ConfigManagerFactory;
import com.fr.base.FRContext;
import com.fr.data.core.db.DBUtils;
import com.fr.data.core.db.dialect.DialectFactory;
@ -13,23 +13,51 @@ import com.fr.data.core.db.dml.Table;
import com.fr.design.DesignerEnvManager;
import com.fr.design.mainframe.errorinfo.ErrorInfoUploader;
import com.fr.design.mainframe.templateinfo.TemplateInfoCollector;
import com.fr.general.*;
import com.fr.general.ComparatorUtils;
import com.fr.general.DateUtils;
import com.fr.general.DesUtils;
import com.fr.general.GeneralUtils;
import com.fr.general.IOUtils;
import com.fr.general.SiteCenter;
import com.fr.general.http.HttpClient;
import com.fr.json.JSONArray;
import com.fr.json.JSONException;
import com.fr.json.JSONObject;
import com.fr.record.DBRecordManager;
import com.fr.stable.*;
import com.fr.stable.xml.*;
import com.fr.stable.ArrayUtils;
import com.fr.stable.EncodeConstants;
import com.fr.stable.ProductConstants;
import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils;
import com.fr.stable.xml.XMLPrintWriter;
import com.fr.stable.xml.XMLReadable;
import com.fr.stable.xml.XMLTools;
import com.fr.stable.xml.XMLWriter;
import com.fr.stable.xml.XMLableReader;
import com.fr.third.javax.xml.stream.XMLStreamException;
import org.json.JSONObject;
import java.io.*;
import java.io.BufferedWriter;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.UnsupportedEncodingException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.text.DateFormat;
import java.util.*;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author neil
@ -126,19 +154,23 @@ public class InformationCollector implements XMLReadable, XMLWriter {
JSONArray startStopArray = new JSONArray();
for (int i = 0; i < startStop.size(); i++) {
JSONObject jo = new JSONObject();
jo.put(ATTR_START, startStop.get(i).getStartDate());
jo.put(ATTR_STOP, startStop.get(i).getStopDate());
startStopArray.put(jo);
try {
jo.put(ATTR_START, startStop.get(i).getStartDate());
jo.put(ATTR_STOP, startStop.get(i).getStopDate());
startStopArray.put(jo);
DesignerEnvManager envManager = DesignerEnvManager.getEnvManager();
content.put(XML_START_STOP, startStopArray);
content.put(XML_UUID, envManager.getUUID());
content.put(XML_JAR, GeneralUtils.readBuildNO());
content.put(XML_VERSION, ProductConstants.RELEASE_VERSION);
content.put(XML_USERNAME, ConfigManagerFactory.getProviderInstance().getBbsUsername());
content.put(XML_KEY, envManager.getActivationKey());
content.put(XML_OS, System.getProperty("os.name"));
} catch (JSONException e) {
FRContext.getLogger().error(e.getMessage(), e);
}
}
DesignerEnvManager envManager = DesignerEnvManager.getEnvManager();
content.put(XML_START_STOP, startStopArray);
content.put(XML_UUID, envManager.getUUID());
content.put(XML_JAR, GeneralUtils.readBuildNO());
content.put(XML_VERSION, ProductConstants.RELEASE_VERSION);
content.put(XML_USERNAME, ConfigManager.getProviderInstance().getBbsUsername());
content.put(XML_KEY, envManager.getActivationKey());
content.put(XML_OS, System.getProperty("os.name"));
try {
return content.toString().getBytes(EncodeConstants.ENCODING_UTF_8);
} catch (UnsupportedEncodingException e) {
@ -162,7 +194,12 @@ public class InformationCollector implements XMLReadable, XMLWriter {
}
String res = hc.getResponseText();
//服务器返回true,说明已经取得成功,清空当前记录的信息
boolean success = ComparatorUtils.equals(new JSONObject(res).get("status"), "success");
boolean success = false;
try {
success = ComparatorUtils.equals(new JSONObject(res).get("status"), "success");
} catch (JSONException e) {
FRContext.getLogger().error(e.getMessage(), e);
}
if (success){
this.reset();
}
@ -202,8 +239,13 @@ public class InformationCollector implements XMLReadable, XMLWriter {
}
String res = httpClient.getResponseText();
boolean success = ComparatorUtils.equals(new JSONObject(res).get("status"), "success");
//服务器返回true, 说明已经获取成功, 清空当前记录的信息
boolean success = false;
try {
success = ComparatorUtils.equals(new JSONObject(res).get("status"), "success");
} catch (JSONException e) {
FRContext.getLogger().error(e.getMessage(), e);
}
//服务器返回true, 说明已经获取成功, 清空当前记录的信息
if (success) {
deleteLogDB(conn, table);
}
@ -255,7 +297,7 @@ public class InformationCollector implements XMLReadable, XMLWriter {
}
DesignerEnvManager envManager = DesignerEnvManager.getEnvManager();
content.put("username", ConfigManager.getProviderInstance().getBbsUsername());
content.put("username", ConfigManagerFactory.getProviderInstance().getBbsUsername());
content.put("uuid", envManager.getUUID());
content.put("functions", functionArray);

6
designer_base/src/com/fr/design/extra/LoginWebBridge.java

@ -2,7 +2,6 @@ package com.fr.design.extra;
import com.fr.base.ConfigManager;
import com.fr.base.FRContext;
import com.fr.design.DesignerEnvManager;
import com.fr.design.bbs.BBSLoginUtils;
import com.fr.design.dialog.UIDialog;
import com.fr.design.extra.ucenter.Client;
@ -10,6 +9,7 @@ import com.fr.design.extra.ucenter.XMLHelper;
import com.fr.design.gui.ilable.UILabel;
import com.fr.general.SiteCenter;
import com.fr.general.http.HttpClient;
import com.fr.json.JSONObject;
import com.fr.stable.EncodeConstants;
import com.fr.stable.StringUtils;
import javafx.scene.web.WebEngine;
@ -312,9 +312,9 @@ public class LoginWebBridge {
* @param userInfo
*/
public void getLoginInfo(String userInfo) {
org.json.JSONObject jo = new org.json.JSONObject(userInfo);
String status = jo.get("status").toString();
try{
JSONObject jo = new JSONObject(userInfo);
String status = jo.get("status").toString();
if (status.equals(LOGIN_SUCCESS)) {
String username = jo.get("username").toString();
int uid = Integer.parseInt(jo.get("uid") == null ? "" : jo.get("uid").toString());

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

@ -10,6 +10,8 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.general.FRLogger;
import com.fr.general.Inter;
import com.fr.general.SiteCenter;
import com.fr.json.JSONException;
import com.fr.json.JSONObject;
import com.fr.plugin.context.PluginContext;
import com.fr.plugin.context.PluginMarker;
import com.fr.plugin.manage.PluginManager;
@ -19,7 +21,6 @@ import javafx.scene.web.WebEngine;
import javafx.stage.FileChooser;
import javafx.stage.Stage;
import netscape.javascript.JSObject;
import org.json.JSONObject;
import javax.swing.*;
import java.awt.*;
@ -91,10 +92,14 @@ public class PluginWebBridge {
public String getRunConfig() {
if (action != null) {
JSONObject jsonObject = new JSONObject();
jsonObject.put(ACTION, action.getContext());
Set<String> keySet = config.keySet();
for (String key : keySet) {
jsonObject.put(key, config.get(key).toString());
try {
jsonObject.put(ACTION, action.getContext());
Set<String> keySet = config.keySet();
for (String key : keySet) {
jsonObject.put(key, config.get(key).toString());
}
} catch (JSONException e) {
FRContext.getLogger().error(e.getMessage(), e);
}
return jsonObject.toString();
}

Loading…
Cancel
Save