Fix freemind import/export notes.

This commit is contained in:
Paulo Gustavo Veiga
2012-12-01 17:22:54 -03:00
parent 6c1188314b
commit bad11bea88
13 changed files with 337 additions and 43 deletions

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);
}

View File

@@ -8,7 +8,7 @@
<jxb:bindings node="/xsd:schema/xsd:complexType[@name='topicType']/xsd:attribute[@name='text']" schemaLocation="mindmap.xsd">
<jxb:property name="textAttr"/>
</jxb:bindings>
<jxb:bindings node="/xsd:schema/xsd:complexType[@name='note']/xsd:attribute[@name='text']" schemaLocation="mindmap.xsd">
<jxb:bindings node="/xsd:schema/xsd:complexType[@name='note']/xsd:simpleContent/xsd:extension/xsd:attribute[@name='text']" schemaLocation="mindmap.xsd">
<jxb:property name="textAttr"/>
</jxb:bindings>
</jxb:bindings>

View File

@@ -48,10 +48,11 @@
</xsd:complexType>
<xsd:complexType name="note">
<xsd:sequence>
<xsd:element minOccurs='0' maxOccurs='1' type="xsd:string" name="text"/>
</xsd:sequence>
<xsd:attribute name="text" type="xsd:string"/>
<xsd:simpleContent>
<xsd:extension base="xsd:string">
<xsd:attribute name="text" type="xsd:string"/>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
<xsd:element name="relationship" type="relationshipType"/>