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


Java NoteFilter.setWords方法代码示例

本文整理汇总了Java中com.evernote.edam.notestore.NoteFilter.setWords方法的典型用法代码示例。如果您正苦于以下问题:Java NoteFilter.setWords方法的具体用法?Java NoteFilter.setWords怎么用?Java NoteFilter.setWords使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.evernote.edam.notestore.NoteFilter的用法示例。


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

示例1: FindNotesTask

import com.evernote.edam.notestore.NoteFilter; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public FindNotesTask(int offset, int maxNotes, @Nullable Notebook notebook, @Nullable LinkedNotebook linkedNotebook, @Nullable String query) {
    super((Class) List.class);

    NoteFilter noteFilter = new NoteFilter();
    noteFilter.setOrder(NoteSortOrder.UPDATED.getValue());

    if (!TextUtils.isEmpty(query)) {
        noteFilter.setWords(query);
    }else{
        //TODO: let the user choose a tag he wants here we just use favorit as tag to filter by
        List<String> list = new ArrayList();
        list.add("03750a45-c107-4e8b-afbf-29fa22777244");
        noteFilter.setTagGuids(list);
    }

    if (notebook != null) {
        noteFilter.setNotebookGuid(notebook.getGuid());
    }

    mSearch = new EvernoteSearchHelper.Search()
            .setOffset(offset)
            .setMaxNotes(maxNotes)
            .setNoteFilter(noteFilter);

    if (linkedNotebook != null) {
        mSearch.addLinkedNotebook(linkedNotebook);
    } else {
        mSearch.addScope(EvernoteSearchHelper.Scope.PERSONAL_NOTES);
    }

}
 
开发者ID:fivef,项目名称:add_to_evernote_note,代码行数:33,代码来源:FindNotesTask.java

示例2: findNoteBySource

import com.evernote.edam.notestore.NoteFilter; //导入方法依赖的package包/类
/**
 * Search for note using the note's source attribute
 * 
 * @param source The source attribute to search for 
 * @return
 * @throws Exception
 */
public NoteList findNoteBySource(String source) throws Exception {
	NoteFilter filter = new NoteFilter();
	String query = "source:\"" + source + "\"";
	filter.setWords(query);

	NoteList notes = noteStore.findNotes(filter, 0, 10);
	
	return notes;
}
 
开发者ID:windsource,项目名称:evernote-markdown-sync,代码行数:17,代码来源:MyEvernoteService.java

示例3: listNotesWithinNotebook

import com.evernote.edam.notestore.NoteFilter; //导入方法依赖的package包/类
/**
 * return a user's all notes(uuid-ENNote) inside the specified notebook.
 *
 * @param args
 *            all things needed to list notes, such as notebook guid.
 * @return The notes in the certain notebook.
 */
@Override
public Map<String, ENNote> listNotesWithinNotebook(final ENNote args) throws EDAMUserException, EDAMSystemException, EDAMNotFoundException, TException {
    NoteFilter filter = new NoteFilter();
    filter.setInactive(false);
    if (StringUtils.isNotBlank(args.getNotebook().getGuid())) {
        filter.setNotebookGuid(args.getNotebook().getGuid());
    }
    if (StringUtils.isNotBlank(args.getName())) {
        filter.setWords(Constants.EDAM_SYNTAX_INTITLE + StringUtil.toQuotedString(args.getName()));
    }

    NotesMetadataResultSpec resultSpec = new NotesMetadataResultSpec();
    resultSpec.setIncludeTitle(true);

    NoteStoreClient client = factory.getNoteStoreClient();
    if (args.getNotebook().getType() == ENObjectType.LINKED) {
        // args.getNotebook().getLinkedObject() should NOT be null
        client = factory.getLinkedNoteStoreClient((LinkedNotebook) args.getNotebook().getLinkedObject());
    }

    List<NoteMetadata> noteList = ListUtil.list();
    int offset = 0, pageSize = com.evernote.edam.limits.Constants.EDAM_USER_NOTES_MAX;
    NotesMetadataList notesMetadataList = null;
    do {
        notesMetadataList = client.findNotesMetadata(filter, offset, pageSize, resultSpec);
        noteList.addAll(notesMetadataList.getNotes());
        offset = offset + notesMetadataList.getNotesSize();
    } while (notesMetadataList != null && offset < notesMetadataList.getTotalNotes());

    Map<String, ENNote> map = MapUtil.map();
    for (NoteMetadata n : noteList) {
        if (map.containsKey(n.getTitle())) {
            map.put(n.getTitle() + ConstantsUtil.LEFT_PARENTHESIS + n.getGuid() + ConstantsUtil.RIGHT_PARENTHESIS, ENNoteImpl.forNameAndGuid(n.getTitle(), n.getGuid()));
        } else {
            map.put(n.getTitle(), ENNoteImpl.forNameAndGuid(n.getTitle(), n.getGuid()));
        }
    }
    return map;
}
 
