use of com.evernote.edam.type.SharedNotebook in project Notes by lguipeng.
the class AsyncBusinessNoteStoreClient method getCorrespondingNotebook.
/**
* Will return the {@link Notebook} associated with the {@link LinkedNotebook} from the business account.
*
* Synchronous call
*
* @param linkedNotebook
*/
@Override
@Deprecated
public Notebook getCorrespondingNotebook(LinkedNotebook linkedNotebook) throws TException, EDAMUserException, EDAMSystemException, EDAMNotFoundException {
// Get LinkedStore for auth information
AsyncLinkedNoteStoreClient sharedNoteStore = getClientFactory().createLinkedNoteStoreClient(linkedNotebook);
SharedNotebook sharedNotebook = sharedNoteStore.getAsyncClient().getClient().getSharedNotebookByAuth(sharedNoteStore.getAuthenticationToken());
return getAsyncClient().getClient().getNotebook(getAuthenticationToken(), sharedNotebook.getNotebookGuid());
}
use of com.evernote.edam.type.SharedNotebook 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.SharedNotebook in project Notes by lguipeng.
the class AsyncLinkedNoteStoreClient method createNote.
/**
* Helper method to create a note synchronously in a linked notebook.
*
* @param note
* @param linkedNotebook
* @return
* @throws com.evernote.edam.error.EDAMUserException
*
* @throws com.evernote.edam.error.EDAMSystemException
*
* @throws com.evernote.thrift.TException
* @throws com.evernote.edam.error.EDAMNotFoundException
*/
@Deprecated
public Note createNote(Note note, LinkedNotebook linkedNotebook) throws EDAMUserException, EDAMSystemException, TException, EDAMNotFoundException {
SharedNotebook sharedNotebook = getAsyncClient().getClient().getSharedNotebookByAuth(getAuthenticationToken());
note.setNotebookGuid(sharedNotebook.getNotebookGuid());
return getAsyncClient().getClient().createNote(getAuthenticationToken(), note);
}
use of com.evernote.edam.type.SharedNotebook 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.SharedNotebook in project Notes by lguipeng.
the class AsyncBusinessNoteStoreClient method createNote.
/**
* Helper method to create a note synchronously in a business notebook.
*
* @param note
* @param linkedNotebook
* @return
* @throws com.evernote.edam.error.EDAMUserException
*
* @throws com.evernote.edam.error.EDAMSystemException
*
* @throws com.evernote.thrift.TException
* @throws com.evernote.edam.error.EDAMNotFoundException
*/
@Override
@Deprecated
public Note createNote(Note note, LinkedNotebook linkedNotebook) throws EDAMUserException, EDAMSystemException, TException, EDAMNotFoundException {
AsyncLinkedNoteStoreClient sharedNoteStore = getClientFactory().createLinkedNoteStoreClient(linkedNotebook);
SharedNotebook sharedNotebook = sharedNoteStore.getAsyncClient().getClient().getSharedNotebookByAuth(sharedNoteStore.getAuthenticationToken());
note.setNotebookGuid(sharedNotebook.getNotebookGuid());
sharedNoteStore.getAsyncClient().getClient().createNote(sharedNoteStore.getAuthenticationToken(), note);
return note;
}
Aggregations