diff --git a/README.md b/README.md index 48d834c0..2205aa10 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ The goal of this project is to provide a high quality product that can be deploy The following products must be installed: - * Java Development Kit 7 or higher ([http://www.oracle.com/technetwork/java/javase/downloads/index.html]) + * Java Development Kit 8 or higher ([http://www.oracle.com/technetwork/java/javase/downloads/index.html]) * Maven 3.x or higher ([http://maven.apache.org/]) ### Compiling @@ -49,6 +49,10 @@ To test the javascript frontend you then do: Now open a browser using the URL http://localhost:8000/wise-editor/src/main/webapp/ +## Maintenance + + + ## Members ### Founders @@ -70,3 +74,4 @@ Now open a browser using the URL http://localhost:8000/wise-editor/src/main/weba The source code is Licensed under the WiseMapping Open License, Version 1.0 (the “License”); You may obtain a copy of the License at: [https://wisemapping.atlassian.net/wiki/display/WS/License] + diff --git a/core-js/pom.xml b/core-js/pom.xml index 672bd5f1..a64965bf 100644 --- a/core-js/pom.xml +++ b/core-js/pom.xml @@ -9,7 +9,7 @@ org.wisemapping wisemapping ../pom.xml - 4.0.4 + 4.0.5-SNAPSHOT scm:git:git@bitbucket.org:wisemapping/wisemapping-open-source.git diff --git a/mindplot/pom.xml b/mindplot/pom.xml index 03196aec..137b3e8d 100644 --- a/mindplot/pom.xml +++ b/mindplot/pom.xml @@ -9,7 +9,7 @@ org.wisemapping wisemapping ../pom.xml - 4.0.4 + 4.0.5-SNAPSHOT diff --git a/pom.xml b/pom.xml index e10b86e0..09c0b704 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ http://maven.apache.org/xsd/maven-4.0.0.xsd"> - 4.0.4 + 4.0.5-SNAPSHOT ${project.basedir}/wise-webapps @@ -16,7 +16,7 @@ org.wisemapping wisemapping WiseMapping Project - 4.0.4 + 4.0.5-SNAPSHOT pom diff --git a/web2d/pom.xml b/web2d/pom.xml index d4a75612..732c81a6 100644 --- a/web2d/pom.xml +++ b/web2d/pom.xml @@ -9,7 +9,7 @@ org.wisemapping wisemapping ../pom.xml - 4.0.4 + 4.0.5-SNAPSHOT diff --git a/wise-editor/pom.xml b/wise-editor/pom.xml index f0b13ab7..a1a1ec4a 100644 --- a/wise-editor/pom.xml +++ b/wise-editor/pom.xml @@ -9,7 +9,7 @@ org.wisemapping wisemapping ../pom.xml - 4.0.4 + 4.0.5-SNAPSHOT diff --git a/wise-webapp/pom.xml b/wise-webapp/pom.xml index cfaed2b2..f8af1bf3 100644 --- a/wise-webapp/pom.xml +++ b/wise-webapp/pom.xml @@ -9,7 +9,7 @@ org.wisemapping wisemapping ../pom.xml - 4.0.4 + 4.0.5-SNAPSHOT @@ -211,7 +211,7 @@ org.apache.xmlgraphics batik-transcoder - 1.9.1 + 1.10 compile @@ -223,13 +223,8 @@ org.apache.xmlgraphics batik-codec - 1.9.1 + 1.10 - - - - - javax javaee-api @@ -576,6 +571,7 @@ false foo + true 9999 ${project.build.directory}/wisemapping.war automatic diff --git a/wise-webapp/src/main/java/com/wisemapping/exporter/ExportProperties.java b/wise-webapp/src/main/java/com/wisemapping/exporter/ExportProperties.java index 64f7ef35..4fb7488f 100644 --- a/wise-webapp/src/main/java/com/wisemapping/exporter/ExportProperties.java +++ b/wise-webapp/src/main/java/com/wisemapping/exporter/ExportProperties.java @@ -48,7 +48,7 @@ public class ExportProperties { this.version = version; } - static public class GenericProperties extends ExportProperties { + private static class GenericProperties extends ExportProperties { private GenericProperties(ExportFormat format) { super(format); } @@ -65,7 +65,7 @@ public class ExportProperties { this.size = size; } - public ImageProperties(ExportFormat format) { + ImageProperties(ExportFormat format) { super(format); } diff --git a/wise-webapp/src/main/java/com/wisemapping/exporter/ExporterFactory.java b/wise-webapp/src/main/java/com/wisemapping/exporter/ExporterFactory.java index a2ffd1f8..a4c6ebb0 100644 --- a/wise-webapp/src/main/java/com/wisemapping/exporter/ExporterFactory.java +++ b/wise-webapp/src/main/java/com/wisemapping/exporter/ExporterFactory.java @@ -19,6 +19,7 @@ package com.wisemapping.exporter; import com.wisemapping.importer.VersionNumber; +import org.apache.batik.ext.awt.image.rendered.TileCache; import org.apache.batik.parser.AWTTransformProducer; import org.apache.batik.parser.ParseException; import org.apache.batik.parser.TransformListParser; @@ -49,26 +50,33 @@ import javax.xml.transform.stream.StreamResult; import javax.xml.xpath.*; import java.awt.geom.AffineTransform; import java.io.*; +import java.nio.charset.StandardCharsets; import java.util.regex.Pattern; public class ExporterFactory { + + static { + // Try to prevent OOM. + TileCache.setSize(0); + } private static final String GROUP_NODE_NAME = "g"; private static final String IMAGE_NODE_NAME = "image"; - public static final int MANGING = 50; - public static final String UTF_8_CHARSET_NAME = "UTF-8"; + private static final int MANGING = 50; + private static final String UTF_8_CHARSET_NAME = "UTF-8"; private File baseImgDir; - public ExporterFactory(@NotNull final ServletContext servletContext) throws ParserConfigurationException { + public ExporterFactory(@NotNull final ServletContext servletContext) { this.baseImgDir = new File(servletContext.getRealPath("/")); } - public ExporterFactory(@NotNull final File baseImgDir) throws ParserConfigurationException { + public ExporterFactory(@NotNull final File baseImgDir) { this.baseImgDir = baseImgDir; } public void export(@NotNull ExportProperties properties, @Nullable String xml, @NotNull OutputStream output, @Nullable String mapSvg) throws ExportException, IOException, TranscoderException { final ExportFormat format = properties.getFormat(); + switch (format) { case PNG: { // Create a JPEG transcoder @@ -80,18 +88,20 @@ public class ExporterFactory { // Create the transcoder input. final String svgString = normalizeSvg(mapSvg); - final TranscoderInput input = new TranscoderInput(new CharArrayReader(svgString.toCharArray())); + final CharArrayReader reader = new CharArrayReader(svgString.toCharArray()); + final TranscoderInput input = new TranscoderInput(reader); - TranscoderOutput trascoderOutput = new TranscoderOutput(output); + TranscoderOutput transcoderOutput = new TranscoderOutput(output); // Save the image. - transcoder.transcode(input, trascoderOutput); + transcoder.transcode(input, transcoderOutput); + reader.close(); break; } case JPG: { // Create a JPEG transcoder final Transcoder transcoder = new JPEGTranscoder(); - transcoder.addTranscodingHint(JPEGTranscoder.KEY_QUALITY, new Float(.99)); + transcoder.addTranscodingHint(JPEGTranscoder.KEY_QUALITY, .99f); final ExportProperties.ImageProperties imageProperties = (ExportProperties.ImageProperties) properties; @@ -100,12 +110,13 @@ public class ExporterFactory { // Create the transcoder input. final String svgString = normalizeSvg(mapSvg); - final TranscoderInput input = new TranscoderInput(new CharArrayReader(svgString.toCharArray())); - + CharArrayReader reader = new CharArrayReader(svgString.toCharArray()); + final TranscoderInput input = new TranscoderInput(reader); TranscoderOutput trascoderOutput = new TranscoderOutput(output); // Save the image. transcoder.transcode(input, trascoderOutput); + reader.close(); break; } case PDF: { @@ -114,31 +125,32 @@ public class ExporterFactory { // Create the transcoder input. final String svgString = normalizeSvg(mapSvg); - final TranscoderInput input = new TranscoderInput(new CharArrayReader(svgString.toCharArray())); + CharArrayReader reader = new CharArrayReader(svgString.toCharArray()); + final TranscoderInput input = new TranscoderInput(reader); TranscoderOutput trascoderOutput = new TranscoderOutput(output); - // Save the image. transcoder.transcode(input, trascoderOutput); + reader.close(); break; } case SVG: { final String svgString = normalizeSvg(mapSvg); - output.write(svgString.getBytes(UTF_8_CHARSET_NAME)); + output.write(svgString.getBytes(StandardCharsets.UTF_8)); break; } case TEXT: { final Exporter exporter = XSLTExporter.create(XSLTExporter.Type.TEXT); - exporter.export(xml.getBytes(UTF_8_CHARSET_NAME), output); + exporter.export(xml.getBytes(StandardCharsets.UTF_8), output); break; } case OPEN_OFFICE_WRITER: { final Exporter exporter = XSLTExporter.create(XSLTExporter.Type.OPEN_OFFICE); - exporter.export(xml.getBytes(UTF_8_CHARSET_NAME), output); + exporter.export(xml.getBytes(StandardCharsets.UTF_8), output); break; } case MICROSOFT_EXCEL: { final Exporter exporter = XSLTExporter.create(XSLTExporter.Type.MICROSOFT_EXCEL); - exporter.export(xml.getBytes(UTF_8_CHARSET_NAME), output); + exporter.export(xml.getBytes(StandardCharsets.UTF_8), output); break; } case FREEMIND: { @@ -155,6 +167,9 @@ public class ExporterFactory { default: throw new UnsupportedOperationException("Export method not supported."); } + + output.flush(); + output.close(); } private String normalizeSvg(@NotNull String svgXml) throws ExportException { diff --git a/wise-webapp/src/main/java/com/wisemapping/exporter/XSLTExporter.java b/wise-webapp/src/main/java/com/wisemapping/exporter/XSLTExporter.java index e3388104..9180e9e8 100644 --- a/wise-webapp/src/main/java/com/wisemapping/exporter/XSLTExporter.java +++ b/wise-webapp/src/main/java/com/wisemapping/exporter/XSLTExporter.java @@ -41,9 +41,7 @@ public class XSLTExporter implements Exporter { final CharArrayReader reader = new CharArrayReader(mmos.toString("iso-8859-1").toCharArray()); final Source mmSource = new StreamSource(reader); transformer.transform(mmSource, new StreamResult(outputStream)); - } catch (TransformerException e) { - throw new ExportException(e); - } catch (UnsupportedEncodingException e) { + } catch (TransformerException | UnsupportedEncodingException e) { throw new ExportException(e); } diff --git a/wise-webapp/src/main/webapp/jsp/login.jsp b/wise-webapp/src/main/webapp/jsp/login.jsp index 63170ad5..6a02a8c8 100644 --- a/wise-webapp/src/main/webapp/jsp/login.jsp +++ b/wise-webapp/src/main/webapp/jsp/login.jsp @@ -21,7 +21,7 @@

-
@@ -49,7 +49,7 @@
- "> +
diff --git a/wise-webapp/src/main/webapp/jsp/userForgotPassword.jsp b/wise-webapp/src/main/webapp/jsp/userForgotPassword.jsp index d11c228e..eec3a155 100755 --- a/wise-webapp/src/main/webapp/jsp/userForgotPassword.jsp +++ b/wise-webapp/src/main/webapp/jsp/userForgotPassword.jsp @@ -23,7 +23,7 @@ " class="btn btn-primary" data-loading-text=""/> " class="btn" - onclick="window.location=''"/> + onclick="window.location='/c/maps/'"/>
diff --git a/wise-webapp/src/main/webapp/jsp/userRegistration.jsp b/wise-webapp/src/main/webapp/jsp/userRegistration.jsp index e0014b04..da42343f 100644 --- a/wise-webapp/src/main/webapp/jsp/userRegistration.jsp +++ b/wise-webapp/src/main/webapp/jsp/userRegistration.jsp @@ -49,7 +49,7 @@
-

${requestScope.captcha}

+

${requestScope.captcha}