Hello.
I have a requirement to create a Java program to query inbox message of a user with specific range. Currently, I use API to query to {$Inbox} view, then use getAllEntriesByKey() method specifying DateRange object of the range to query. For example
===============================
String ior = NotesFactory.getIOR(host);
Session s = NotesFactory.createSessionWithIOR(ior, username, password);
Database db = s.getDatabase(“”, “mail/aadmin.nsf”);
View view = db.getView(“($Inbox)”);
DateTime begin = s.createDateTime(dateFormat.parse(“2005-01-01 00:00:00”));
DateTime end = s.createDateTime(dateFormat.parse(“2005-12-30 23:59:59”));
DateRange dateRange = s.createDateRange(begin, end);
ViewEntryCollection c = view.getAllEntriesByKey(dateRange);
===============================
This code has been working fine because {@Inbox} view is sorted by date column with match the parameter passes in to getAllEntriesByKey method.
But soon our Lotus Domino backend will be upgraded to 6.5 and custom mail template is going to be used which the column not sorted by date anymore. This will break our current code since parameter to getAllEntriesByKey has to match the sorted column.
The solution I am thinking is to query directly to user database without using view, but use formula language instead (use Database.search()). I come up with this query
==============================
"DeliveredDate != “”
& PostedDate > @Date(2003; 01; 01; 11; 05; 00)
& PostedDate < @Date(2006; 06; 17; 11; 30; 00)
==============================
I figured out that only incoming mail will have “DeliveredDate” property set, and the property which is shown in Date column in Lotus Notes is “PostedDate”. Is this correct?
The problem I am having here is with this query I will get all incoming mail in specified range, from all folder, NOT just from inbox. Is there anything I can add to this query to filter only incoming mail which is in “Inbox” folder only?
Thank you very much in advanced.
Tinnapat Chaipanich
Software Engineer
PWS Consulting Co., Ltd
Email: tinnapat.c@pwsconsulting.com