Describes how users can store their address info in Active Directory and how NPS web authors can insert tables of such information into web pages.
Note: The solution described herein is currently disabled, because the connection of the servlet to the LDAP/ActiveDirectory server tends to fail (once and for all) after some time for reasons we do not understand and could not find despite our best efforts. Sorry. As a replacement, user information is modeled directly in NPS, which is a partially manual, but rather flexible solution.All of our four servers www.[mi|inf|math|fbv].fu-berlin.de have the same Java/Jython servlet running for retrieving user information from our central Fachbereich-wide Active Directory server and displaying it in form of HTML tables.
NPS web page authors can insert calls to this servlet on arbitrary web pages.
Here is how the calls look like on an NPS page
<div id="userinfo1"> For the people list, see <a class="userinfolink" jtarget="userinfo1" href="/ldap/userinfo?group=org_agse&columns=fullname@homepage;email@email;street,room;phone&sort=lastname&lang=en" >/ldap/userinfo</a>. </div>You may vary the text and the part of the
href
attribute after the
?
, but all other tags and attributes must be exactly as shown.
(Exception: For putting multiple userinfo tables onto the same page, you
can exchange the two appearances of "userinfo1" to "userinfo2" etc. But
you must always change both of them together.)
NPS pages are purely static pages. However, people information is dynamically extracted from Active Directory. How can that work?
As shown above, the NPS page just contains a link. If you follow that link, you will call a 'naked' page (outside of NPS) that will contain only the people information and nothing else.
But that is obviously an ugly solution.
Therefore, the above section (because it is marked with class="userinfolink") is normally processed by a Javascript routine that you can load into the respective NPS page. This Javascript performs the call described in thehref
and inserts the resulting HTML table in place of the current contents of the div
element.
head
section of your page:
Everything else happens automatically. The code activates itself as soon as the page has finished loading.
?
in the href
, you can use the following arguments to
select what will be included in the resulting HTML table:
group
: a comma-separated list of Active Directory org_* group names. The union of the members of all of these groups will be included in the table, one line per member.
user
: a comma-separated list of individual usernames that will also be included in the table. You can use either group
or user
or both.
columns
: a list of field names whose contents will be included for each member. Semicolon as a separator indicates using a new column, using comma as a separator indicates using a new line within a column (i.e. within the same table cell), @ as a separator indicates hyperlink creation (the left operand provides the link text, the right operand provides the URL). The field names will be explained below.
lang
: Language used in the output table. Possible values are "en" (English) and "de" (Deutsch). This selects different text for the column headers and also a different format for telephone numbers (international vs. national).
sort
: Name of the field to be used as a sorting criterion for the lines of the table.
refresh
: If 1, the servlet's internal cache will be updated with new data from Active Directory with respect to the given values of group
and user
. If 0 or not given, cached data will be used. refresh
is needed only to make the servlet reflect changes in the contents of the Active Directory.
Here is a table describing the columns you can have in a userinfo table:
Nr | userinfo name | Active Directory name | "en" title | "de" title |
1 | cn | cn | Username | Benutzername |
2 | fullname | displayName | Name | Name |
3 | firstname | givenName | Given Name | Vorname |
4 | lastname | sn | Family Name | Nachname |
5 | ||||
6 | phone | telephoneNumber | Phone | Telefon |
7 | shortphone | Extension | Durchwahl | |
8 | fax | facsimileTelephoneNumber | Fax | Fax |
9 | shortfax | Fax ext. | Fax | |
10 | mobile | mobile | Mobile | Mobil |
11 | street | streetAddress | Street | Straße |
12 | room | physicalDeliveryOfficeName | Room no. | Raum |
13 | buildingroom | Room no. | Raum | |
14 | ag | department | Work group | Arbeitsgruppe |
15 | jobtitle | title | Job title | Jobtitel |
16 | homepage | wWWHomePage | Homepage | Webseite |
mail
field, it will be replaced by "..." for spam protection.
street
field plus the room
field (say "T9.014"). This works only for the standard buildings, e.g. "Takustr. 9" (note the "str." not "straße") will become "T9" etc.
cn
).
The other fields' meaning should be obvious.
Where possible, the userinfo servlet will compute some data from others, but explicitly entered data is prefered; see below.
By default, only little information is present in Active Directory for any one person. But everybody can modify his or her own Active Directory person record easily as follows:
Start→Search→For People...
(in a german Windows installation, the labels will be different, but meaning and behavior are the same)
refresh
turned on to invalidate the servlet's cache.
The following improvements are planned to be done to userinfo in the future:
refresh
link in the HTML output
Add comments here: