|
|
|
|
|
|
|
|
|
|
|
|
|
|
Access list management system (continued)
ResortGroupDocument
This function is called by the AddToGroup sub above and gets a handle on the group document that just had a value added to it and sorts the member field by last name.
MagicBubbleSort
This sub is called by the ResortGroupDocument function. This is the code that, as its name implies, actually does all of the sorting. Don't forget that a bubble sort isn't the most efficient. This works on a small list, but as your list grows, this sorting algorithm will take longer.
SendEmailAlert
This sub sends an email alert to whomever you specify. Right now it's hard-coded but you can customize it easily.
ACLDeletePersonAgent You already know how to add a person. But what if you want to delete a person? Here's a brief description of all of the functions of ACLDeletePersonAgent, and what each does.
Declarations
Be sure to look here to familiarize yourself with all of the different global variables that are used in this agent.
Options
The complete code for this section follows:
Option Public
'-Use script library to get essential function code
Use "ACL Agent Script Library"
|
Initialize
The Initialize Sub in this agent controls the flow of this agent and then prints out a short confirmation message upon success or an error message.
SetGlobalVariables
Be sure to customize this section based on the location of your key databases.
GetDeleteVariables
See the code for the GetAddVariables sub in the ACLAddPersonAgent code description above.
DeleteFromGroup
Here is the core code from the DeleteFromGroup sub that deletes a person from a group by building a new member array that excludes the deleted person and then reassigns this new member array to the group document.
'--Add this person to this group
If Not (groupDoc Is Nothing) Then
'--If the Group doc exists, loop through the members and create a new array excluding the deleted person
i% = 0
Forall member In groupDoc.Members
If (ProperCase(member) <> deleteName) Then
Redim Preserve newMemberArray(i%)
newMemberArray(i%) = member
i% = i% + 1
Elseif (ProperCase(member) = deleteName) Then
deleteSuccessful = "Yes"
End If
End Forall
Else
'--Do Nothing if the group document does not exist
Exit Sub
End If
'--Replace the Members field of the group document with the newMemberArray
groupDoc.Members = newMemberArray
Call groupDoc.Save(True, True)
|
SendEmailAlert
This sub sends an email alert to whomever you specify. Right now it is hard-coded but you can customize it easily.
ACL Agent Script Library
The ACL Agent Script Library contains a lot of functions for use with the above agents. You can also just steal any one of the functions and make it do your bidding. Here is a quick list of the functions that are included in the script library: RightChar, LeftChar, ReplaceSubstring, ProperCase, CheckRole, ErrorRoutine, and GetHTML. The agents above won't function without this script library, so make sure you add it to whatever database you might add these agents.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- 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. |
|
|
|
|
|
|
|
|
|
|