203 Lotus blogs updated hourly. Who will post next? Home | Blogs | Search | About 
 
Latest 7 Posts
Bleedyellow.com has a new home
Sat, Nov 11th 2017 11
Life sign / Major update for Domino JNA on Github
Fri, Nov 10th 2017 10
New APIs for Domino JNA project, now available for XPages development
Mon, Jan 16th 2017 3
New APIs for Domino JNA project, now available for XPages development
Mon, Jan 16th 2017 1
My latest wish list for the Domino Java API
Thu, Nov 3rd 2016 4
My latest wish list for the Domino Java API
Thu, Nov 3rd 2016 2
Big update for Domino JNA project on Github
Mon, Jul 11th 2016 2
Top 10
Bleedyellow.com has a new home
Sat, Nov 11th 2017 11
Life sign / Major update for Domino JNA on Github
Fri, Nov 10th 2017 10
Tools we use to build web apps
Sun, Sep 21st 2014 6
XSS security fix in Domino R9 HTTP server may break existing web applications
Mon, Jun 3rd 2013 6
Quick tip: Fixing Dojo drag and drop issues in a Windows 8 VMWare on the Mac
Thu, Mar 7th 2013 6
Fast Notes view reading via Java API:New ViewNavigator cache methods in 8.5.3
Thu, Jan 17th 2013 6
Download links for IBM Connect 2013 session slides
Thu, Jan 31st 2013 5
Notes 9.0.1 64 bit for Mac OS X 10.11 El Capitan now available - warning our customer NOT to update for 30+ days!
Tue, Sep 29th 2015 5
New on Github: Domino JNA - Cross-platform access to IBM Notes/Domino C API methods from Java
Fri, Apr 8th 2016 5
Big update for Domino JNA project on Github
Mon, Jul 11th 2016 5


My latest wish list for the Domino Java API
Twitter Google+ Facebook LinkedIn Addthis Email Gmail Flipboard Reddit Tumblr WhatsApp StumbleUpon Yammer Evernote Delicious
Karsten Lehmann    

Last week I sent an email with enhancement ideas for the Domino Java API to IBM development. Most of the stuff listed here (except new @-functions) can be implemented by wrapping existing C API functions or simple copy&paste of already existing code.
We already did this using our Domino JNA project, but I thought it would be a good idea to add this functionality to the standard API and provide full platform support.

I don't really have unrealistic expectations whether this will ever be added to the product, given the latest speed new features got in, but I haven't given up hope yet.

I am posting this here in the blog in case it is interesting for anyone.


1. ViewNavigator View.createViewNavForSelection(int[] noteIds)
Filter a view navigator to only return entries with specified note ids, e.g. received via previous lookups.

Using the C API, this can be done by opening the view with NIFOpenCollection and populating the ID table "rethSelectedList":

STATUS LNPUBLIC NIFOpenCollection(
DBHANDLE hViewDB,
DBHANDLE hDataDB,
NOTEID ViewNoteID,
WORD OpenFlags,
HANDLE hUnreadList,
HCOLLECTION far *rethCollection,
NOTEHANDLE far *rethViewNote,
UNID far *retViewUNID,
HANDLE far *rethCollapsedList,
HANDLE far *rethSelectedList);


To navigate the view, NIFReadEntries would be called with NAVIGATE_NEXT_SELECTED / NAVIGATE_PREV_SELECTED flag.

2. int[] View.getAllIdsByKey(Object key, boolean exact)
Convenience function to only read the note ids of view entries matching the lookup key for better performance (less data in the summary buffer returned from NIFReadEntries, so more rows read with one C API call).

Using the C API, this can be done with NIFReadEntries calls where only READ_MASK_NOTEID is used as return data mask.

3. View.getViewEntryByKeyWithOptions(Object startKey, int searchOptions)

This function is already available in the XPages runtime and would need to be copied over to the Domino Java API. The AbstractDominoViewPickerData class in the Extension Library uses it to locate view entries with a search key greater or equal "X":
https://github.com/the-ntf/xspstarterkit/blob/master/extlib/com.ibm.xsp.extlib.domino/src/com/ibm/xsp/extlib/component/picker/data/AbstractDominoViewPickerData.java#L221

ViewEntry ve=null;
String startKey = options.getStartKey();
if(startKey!=null) {
        int searchOptions = DominoUtils.FIND_GREATER_THAN|DominoUtils.FIND_EQUAL|DominoUtils.FIND_PARTIAL|DominoUtils.FIND_CASE_INSENSITIVE;
        ve = DominoUtils.getViewEntryByKeyWithOptions(view, startKey, searchOptions);
} else {
        ve=nav.getCurrent();
}


