protected EvernoteBusinessNotebookHelper createBusinessNotebookHelper() throws TException, EDAMUserException, EDAMSystemException { authenticateToBusiness(); EvernoteNoteStoreClient client = getNoteStoreClient(mBusinessAuthenticationResult.getNoteStoreUrl(), mBusinessAuthenticationResult.getAuthenticationToken()); User businessUser = mBusinessAuthenticationResult.getUser(); return new EvernoteBusinessNotebookHelper(client, mExecutorService, businessUser.getUsername(), businessUser.getShardId()); }
@Override protected String checkedExecute() throws Exception { EvernoteClientFactory clientFactory = EvernoteSession.getInstance().getEvernoteClientFactory(); String shardId = clientFactory.getUserStoreClient().getUser().getShardId(); String shareKey = clientFactory.getNoteStoreClient().shareNote(mNoteRef.getGuid()); return "https://" + EvernoteSession.getInstance().getAuthenticationResult().getEvernoteHost() + "/shard/" + shardId + "/sh/" + mNoteRef.getGuid() + "/" + shareKey; } }
/** * 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); }
/** * 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); }