From bad11bea88d5d76993f73bb3a7c9c636b5e60b5d Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sat, 1 Dec 2012 17:22:54 -0300 Subject: [PATCH] Fix freemind import/export notes. --- .../exporter/FreemindExporter.java | 2 +- .../importer/JaxbCDATAMarshaller.java | 2 +- .../importer/freemind/FreemindImporter.java | 4 +- wise-webapp/src/main/resources/mindmap.xjb | 2 +- wise-webapp/src/main/resources/mindmap.xsd | 9 +- .../test/resources/data/freemind/i18n2.wxml | 4 +- .../test/resources/data/freemind/note.wxml | 10 +- .../resources/data/freemind/richtextnode.wxml | 4 +- .../src/test/resources/data/wisemaps/bug2.mmr | 13 + .../src/test/resources/data/wisemaps/bug3.mmr | 290 ++++++++++++++++-- .../resources/data/wisemaps/cdata-support.mmr | 11 +- .../src/test/resources/data/wisemaps/enc.mmr | 18 ++ .../test/resources/data/wisemaps/welcome.mmr | 11 +- 13 files changed, 337 insertions(+), 43 deletions(-) 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 993dc8e6..db73e850 100755 --- a/wise-webapp/src/main/java/com/wisemapping/exporter/FreemindExporter.java +++ b/wise-webapp/src/main/java/com/wisemapping/exporter/FreemindExporter.java @@ -225,7 +225,7 @@ public class FreemindExporter private void addNote(com.wisemapping.jaxb.freemind.Node fnode, com.wisemapping.jaxb.wisemap.TopicType mindmapTopic) throws IOException, SAXException, ParserConfigurationException { final Note note = mindmapTopic.getNote(); if (note != null) { - final String noteStr = note.getText() != null ? note.getText() : note.getTextAttr(); + final String noteStr = note.getValue() != null ? note.getValue() : note.getTextAttr(); if (noteStr != null) { final Richcontent richcontent = buildRichContent(noteStr, "NOTE"); fnode.getArrowlinkOrCloudOrEdge().add(richcontent); diff --git a/wise-webapp/src/main/java/com/wisemapping/importer/JaxbCDATAMarshaller.java b/wise-webapp/src/main/java/com/wisemapping/importer/JaxbCDATAMarshaller.java index cef78a43..f207a27c 100644 --- a/wise-webapp/src/main/java/com/wisemapping/importer/JaxbCDATAMarshaller.java +++ b/wise-webapp/src/main/java/com/wisemapping/importer/JaxbCDATAMarshaller.java @@ -43,7 +43,7 @@ public class JaxbCDATAMarshaller { // When processing xml that doesn't use namespaces, simply omit the // namespace prefix as shown in the third CDataElement below. of.setCDataElements( - new String[]{"^text"}); // + new String[]{"^text","^note"}); // // set any other options you'd like // of.setPreserveSpace(true); diff --git a/wise-webapp/src/main/java/com/wisemapping/importer/freemind/FreemindImporter.java b/wise-webapp/src/main/java/com/wisemapping/importer/freemind/FreemindImporter.java index 7e6a219a..15bed398 100755 --- a/wise-webapp/src/main/java/com/wisemapping/importer/freemind/FreemindImporter.java +++ b/wise-webapp/src/main/java/com/wisemapping/importer/freemind/FreemindImporter.java @@ -298,7 +298,7 @@ public class FreemindImporter if (textNote == null) // It is not a note is a BlinkingNodeHook or AutomaticLayout Hook { textNote = EMPTY_NOTE; - mindmapNote.setText(textNote); + mindmapNote.setValue(textNote); currentWiseTopic.setNote(mindmapNote); } } else if (element instanceof Richcontent) { @@ -312,7 +312,7 @@ public class FreemindImporter String text = html2text(content); final com.wisemapping.jaxb.wisemap.Note mindmapNote = new com.wisemapping.jaxb.wisemap.Note(); text = text != null ? text : EMPTY_NOTE; - mindmapNote.setText(text); + mindmapNote.setValue(text); currentWiseTopic.setNote(mindmapNote); } diff --git a/wise-webapp/src/main/resources/mindmap.xjb b/wise-webapp/src/main/resources/mindmap.xjb index deae82bd..1d411a86 100644 --- a/wise-webapp/src/main/resources/mindmap.xjb +++ b/wise-webapp/src/main/resources/mindmap.xjb @@ -8,7 +8,7 @@ - + \ No newline at end of file diff --git a/wise-webapp/src/main/resources/mindmap.xsd b/wise-webapp/src/main/resources/mindmap.xsd index c4697b35..4d40a9ee 100644 --- a/wise-webapp/src/main/resources/mindmap.xsd +++ b/wise-webapp/src/main/resources/mindmap.xsd @@ -48,10 +48,11 @@ - - - - + + + + + diff --git a/wise-webapp/src/test/resources/data/freemind/i18n2.wxml b/wise-webapp/src/test/resources/data/freemind/i18n2.wxml index 25603929..94ce5659 100644 --- a/wise-webapp/src/test/resources/data/freemind/i18n2.wxml +++ b/wise-webapp/src/test/resources/data/freemind/i18n2.wxml @@ -4,9 +4,7 @@ - - - + - - - + - - - + diff --git a/wise-webapp/src/test/resources/data/freemind/richtextnode.wxml b/wise-webapp/src/test/resources/data/freemind/richtextnode.wxml index 0e3a1159..e8624c3e 100644 --- a/wise-webapp/src/test/resources/data/freemind/richtextnode.wxml +++ b/wise-webapp/src/test/resources/data/freemind/richtextnode.wxml @@ -3,9 +3,7 @@ - - - + diff --git a/wise-webapp/src/test/resources/data/wisemaps/bug2.mmr b/wise-webapp/src/test/resources/data/wisemaps/bug2.mmr index 6a5ae424..5d08cb8f 100644 --- a/wise-webapp/src/test/resources/data/wisemaps/bug2.mmr +++ b/wise-webapp/src/test/resources/data/wisemaps/bug2.mmr @@ -28,6 +28,19 @@ + + + + +

Todos los contenidos de los talleres están relacionados con el currículo de la enseñanza básica.

+

A diferencia de la práctica tradicional, pretendemos ahondar en el conocimiento partiendo de lo que realmente interesa al niño o niña,

+

ayudándole a que encuentre respuesta a las preguntas que él o ella se plantea.

+

+

Por ese motivo, SaberMás proyecta estar al lado de los niños que necesitan una motivación extra para entender la escuela y fluir en ella,

+

y también al lado de aquellos a quienes la curiosidad y las ganas de saber les lleva más allá.

+ + +
diff --git a/wise-webapp/src/test/resources/data/wisemaps/bug3.mmr b/wise-webapp/src/test/resources/data/wisemaps/bug3.mmr index ca04791a..bed9f392 100644 --- a/wise-webapp/src/test/resources/data/wisemaps/bug3.mmr +++ b/wise-webapp/src/test/resources/data/wisemaps/bug3.mmr @@ -3,8 +3,25 @@ + + + + +

Identifying new measures or investments that should be implemented.

+ + +
- + + + + + +

Number of different innovations policy instruments existing in the region as a share of a total number representing a full typology of instruments

+ + +
+
@@ -15,6 +32,14 @@ + + + + +

Understanding how to design the details of a particular measure and how to implement them.

+ + +
@@ -126,7 +151,23 @@ + + + + +

Understanding the level of effort the region needs to take to compete on innovation and where to put this effort

+ + +
+ + + + +

This is what policy makers care about in the end

+ + +
@@ -158,13 +199,38 @@ + + + + +

WB

+ + +
- + + + + + +

GCR

+ + +
+
+ + + + +

GCR

+ + +
@@ -172,6 +238,14 @@ + + + + +

per 100 population aged 25-64

+ + +
@@ -207,7 +281,16 @@
- + + + + + +

GCR

+ + +
+
@@ -235,7 +318,16 @@
- + + + + + +

GCR

+ + +
+
@@ -247,7 +339,16 @@ - + + + + + +

: the percentage of the workforce employed by foreign companies [%].

+ + +
+
@@ -255,6 +356,14 @@ + + + + +

: exports as a share of total output in manufacturing and services [%].

+ + +
@@ -284,14 +393,59 @@ - - - + + + + + +

GEM

+ + +
+
+ + + + + +

GEM

+ + +
+
+ + + + + +

GEM

+ + +
+
- - + + + + + +

UNESCO

+ + +
+
+ + + + + +

CIS

+ + +
+
@@ -317,7 +471,16 @@ - + + + + + +

GCR

+ + +
+
@@ -364,7 +527,16 @@ - + + + + + +

CIS, BEEPS

+ + +
+
@@ -380,8 +552,26 @@ - - + + + + + +

Number of new organizations per thousand working age population (WBI)

+ + +
+
+ + + + + +

(as a percentage of all registered corporations)

+ + +
+
@@ -484,7 +674,16 @@ - + + + + + +

Number of measures offered by the unversity within a preset range (NCET2 survey)

+ + +
+
@@ -544,8 +743,26 @@ - - + + + + + +

(design firms, IP consultants, etc.)

+ + +
+
+ + + + + +

(e.g. accelerators, incubators)

+ + +
+
@@ -564,11 +781,29 @@ + + + + +

Understanding which measures should be strengthened, dropped or improved, and how.

+ + +
- + + + + + +

WIPO SURVEY OF INTELLECTUAL PROPERTY SERVICES OF

+

EUROPEAN TECHNOLOGY INCUBATORS

+ + +
+
@@ -649,7 +884,16 @@ - + + + + + +

JL: not sure how this would be measured

+ + +
+
@@ -716,6 +960,14 @@ + + + + +

Understanding what investments should be made in innovative projects.

+ + +
diff --git a/wise-webapp/src/test/resources/data/wisemaps/cdata-support.mmr b/wise-webapp/src/test/resources/data/wisemaps/cdata-support.mmr index 4855185c..401efe27 100644 --- a/wise-webapp/src/test/resources/data/wisemaps/cdata-support.mmr +++ b/wise-webapp/src/test/resources/data/wisemaps/cdata-support.mmr @@ -1,3 +1,12 @@ - + + + + + +

Always ask

+ + +
+
\ No newline at end of file diff --git a/wise-webapp/src/test/resources/data/wisemaps/enc.mmr b/wise-webapp/src/test/resources/data/wisemaps/enc.mmr index eee869d3..2a9491f9 100644 --- a/wise-webapp/src/test/resources/data/wisemaps/enc.mmr +++ b/wise-webapp/src/test/resources/data/wisemaps/enc.mmr @@ -72,6 +72,15 @@
+ + + + +

+

Isso significa que estudos de característica de história de vida compensam? Ver nos m&m.

+ + +
@@ -84,6 +93,15 @@ + + + + +

+

Falar que isso corrobora nossa sugestão de utilizar poucas medidas, mas que elas sejam confiáveis.

+ + +
diff --git a/wise-webapp/src/test/resources/data/wisemaps/welcome.mmr b/wise-webapp/src/test/resources/data/wisemaps/welcome.mmr index 30664a9a..764ad6c8 100644 --- a/wise-webapp/src/test/resources/data/wisemaps/welcome.mmr +++ b/wise-webapp/src/test/resources/data/wisemaps/welcome.mmr @@ -39,7 +39,16 @@ - + + + + + +

This is a multiline note with some spanish char "ñ"

+ + +
+