Jump to content

Welcome! You're currently a Guest.

If you'd like to join in the Discussion, or access additional features in our forums, please sign in with your Evernote Account here. Have an Evernote Account but forgot your password? Reset it! Don't have an account yet? Create One! You'll need to set your Display Name before your first post.

Photo

Problem Java api constants


  • Please log in to reply
1 reply to this topic

#1 Alex Druga

Alex Druga

  • Pip
  • Title: Member
  • Group: Members
  • 3 posts

Posted 29 February 2012 - 03:23 PM

Hi,

I was trying to use the suplied Java API JAR
to make a call to findNotes() where i want to retrieve all notes that pass the filter
so i wanted not to set the maxNotes or set it to the maximum possible

like this:
noteStore.findNotes(userAccessToken, filter, 0, maxNotes);

in the api docs it says the maxNotes must be between 0 and EDAM_USER_NOTES_MAX

but the Constants class only has the following static members

EDAM_NOTE_SOURCE_MAIL_CLIP
EDAM_NOTE_SOURCE_MAIL_SMTP_GATEWAY
EDAM_NOTE_SOURCE_WEB_CLIP

I've looked at the suplied source files and the Constants.java file does have all the constants
and i was able to get the number for EDAM_USER_NOTES_MAX from there.

I'm just writing this to inform you guys of this problem with the class in the JAR.

#2 SethH

SethH

  • Title: Evernote Employee
  • Group: Evernote Employee
  • 683 posts

Posted 01 March 2012 - 07:46 AM

Yah, this can be a little confusing. There's a separate constants file for each module; EDAM_USER_NOTES_MAX is in com.evernote.edam.limits.Constants. The three constants that you referenced are in com.evernote.edam.type.Constants.

That said, this isn't the value that you want to be using. EDAM_USER_NOTES_MAX is the maximum number of notes that a user is allowed to have in their Evernote account. When you're calling findNotes, maxNotes is the size of the page that you want back. If your search matches 10,000 notes, you probably don't want to get all of those back in one gigantic HTTP response. Instead, you might want to fetch 100 at a time and page through them. It's also important to note that the server may return less than maxNotes, even if there are more matches:

@param maxNotes The most notes to return in this query. The service will return a set of notes that is no larger than this number, but may return fewer notes if needed. The NoteList.totalNotes field in the return value will indicate whether there are more values available after the returned set.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Clip to Evernote