当前位置: 首页>>代码示例>>Java>>正文


Java SharedNotebook类代码示例

本文整理汇总了Java中com.evernote.edam.type.SharedNotebook的典型用法代码示例。如果您正苦于以下问题:Java SharedNotebook类的具体用法?Java SharedNotebook怎么用?Java SharedNotebook使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


SharedNotebook类属于com.evernote.edam.type包,在下文中一共展示了SharedNotebook类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createBusinessNotebook

import com.evernote.edam.type.SharedNotebook; //导入依赖的package包/类
/**
 * @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);
}
 
开发者ID:fivef,项目名称:add_to_evernote_note,代码行数:22,代码来源:EvernoteBusinessNotebookHelper.java

示例2: listNotebooks

import com.evernote.edam.type.SharedNotebook; //导入依赖的package包/类
/**
 * return a user's all notebooks(including linked notebooks).
 *
 * @return The user's notebooks.
 */
@Override
public Map<String, ENObject> listNotebooks() throws EDAMUserException, EDAMSystemException, TException, EDAMNotFoundException {
    List<Notebook> notebooks = factory.getNoteStoreClient().listNotebooks();
    List<LinkedNotebook> linkedNotebooks = factory.getNoteStoreClient().listLinkedNotebooks();

    Map<String, ENObject> map = MapUtil.map();
    for (Notebook n : notebooks) {
        map.put(n.getName(), ENObjectImpl.forNameAndGuid(n.getName(), n.getGuid()));
    }

    for (LinkedNotebook linkedNotebook : linkedNotebooks) { // LinkedNotebook must be serializable
        NoteStoreClient linkedNoteStore = factory.getLinkedNoteStoreClient(linkedNotebook);
        SharedNotebook sharedNotebook = linkedNoteStore.getSharedNotebookByAuth();

        if (map.containsKey(linkedNotebook.getShareName())) {
            map.put(linkedNotebook.getShareName() + ConstantsUtil.LEFT_PARENTHESIS + linkedNotebook.getUsername() + ConstantsUtil.COLON + sharedNotebook.getNotebookGuid() + ConstantsUtil.RIGHT_PARENTHESIS, ENObjectImpl.forValues(linkedNotebook.getShareName(), sharedNotebook.getNotebookGuid(), ENObjectType.LINKED, linkedNotebook));
        } else {
            map.put(linkedNotebook.getShareName(), ENObjectImpl.forValues(linkedNotebook.getShareName(), sharedNotebook.getNotebookGuid(), ENObjectType.LINKED, linkedNotebook));
        }
    }

    return map;
}
 
开发者ID:LTTPP,项目名称:Eemory,代码行数:29,代码来源:EeClipperImpl.java

示例3: deleteLinkedNotebook

import com.evernote.edam.type.SharedNotebook; //导入依赖的package包/类
/**
 * @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());
}
 
开发者ID:fivef,项目名称:add_to_evernote_note,代码行数:15,代码来源:EvernoteLinkedNotebookHelper.java

示例4: createSharedNotebookAsync

import com.evernote.edam.type.SharedNotebook; //导入依赖的package包/类
public Future<SharedNotebook> createSharedNotebookAsync(final SharedNotebook sharedNotebook, EvernoteCallback<SharedNotebook> callback) {
    return submitTask(new Callable<SharedNotebook>() {
        @Override
        public SharedNotebook call() throws Exception {
            return createSharedNotebook(sharedNotebook);
        }
    }, callback);
}
 
开发者ID:fivef,项目名称:add_to_evernote_note,代码行数:9,代码来源:EvernoteNoteStoreClient.java

示例5: updateSharedNotebookAsync

import com.evernote.edam.type.SharedNotebook; //导入依赖的package包/类
public Future<Integer> updateSharedNotebookAsync(final SharedNotebook sharedNotebook, EvernoteCallback<Integer> callback) {
    return submitTask(new Callable<Integer>() {
        @Override
        public Integer call() throws Exception {
            return updateSharedNotebook(sharedNotebook);
        }
    }, callback);
}
 
开发者ID:fivef,项目名称:add_to_evernote_note,代码行数:9,代码来源:EvernoteNoteStoreClient.java

示例6: listSharedNotebooksAsync

import com.evernote.edam.type.SharedNotebook; //导入依赖的package包/类
public Future<List<SharedNotebook>> listSharedNotebooksAsync(EvernoteCallback<List<SharedNotebook>> callback) {
    return submitTask(new Callable<List<SharedNotebook>>() {
        @Override
        public List<SharedNotebook> call() throws Exception {
            return listSharedNotebooks();
        }
    }, callback);
}
 
开发者ID:fivef,项目名称:add_to_evernote_note,代码行数:9,代码来源:EvernoteNoteStoreClient.java

示例7: getSharedNotebookByAuthAsync

import com.evernote.edam.type.SharedNotebook; //导入依赖的package包/类
public Future<SharedNotebook> getSharedNotebookByAuthAsync(EvernoteCallback<SharedNotebook> callback) {
    return submitTask(new Callable<SharedNotebook>() {
        @Override
        public SharedNotebook call() throws Exception {
            return getSharedNotebookByAuth();
        }
    }, callback);
}
 
开发者ID:fivef,项目名称:add_to_evernote_note,代码行数:9,代码来源:EvernoteNoteStoreClient.java

示例8: deleteNotebook

import com.evernote.edam.type.SharedNotebook; //导入依赖的package包/类
/**
 * Providing a LinkedNotebook referencing a Business notebook, perform a delete
 *
 * Synchronous call
 *
 * @return guid of notebook deleted
 */
