Search DominoPower's 11,441 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.
Inside mail distribution: the programming project (continued)

@Elements(rules) <= 1

Before we look at the agent that actually manages the groups, there's one other thing to look at. This is the PostDocumentDelete code in the Database Script. This is used to detect the deletion of Group definitions. It asks whether the actual Group itself is to be deleted from the Directory. The Lotuscript code for this can be seen at http://www.component-net.com/dp-extras/dp-200106-1.html.

The agent
The core of the application is the agent that actually processes the groups. This agent can be run by hand or on schedule. One proviso, however, is that the database is physically resident on a server. This is because the agent and other code that looks at the directory assumes that it will operate on the Names.NSF that's found on the same machine as the database itself. The code of the agent can be found at http://www.component-net.com/dp-extras/dp-200106-2.html.

Let's look at some of it's features I've numbered the lines of the code so that it's easy to call out interesting features.

First, you'll see running though it that all messages are logged to a NotesLog database (see Initialize, lines 12-14, for example). This feature of Notes isn't commonly used, but it's very useful for background agents; it keeps all the messages together and out of the Domino server log, making them easier to find and trace. From the developer's point of view, it's also very easy to use. The only thing you have to do before running any code is to create the actual agent log database, using the Lotus ALog4.ntf template, and give it the same filename as used on theNotesLog.OpenNotesLog call. I recommend the use of NotesLog databases for applications with background agents and in places where some sort of audit trail of actions is required. It's a real neat and easy way to keep track of what's happened.

Initialize lines 15-19 get hold of all the Active group definitions. Then the For loop starting at line 20 starts processing each of these. Line 30 calls the CheckDNAB sub to check if the group exists in the directory and to see whether the owner field contains the GroupOwner value from the Group definition form. If the group doesn't exist in the directory, the call to CreateGroup at line 31 gets it created. Then we use CheckDNAB again to read it back and set values in the indicator fields DNABGroupFound and DNABOK. The sub CreateGroup is modeled on the Group form in the Domino Directory and is intended to mimic the fields and values that are created when Groups are created by hand.

So by the time the agent gets to line 37 in sub Initialize, the group exists in the directory, and we're ready to go. The key to the whole process is the sub RulesProcess, which turns the set of rules for this group into a NotesDatabase.Search formula and then executes it.

At line 5 it starts the search formula off with Select Form = "Person", and then loops through the set of rules for the group. At lines 8-10, the current rule is connected with an And or an Or with any previous one. Once we have checked in lines 13-16 that the rule specified actually exists, at line 30 we start building a formula for this rule. If the comparison is not case-sensitive, we put both sides of the comparison in uppercase. Also note that we use @Contains and @Left to perform the operators Contains and Startswith in the operator list we saw in Figure C. Lines 57-61 handle the rule having a second part, and if so, lines 62-85 handle the second part of the rule as we've already seen. It's quite neat here using the debugger to watch how the search string is being built up.


« Previous  ·  1  ·  2  ·  3  ·  4  ·  Next »
Other articles you might like
Home > Strategies > Email Management (60 articles)
   Using the Notes Client with Gmail
   Using the Notes client with Hotmail (or not)
   Is English-only a viable mail management strategy?
Home > Social Computing > Messaging (10 articles)
   A Sametime plugin for Trillian
   DAMO deep-six: is there a future for Outlook/Domino integration?
   Why I STILL recommend Domino over Exchange
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
Application development, William Shatner, and the origin of the universe
Learn Domino Designer 8.5 for free
The (near) future of Sametime, Quickr, Connections, and Symphony
Inside the IBM Innovations lab
Lotusphere 2010: Hot fixes and cool news for Notes, Domino, and LotusLive
Lotusphere 2010: mobility and collaboration
2010: A Lotusphere of change
Latest Lotus Headlines
Xpages not loading? JVM errors? - Solution
How to implement an iCalendar feed into your Notes calendar with XPages
DWA Hotfixes for Domino 8.5.1FP1 - A Gotcha
IBM Adds DB2 to Lotus Foundations SMB Package
SNTT : XPages onclick Ghosts in the machine
Ports used by Lotus Sametime 8.5 servers
Exploring a Domino Date Bug
>> Read all the news
More from the ZATZ journals
Computing Unplugged: The iPad defenders have spoken
David Gewirtz Online: CNN commentary and analysis
OutlookPower: More about disappearing text
-- 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 --

Struggling with exporting Notes data to spreadsheets? No More!
Try IntelliPRINT, The world's leading Reporting, Dashboards, and Analysis solution for Notes & Domino

  • Don't spend unproductive time maintaining different versions of the same spreadsheet
  • Preserve data integrity and security in multi-user environments
  • Create reports in minutes INSIDE Notes
  • Get freedom from iterative report requests, deliver self-serve capabilities

Experience Reporting, Dashboards, and Analysis INSIDE Notes.

Try IntelliPRINT NOW!

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