/** * Helper method to create a note 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 * */ public Note createNote(Note note, LinkedNotebook linkedNotebook) throws EDAMUserException, EDAMSystemException, TException, EDAMNotFoundException { SharedNotebook sharedNotebook = getClient().getSharedNotebookByAuth(); note.setNotebookGuid(sharedNotebook.getNotebookGuid()); return getClient().createNote(note); }
/** * Will return the {@link com.evernote.edam.type.Notebook} associated with the * {@link com.evernote.edam.type.LinkedNotebook} from the linked account * * @param linkedNotebook */ public Notebook getCorrespondingNotebook(LinkedNotebook linkedNotebook) throws TException, EDAMUserException, EDAMSystemException, EDAMNotFoundException { SharedNotebook sharedNotebook = getClient().getSharedNotebookByAuth(); return getClient().getNotebook(sharedNotebook.getNotebookGuid()); }
Notebook parentNotebook = noteStoreClient.getNotebook(notebookGuid); if (parentNotebook != null && parentNotebook.isSetGuid()) { note.setGuid(parentNotebook.getGuid()); Note createdNote = noteStoreClient.createNote(note);
/** * Create Linked Notebook from a Notebook * * @return {@link LinkedNotebook} with guid from server */ public LinkedNotebook createNotebook(Notebook notebook) throws TException, EDAMUserException, EDAMSystemException, EDAMNotFoundException { Notebook originalNotebook = getClient().createNotebook(notebook); SharedNotebook sharedNotebook = originalNotebook.getSharedNotebooks() .get(0); LinkedNotebook linkedNotebook = new LinkedNotebook(); linkedNotebook.setShareKey(sharedNotebook.getShareKey()); linkedNotebook.setShareName(originalNotebook.getName()); linkedNotebook.setUsername(getAuthenticationResult().getUser() .getUsername()); linkedNotebook.setShardId(getAuthenticationResult().getUser().getShardId()); return getPersonalClient().createLinkedNotebook(linkedNotebook); }
String defaultNotebook = EvernoteUtil.lookupTemplateParamater(messageContext,EvernoteUtil.NOTEBOOK_DEFAULT); Notebook notebook = noteStoreClient.getNotebook(guid); int updateSequenceNumber = noteStoreClient.updateNotebook(notebook);
Notebook createdNotebook = noteStoreClient.createNotebook(notebook); OMElement omResponse = EvernoteUtil.parseResponse("notebook.create.success"); OMElement omNotebook = EvernoteUtil.createOMElement("notebook");
Notebook notebook= noteStoreClient.getNotebook(guid); OMElement omResponse = EvernoteUtil.parseResponse("notebook.display.success"); OMElement omNotebook = EvernoteUtil.createOMElement("notebook");
/** * Creates a LinkedNoteStoreClient from a {@link LinkedNotebook} synchronously * * @param linkedNotebook */ public LinkedNoteStoreClient createLinkedNoteStoreClient( LinkedNotebook linkedNotebook) throws EDAMUserException, EDAMSystemException, TException, EDAMNotFoundException { NoteStoreClient mainNoteStoreClient = createNoteStoreClient(); AuthenticationResult sharedAuth = mainNoteStoreClient .authenticateToSharedNotebook(linkedNotebook.getShareKey()); NoteStoreClient linkedNoteStoreClient = createStoreClient( NoteStoreClient.class, linkedNotebook.getNoteStoreUrl(), sharedAuth.getAuthenticationToken()); return new LinkedNoteStoreClient(mainNoteStoreClient, linkedNoteStoreClient, sharedAuth); }
SavedSearch search = noteStoreClient.createSearch(savedSearch); OMElement omResponse = EvernoteUtil.parseResponse("create.search.success"); EvernoteUtil.addElement(omResponse,"search-guid",search.getGuid());
int update_sequence_number = noteStoreClient.deleteNote(guid); OMElement omResponse = EvernoteUtil.parseResponse("note.delete.success"); EvernoteUtil.addElement(omResponse,"update_sequence_number",update_sequence_number+"");
int update_sequence_number = noteStoreClient.expungeNote(guid); OMElement omResponse = EvernoteUtil.parseResponse("note.delete.completely"); EvernoteUtil.addElement(omResponse,"update_sequence_number",update_sequence_number+"");
Tag tag1 = noteStoreClient.createTag(tag);
SharedNotebook createdSharedNotebook = noteStoreClient.createSharedNotebook(sharedNotebook); OMElement omResponse = EvernoteUtil.parseResponse("sharednotebook.create.success"); OMElement omSharedNotebook = EvernoteUtil.createOMElement("sharednotebook");
/** * Create Linked Notebook from a Notebook * * @return {@link LinkedNotebook} with guid from server */ public LinkedNotebook createNotebook(Notebook notebook) throws TException, EDAMUserException, EDAMSystemException, EDAMNotFoundException { Notebook originalNotebook = getClient().createNotebook(notebook); SharedNotebook sharedNotebook = originalNotebook.getSharedNotebooks() .get(0); LinkedNotebook linkedNotebook = new LinkedNotebook(); linkedNotebook.setShareKey(sharedNotebook.getShareKey()); linkedNotebook.setShareName(originalNotebook.getName()); linkedNotebook.setUsername(getAuthenticationResult().getUser() .getUsername()); linkedNotebook.setShardId(getAuthenticationResult().getUser().getShardId()); return getPersonalClient().createLinkedNotebook(linkedNotebook); }
/** * Creates a LinkedNoteStoreClient from a {@link LinkedNotebook} synchronously * * @param linkedNotebook */ public LinkedNoteStoreClient createLinkedNoteStoreClient( LinkedNotebook linkedNotebook) throws EDAMUserException, EDAMSystemException, TException, EDAMNotFoundException { NoteStoreClient mainNoteStoreClient = createNoteStoreClient(); AuthenticationResult sharedAuth = mainNoteStoreClient .authenticateToSharedNotebook(linkedNotebook.getShareKey()); NoteStoreClient linkedNoteStoreClient = createStoreClient( NoteStoreClient.class, linkedNotebook.getNoteStoreUrl(), sharedAuth.getAuthenticationToken()); return new LinkedNoteStoreClient(mainNoteStoreClient, linkedNoteStoreClient, sharedAuth); }
/** * Will return the {@link com.evernote.edam.type.Notebook} associated with the * {@link com.evernote.edam.type.LinkedNotebook} from the linked account * * @param linkedNotebook */ public Notebook getCorrespondingNotebook(LinkedNotebook linkedNotebook) throws TException, EDAMUserException, EDAMSystemException, EDAMNotFoundException { SharedNotebook sharedNotebook = getClient().getSharedNotebookByAuth(); return getClient().getNotebook(sharedNotebook.getNotebookGuid()); }
/** * Helper method to create a note 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 * */ public Note createNote(Note note, LinkedNotebook linkedNotebook) throws EDAMUserException, EDAMSystemException, TException, EDAMNotFoundException { SharedNotebook sharedNotebook = getClient().getSharedNotebookByAuth(); note.setNotebookGuid(sharedNotebook.getNotebookGuid()); return getClient().createNote(note); }