Skip to content

Instantly share code, notes, and snippets.

@markleusink
Last active October 2, 2018 09:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save markleusink/0878a306f63a92ab486451bc749bf056 to your computer and use it in GitHub Desktop.
Save markleusink/0878a306f63a92ab486451bc749bf056 to your computer and use it in GitHub Desktop.
String fakenamesPath = "fakenames2018.nsf";
// open the target database/ view (collection)
NotesDatabase db = new NotesDatabase(ExtLibUtil.getCurrentSession(), "", fakenamesPath);
NotesCollection collection = db.openCollectionByName("contacts");
// read total number of entries
totalEntries = collection.getTopLevelEntries();
// tell the API how to navigate in the view: from one entry to the next (in view ordering)
EnumSet<Navigate> returnNavigator = EnumSet.of(Navigate.NEXT);
// tell the API which data we want to read from the view
// (in this case note ids and column itemname/value map)
EnumSet<ReadMask> returnData = EnumSet.of(ReadMask.NOTEID, ReadMask.SUMMARYVALUES);
int skipEntries = 1;
int NUM_PER_PAGE = 15;
// read the data from the collection
List<NotesViewEntryData> viewEntries = collection.getAllEntries("0",
1, returnNavigator,
NUM_PER_PAGE, returnData,
new EntriesAsListCallback(NUM_PER_PAGE));
//store the view entry data in a list containing maps
List<Map<String, Object>> entries = new ArrayList<Map<String, Object>>();
for( NotesViewEntryData entry : viewEntries) {
entries.add( entry.getColumnDataAsMap() );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment