On Domino, the execution of LotusScript is handled by an agent attached to a database. The Domino adapter will execute LotusScript in any one of the following ways:
Input |
Results |
---|---|
agentName |
Runs the agent. |
agentName and script |
Updates the agent with the script and runs the agent. |
agentName, agentCreate, and script |
Creates an agent with the script and runs the agent. |
The following customized account attributes can be used with LotusScript. If any of these attributes are to be used, add the attribute on the Domino Gateway schema map. Specify IGNORE_ATTR as the value in the Resource User Attribute column.
agentName. Identifies the name of the agent to execute. This attribute must be specified, or an error will be returned.
agentServer. Specifies the location of the database where the agent has been installed, and where to run the agent. This attribute defaults to the value specified in the Registration Server Machine resource parameter (REG_SERVER) if not present.
agentDBName. Specifies the database name where the agent can be found. This attribute defaults to the value specified in the Names Database resource parameter (NAB) on the resource.
agentCreate. Specifies the flag that indicates whether the adapter should create a new agent, if the named agent is not found. This attribute defaults to false. A non-NULL value enables this flag.
If you specify agentCreate you must also specify LotusScript to be executed.
Agents arguments will be given in a note handle to LotusScript in a special property from the back-end NotesSession class. It can be defined as follows:
NotesDocument = NotesSession.DocumentContext
The NotesDocument can be instantiated by the action script routine and its field values can be read in as parameters to the LotusScript subroutine.
The following is a Lotus script example that gets the name a value of any arguments defined in the document.
Dim session As New NotesSession Dim doc As NotesDocument Set doc = session.DocumentContext Forall i In doc.Items Dim attrVal As Variant attrVal = doc.GetItemValue(i.Name) Print(" Attribute Name: " + i.Name + " Value: " + attrVal(0)) End Forall
All of the attributes defined during the action call will be put into the NotesDocument prefixed with WSUSER_, just as in the case of the NT actions.
Actions are run using the Windows command interpreter cmd.exe with extensions enabled. Actions that run before a user operation must return a zero value. Otherwise, the operation is aborted.
As with NT/ADSI cmd actions, the environment variables are exported and available to actions. These comprise any one of the schema-mapped attributes that have values on the user (defined in the resource schema map in the Identity Manager User Attribute column), prefixed by WSUSER_.
Multi-valued attributes consist of a pipe-separated list, as in:
WSUSER_groups=staff|admin|users