|
|
@ -1,7 +1,16 @@ |
|
|
|
package com.fr.env; |
|
|
|
package com.fr.env; |
|
|
|
|
|
|
|
|
|
|
|
import com.fr.base.*; |
|
|
|
import com.fr.base.AbstractEnv; |
|
|
|
|
|
|
|
import com.fr.base.EnvException; |
|
|
|
|
|
|
|
import com.fr.base.FRContext; |
|
|
|
|
|
|
|
import com.fr.base.FRCoreContext; |
|
|
|
|
|
|
|
import com.fr.base.ModifiedTable; |
|
|
|
|
|
|
|
import com.fr.base.Parameter; |
|
|
|
|
|
|
|
import com.fr.base.StoreProcedureParameter; |
|
|
|
|
|
|
|
import com.fr.base.TableData; |
|
|
|
|
|
|
|
import com.fr.base.Utils; |
|
|
|
import com.fr.base.remote.RemoteDeziConstants; |
|
|
|
import com.fr.base.remote.RemoteDeziConstants; |
|
|
|
|
|
|
|
import com.fr.data.TableDataSource; |
|
|
|
import com.fr.data.core.DataCoreUtils; |
|
|
|
import com.fr.data.core.DataCoreUtils; |
|
|
|
import com.fr.data.core.db.TableProcedure; |
|
|
|
import com.fr.data.core.db.TableProcedure; |
|
|
|
import com.fr.data.impl.Connection; |
|
|
|
import com.fr.data.impl.Connection; |
|
|
@ -21,13 +30,25 @@ import com.fr.file.CacheManager; |
|
|
|
import com.fr.file.DatasourceManager; |
|
|
|
import com.fr.file.DatasourceManager; |
|
|
|
import com.fr.file.DatasourceManagerProvider; |
|
|
|
import com.fr.file.DatasourceManagerProvider; |
|
|
|
import com.fr.file.filetree.FileNode; |
|
|
|
import com.fr.file.filetree.FileNode; |
|
|
|
import com.fr.general.*; |
|
|
|
import com.fr.general.ComparatorUtils; |
|
|
|
|
|
|
|
import com.fr.general.FRLogger; |
|
|
|
|
|
|
|
import com.fr.general.IOUtils; |
|
|
|
|
|
|
|
import com.fr.general.Inter; |
|
|
|
|
|
|
|
import com.fr.general.LogRecordTime; |
|
|
|
|
|
|
|
import com.fr.general.VT4FR; |
|
|
|
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; |
|
|
|
import com.fr.json.JSONObject; |
|
|
|
import com.fr.json.JSONObject; |
|
|
|
import com.fr.share.ShareConstants; |
|
|
|
import com.fr.share.ShareConstants; |
|
|
|
import com.fr.stable.*; |
|
|
|
import com.fr.stable.ArrayUtils; |
|
|
|
|
|
|
|
import com.fr.stable.EncodeConstants; |
|
|
|
|
|
|
|
import com.fr.stable.JavaCompileInfo; |
|
|
|
|
|
|
|
import com.fr.stable.LicUtils; |
|
|
|
|
|
|
|
import com.fr.stable.ProductConstants; |
|
|
|
|
|
|
|
import com.fr.stable.StableUtils; |
|
|
|
|
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
|
|
|
|
import com.fr.stable.SvgProvider; |
|
|
|
import com.fr.stable.file.XMLFileManagerProvider; |
|
|
|
import com.fr.stable.file.XMLFileManagerProvider; |
|
|
|
import com.fr.stable.project.ProjectConstants; |
|
|
|
import com.fr.stable.project.ProjectConstants; |
|
|
|
import com.fr.stable.xml.XMLPrintWriter; |
|
|
|
import com.fr.stable.xml.XMLPrintWriter; |
|
|
@ -35,18 +56,40 @@ import com.fr.stable.xml.XMLTools; |
|
|
|
import com.fr.stable.xml.XMLableReader; |
|
|
|
import com.fr.stable.xml.XMLableReader; |
|
|
|
import com.fr.web.ResourceConstants; |
|
|
|
import com.fr.web.ResourceConstants; |
|
|
|
|
|
|
|
|
|
|
|
import javax.swing.*; |
|
|
|
import javax.swing.JOptionPane; |
|
|
|
import javax.xml.transform.*; |
|
|
|
import javax.swing.UIManager; |
|
|
|
|
|
|
|
import javax.xml.transform.Source; |
|
|
|
|
|
|
|
import javax.xml.transform.Transformer; |
|
|
|
|
|
|
|
import javax.xml.transform.TransformerConfigurationException; |
|
|
|
|
|
|
|
import javax.xml.transform.TransformerException; |
|
|
|
|
|
|
|
import javax.xml.transform.TransformerFactory; |
|
|
|
import javax.xml.transform.dom.DOMSource; |
|
|
|
import javax.xml.transform.dom.DOMSource; |
|
|
|
import javax.xml.transform.stream.StreamResult; |
|
|
|
import javax.xml.transform.stream.StreamResult; |
|
|
|
import java.awt.*; |
|
|
|
import java.awt.Component; |
|
|
|
import java.io.*; |
|
|
|
import java.io.BufferedReader; |
|
|
|
|
|
|
|
import java.io.ByteArrayInputStream; |
|
|
|
|
|
|
|
import java.io.ByteArrayOutputStream; |
|
|
|
|
|
|
|
import java.io.File; |
|
|
|
|
|
|
|
import java.io.FileInputStream; |
|
|
|
|
|
|
|
import java.io.FileOutputStream; |
|
|
|
|
|
|
|
import java.io.FilenameFilter; |
|
|
|
|
|
|
|
import java.io.IOException; |
|
|
|
|
|
|
|
import java.io.InputStream; |
|
|
|
|
|
|
|
import java.io.InputStreamReader; |
|
|
|
|
|
|
|
import java.io.OutputStream; |
|
|
|
|
|
|
|
import java.io.OutputStreamWriter; |
|
|
|
|
|
|
|
import java.io.UnsupportedEncodingException; |
|
|
|
import java.net.HttpURLConnection; |
|
|
|
import java.net.HttpURLConnection; |
|
|
|
import java.net.NoRouteToHostException; |
|
|
|
import java.net.NoRouteToHostException; |
|
|
|
import java.net.Socket; |
|
|
|
import java.net.Socket; |
|
|
|
import java.util.*; |
|
|
|
import java.net.URLEncoder; |
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
|
|
|
import java.util.HashMap; |
|
|
|
|
|
|
|
import java.util.Iterator; |
|
|
|
import java.util.List; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
import java.util.Map; |
|
|
|
import java.util.Timer; |
|
|
|
import java.util.Timer; |
|
|
|
|
|
|
|
import java.util.TimerTask; |
|
|
|
import java.util.logging.Level; |
|
|
|
import java.util.logging.Level; |
|
|
|
import java.util.regex.Pattern; |
|
|
|
import java.util.regex.Pattern; |
|
|
|
|
|
|
|
|
|
|
@ -112,6 +155,15 @@ public class RemoteEnv extends AbstractEnv { |
|
|
|
return password; |
|
|
|
return password; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 修复密码中包含特殊字符,无法登录的问题
|
|
|
|
|
|
|
|
private String getEncodedPassword() { |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
return URLEncoder.encode(password, "UTF-8"); |
|
|
|
|
|
|
|
} catch (UnsupportedEncodingException e) { |
|
|
|
|
|
|
|
return password; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void setPassword(String password) { |
|
|
|
public void setPassword(String password) { |
|
|
|
this.password = password; |
|
|
|
this.password = password; |
|
|
|
clearUserID(); |
|
|
|
clearUserID(); |
|
|
@ -333,7 +385,7 @@ public class RemoteEnv extends AbstractEnv { |
|
|
|
para.put("op", "fr_remote_design"); |
|
|
|
para.put("op", "fr_remote_design"); |
|
|
|
para.put("cmd", "test_server_connection"); |
|
|
|
para.put("cmd", "test_server_connection"); |
|
|
|
para.put("user", user); |
|
|
|
para.put("user", user); |
|
|
|
para.put("password", password); |
|
|
|
para.put("password", getEncodedPassword()); |
|
|
|
|
|
|
|
|
|
|
|
if (path.startsWith("https") && (!DesignerEnvManager.getEnvManager().isHttps())) { |
|
|
|
if (path.startsWith("https") && (!DesignerEnvManager.getEnvManager().isHttps())) { |
|
|
|
return false; |
|
|
|
return false; |
|
|
@ -454,7 +506,7 @@ public class RemoteEnv extends AbstractEnv { |
|
|
|
para.put("op", "fr_remote_design"); |
|
|
|
para.put("op", "fr_remote_design"); |
|
|
|
para.put("cmd", "r_sign_in"); |
|
|
|
para.put("cmd", "r_sign_in"); |
|
|
|
para.put("user", user); |
|
|
|
para.put("user", user); |
|
|
|
para.put("password", password); |
|
|
|
para.put("password", getEncodedPassword()); |
|
|
|
|
|
|
|
|
|
|
|
simulaRPC(para, true); |
|
|
|
simulaRPC(para, true); |
|
|
|
|
|
|
|
|
|
|
@ -1202,6 +1254,11 @@ public class RemoteEnv extends AbstractEnv { |
|
|
|
return DavXMLUtils.readXMLParameters(input); |
|
|
|
return DavXMLUtils.readXMLParameters(input); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public EmbeddedTableData previewTableData(Object tableData, Map parameterMap, int rowCount) throws Exception { |
|
|
|
|
|
|
|
return previewTableData(null, tableData, parameterMap, rowCount); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 根据指定的参数生成一个实际可预览的数据集 |
|
|
|
* 根据指定的参数生成一个实际可预览的数据集 |
|
|
|
* |
|
|
|
* |
|
|
@ -1211,7 +1268,7 @@ public class RemoteEnv extends AbstractEnv { |
|
|
|
* @return 实际的二维数据集 |
|
|
|
* @return 实际的二维数据集 |
|
|
|
* @throws Exception 如果生成数据失败则抛出此异常 |
|
|
|
* @throws Exception 如果生成数据失败则抛出此异常 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public EmbeddedTableData previewTableData(Object tableData, java.util.Map parameterMap, int rowCount) throws Exception { |
|
|
|
public EmbeddedTableData previewTableData(TableDataSource dataSource, Object tableData, java.util.Map parameterMap, int rowCount) throws Exception { |
|
|
|
ByteArrayOutputStream out = new ByteArrayOutputStream(); |
|
|
|
ByteArrayOutputStream out = new ByteArrayOutputStream(); |
|
|
|
|
|
|
|
|
|
|
|
// 把tableData写成xml文件到out
|
|
|
|
// 把tableData写成xml文件到out
|
|
|
@ -1250,6 +1307,11 @@ public class RemoteEnv extends AbstractEnv { |
|
|
|
return previewTableData(tableData, parameterMap, -1); |
|
|
|
return previewTableData(tableData, parameterMap, -1); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public Object previewTableData(TableDataSource dataSource, Object tableData, Map parameterMap, int start, int end, String[] cols, int[] colIdx) throws Exception { |
|
|
|
|
|
|
|
return previewTableData(dataSource, tableData, parameterMap, -1); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* nameValuePairs,这个参数要接着this.path,拼成一个URL,否则服务器端req.getParameter是无法得到的 |
|
|
|
* nameValuePairs,这个参数要接着this.path,拼成一个URL,否则服务器端req.getParameter是无法得到的 |
|
|
|
* |
|
|
|
* |
|
|
@ -1934,7 +1996,7 @@ public class RemoteEnv extends AbstractEnv { |
|
|
|
para.put("op", "fr_remote_design"); |
|
|
|
para.put("op", "fr_remote_design"); |
|
|
|
para.put("cmd", "design_get_designer_version"); |
|
|
|
para.put("cmd", "design_get_designer_version"); |
|
|
|
para.put("user", user); |
|
|
|
para.put("user", user); |
|
|
|
para.put("password", password); |
|
|
|
para.put("password", getEncodedPassword()); |
|
|
|
|
|
|
|
|
|
|
|
HttpClient client = createHttpMethod(para, true); |
|
|
|
HttpClient client = createHttpMethod(para, true); |
|
|
|
try { |
|
|
|
try { |
|
|
@ -2155,6 +2217,10 @@ public class RemoteEnv extends AbstractEnv { |
|
|
|
return StringUtils.EMPTY; |
|
|
|
return StringUtils.EMPTY; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void doWhenServerShutDown() { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public boolean isLocalEnv() { |
|
|
|
public boolean isLocalEnv() { |
|
|
|