| The LDAPTemplate is invoked to process LDAP tags embedded in
a document. This version requires the "ldap40.jar" file from the
Netscape Navigator distribution.
The LDAPTemplate uses the following special tag:
When an LDAP tag is seen, the LDAP database is searched and the results
are used to populate the request properties.
The following configuration parameters are used to perform the search.
The parameters may appear either in the request properties (preceded by
the prefix of this template as specified in the configuration file) or as
named arguments in the LDAP tag.
-
prefix
- The string prefix for the property names that will be stored
in the request properties to hold the results. If not specified,
defaults to the prefix of this template as specified in the
configuration file.
-
dn
- The Distinguished Name (DN) to lookup in the LDAP server. The format
of a DN is described in RFC-1779. The "dn" and "search" options are
mutually exclusive. When "dn" is specified, only zero or one result
will be returned from the LDAP database. The result (if any) will be
stored in the request properties as follows:
<ldap dn="uid=6105,ou=people,o=WebAuth" prefix=name>
<property name.dn>
<property name.cn>
<property name.sn>
<property name.objectclass>
etc. The property name.dn is the DN that was
found. Other properties will be defined as shown, based on the
attributes present in the LDAP record.
-
search
- The search filter to use when searching the LDAP server. The format
of a search filter is described in RFC-1558. The "search" and "dn"
options are mutually exclusive. When "search" is specified, zero or
more results will be returned from the LDAP database. The results
will be stored in the request properties as follows:
<ldap search="(givenname=scott)" prefix=name>
<property name.rows>
<property name.0.dn>
<property name.0.cn>
<property name.0.mail>
<property name.1.dn>
<property name.1.cn>
<property name.1.pager>
etc. The property name.rows is set to the list
of record indices found, and can be used by the BSL tag
<foreach name=x property=name.rows> to
iterate over all records. Other properties will be defined for
each of the records found as shown, based on the attributes present
in the each of the LDAP records.
-
base
- The Distinguished Name of the base record that forms the root of the
search tree in the LDAP database. Used only with the "search" option.
Defaults to "". This would be a good option to specify in the
configuration file rather than in the LDAP tag.
-
scope
- The scope of the LDAP search, one of
- "base" Search only in base record (specified by the "base" option).
- "one" Search only records one level below the base record.
- "sub" Search the entire subtree below the base record.
Used only with the "search" option. Defaults to "sub". This would
be a good option to specify in the configuration file rather than in
the LDAP tag.
-
attributes
- The space-delimited list of attribute names to return from the
LDAP "dn" or "search" operation. If empty or unspecified, all
attributes for the record are returned. Not all records in the
LDAP database have the same attributes. Defaults to "".
-
host
- The hostname of the LDAP server, of the form
"host"
or "host:port" if the server is not running on the
standard LDAP port. Defaults to "". This would be a good option to
specify in the configuration file rather than in the LDAP tag.
-
authenticate
- The Distinguished Name used for authenticating to the LDAP server,
if necessary. Defaults to "". This would be a good option to specify
in the configuration file rather than in the LDAP tag.
-
password
- The password sent when the "authenticate" option is used. Defaults
to "".
author: Colin Stevens (colin.stevens@sun.com) version: 1.4, 01/01/14 |