/** * @return The notebook for this linked notebook. */ public Notebook getCorrespondingNotebook() throws TException, EDAMUserException, EDAMSystemException, EDAMNotFoundException { SharedNotebook sharedNotebook = mClient.getSharedNotebookByAuth(); return mClient.getNotebook(sharedNotebook.getNotebookGuid()); }
public SharedNotebook deepCopy() { return new SharedNotebook(this); }
/** * @param defaultClient The note store client, which references the user's note store. * @return A flag indicating if the action was successful. * @see EvernoteNoteStoreClient#expungeLinkedNotebook(String) */ public int deleteLinkedNotebook(@NonNull EvernoteNoteStoreClient defaultClient) throws TException, EDAMUserException, EDAMSystemException, EDAMNotFoundException { SharedNotebook sharedNotebook = mClient.getSharedNotebookByAuth(); List<Long> sharedNotebookIds = new ArrayList<>(); sharedNotebookIds.add(sharedNotebook.getId()); mClient.expungeSharedNotebooks(sharedNotebookIds); return defaultClient.expungeLinkedNotebook(mLinkedNotebook.getGuid()); }
this.id = other.id; this.userId = other.userId; if (other.isSetNotebookGuid()) { this.notebookGuid = other.notebookGuid; if (other.isSetEmail()) { this.email = other.email; this.serviceCreated = other.serviceCreated; this.serviceUpdated = other.serviceUpdated; if (other.isSetShareKey()) { this.shareKey = other.shareKey; if (other.isSetUsername()) { this.username = other.username; if (other.isSetPrivilege()) { this.privilege = other.privilege; if (other.isSetRecipientSettings()) { this.recipientSettings = new SharedNotebookRecipientSettings(other.recipientSettings);
boolean this_present_id = true && this.isSetId(); boolean that_present_id = true && that.isSetId(); if (this_present_id || that_present_id) { if (!(this_present_id && that_present_id)) boolean this_present_userId = true && this.isSetUserId(); boolean that_present_userId = true && that.isSetUserId(); if (this_present_userId || that_present_userId) { if (!(this_present_userId && that_present_userId)) boolean this_present_notebookGuid = true && this.isSetNotebookGuid(); boolean that_present_notebookGuid = true && that.isSetNotebookGuid(); if (this_present_notebookGuid || that_present_notebookGuid) { if (!(this_present_notebookGuid && that_present_notebookGuid)) boolean this_present_email = true && this.isSetEmail(); boolean that_present_email = true && that.isSetEmail(); if (this_present_email || that_present_email) { if (!(this_present_email && that_present_email)) boolean this_present_notebookModifiable = true && this.isSetNotebookModifiable(); boolean that_present_notebookModifiable = true && that.isSetNotebookModifiable(); if (this_present_notebookModifiable || that_present_notebookModifiable) { if (!(this_present_notebookModifiable && that_present_notebookModifiable)) boolean this_present_requireLogin = true && this.isSetRequireLogin(); boolean that_present_requireLogin = true && that.isSetRequireLogin(); if (this_present_requireLogin || that_present_requireLogin) { if (!(this_present_requireLogin && that_present_requireLogin))
log.auditLog("Start : createSharedNotebook"); NoteStoreClient noteStoreClient = EvernoteUtil.getNoteStoreClient(messageContext); SharedNotebook sharedNotebook = new SharedNotebook(); sharedNotebook.setPrivilege(privilege); if(email!=null&&!email.trim().equalsIgnoreCase("")){ sharedNotebook.setEmail(email); sharedNotebook.setNotebookGuid(guid); OMElement omResponse = EvernoteUtil.parseResponse("sharednotebook.create.success"); OMElement omSharedNotebook = EvernoteUtil.createOMElement("sharednotebook"); EvernoteUtil.addAttribute(omSharedNotebook,"id",createdSharedNotebook.getId()+""); EvernoteUtil.addElement(omSharedNotebook,"notebookGuid",createdSharedNotebook.getNotebookGuid()); EvernoteUtil.addElement(omSharedNotebook,"email",createdSharedNotebook.getEmail()); EvernoteUtil.addElement(omSharedNotebook,"shareKey",createdSharedNotebook.getShareKey()); EvernoteUtil.addElement(omSharedNotebook,"privilege",createdSharedNotebook.getPrivilege().name()); omResponse.addChild(omSharedNotebook); EvernoteUtil.preparePayload(messageContext,omResponse);
case 2: // SHARED_NOTEBOOK if (field.type == TType.STRUCT) { this.sharedNotebook = new com.evernote.edam.type.SharedNotebook(); this.sharedNotebook.read(iprot); } else { TProtocolUtil.skip(iprot, field.type);
String allowPreview = EvernoteUtil.lookupTemplateParamater(messageContext,EvernoteUtil.ALLOW_PREVIEW); SharedNotebook sharedNotebook = new SharedNotebook(); SharedNotebookPrivilegeLevel privilege = SharedNotebookPrivilegeLevel.READ_NOTEBOOK; sharedNotebook.setPrivilege(privilege); if(sharedID!=null&&!sharedID.equalsIgnoreCase("")) { sharedNotebook.setId(Long.parseLong(sharedID)); sharedNotebook.setEmail(email); sharedNotebook.setAllowPreview(Boolean.parseBoolean(allowPreview));
/** * @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); }
@Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof SharedNotebook) return this.equals((SharedNotebook)that); return false; }
boolean this_present_id = true && this.isSetId(); boolean that_present_id = true && that.isSetId(); if (this_present_id || that_present_id) { if (!(this_present_id && that_present_id)) boolean this_present_userId = true && this.isSetUserId(); boolean that_present_userId = true && that.isSetUserId(); if (this_present_userId || that_present_userId) { if (!(this_present_userId && that_present_userId)) boolean this_present_notebookGuid = true && this.isSetNotebookGuid(); boolean that_present_notebookGuid = true && that.isSetNotebookGuid(); if (this_present_notebookGuid || that_present_notebookGuid) { if (!(this_present_notebookGuid && that_present_notebookGuid)) boolean this_present_email = true && this.isSetEmail(); boolean that_present_email = true && that.isSetEmail(); if (this_present_email || that_present_email) { if (!(this_present_email && that_present_email)) boolean this_present_notebookModifiable = true && this.isSetNotebookModifiable(); boolean that_present_notebookModifiable = true && that.isSetNotebookModifiable(); if (this_present_notebookModifiable || that_present_notebookModifiable) { if (!(this_present_notebookModifiable && that_present_notebookModifiable)) boolean this_present_requireLogin = true && this.isSetRequireLogin(); boolean that_present_requireLogin = true && that.isSetRequireLogin(); if (this_present_requireLogin || that_present_requireLogin) { if (!(this_present_requireLogin && that_present_requireLogin))
case 2: // SHARED_NOTEBOOK if (field.type == TType.STRUCT) { this.sharedNotebook = new com.evernote.edam.type.SharedNotebook(); this.sharedNotebook.read(iprot); } else { TProtocolUtil.skip(iprot, field.type);
this.id = other.id; this.userId = other.userId; if (other.isSetNotebookGuid()) { this.notebookGuid = other.notebookGuid; if (other.isSetEmail()) { this.email = other.email; this.serviceCreated = other.serviceCreated; this.serviceUpdated = other.serviceUpdated; if (other.isSetShareKey()) { this.shareKey = other.shareKey; if (other.isSetUsername()) { this.username = other.username; if (other.isSetPrivilege()) { this.privilege = other.privilege; if (other.isSetRecipientSettings()) { this.recipientSettings = new SharedNotebookRecipientSettings(other.recipientSettings);
/** * 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); }
@Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof SharedNotebook) return this.equals((SharedNotebook)that); return false; }
lastComparison = Boolean.valueOf(isSetId()).compareTo(typedOther.isSetId()); if (lastComparison != 0) { return lastComparison; if (isSetId()) { lastComparison = TBaseHelper.compareTo(this.id, typedOther.id); if (lastComparison != 0) { return lastComparison; lastComparison = Boolean.valueOf(isSetUserId()).compareTo(typedOther.isSetUserId()); if (lastComparison != 0) { return lastComparison; if (isSetUserId()) { lastComparison = TBaseHelper.compareTo(this.userId, typedOther.userId); if (lastComparison != 0) { return lastComparison; lastComparison = Boolean.valueOf(isSetNotebookGuid()).compareTo(typedOther.isSetNotebookGuid()); if (lastComparison != 0) { return lastComparison; if (isSetNotebookGuid()) { lastComparison = TBaseHelper.compareTo(this.notebookGuid, typedOther.notebookGuid); if (lastComparison != 0) { return lastComparison; lastComparison = Boolean.valueOf(isSetEmail()).compareTo(typedOther.isSetEmail()); if (lastComparison != 0) { return lastComparison; if (isSetEmail()) { lastComparison = TBaseHelper.compareTo(this.email, typedOther.email);
case 2: // SHARED_NOTEBOOK if (field.type == TType.STRUCT) { this.sharedNotebook = new com.evernote.edam.type.SharedNotebook(); this.sharedNotebook.read(iprot); } else { TProtocolUtil.skip(iprot, field.type);
public SharedNotebook deepCopy() { return new SharedNotebook(this); }
/** * @param note The new note. * @return The new created note from the server. */ public Note createNoteInLinkedNotebook(@NonNull Note note) throws EDAMUserException, EDAMSystemException, TException, EDAMNotFoundException { SharedNotebook sharedNotebook = mClient.getSharedNotebookByAuth(); note.setNotebookGuid(sharedNotebook.getNotebookGuid()); return mClient.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); }