$ldap

Used to access LDAP servers.
Syntax$ldap{addToEnviroment}{key_1}{value_1} ... {key_n}{value_n} $ldap{bind} $ldap{clearAttributes} $ldap{close} $ldap{createSubcontext}{dn} $ldap{destroySubContext}{dn} $ldap{getAttributes}{dn} $ldap{getEnviroment}{dn} $ldap{getNameInNamespace}{dn} $ldap{list}{dn} $ldap{lookup}{dn} $ldap{modifyAttributes}{dn}{mode} $ldap{NamingException}{request} $ldap{rebind} $ldap{removeFromEnviroment}{key} $ldap{rename}{old_dn}{new_dn} $ldap{search}{dn}{filter} $ldap{setAttribute}{key}{value_1} ... {value_n} $ldap{unbind} $ldap{setSearchResultCountLimit}{limit} $ldap{setSearchScope}{scope} $ldap{setSearchTimeLimit}{limit}
Documentation

$//Set the Environment properties and build the connection

$ldap{addToEnvironment}{PROVIDER_URL}{ldap://localhost:389}

$ldap{addToEnvironment}{AUTHENTICATION}{simple}

$ldap{addToEnvironment}{PRINCIPAL}{cn=root, o=SITEFORUM, c=DE}

$ldap{addToEnvironment}{CREDENTIALS}{secret}

$try

{

$ldap{bind}

}

{$ldap{NamingException}{getExplanation}}

$//List the dn: o=SITEFORUM, c=DE

$try

{

$set{listing}{$ldap{list}{o=SITEFORUM, c=DE}}

}

{$ldap{NamingException}{getExplanation}}

$forEach{subcontext}{$get{listing}}

{

$get{subcontext}

}{$ }

$//List the attributes of the context

$try

{

$set{attributes}{$ldap{getAttributes}{o=SITEFORUM, c=DE}}

}

{$ldap{NamingException}{getExplanation}}

$forEach{attribute}{$get{attributes}}

{

$get{attribute}

}{$ }

$//Create the subcontext 'cn=Nikos Vitalis, o=SITEFORUM, c=DE'.See also RFC 2253 about distinguished names.

$try

{

$//Remove any cashed attributes

$ldap{clearAttributes}

$//Create the attributes of the subcontext to use for creation

$ldap{setAttribute}{objectclass}{top}{person}{organizationalPerson}{inetOrgPerson}

$ldap{setAttribute}{givenname}{Nikos}

$ldap{setAttribute}{sn}{Vitalis}

$ldap{setAttribute}{cn}{Nikos Vitalis}

$//Create the subcontext.

$ldap{createSubcontext}{cn=Nikos Vitalis, o=SITEFORUM, c=DE}

}

{$ldap{NamingException}{getExplanation}}

$//Rename the newly created context

$try

{

$ldap{rename}{cn=Nikos Vitalis, o=SITEFORUM, c=DE}{cn=Nick Vitalis, o=SITEFORUM, c=DE}

}

{$ldap{NamingException}{getExplanation}}

$//Modify the attributes of the newly created context

$try

{

$//Clear any cashed attributes

$ldap{clearAttributes}

$//Define the attributes to be modified

$ldap{setAttribute}{givenname}{Nick}

$ldap{setAttribute}{cn}{Nick Vitalis}

$//Modify the attributes

$ldap{modifyAttributes}{cn=Nick Vitalis, o=SITEFORUM, c=DE}{REPLACE}

}

{$ldap{NamingException}{getExplanation}}

$//Search for the newly creted context

$try

{

$//Set the search control properties

$ldap{setSearchResultCountLimit}{10}

$ldap{setSearchScope}{SUBTREE}

$ldap{setSearchLimit}{10000}

$//Create the search filter. See also RFC 2254 for how to use search filters

$set{filter}{(sn=Vitalis)}

$//Search for the context

$set{searchResult}{$ldap{search}{o=SITEFORUM, c=DE}{$get{filter}}}

$//List the search results

$forEach{result}{$get{searchResults}}

{

$get{result}

}{$ }

}

{$ldap{NamingException}{getExplanation}}

$//Remove the newly created context and close the connection

$try

{

$ldap{destroySubcontext}{cn=Nick Vitalis, o=SITEFORUM, c=DE}

$ldap{close}

}

{$ldap{NamingException}{getExplanation}}

Used to build LDAP clients.

Specifies the Environment properties to be used for building the connection to a LDAP server: $ldap{addToEnvironment}{key_1}{value_1} ... {key_n}{value_n}

Parameters:

addToEnvironment, a flag to indicate that a Environment property is to be set.

key_1 through key_n, the names of the Environment properties to set. Valid values are:

AUTHORITATIVE, specify the authoritativeness of the service requested.

LANGUAGE, specify the prefered language to use with the service.

REFERRAL, specify how referrals encountered by the service provider are to be processed.

AUTHENTICATION, specify the security level to use.

CREDENTIALS, specify the credentials of the principal for authenticating the caller to the service.

PRINCIPAL, specify the identity of the principal for authenticating the caller to the service.

PROTOCOL, specifying the security protocol to use.

PROVIDER_URL, specifying configuration information for the service provider to use.

value_1 through value_n, the values of the corresponding keys.

Builds a connection to the specified LDAP server: $ldap{bind}

Parameters: bind, a flag to indicate that a connection is to be established.

Throws: an javax.naming.NamingException if an error occurs.

Deletes the cached attributes: $ldap{clearAttributes}

Parameters: clearAttributes, a flag to indicate that the cashed attributes are to be deleted.

Closes the connection to the LDAP server and deletes the Environment properties: $ldap{close}

Parameters:

close, a flag to indicate that the current LDAP connection is to be closed.

Throws:

a javax.naming.NamingException if an error occurs.

Creates a subcontext to the context currently bind to: $ldap{createSubcontext}{dn}

Parameters:

createSubcontext, a flag to indicate that a subcontext is to be created.

dn, the distinguished name of the subcontext to be created (RFC 2253).

Throws:

an javax.naming.NamingException if an error occurs.

Deletes a subcontext of the context currently bind to: $ldap{destroySubcontext}{dn}

Parameters:

destroySubcontext, a flag to indicate that the named subcontext is to be deleted.

dn, the distinguished name of the subcontext to be deleted (RFC 2253).

Thows:

a javax.naming.NamingException if an error occurs.

Retrieves the attributtes of the named context: $ldap{getAttributes}{dn}

Parameters:

getAttributes, a flag to indicate that the attributes of the named context are requested.

dn, an optional parameter to specify the context by its distinguished name (RFC 2253).

Returns:

a $ separeted list of key=value pairs. If an distinguished name is given, then the attributes of the specified context are returned. Else the cashed attributes are returned.

Throws:

a javax.naming.NamingException if an error occurs.

Retrieves the environment properties: $ldap{getEnvironment}

Parameters:

getEnvironment, a flag to indicate that the Environment properties are requested.

Returns:

a $ separeted list of key=value pairs.

Returns the name of the current context: $ldap{getNameInNamespace}

Parameters:

getNameInNamespace, a flag to indicate that the name of the context currently bind to is requested.

Returns:

the absolute distinguished name of the current context (RFC 2253).

Throws:

a javax.naming.NamingException if an error occurs.

Returns a listing of the named context: $ldap{list}{dn}

Parameters:

list, a flag to indicate that a listing is requested. dn, the distinguished name of the context whos listing is requested (RFC 2253).

Returns:

a $ separeted list of the subcontexts of the named context.

Throws:

a javax.naming.NamingException if an error occurs.

Retrieves the named context: $ldap{lookup}{dn}

Parameters:

lookup, a flag to indicate that the named context is requested.

dn, the distinguished name of the context to be retrieved (RFC 2253).

Throws:

an javax.naming.NamingException if an error occurs.

Modifies the attributes of the named context: $ldap{modifyAttributes}{dn}{mode}

Parameters:

modifyAttributes, a flag to indicate that the attributes of the named context are to be modified.

dn, the distinguished name of the context whos attributes are to be modified (RFC 2253).

mode, the mode of the modification.

Valid values are:

ADD, the specified attributes are to be added to the existing.

REMOVE, the specified attributes are to be removed.

REPLACE, the values of the existing attributes are to be replaced by the specified.

Throws:
an javax.naming.NamingException if an error occurs.

Note: the attributes to be modified have to be specified before calling this method. See $ldap{setAttribute}.

Retrieves the properties of the last occured LDAP error: $ldap{NamingException}{request}

Parameters:

NamingException, a flag to indicate that the property of the last error occured is requested.

request, the property of the error requested. Valid values are:

clear, deletes the exception object.

getClassName, retrieves the classname of the exception.

getExplanation, retrieves the exceptions explanation.

getRemainingName, returns the unresolved portion of the dn.

getResolvedName, returns the portion of the dn resolved successfully.

Returns:

the requested property of the exception.

Reconnects to the LDAP server using the specified Environment properties: $ldap{rebind}

Parameters:

a flag to indicate that a new connection is requested.

Throws:

an javax.naming.NamingException if an error occurs.

Removes the specified entry from the envirement properties: $ldap{removeFromEnvironment}{key}

Parameters:

removeFromEnvironment, a flag to indicate that the named property is to be removed from the environment.

key, the name of the property.

Renames the specified context: $ldap{rename}{old_dn}{new_dn}

Parameters:

rename, a flag to indicate that the specified context is to be renamed.

old_dn, the distinguished name of the context to be renamed.

new_dn, the new name of the context.

Throws:

an javax.naming.NamingException if an error occurs.

Searches the specified context: $ldap{search}{dn}{filter}

Parameters:

search, a flag to indicate that a search is requested.

dn, the distinguished name of the context to search (RFC 2253).

filter, a entity to search for (RFC 2254).

Returns:

a $ separated list of all matches.

Throws:

a javax.naming.NamingException if an error occurs.

Sets an attribute: $ldap{setAttribute}{key}{value_1} ... {value_n}

Parameters:

setAttribute, a flag to indicate that an attribute is to be set.

key, the name of the attribute.

value_1 through value_n, the values of the attribute.

Closes the connection to the LDAP server without deleting the Environment properties: $ldap{unbind}

Parameters:

unbind, a flag to indicate that the connection is to be closed.

Throws:

an javax.naming.NamingException if an error occurs.

Sets the maximum amount of results returned by a search statement: $ldap{setSearchResultCountLimit}{limit}

Parameters:

setSearchResultCountLimit, a flag to indicate that the result limit is to be set.

limit, a positive integer value representing the maximum amount of results returned by a search.

Sets the scope of a search: $ldap{setSearchScope}{scope}

Parameters:

setSearchScope, a flag to indicate that the scope of a search is to set.

scope, the scope of the search. Valid values are:

OBJECT, search the named context.

ONELEVEL, search the first level of the named context.

SUBTREE, search the subtree rooted at the named context.

Sets the maximum search duration: $ldap{setSearchTimeLimit}{limit}

Parameters:

setSearchTimeLimit, a flag to indicate that the maximum search duration is to be set.

limit, the maximum search duration in milliseconds.

Examples
GroupNet
Minimum required transaction-mode:NONE
Required scripting permission of the developerPERMISSION_FL_EXPERT
Minimum parameters1
Maximum parameters <unlimited>