use of com.evernote.edam.type.LinkedNotebook in project Notes by lguipeng.
the class EvernoteSearchHelper method findNotesInBusinessNotebook.
protected List<NotesMetadataList> findNotesInBusinessNotebook(Search search, LinkedNotebook linkedNotebook) throws Exception {
EvernoteBusinessNotebookHelper businessNotebookHelper = mClientFactory.getBusinessNotebookHelper();
EvernoteLinkedNotebookHelper linkedNotebookHelper = mClientFactory.getLinkedNotebookHelper(linkedNotebook);
Notebook correspondingNotebook = linkedNotebookHelper.getCorrespondingNotebook();
// create a deep copy so that we don't touch the initial search request values
NoteFilter noteFilter = new NoteFilter(search.getNoteFilter());
noteFilter.setNotebookGuid(correspondingNotebook.getGuid());
return findAllNotes(search, businessNotebookHelper.getClient(), noteFilter);
}
use of com.evernote.edam.type.LinkedNotebook in project Notes by lguipeng.
the class NoteRefHelper method getNoteStore.
public static EvernoteNoteStoreClient getNoteStore(NoteRef noteRef) throws EDAMUserException, EDAMSystemException, EDAMNotFoundException, TException {
EvernoteSession session = getSession();
if (!noteRef.isLinked()) {
return getSession().getEvernoteClientFactory().getNoteStoreClient();
}
LinkedNotebook linkedNotebook = getLinkedNotebook(noteRef.getNotebookGuid());
if (linkedNotebook == null) {
return null;
}
return session.getEvernoteClientFactory().getLinkedNotebookHelper(linkedNotebook).getClient();
}
use of com.evernote.edam.type.LinkedNotebook in project Notes by lguipeng.
the class AsyncLinkedNoteStoreClient method createNotebook.
/**
* Create Linked Notebook from a Notebook.
*
* Synchronous call
*
* @return {@link LinkedNotebook} with guid from server
*/
@Deprecated
public LinkedNotebook createNotebook(Notebook notebook) throws TException, EDAMUserException, EDAMSystemException, EDAMNotFoundException {
Notebook originalNotebook = getAsyncClient().getClient().createNotebook(getAuthenticationToken(), notebook);
SharedNotebook sharedNotebook = originalNotebook.getSharedNotebooks().get(0);
LinkedNotebook linkedNotebook = new LinkedNotebook();
linkedNotebook.setShareKey(sharedNotebook.getShareKey());
linkedNotebook.setShareName(originalNotebook.getName());
linkedNotebook.setUsername(mClientFactory.getBusinessAuthResult().getUser().getUsername());
linkedNotebook.setShardId(mClientFactory.getBusinessAuthResult().getUser().getShardId());
return getAsyncPersonalClient().getClient().createLinkedNotebook(getAsyncPersonalClient().getAuthenticationToken(), linkedNotebook);
}
use of com.evernote.edam.type.LinkedNotebook in project Notes by lguipeng.
the class EvernoteBusinessNotebookHelper method createBusinessNotebook.
/**
* @param notebook The new business notebook.
* @param defaultClient The note store client, which references the user's note store.
* @return The new created {@link LinkedNotebook}, which has an business ID.
*/
public LinkedNotebook createBusinessNotebook(@NonNull Notebook notebook, @NonNull EvernoteNoteStoreClient defaultClient) throws TException, EDAMUserException, EDAMSystemException, EDAMNotFoundException {
Notebook originalNotebook = mClient.createNotebook(notebook);
List<SharedNotebook> sharedNotebooks = originalNotebook.getSharedNotebooks();
SharedNotebook sharedNotebook = sharedNotebooks.get(0);
LinkedNotebook linkedNotebook = new LinkedNotebook();
linkedNotebook.setShareKey(sharedNotebook.getShareKey());
linkedNotebook.setShareName(originalNotebook.getName());
linkedNotebook.setUsername(mBusinessUserName);
linkedNotebook.setShardId(mBusinessUserShardId);
return defaultClient.createLinkedNotebook(linkedNotebook);
}
use of com.evernote.edam.type.LinkedNotebook in project Notes by lguipeng.
the class EvernoteSearchHelper method findNotesInLinkedNotebook.
protected List<NotesMetadataList> findNotesInLinkedNotebook(Search search, LinkedNotebook linkedNotebook) throws Exception {
EvernoteLinkedNotebookHelper linkedNotebookHelper = mClientFactory.getLinkedNotebookHelper(linkedNotebook);
Notebook correspondingNotebook = linkedNotebookHelper.getCorrespondingNotebook();
// create a deep copy so that we don't touch the initial search request values
NoteFilter noteFilter = new NoteFilter(search.getNoteFilter());
noteFilter.setNotebookGuid(correspondingNotebook.getGuid());
return findAllNotes(search, linkedNotebookHelper.getClient(), noteFilter);
}
Aggregations