Browse Source

将保存和删除svg地图的action放到chart中

在远程的时候,增删改svg地图时,更新mapattr
master
mengao 7 years ago
parent
commit
72d0699927
  1. 38
      designer_base/src/com/fr/env/RemoteEnv.java
  2. 4
      designer_chart/src/com/fr/design/chart/series/PlotSeries/MapGroupExtensionPane.java

38
designer_base/src/com/fr/env/RemoteEnv.java vendored

@ -56,8 +56,7 @@ import com.fr.stable.xml.XMLTools;
import com.fr.stable.xml.XMLableReader;
import com.fr.web.ResourceConstants;
import javax.swing.JOptionPane;
import javax.swing.UIManager;
import javax.swing.*;
import javax.xml.transform.Source;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerConfigurationException;
@ -65,7 +64,7 @@ import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import java.awt.Component;
import java.awt.*;
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
@ -1537,7 +1536,7 @@ public class RemoteEnv extends AbstractEnv {
testServerConnection();
HashMap<String, String> para = new HashMap<String, String>();
para.put("op", "fr_remote_design");
para.put("op", "svgrelate");
para.put("cmd", "design_save_svg");
para.put("filePath", svgFile.getFilePath());
para.put("current_uid", this.createUserID());
@ -1578,6 +1577,37 @@ public class RemoteEnv extends AbstractEnv {
return true;
}
/**
* 删除svg文件
*
* @param filePath svg文件地址
* @return 删除成功返回true
*/
public boolean deleteSvg(String filePath) {
if (filePath == null) {
return false;
}
try {
HashMap<String, String> para = new HashMap<String, String>();
para.put("op", "svgrelate");
para.put("cmd", "delete_svg");
para.put("file_path", filePath);
HttpClient client = createHttpMethod(para);
InputStream input = execute4InputStream(client);
if (input == null) {
return false;
}
return Boolean.valueOf(IOUtils.inputStream2String(input, EncodeConstants.ENCODING_UTF_8));
} catch (Exception e) {
FRLogger.getLogger().error(e.getMessage());
}
return false;
}
/**
* 写报表运行环境所需的配置文件
*

4
designer_chart/src/com/fr/design/chart/series/PlotSeries/MapGroupExtensionPane.java

@ -361,9 +361,9 @@ public class MapGroupExtensionPane extends BasicPane implements UIObserver {
groupExtensionPane.setValueAtCurrentSelectIndex(newName);
fireStateChange();
saveMapInfo(newName);
FRContext.getCurrentEnv().deleteFile(
FRContext.getCurrentEnv().deleteSvg(
StableUtils.pathJoin(new String[]{MapSvgXMLHelper.relativeDefaultMapPath(),oldName+SvgProvider.EXTENSION}));
FRContext.getCurrentEnv().deleteFile(
FRContext.getCurrentEnv().deleteSvg(
StableUtils.pathJoin(new String[]{MapSvgXMLHelper.relativeCustomMapPath(),oldName+SvgProvider.EXTENSION}));
refresh();
}catch (Exception exp){

Loading…
Cancel
Save