//* Begin syncing shared notebooks \r
//******************************************\r
private void syncLinkedNotebooks() {\r
- logger.log(logger.MEDIUM, "Authenticating Shared Notebooks");\r
+ logger.log(logger.MEDIUM, "Authenticating linked Notebooks");\r
status.message.emit(tr("Synchronizing shared notebooks."));\r
List<LinkedNotebook> books = conn.getLinkedNotebookTable().getAll();\r
\r
if (errorSharedNotebooksIgnored.containsKey(books.get(i).getGuid()))\r
break;\r
try {\r
+ logger.log(logger.EXTREME, "Checking notebook: " +books.get(i).getShareName());\r
long lastSyncDate = conn.getLinkedNotebookTable().getLastSequenceDate(books.get(i).getGuid());\r
int lastSequenceNumber = conn.getLinkedNotebookTable().getLastSequenceNumber(books.get(i).getGuid());\r
\r
linkedAuthResult = linkedNoteStore.authenticateToSharedNotebook(books.get(i).getShareKey(), authToken);\r
logger.log(logger.EXTREME, "Authentication Token" +linkedAuthResult.getAuthenticationToken());\r
} else {\r
- logger.log(logger.EXTREME, "Share key is null ");\r
+ logger.log(logger.EXTREME, "Share key is null");\r
linkedAuthResult = new AuthenticationResult();\r
linkedAuthResult.setAuthenticationToken("");\r
}\r
SyncState linkedSyncState = \r
linkedNoteStore.getLinkedNotebookSyncState(linkedAuthResult.getAuthenticationToken(), books.get(i));\r
if (linkedSyncState.getUpdateCount() > lastSequenceNumber) {\r
+ logger.log(logger.EXTREME, "Remote changes found");\r
if (lastSyncDate < linkedSyncState.getFullSyncBefore()) {\r
lastSequenceNumber = 0;\r
} \r
+ logger.log(logger.EXTREME, "Calling syncLinkedNotebook for " +books.get(i).getShareName());\r
syncLinkedNotebook(linkedNoteStore, books.get(i), \r
- //lastSequenceNumber, linkedSyncState.getUpdateCount(), linkedAuthResult.getAuthenticationToken());\r
lastSequenceNumber, linkedSyncState.getUpdateCount(), authToken);\r
}\r
\r
if (notebooks != null) {\r
for (int i=0; i<notebooks.size() && keepRunning; i++) {\r
try {\r
+ logger.log(logger.EXTREME, "auth token:" +linkedAuthResult.getAuthenticationToken());\r
if (!linkedAuthResult.getAuthenticationToken().equals("")) {\r
SharedNotebook s = noteStore.getSharedNotebookByAuth(linkedAuthResult.getAuthenticationToken());\r
+ logger.log(logger.EXTREME, "share key:"+s.getShareKey() +" notebookGuid" +s.getNotebookGuid());\r
conn.getLinkedNotebookTable().setNotebookGuid(s.getShareKey(), s.getNotebookGuid());\r
readOnly = !s.isNotebookModifiable();\r
} else {\r
\r
// Synchronize changes locally done to linked notes\r
private void syncLocalLinkedNoteChanges(Client noteStore, LinkedNotebook book) {\r
+ logger.log(logger.EXTREME, "Entering SyncRunner.synclocalLinkedNoteChanges");\r
String notebookGuid = conn.getLinkedNotebookTable().getNotebookGuid(book.getGuid());\r
+ logger.log(logger.EXTREME, "Finding changes for " +book.getShareName() +":" +book.getGuid() + ":" +notebookGuid);\r
List<Note> notes = conn.getNoteTable().getDirtyLinked(notebookGuid);\r
+ logger.log(logger.EXTREME, "Number of changes found: " +notes.size());\r
for (int i=0; i<notes.size(); i++) {\r
+ logger.log(logger.EXTREME, "Calling syncLocalNote with key " +linkedAuthResult.getAuthenticationToken());\r
syncLocalNote(noteStore, notes.get(i), linkedAuthResult.getAuthenticationToken());\r
}\r
+ logger.log(logger.EXTREME, "Leaving SyncRunner.synclocalLinkedNoteChanges");\r
}\r
\r
}\r