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.
Access list management system (continued)

ACLAddPersonAgent
The next agent used adds a person to the list. Here's a brief description of all of the functions of ACLAddPersonAgent, 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.

GetAddVariables
This agent parses the Query_String of the called agent to get the name to add to the access list and the access level. It's definitely a useful piece of code to use for extracting arguments passed to an agent through the Query_String. I know I'm going to reuse this code a lot.

Sub GetAddVariables

Dim queryString As String
queryString = note.Query_String(0)

Dim param1, param2, param1Name, param2Name As String

param1Name = "&addname="
param2Name = "&addlevel="

'--Get Value for Parameter 1
If Instr(Lcase(queryString), param1Name) > 0 Then
param1 = queryString
'--Cut off everything in the query string to the left of parameter 2
param1 = Mid(param1, Instr(param1, param1Name) + Len (param1Name))
'--Cut off everything to the right, if any
If Instr(param1, "&") > 0 Then
param1 = Left(param1, Instr(param1, "&") -1)
End If
Else
'--Bad Request Handler
Print {<body>}
Print {<H1>Bad Parameter 1</H1>}
Print {</body>}
End If

'--Get Value for Parameter 2
If Instr(Lcase(queryString), param2Name) > 0 Then
param2 = queryString
'--Cut off everything in the query string to the left of parameter 2
param2 = Mid(param2, Instr(param2, param2Name) + Len(param2Name))
'--Cut off everything to the right, if any
If Instr(param2,"&") > 0 Then
param2 = Left(param2, Instr(param2, "&") -1)
End If
Else
'--Bad Request Handler
Print {<body>}
Print {<H1>Bad Parameter 2</H1>}
Print {</body>}
End If

'--Get and set the delete name and the access level
addName = ReplaceSubstring(param1,"+"," ")
addLevel = param2

End Sub

AddToGroup
The absolute core of this agent is the following straightforward code in the AddToGroup sub that actually adds a person to the member field on a group document.

'--Add this person to this group
If Not (groupDoc Is Nothing) Then
Dim memberItem As NotesItem
Set memberItem = groupDoc.GetFirstItem("Members")
Call memberItem.AppendToTextList(addName)
Call groupDoc.Save(True, True)
success = "Yes"

Call ResortGroupDocument(groupName)
End If


« Previous  ·  1  ·  2  ·  3  ·  4  ·  5  ·  6  ·  7  ·  Next »
Other articles you might like
Home > Lotus Technologies > LotusScript (64 articles)
   When the debugger won't debug hidden code that isn't hidden
   What to do if the LotusScript debugger won't single-step over code
   Little known traps about Lotus Notes fields
Home > Lotus Technologies > Access Control (7 articles)
   Forcing immediate indexes to actually update immediately
   Enabling and disabling the single login setting in Notes 6
   Coding Domino server tasks in C: beyond Windows
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 --

Integrate your Notes Applications with Microsoft Office and Symphony
Integra for Notes Integrates Microsoft Office and/or IBM Lotus Symphony
Requires NO change to the design of the appliation or Installations of DLL's and EXE's
  • Integra is a ready to use solution, enhance static reports with Excel data analysis, pivot tables, macros
  • User friendly aproach, using a point and click access to features
  • Reports from any Lotus Notes databases
  • Runs reports through a Notes client, web browser and scheduled basis
  • Allows use of LotusScript for advanced data manipulation
  • Enables self service reporting capabilities to end-users


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