Search DominoPower's 11,323 Lotus-related article archive 
Home
EasyPrint
News details Click here for the RSS feed's XML code. This is not a browser URL.
Articles-only Click here for the RSS feed's XML code. This is not a browser URL.
Twitter Feed Click here for the Twitter feed.
PROGRAMMING POWER
The further case of Last Modified dates
By Mick Moignard

Back in the March issue of DominoPower Magazine I wrote about document lastmodified dates -- see http://www.dominopower.com/issues/issue200403/00001250001.html. Maybe someone at Lotus reads DominoPower, because in the latest ND7 beta, beta2 at the time of this writing, lo and behold, NotesDatabase.getModifiedDocuments has been included.

NotesDatabase.getModifiedDocuments
What NotesDatabase.getModifiedDocuments does is return a collection of documents that have been modified since a given date and time. While it defaults to returning a collection of data documents, you can set flags to also return non-data documents, meaning you can also use it to track changes to design elements if you need to.

The returned collection is stamped with an "Until" time -- NotesDocumentCollection.UntilTime. This enables you to design an agent that steps forward on successive runs, only dealing with documents it has previously seen.

Just like NotesDatabase.Search, NotesDatabase.getModifiedDocuments also seems to filter on the values stored as NotesDocument.LastModified time, which as we saw back in March, is just one of the many document modification times that Notes keeps. This actually solves the problem that I described in March rather well, better than the solution we devised then with Notes 6.5.

To recap, what we wanted to do was design an agent that worked on documents that had changed since it last ran. How we solved it then was to use the cut-off time in a Db.Search. We then recorded the time that the agent started, which basically was the time we actually did the search.

On the next run, we retrieved that stored date, and used that as the cut-off time on the next search. It worked, but was a bit cumbersome. It also relied on the captured agent start date/time and the search actually happening at the same instant, which they might not.

This whole process will be simplified when we move forward to ND7. Instead of making the collection with a search, we use the new NotesDatabase.getModifiedDocuments, which will give us the same collection as we had before. So no change there.

But we can also capture the UntilTime from the collection (NotesDocumentCollection.UntilTime) and store that, rather than capturing the agent start time. So on the next run, the next time we make a getModifiedDocuments collection, we replay back into the call the stored UntilTime, and know that we will have a seamless move forward to the next set of modified documents, if any. Indeed, if you do a getModifiedDocuments and the collection is empty, it still gives a new UntilTime.

Cool. Thanks, Lotus.

Mick Moignard has been working and traveling with Lotus Notes since Release 2.0 in 1991. Mick is a DominoPower Senior Technical Editor and a Principal CLP with Unipart Expert Practices, a Lotus Advanced Partner in the UK. If you want to discuss anything to do with this article, or indeed anything else to do with Notes and Domino, contact Mick at Mick_Moignard@unipart.co.uk. Unipart Expert Practices will also happily discuss any opportunities you may have with any Notes and Domino application development or infrastructure projects you need help with. Unipart Expert Practices can be found at http://www.unipartep.com.


Other articles you might like
Home > Lotus Technologies > Application Development (48 articles)
   An application for scanning physical mail and distributing it virtually
   How hide-whens in Rich Text can ruin your whole day (and what to do about it)
   Little known traps about Lotus Notes fields
Get Weekly Email Updates
Subscribe to our regular weekly email newsletter. It's packed with tips, reviews, deep analysis, and the latest news.
 
Recent DominoPower Articles
Lotusphere 2010: mobility and collaboration
2010: A Lotusphere of change
Five trends for 2010
DominoPower TV Episode 1: Inside a strategy session with Teamstudio
More about Domino log files
Say goodbye to the Uh-Ohs. Long live the Tens.
Why your log.nsf might not be purging properly
Latest Lotus Headlines
Recommended Maintenance - Lotus Notes Traveler
Here are the slides and other materials from our Lotusphere session
Microsoft OCS awareness in Lotus Connections and Websphere Portal?
SnTT: XPages Blank Calendar Control (Part 2), adding data
Have your Lotus Notes calendar display multiple time zones
Sample Database for Microsoft Office and Lotus Symphony Integration
Symphony 3.0 beta signals another attack on Office
>> Read all the news
More from the ZATZ journals
Computing Unplugged: The iPad: Apple's latest heartbreaker
David Gewirtz Online: CNN commentary and analysis
OutlookPower: Running auto-respond rules when Outlook is closed
-- Advertisement --

Sophisticated Meets Simple For Document Management
Share. Control. Manage.
Documents, emails, and content in the context of how work is done. Native to Lotus Domino. The User Experience unseen for Lotus Domino. Do more with less. Really.

See the possibilities Docova unleashes for Lotus Domino.
-- Advertisement --

Teamstudio announces the 2010 spotlight awards winners!
We had some extraordinary submissions for the 3rd annual Teamstudio Spotlight Awards, and choosing the winners was no easy task for our judges! Click here to find out who won, and to learn more about these remarkable applications and the genius developers behind them!

Tap here for more information.
ZATZ Home  ·  News  ·  Back Issues  ·  Credits/Trademarks ·  Link To Us
Copyright © 1998-2010, ZATZ Publishing. All rights reserved worldwide.
Editor's Login