X-Git-Url: http://git.sourceforge.jp/view?p=neighbornote%2FNeighborNote.git;a=blobdiff_plain;f=src%2Fcx%2Ffbn%2Fnevernote%2Fxml%2FExportData.java;h=effdcb690d517d3c43e4a1576e8dec7f912e2bb7;hp=2c36707ad8811b2e683ffb681520b57811e8e1fe;hb=421ecf1316e636317bc64dd3d283e1dce1bcfff9;hpb=9196841f0c0ad2ad2d9f5b0de8bb616daea4ae43 diff --git a/src/cx/fbn/nevernote/xml/ExportData.java b/src/cx/fbn/nevernote/xml/ExportData.java index 2c36707..effdcb6 100644 --- a/src/cx/fbn/nevernote/xml/ExportData.java +++ b/src/cx/fbn/nevernote/xml/ExportData.java @@ -24,11 +24,14 @@ import java.util.HashMap; import java.util.List; import com.evernote.edam.type.Data; +import com.evernote.edam.type.LinkedNotebook; import com.evernote.edam.type.Note; import com.evernote.edam.type.NoteAttributes; import com.evernote.edam.type.Notebook; +import com.evernote.edam.type.Publishing; import com.evernote.edam.type.Resource; import com.evernote.edam.type.SavedSearch; +import com.evernote.edam.type.SharedNotebook; import com.evernote.edam.type.Tag; import com.trolltech.qt.core.QByteArray; import com.trolltech.qt.core.QFile; @@ -48,6 +51,8 @@ public class ExportData { private final ApplicationLogger logger; private List searches; + private List linkedNotebooks; + private List sharedNotebooks; private final HashMap dirtySearches; private List tags; @@ -57,7 +62,9 @@ public class ExportData { private final HashMap exportableTags; private List notes; private final HashMap dirtyNotes; - private HashMap titleColors; + private final HashMap dirtyLinkedNotebooks; + private final HashMap dirtySharedNotebooks; + private HashMap titleColors; private final boolean fullBackup; private final DatabaseConnection conn; private QXmlStreamWriter writer; @@ -71,8 +78,12 @@ public class ExportData { notebooks = new ArrayList(); tags = new ArrayList(); notes = new ArrayList(); + sharedNotebooks = new ArrayList(); + linkedNotebooks = new ArrayList(); dirtyNotebooks = new HashMap(); localNotebooks = new HashMap(); + dirtyLinkedNotebooks = new HashMap(); + dirtySharedNotebooks = new HashMap(); dirtyTags = new HashMap(); fullBackup = full; @@ -100,6 +111,8 @@ public class ExportData { fullBackup = full; dirtyNotes = new HashMap(); + dirtyLinkedNotebooks = new HashMap(); + dirtySharedNotebooks = new HashMap(); dirtySearches = new HashMap(); searches = new ArrayList(); @@ -148,7 +161,17 @@ public class ExportData { dirtySearches.put(ds.get(i).getGuid(), ""); } - + linkedNotebooks = conn.getLinkedNotebookTable().getAll(); + List dln = conn.getLinkedNotebookTable().getDirtyGuids(); + for (int i=0; i dsn = conn.getSharedNotebookTable().getDirtyIds(); + for (int i=0; i"); writer.writeStartElement("nevernote-export"); - writer.writeAttribute("version", "0.86"); + writer.writeAttribute("version", "0.95"); if (fullBackup) writer.writeAttribute("exportType", "backup"); else @@ -191,6 +214,8 @@ public class ExportData { writeNotebooks(); writeTags(); writeSavedSearches(); + writeLinkedNotebooks(); + writeSharedNotebooks(); writer.writeEndElement(); @@ -224,8 +249,51 @@ public class ExportData { } } + + private void writeLinkedNotebooks() { + if (!fullBackup) + return; + for (int i=0; i