From df52d57a1d9b05d78afb88c6e72cbf72e2ce59da Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Thu, 30 Aug 2012 20:43:56 -0300 Subject: [PATCH] Bug java.lang.NullPointerException at com.wisemapping.exporter.FreemindExporter.addNote(FreemindExporter.java:170) fixed. --- wise-editor/src/main/webapp/samples/issue.xml | 120 ++++++++++++++++++ .../src/main/webapp/samples/sample3.xml | 41 ++---- .../src/main/webapp/samples/sample4.xml | 10 ++ .../exporter/FreemindExporter.java | 5 + .../src/test/resources/data/wisemaps/bug2.xml | 49 +++++++ .../resources/data/wisemaps/cdata-support.mmr | 8 ++ .../data/wisemaps/cdata-support.wxml | 4 +- 7 files changed, 202 insertions(+), 35 deletions(-) create mode 100644 wise-webapp/src/test/resources/data/wisemaps/cdata-support.mmr diff --git a/wise-editor/src/main/webapp/samples/issue.xml b/wise-editor/src/main/webapp/samples/issue.xml index e69de29b..e957fa3d 100644 --- a/wise-editor/src/main/webapp/samples/issue.xml +++ b/wise-editor/src/main/webapp/samples/issue.xml @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/wise-editor/src/main/webapp/samples/sample3.xml b/wise-editor/src/main/webapp/samples/sample3.xml index 41060d97..a5a72ca4 100644 --- a/wise-editor/src/main/webapp/samples/sample3.xml +++ b/wise-editor/src/main/webapp/samples/sample3.xml @@ -1,34 +1,9 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + \ No newline at end of file diff --git a/wise-editor/src/main/webapp/samples/sample4.xml b/wise-editor/src/main/webapp/samples/sample4.xml index e69de29b..8053577a 100644 --- a/wise-editor/src/main/webapp/samples/sample4.xml +++ b/wise-editor/src/main/webapp/samples/sample4.xml @@ -0,0 +1,10 @@ + + + + + + + + + \ No newline at end of file diff --git a/wise-webapp/src/main/java/com/wisemapping/exporter/FreemindExporter.java b/wise-webapp/src/main/java/com/wisemapping/exporter/FreemindExporter.java index 06ed9647..1bd0f470 100755 --- a/wise-webapp/src/main/java/com/wisemapping/exporter/FreemindExporter.java +++ b/wise-webapp/src/main/java/com/wisemapping/exporter/FreemindExporter.java @@ -174,6 +174,11 @@ public class FreemindExporter if (textNote == null || textNote.isEmpty()) { textNote = mindmapTopic.getNote().getText(); } + + // @Todo: For some reason central topic nodes with CDATA seems not to be loaded in the JAXB model. + // Temporally excluding and continue .. + textNote = (textNote != null) ? textNote : ""; + textNote = textNote.replaceAll("%0A", "\n"); note.setNAME("accessories/plugins/NodeNote.properties"); note.setText(textNote); diff --git a/wise-webapp/src/test/resources/data/wisemaps/bug2.xml b/wise-webapp/src/test/resources/data/wisemaps/bug2.xml index e69de29b..713e55e2 100644 --- a/wise-webapp/src/test/resources/data/wisemaps/bug2.xml +++ b/wise-webapp/src/test/resources/data/wisemaps/bug2.xml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/wise-webapp/src/test/resources/data/wisemaps/cdata-support.mmr b/wise-webapp/src/test/resources/data/wisemaps/cdata-support.mmr new file mode 100644 index 00000000..ff0d661b --- /dev/null +++ b/wise-webapp/src/test/resources/data/wisemaps/cdata-support.mmr @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/wise-webapp/src/test/resources/data/wisemaps/cdata-support.wxml b/wise-webapp/src/test/resources/data/wisemaps/cdata-support.wxml index e02150bb..4d262220 100644 --- a/wise-webapp/src/test/resources/data/wisemaps/cdata-support.wxml +++ b/wise-webapp/src/test/resources/data/wisemaps/cdata-support.wxml @@ -1,6 +1,6 @@ - - + +