Email:   
Home
In This Issue
Email a Friend
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.
Control your application's agents with this Agent Launchers tool (continued)

Using naming standards at the field level may seem too picky, but it has an extra advantage: it helps clarify which field names you arbitrarily chose for the application (e.g., fAnyField, fdDisplayField, ftTempField), and which fields have special meaning to Notes (e.g., SaveOptions, Categories, SendTo). This can make your application's design much more understandable, especially to less experienced Notes developers.

Notes ACL roles are case sensitive, so I make all my reusable tools use lower-case roles. I use @LowerCase when referencing these roles so that I can easily add a tool to an application that uses the same roles with different case (e.g., "[Admin]" instead of "[admin]").

Launching agents manually
When designing an agent, you can set "When should this agent run?" to "Manually From Actions Menu". Once an agent is set up this way, it cannot be removed from the Actions Menu, renamed, or set to run on schedule. Use standard Notes features. The best way to avoid duplicating code between identical scheduled and UI agents is to move their code into a script library.

Instead of creating two agents and a script library for every agent that needs to be run manually and on schedule, it's possible to use a single scheduled agent and create a special interface for launching it manually. This may seem like a lot of pain for a little gain, but this interface will provide a lot of flexibility and can be reused in many applications.

The manual launch interface I use consists of a configurable list of UI agents and a launching agent named "Launch Agent...|agtAGTLauncher". The launcher is the only agent in the database that needs to be set to run from the Actions Menu, since it can then launch any other agent.

The configurable list could be stored as a profile document, but I prefer to use standard documents that can be accessed through standard views. The core of my reusable settings tool is the frmSetting form, the vwSettings view, and the vwLookSettings lookup view. For more information about this tool, please refer to my article in the July 2001 issue of Notes.net at http://www.notes.net/today.nsf/lookup/jul2001.

The manual launch interface's setting document is named "ManualLaunchList" and is accessible through vwLookSettings. It contains the list of UI agents in its fValues field. Each entry in the list consists of the name to display for a given agent, a pipe ( | ), and the real name of the agent.

The Application Setting is pictured in Figure C.

FIGURE C

Here you can see the Application Setting. Click picture for a larger image.

The launcher agent uses @DBLookup to get the list of UI agents, exiting with an error message if the lookup fails. It then breaks the list into two parts, display names and real names, and passes the display names to @Prompt([OkCancelList]). If the user selects a display name and doesn't cancel, the corresponding real name is extracted from its list. Passing this real name into @Command([ToolsRunMacro]) launches the selected agent.




[ Prev | Next ]

ZATZ Home  ·  News  ·  Back Issues  ·  Credits/Trademarks ·  Link To Us
-- Advertisement --

2-Minute Tutorials
How do I...

  • integrate MS Office or OpenOffice with Notes?
  • create cross-tab reports and charts?
  • print serial letters and mailing labels?
  • create PDFs in Lotus Notes?


Check out the 2-minute tutorials here.
-- Advertisement --

Get in the Spotlight! Teamstudio Spotlight Awards 2009
For the second year, Teamstudio is holding the Teamstudio Spotlight Awards Contest to recognize developers of the Notes community for their most remarkable Notes applications! Winners will be announced at Lotusphere 2009 January and featured in DominoPower in the month of February. Prizes to include:

1st Prize: Your choice of one configured software product with installation at one site, Teamstudio's complete suite of tools for one user and an iPod Touch.
2nd Prize: Teamstudio's complete suite of tools.
3rd Prize: One tool of your choice.

For more information on how to enter, click here!

Copyright © 1998-2008, ZATZ Publishing. All rights reserved worldwide.
Editor's Login