@Override
public int deleteNotebook(LinkedNotebook linkedNotebook) throws TException, EDAMUserException, EDAMSystemException, EDAMNotFoundException {

  AsyncLinkedNoteStoreClient sharedNoteStore = getClientFactory().createLinkedNoteStoreClient(linkedNotebook);
  SharedNotebook sharedNotebook = sharedNoteStore.getAsyncClient().getClient().getSharedNotebookByAuth(sharedNoteStore.getAuthenticationToken());

  Long[] ids = {sharedNotebook.getId()};
  getAsyncClient().getClient().expungeSharedNotebooks(getAuthenticationToken(), Arrays.asList(ids));
  return getAsyncPersonalClient().getClient().expungeLinkedNotebook(getAsyncPersonalClient().getAuthenticationToken(), linkedNotebook.getGuid());
}
 
开发者ID:duanze,项目名称:PureNote,代码行数:18,代码来源:AsyncBusinessNoteStoreClient.java

示例9: getCorrespondingNotebook

import com.evernote.edam.type.SharedNotebook; //导入依赖的package包/类
/**
 * Will return the {@link Notebook} associated with the {@link LinkedNotebook} from the business account
 *
 * Synchronous call
 *
 * @param linkedNotebook
 */
@Override
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());
}
 
开发者ID:duanze,项目名称:PureNote,代码行数:16,代码来源:AsyncBusinessNoteStoreClient.java

示例10: createNotebook

import com.evernote.edam.type.SharedNotebook; //导入依赖的package包/类
/**
 * Create Linked Notebook from a Notebook
 *
 * Synchronous call
 *
 * @return {@link LinkedNotebook} with guid from server
 */
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(EvernoteSession.getOpenSession().getAuthenticationResult().getBusinessUser().getUsername());
  linkedNotebook.setShardId(EvernoteSession.getOpenSession().getAuthenticationResult().getBusinessUser().getShardId());

  return getAsyncPersonalClient().getClient().createLinkedNotebook(getAsyncPersonalClient().getAuthenticationToken(), linkedNotebook);
}
 
开发者ID:duanze,项目名称:PureNote,代码行数:21,代码来源:AsyncLinkedNoteStoreClient.java

示例11: deleteNotebook

import com.evernote.edam.type.SharedNotebook; //导入依赖的package包/类
/**
 * Providing a LinkedNotebook referencing a linked account, perform a delete
 *
 * Synchronous call
 *
 * @return guid of notebook deleted
 */
public int deleteNotebook(LinkedNotebook linkedNotebook) throws TException, EDAMUserException, EDAMSystemException, EDAMNotFoundException {

  SharedNotebook sharedNotebook = getAsyncClient().getClient().getSharedNotebookByAuth(getAuthenticationToken());

  Long[] ids = {sharedNotebook.getId()};
  getAsyncClient().getClient().expungeSharedNotebooks(getAuthenticationToken(), Arrays.asList(ids));
  return getAsyncPersonalClient().getClient().expungeLinkedNotebook(getAsyncPersonalClient().getAuthenticationToken(), linkedNotebook.getGuid());
}
 
开发者ID:duanze,项目名称:PureNote,代码行数:16,代码来源:AsyncLinkedNoteStoreClient.java

示例12: createNoteInLinkedNotebook

import com.evernote.edam.type.SharedNotebook; //导入依赖的package包/类
/**
 * @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);
}
 
开发者ID:fivef,项目名称:add_to_evernote_note,代码行数:10,代码来源:EvernoteLinkedNotebookHelper.java

示例13: getCorrespondingNotebook

import com.evernote.edam.type.SharedNotebook; //导入依赖的package包/类
/**
 * @return The notebook for this linked notebook.
 */
public Notebook getCorrespondingNotebook() throws TException, EDAMUserException, EDAMSystemException, EDAMNotFoundException {
    SharedNotebook sharedNotebook = mClient.getSharedNotebookByAuth();
    return mClient.getNotebook(sharedNotebook.getNotebookGuid());
}
 
开发者ID:fivef,项目名称:add_to_evernote_note,代码行数:8,代码来源:EvernoteLinkedNotebookHelper.java

示例14: createSharedNotebook

import com.evernote.edam.type.SharedNotebook; //导入依赖的package包/类
public SharedNotebook createSharedNotebook(SharedNotebook sharedNotebook) throws EDAMUserException, EDAMNotFoundException, EDAMSystemException, TException {
    return mClient.createSharedNotebook(mAuthenticationToken, sharedNotebook);
}
 
开发者ID:fivef,项目名称:add_to_evernote_note,代码行数:4,代码来源:EvernoteNoteStoreClient.java

示例15: updateSharedNotebook

import com.evernote.edam.type.SharedNotebook; //导入依赖的package包/类
public int updateSharedNotebook(SharedNotebook sharedNotebook) throws EDAMUserException, EDAMNotFoundException, EDAMSystemException, TException {
    return mClient.updateSharedNotebook(mAuthenticationToken, sharedNotebook);
}
 
开发者ID:fivef,项目名称:add_to_evernote_note,代码行数:4,代码来源:EvernoteNoteStoreClient.java


注:本文中的com.evernote.edam.type.SharedNotebook类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。