So this gives us a way to do inequality searches for Strings and Numbers in views and decide if keys need to be case sensitive.



These functions can be combined to implement powerful view lookups, e.g. filter view entries by multiple column values and sort the result dynamically.


Here is an example:

View myView = db.getView("MyView");
myView.setAutoUpdate(false);

//resort view by first sort column
myView.resortView("firstsortcolumn", true);

//get matches for first search key
int[] noteIdsFirstKey = myView.getAllIdsByKey(firstSearchKey, false);

//resort view by second sort column
myView.resortView("secondsortcolumn", true);

//get matches for second search key
int[] noteIdsSecondKey = myView.getAllIdsByKey(secondSearchKey, false);

//intersect both note ids lists: list1 AND list2 using some tool class
int[] noteIdsFirstAndSecondKey = IDUtil.and(noteIdsFirstKey, noteIdsSecondKey);

//resort view by third sort column
myView.resortView("thirdsortcolumn", true);

//get matches for third search key
int noteIdsThirdKey = myView.getAllIdsByKey(thirdSearchKey, false);

//merge intersection of first/second key matches with third: (list1 AND list2) OR list3
int[] noteIdsFirstAndSecondKeyOrThirdKey = IDUtil.or(noteIdsFirstAndSecondKey, noteIdsThirdKey);

//and now we produce the final sorting:
myView.resortView("finalsortcolumn", true);

//we would need this API to reduce the view to entries with specified note ids with max performance (let NIF skip irrelevant collection entries for us)
ViewNavigator nav = myView.createViewNavForSelection(noteIdsFirstAndSecondKeyOrThirdKey);
nav.setCacheGuidance(400, ViewNavigator.VN_CACHEGUIDANCE_READSELECTIVE);

//skip some view entries to support paging
nav.skip(start);

//write requested page data (start/count) in JSON format:
ViewEntry veCurrent = nav.getCurrent();
while (veCurrent!=null && count>0) {
        if (veCurrent.isValid()) {
                writeAsJson(veCurrent);
                count--;
        }

        //read next view entry matching our selection list
        ViewEntry veNext = nav.getNext();
        veCurrent.recycle();
        veCurrent = veNext;
}



This view lookup technique is already being used by us at a big Domino customer in Germany using C calls (Domino JNA project), but platform support is currently limited to those supported by JNA and this should really be part of the standard API.



Other useful APIs to add:

4. @ModifiedInThisFile / @AddedToThisFile (posted in the Design Partner Forum in January 2014)
Two new @-functions to sort view entries by the date their corresponding documents got added to/modified in the database. Required for synchronization of Domino data with external databases. Using @modified instead would not cover changes coming in via replication that happened before the cutoff date for the current data synchronization. Response to DP forum article in 2014 said the feature will be in 9.0.2, so it seems to be already implemented and would need to be added to a feature pack.

5. NoteCollection.add(int[] noteIds)
Fast bulk add function to add many note ids at once to a NoteCollection for better performance.

6. int[] DocumentCollection.getNoteIDs()
Fast method to get all note ids stored in a DocumentCollection as an int array. If DocumentCollection is sorted internally, the array should have the same sorting.
Could be used in combination with "DocumentCollection Database.FTSearch()" to quickly get a note id list of documents matching a fulltext search.

7. int[] Database.getDeletedDocuments(DateTime since, int noteClass)
Method to get a list of note ids for documents deleted since the specified datetime. C API function NSFDbGetModifiedNoteTable already returns deleted notes ORed with RRV_DELETED flag. So this function would simply copy this list to an int array.
Already available method Database.getModifiedDocuments(DateTime since, int noteClass) is no help because it filters out deleted documents.

Use case is data synchronisation between Domino databases and with external systems.



---------------------
https://www.mindoo.com/web/blog.nsf/dx/03.11.2016111046KLEDXT.htm
Nov 03, 2016
3 hits



