diff options
author | Thomas Lenz <tlenz@iaik.tugraz.at> | 2016-04-08 09:54:25 +0200 |
---|---|---|
committer | Thomas Lenz <tlenz@iaik.tugraz.at> | 2016-04-08 09:54:25 +0200 |
commit | 9231c84c9a509ba75b3e92a286941cc0792982f6 (patch) | |
tree | e098752556d0a2e143a5be7747ae651494c25d8a /id/ConfigWebTool/src/main | |
parent | 19cbabff11dd919e40eaef5e8eb50d4e35c7421f (diff) | |
download | moa-id-spss-9231c84c9a509ba75b3e92a286941cc0792982f6.tar.gz moa-id-spss-9231c84c9a509ba75b3e92a286941cc0792982f6.tar.bz2 moa-id-spss-9231c84c9a509ba75b3e92a286941cc0792982f6.zip |
fix configurationTool BKU-selection preview problem
Diffstat (limited to 'id/ConfigWebTool/src/main')
-rw-r--r-- | id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/BasicOAAction.java | 34 |
1 files changed, 23 insertions, 11 deletions
diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/BasicOAAction.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/BasicOAAction.java index c80bc1925..5bc17f1ee 100644 --- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/BasicOAAction.java +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/BasicOAAction.java @@ -29,6 +29,8 @@ import java.io.FileInputStream; import java.io.InputStream; import java.io.InputStreamReader; import java.io.StringWriter; +import java.io.UnsupportedEncodingException; +import java.net.URI; import java.util.ArrayList; import java.util.Arrays; import java.util.Iterator; @@ -84,7 +86,7 @@ public class BasicOAAction extends BasicAction { private boolean newOA; private boolean isMetaDataRefreshRequired = false; - private InputStream stream; + private InputStream stream = null; /** * @@ -587,8 +589,8 @@ public class BasicOAAction extends BasicAction { ConfigurationProvider config = ConfigurationProvider.getInstance(); String templateURL = config.getConfigRootDir() + ConfigurationProvider.HTMLTEMPLATE_DIR + ConfigurationProvider.HTMLTEMPLATE_FILE; - - File file = new File(templateURL); + + File file = new File(new URI(templateURL)); input = new FileInputStream(file); String contextpath = config.getMOAIDInstanceURL(); @@ -656,6 +658,15 @@ public class BasicOAAction extends BasicAction { } + if (stream == null && MiscUtil.isNotEmpty(preview)) { + try { + stream = new ByteArrayInputStream(preview.getBytes("UTF-8")); + + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + + } + } return Constants.STRUTS_SUCCESS; @@ -699,12 +710,13 @@ public class BasicOAAction extends BasicAction { public void setPvp2OA(OAPVP2Config pvp2oa) { formList.put(pvp2oa.getName(), pvp2oa); } - - /** - * @return the stream - */ - public InputStream getStream() { - return stream; - } - + + /** + * @return the stream + */ + public InputStream getStream() { + return stream; + } + + } |