Last active
October 2, 2018 09:29
-
-
Save markleusink/0878a306f63a92ab486451bc749bf056 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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