Recent Blog Posts
11
Bleedyellow.com has a new home
Sat, Nov 11th 2017 11:16a   Karsten Lehmann
It took some time and the domain transfer is not 100% complete, but bleedyellow.com is on it's way from René Winkelmeyer to Mindoo. Our blog is currently configured to be the default website on www.bleedyellow.com We do not have any plans yet for the domain, but did not want to let it expire. If you have any suggestions, feel free to comment.
10
Life sign / Major update for Domino JNA on Github
Fri, Nov 10th 2017 4:25p   Karsten Lehmann
Wow - I haven't written a blog post in the last 9 months! It's just so much easier to write a Tweet than to produce long articles, when I split the week between three customers and my family with two children. Just wanted to let you know that we are alive and kicking and still doing very much Domino related work! :-) Technologies have as always shifted a bit. Most of the time we create pure JavaEE projects now for our customer web apps, developed in Eclipse and not Domino Designer (ok, u
3
New APIs for Domino JNA project, now available for XPages development
Mon, Jan 16th 2017 8:21a   Karsten Lehmann
It took some time (mainly because I was very busy and my main use case for the project is not XPages), but now the Domino JNA project is available for XPages development. That means that there is an XPages Extensibility API plugin available in the project's release section on Github that can be installed both in Domino Designer and on the Domino R9 server to use the API in your own applications. After installation, the API classes are available in SSJS and Java code including API source c
1
New APIs for Domino JNA project, now available for XPages development
Mon, Jan 16th 2017 6:21a   Karsten Lehmann
It took some time (mainly because I was very busy and my main use case for the project is not XPages), but now the Domino JNA project is available for XPages development. That means that there is an XPages Extensibility API plugin available in the project's release section on Github that can be installed both in Domino Designer and on the Domino R9 server to use the API in your own applications. After installation, the API classes are available in SSJS and Java code including API source c
3
My latest wish list for the Domino Java API
Thu, Nov 3rd 2016 9:10a   Karsten Lehmann
Last week I sent an email with enhancement ideas for the Domino Java API to IBM development. Most of the stuff listed here (except new @-functions) can be implemented by wrapping existing C API functions or simple copy&paste of already existing code. We already did this using our Domino JNA project, but I thought it would be a good idea to add this functionality to the standard API and provide full platform support. I don't really have unrealistic expectations whether this will ever be
2
Big update for Domino JNA project on Github
Mon, Jul 11th 2016 9:33p   Karsten Lehmann
Last weekend, I committed a big update for the Domino JNA project on Github. Here is what's new: Note (Document) APIs The last weeks since creating the project, I added basic APIs to work with database notes (documents). The main focus was to be able to read the classic note item value types, e.g. String, Number and Date/Time with single or multiple values per item, handle a few rarely known edge cases (e.g. multiline text values that Domino stores with delimiter between the lines
0
New on Github: Domino JNA - Cross-platform access to IBM Notes/Domino C API methods from Java
Fri, Apr 8th 2016 5:11p   Karsten Lehmann
I would like to introduce you to a pet project that I have been working on for the last months: Domino JNA - Cross-platform access to IBM Notes/Domino C API methods from Java As you might have already read in this blog in the past, we have been playing with the Domino C API for some time now and found out that you can speed up view reading dramatically when you talk directly to the C API instead of using IBM's Java classes. The C API also provides lots of other functionality for whic
1
Updated on OpenNTF: Release 1.1 of Open Eclipse Update Site with Mac 64 Bit Client support and other cool stuff
Thu, Mar 3rd 2016 11:23p   Karsten Lehmann
I have updated the OpenNTF project "Open Eclipse Update Site" with release version 1.1 and added the following useful features: added support for the Mac Notes Client with 64 bit new view action to extract selected features as an update site to disk (also available in headless mode via Java agents “(API)” and “(Java-API)“) new view actions to install/uninstall selected features via rcplauncher based deployment, which is used by software distribution systems and should
2
Notes 9.0.1 64 bit for Mac OS X 10.11 El Capitan now available - warning our customers NOT to update for 30+ days!
Tue, Sep 29th 2015 8:30a   Karsten Lehmann
One day before the general availability of Mac OS X 10.11 (El Capitan), IBM released an update for their IBM Notes Client 9.0.1 with 64 bit support: http://www-01.ibm.com/common/ssi/cgi-bin/ssialias?subtype=ca&infotype=an&appname=iSource&supplier=877&letternum=ENUSZP15-0483 Previous versions were using Java 1.6 32 Bit under the hood, which was maintained by Apple for the last 7 years. Since Apple dropped support for Java 1.6 in OS X 10.11, IBM had to update their IBM Mac No
1
New C API method NIFFindByKeyExtended2 in Domino 9.0 improves view lookups
Fri, Mar 6th 2015 12:48p   Karsten Lehmann
Once again I am digging into the Notes/Domino C API to implement fast and powerful view lookups. What caused it this time was a customer requirement for "Notes Client style keyboard navigation" in web views, meaning that you type a character, press enter and the cursor position should be moved to the relevant area of the view (e.g. where the content in the first sorted view column is greater or equal letter "L"). Using standard Java APIs for this purpose (ViewNavigator.getNextSibling(), unt




Created and Maintained by Yancy Lent - About - Planet Lotus Blog - Advertising - Mobile Edition