本文整理汇总了Java中com.evernote.edam.type.Note.getGuid方法的典型用法代码示例。如果您正苦于以下问题:Java Note.getGuid方法的具体用法?Java Note.getGuid怎么用?Java Note.getGuid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.evernote.edam.type.Note
的用法示例。
在下文中一共展示了Note.getGuid方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: parseFromNote
import com.evernote.edam.type.Note; //导入方法依赖的package包/类
public static GNote parseFromNote(Note note) {
GNote gNote = new GNote();
String content = Html.fromHtml(note.getContent()).toString();
// int length = content.length();
// gNote.content = content.substring(0, length - 2);//去除掉最后的两个换行符-_-||
gNote.content = content.replace("\n\n", "\n");
gNote.guid = note.getGuid();
gNote.bookGuid = note.getNotebookGuid();
gNote.createdTime = note.getCreated();
gNote.editTime = note.getUpdated();
parseTime(note, gNote);
return gNote;
}
示例2: createNote
import com.evernote.edam.type.Note; //导入方法依赖的package包/类
/**
* Create a new note containing a little text and the Evernote icon.
*/
private void createNote() throws Exception {
// To create a new note, simply create a new Note object and fill in
// attributes such as the note's title.
Note note = new Note();
note.setTitle("Test note from EDAMDemo.java");
String fileName = "enlogo.png";
String mimeType = "image/png";
// To include an attachment such as an image in a note, first create a
// Resource
// for the attachment. At a minimum, the Resource contains the binary
// attachment
// data, an MD5 hash of the binary data, and the attachment MIME type.
// It can also
// include attributes such as filename and location.
Resource resource = new Resource();
resource.setData(readFileAsData(fileName));
resource.setMime(mimeType);
ResourceAttributes attributes = new ResourceAttributes();
attributes.setFileName(fileName);
resource.setAttributes(attributes);
// Now, add the new Resource to the note's list of resources
note.addToResources(resource);
// To display the Resource as part of the note's content, include an
// <en-media>
// tag in the note's ENML content. The en-media tag identifies the
// corresponding
// Resource using the MD5 hash.
String hashHex = bytesToHex(resource.getData().getBodyHash());
// The content of an Evernote note is represented using Evernote Markup
// Language
// (ENML). The full ENML specification can be found in the Evernote API
// Overview
// at http://dev.evernote.com/documentation/cloud/chapters/ENML.php
String content = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
+ "<!DOCTYPE en-note SYSTEM \"http://xml.evernote.com/pub/enml2.dtd\">"
+ "<en-note>"
+ "<span style=\"color:green;\">Here's the Evernote logo:</span><br/>"
+ "<en-media type=\"image/png\" hash=\"" + hashHex + "\"/>"
+ "</en-note>";
note.setContent(content);
// Finally, send the new note to Evernote using the createNote method
// The new Note object that is returned will contain server-generated
// attributes such as the new note's unique GUID.
Note createdNote = noteStore.createNote(note);
newNoteGuid = createdNote.getGuid();
System.out.println("Successfully created a new note with GUID: "
+ newNoteGuid);
System.out.println();
}