|
|
|
|
|
|
|
|
|
|
|
|
|
|
Control your application's agents with this Agent Launchers tool (continued)
In addition to this basic functionality, I often find it useful to specify which users can use which agents. As I mentioned before, using the launcher agent in combination with the agent list setting allows the developer or administrator to modify or remove any agent in this list without making a design change. One possible use for this might be to hide miscellaneous development/testing agents once the application has been tested and moved into production.
Still, instead of completely hiding the various agents used during development, you might find it useful to only hide them from non-developers. To do this, you would need to create a "[developer]" role and maintain a separate list of the agents that only developers can run. For that matter, creating an "[admin]" role and agent list might also be a good idea.
If this level of security is necessary for a given application, the launcher agent can optionally support the "[developer]" and "[admin]" roles and agent lists. After getting the standard list of available agents from the ManualLaunchList setting, it also checks whether the user has the "[developer]" or "[admin]" roles; if so, it gets the corresponding agent lists and appends them to the standard list.
REM "Allows an user to launch an agent manually (e.g. a scheduled agent or one that cannot be launched from the actions menu).";
REM "This tool requires the Agents*ManualLaunchList setting. It optionally also uses the [admin] and [developer] roles, and their respective lists.";
REM "Get the standard list of agents";
errmsg := "ERROR: Please notify the database owner that this lookup failed.";
choicelist := @DbLookup( "" : "NoCache"; "" ; "vwLookSettings" ; "Agents*ManualLaunchList" ; "fValues" );
@If(
@IsError(choicelist);
@Do(
@Prompt([OK]; "Error"; errmsg);
@Return("")
);
""
);
REM "Get the admin and/or developer lists of agents, if the user has access and they exist.";
roles := @LowerCase (@UserRoles);
choicelistadmin := @If(
@IsMember("[admin]"; roles);
@DbLookup( "" : "NoCache"; "" ; "vwLookSettings" ; "Agents*ManualLaunchListAdmin" ; "fValues" );
""
);
choicelistdev := @If(
@IsMember("[developer]"; roles);
@DbLookup( "" : "NoCache"; "" ; "vwLookSettings" ; "Agents*ManualLaunchListDev" ; "fValues" );
""
);
REM "Concatenate the lists of agents, removing blanks and duplicates. Split out the names and aliases.";
choicelistall := @Trim ( @Unique(
choicelist :
@If (@IsError(choicelistadmin); ""; choicelistadmin) :
@If (@IsError(choicelistdev); ""; choicelistdev)
) );
namelist := @Left( choicelistall; "|" );
aliaslist := @Right( choicelistall; "|" );
REM "Get user selection";
namechoice := @Prompt([OKCANCELLIST]:[NoSort]; "Select Agent"; ""; @Subset(namelist; 1); namelist);
@If(
namechoice = "";
@Return("");
""
);
REM "Get the corresponding alias and launch it";
pos := @Member (namechoice; namelist);
aliaschoice := @Subset ( @Subset (aliaslist; pos); -1);
@Command([ToolsRunMacro]; aliaschoice)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- Advertisement --
Learn Notes and Domino 8 at your place and pace!
Learn Notes and Domino in your office and/or home! TLCC's highly acclaimed distance learning courses for users, developers, and admins will enhance your career and your resume.
The many included activities and demos will make you a pro! Expert instructor help is a click away.
Click here to try a FREE demo course!! |
-- Advertisement --
Mark your calendar for in-depth Lotus training, May 12-14, Boston
Join experts and peers May 12-14 in Boston for educational and networking events that deliver real-world Lotus training so you can increase productivity and efficiency in your company, advance your skills, and squeeze the most from your current environment. One registration gets you into THE VIEW's Admin2010 and Lotus Developer2010.
Register by April 10 to save $200. |
|
|
|
|
|
|
|
|
|
|