开发者ID:LTTPP,项目名称:Eemory,代码行数:47,代码来源:EeClipperImpl.java

示例4: onResume

import com.evernote.edam.notestore.NoteFilter; //导入方法依赖的package包/类
@Override
public void onResume() {
    super.onResume();
    // ここで読みに行く
    ClientFactory factory = mProvider.getEvernoteSession()
            .getClientFactory();
    try {
        AsyncNoteStoreClient client = factory.createNoteStoreClient();

        NoteFilter filter = new NoteFilter();
        filter.setOrder(NoteSortOrder.UPDATED.getValue());
        filter.setWords("evernote_sample");
        client.findNotes(filter, 0, 20, new OnClientCallback<NoteList>() {
            public void onSuccess(NoteList data) {
                ArrayAdapter<String> adapter = (ArrayAdapter<String>) getListAdapter();
                adapter.clear();
                for (Note note : data.getNotes()) {
                    adapter.add(note.getTitle());
                }
                adapter.notifyDataSetChanged();
            };

            @Override
            public void onException(Exception exception) {
                exception.printStackTrace();
                Toast.makeText(getActivity(), "接続に失敗しました",
                        Toast.LENGTH_SHORT).show();
            }
        });
    } catch (Exception e) {
        e.printStackTrace();
        Toast.makeText(getActivity(), "接続に失敗しました", Toast.LENGTH_SHORT)
                .show();
    }
}
 
开发者ID:android-opensource-library-56,项目名称:android-opensource-library-56,代码行数:36,代码来源:MainFragment.java

示例5: searchNotes

import com.evernote.edam.notestore.NoteFilter; //导入方法依赖的package包/类
/**
 * Search a user's notes and display the results.
 */
private void searchNotes() throws Exception {
	// Searches are formatted according to the Evernote search grammar.
	// Learn more at
	// http://dev.evernote.com/documentation/cloud/chapters/Searching_notes.php

	// In this example, we search for notes that have the term "EDAMDemo" in
	// the title.
	// This should return the sample note that we created in this demo app.
	String query = "intitle:EDAMDemo";

	// To search for notes with a specific tag, we could do something like
	// this:
	// String query = "tag:tagname";

	// To search for all notes with the word "elephant" anywhere in them:
	// String query = "elephant";

	NoteFilter filter = new NoteFilter();
	filter.setWords(query);
	filter.setOrder(NoteSortOrder.UPDATED.getValue());
	filter.setAscending(false);

	// Find the first 50 notes matching the search
	System.out.println("Searching for notes matching query: " + query);
	NoteList notes = noteStore.findNotes(filter, 0, 50);
	System.out
			.println("Found " + notes.getTotalNotes() + " matching notes");

	Iterator<Note> iter = notes.getNotesIterator();
	while (iter.hasNext()) {
		Note note = iter.next();
		System.out.println("Note: " + note.getTitle());

		// Note objects returned by findNotes() only contain note attributes
		// such as title, GUID, creation date, update date, etc. The note
		// content
		// and binary resource data are omitted, although resource metadata
		// is included.
		// To get the note content and/or binary resources, call getNote()
		// using the note's GUID.
		Note fullNote = noteStore.getNote(note.getGuid(), true, true,
				false, false);
		System.out.println("Note contains " + fullNote.getResourcesSize()
				+ " resources");
		System.out.println();
	}
}
 
开发者ID:winture,项目名称:wt-studio,代码行数:51,代码来源:HelpEverNote.java


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