Sun ONE Directory Server Resource Kit 5.2 Tools Reference |
Chapter 34
NameFinder ApplicationNameFinder is a web-based tool to look up people in an Lightweight Directory Access Protocol (LDAP) database. This chapter provides information on NameFinder. It contains the following sections:
OverviewNameFinder shows all relevant LDAP entries in an LDAP database based on certain search parameters. In order to run the application, you need either Sun ONE Web Server 6.0 SP5 or higher or Sun ONE Application Server 7.0 or higher to deploy it. The Java Development Kit (JDK) 1.4.0 or higher must be installed on the server. The WAR file and related files can be found in DSRK_base/NameFinder.
Caution
The Java Development Kit (JDK) 1.4.0 or higher is mandatory. The default JDK for Sun ONE Web Server 6.0 is JDK 1.3.0 and NameFinder will not run on this.
Deploying NameFinderBefore you can deploy a web application manually, you must make sure that the web_server_base/bin/https/httpsadmin/bin directory is in your path and the IWS_SERVER_HOME environment variable is set to your web_server_base directory.
Sun ONE Web Server 6.0 SP5 has a web interface that can be used to easily deploy a web archive (WAR) file. Figure 34-1 is a screen shot of the WAR deployment interface.
Figure 34-1
Web Server Interface For WAR Deployment
More complete information on how to deploy a WAR file using the interface or via the command line can be found in the documentation for Sun ONE Web Server 6.0.
Configuring NameFinderAfter deploying the application, you need to modify the NameFinder.properties file. The NameFinder servlet (as defined in the file itself) retrieves this file automatically for configuration information to display entries from your directory. NameFinder.properties is located in DSRK_base/NameFinder/WEB-INF/classes. The following sections detail the information defined in NameFinder.properties. The information and attribute/value pairs are taken from the sample.properties file also included in DSRK_base/NameFinder/WEB-INF/classes. sample.properties was created for documentation purposes.
Server Configuration Attributes
Information concerning the directory server and directory tree is defined in NameFinder.properties. This includes the base DN, the server domain and the version of LDAP used by the server. The server configurations are:
NameFinder.ldapBase=ou=people,dc=siroe,dc=com
NameFinder.ldapServers=directory.siroe.com
NameFinder.ldapVersion=2
(If no LDAP version is specified, the default is 3.)
NameFinder.servletName=NameFinder
(If no servlet name is specified, the default is NameFinder.)
NameFinder.ldapPort=389
(If no port is specified, the default is 389.)
NameFinder.ldapUser=
NameFinder.ldapPasswd=
Note
Only simple authentication (anonymous or user-based) is supported. If you require SSL authentication, the connection must be provided by the servlet utilities.
LDAP Attribute Configurations
NameFinder can only obtain the LDAP attributes specified in this section of NameFinder.properties. The attribute fields are defined in ascending order. The syntax for the attribute configuration line is:
NameFinder.attr#=arg1|arg2|arg3|arg4|arg5
Where:
- The hash sign (#) represents the number given to the attribute/value pair. The numbers must be defined in ascending order. If an attribute number is missing, any attributes after the last valid sequential attribute are ignored.
- arg1 denotes the search field option. Options are used in the search field to define a search for the particular attribute. For example, if you specify f for first name, you can search for a first name using -f donald. (Searching for donald without an option will generate results including first and last names; using the option restricts the results to first names only.) See Search Parameters for more information.
Caution
Do not use F as an option character. F is reserved for directly entering an LDAP search filter.
- arg2 defines the tablefield property. If more than one entry is found in a search, a table is generated for the results; each column is defined in the tablefield pairs listed in Predefined Attribute Fields. (The default table is specified in NameFinder.tablefields.) The table is sorted by the first entry. Clicking on the column header will refresh the table and sort it using the data in the column that is clicked.
- arg3 is the corresponding LDAP attribute.
- arg4 is the label displayed for the LDAP attribute if a single entry is shown.
- arg5 is the column label for the LDAP attribute in a table displayed if multiple entries are found. If this argument is not specified, the label from arg4 is used.
Name and Contact Information
NameFinder.attr1=n|n|sn|Name|Lastname
NameFinder.attr2=f|f|givenname||Firstname
NameFinder.attr3=|N|nickname|Nickname
NameFinder.attr4=|1|userdefinedattribute1|Title/Function
NameFinder.attr5=p|p|extensionphone|5digit Phone #|Phone
NameFinder.attr6=P|P|telephonenumber|Phone #
NameFinder.attr7=|A|altcontact|Admin Phone #
NameFinder.attr8=|F|facsimiletelephonenumber|FAX #
NameFinder.attr9=m|e|mail|eMail
NameFinder.attr10=|m|mobile|Mobile
NameFinder.attr11=|a|pager|Pager
NameFinder.attr12=|E|pageremail|SMS/Pager eMail|PagerEmail
NameFinder.attr13=||mailalternateaddress
Location Information
NameFinder.attr14=C|C|countrycode|Countrycode
NameFinder.attr15=l|l|globallocation|Building Code|LOC
NameFinder.attr16=|||Flexible Office|
NameFinder.attr17=g|g|l|Ext.Location
NameFinder.attr18=|M|extendedaddress|Mailstop
NameFinder.attr19=|r|roomnumber|Room #
Calendar Information
NameFinder.attr20=|c|calendar|Calendar
NameFinder.attr21=|Z|preferredtimezone|Local Time|Timezone
Miscellaneous Information
NameFinder.attr22=|h|labeleduri|Homepage
NameFinder.attr23=s|s|employeenumber|SunID
NameFinder.attr24=D|D|departmentnumber|Department #|CC
NameFinder.attr25=|||Direct Reports
NameFinder.attr26=r|R|reportsto|Reports to
NameFinder.attr27=|2|userdefinedattribute2|Personal Field2
NameFinder.attr28=u|u|uid|Loginname
NameFinder.attr29=||mailhost|Mailserver
NameFinder.attr30=||host|Hostname
NameFinder.attr31=||employeetype
NameFinder.attr32=||photourl
Predefined Attribute Fields
Predefined fields contain LDAP attributes as values. For example, if lastNameField, firstNameField and/or emailField are specified, NameFinder automatically searches on the attributes defined in these fields. It will search up to six levels to find an entry. Following is a list of the predefined fields.
- uniqueIdField determines which attribute is the unique ID.
NameFinder.uniqueIdField=employeenumber
Caution
uniqueIdField must be specified. If not, NameFinder will not work. This LDAP field denotes a query which returns exactly ONE entry.
- If multiple entries are found during a search, the entries are generated in a table format. tableFields defines the column layout for the table.
NameFinder.tableFields=sn|givenname|mail|employeenumber|extensionphone| globallocation|departmentnumber
NameFinder.emailFields=mail|mailalternateaddress
- reportsTableFields defines the column layout of the Direct Reports table.
NameFinder.reportsTableFields=sn|givenname|extensionphone|mail|globallo cation
- teamTableFields defines output fields for the Team Viewer. firstNameField, lastNameField and locationField are automatically gathered in addition to other attributes defined here. After setting up NameFinder, see the Online Help for instructions on how to set up and view a Team.
NameFinder.teamTableFields=sn|telephonenumber|mail|calendar|labeleduri| mobile|pageremail
- phoneFields specifies all phone attributes. Searching on this field will invoke an OR search for all fields.
NameFinder.phoneFields=extensionphone|telephonenumber|mobile
- emailFields specifies all email attributes. Searching on this field will invoke an OR search for all fields.
- lastNameField determines which attribute is the last name.
NameFinder.lastNameField=sn
- firstNameField determines which attribute is the first name.
NameFinder.firstNameField=givenname
- emailField determines which attribute is the email address.
NameFinder.emailField=mail
- nickNameField determines which attribute is the nickname.
NameFinder.nickNameField=nickname
- uidField determines which attribute is the user ID.
NameFinder.uidField=uid
- photoUrlField determines which attribute contains the URL to a photograph.
NameFinder.photoUrlField=photourl
- locationField determines the location attribute.
NameFinder.locationField=globallocation
- calendarServerField determines the calendar server.
NameFinder.calendarServerField=calendar
- calidField determines the calendar ID.
NameFinder.calidField=uid
- titleField determines which attribute contains the person’s title.
NameFinder.titleField=userdefinedattribute1
- timeZoneField determines which attribute is the time zone.
NameFinder.timeZoneField=preferredtimezone
- phoneField determines which attribute contains the phone number.
NameFinder.phoneField=extensionphone
- mobilePhoneField determines which attribute conains the mobile/cell phone number.
NameFinder.mobilePhoneField=mobile
- managerField determines a person’s direct reports.
NameFinder.managerField=reportsto
- The following fields change the OrgTree view. Images will take much longer to build up the page.
NameFinder.emptyEntry=<img align="TOP" src="nf/empty.gif">
NameFinder.scanEntry=<img align="TOP" src="nf/scan.gif">
NameFinder.lastEntry=<img align="TOP" src="nf/lastEntry.gif">
NameFinder.entry=<img align="TOP" src="nf/entry.gif">
Code Example 34-1 is the NameFinder.properties file.
Search ParametersTable 34-1 is a listing of available search parameters based on NameFinder.properties. The parameters refer to the defined options as detailed in LDAP Attribute Configurations. Wildcards (*) are allowed in the search field.
Table 34-1 Search Parameters
Parameter
Example
firstname lastname
John Smith
lastname firstname
m* da silva
firstname lastname
de* be*
lastname
-n Smith
lastname
-n m*ller
firstname or lastname
m*cdonald
firstname or lastname
*ben
firstname
-f hugo
firstname lastname
d* sch*
SunID
12345
firstname.lastname
d*.sch*
-p phone
-p x62155*
-u loginname
-u scott
-l locationcode
-l muc07
URL
http://namefinder/nf/nfJon.txt