The file /etc/ldap/ldaptemplates.conf contains information used by the LDAP display templates routines (see ldap_disptmpl(3)?). Blank lines and lines that have a first character of `#' are treated as comments and ignored. Non-comment lines contain one or more tokens. Tokens are separated by white space, and double quotes `
The first non-commment line specifies the version of the template information and must contain the token Version followed by an integer version number. E.g.,
Version 1 The current version is 1, so the above example is always the correct opening line.
The remainder of the file consists of one or more display templates. The first two lines of the display template should each contain a single token that specifies singular and plural names for the template that are suitable for human consumption. These names are stored in the dt_name and dt_pluralname members of the ldap_disptmpl structure. E.g.,
specifies appropriate names for a template designed to display X.500 person information.
The next line specifies the name of the icon or similar element that is associated with this template. E.g.,
The next line is a blank-separated list of template options.
The next portion of the template is a list of X.500 object classes that is used to determine whether the template should be used to display a given entry. The object class information consists of one or more lines, followed by a terminating line that contains the single token END. Each line contains one or more object class names, all of which must be present in an X.500 entry for the ldap_oc2template(3)? routine to return a pointer to this template. The object class information is stored in the dt_oclist member of the ldap_disptmpl structure. Multiple lines can be used to associate more than one set of object classes with a given template. E.g.,
umichPerson lblPerson END means that the template is appropriate for display of umichPerson entries or lblPerson entries.
Next next line after the object class list is the name of the attribute to authenticate as to make changes (use
The next line is the default attribute to use when naming a new entry. E.g.,
The next line is the default location under which new entries are created. It should be a string-represented Distringuished Name. E.g.,
The next section is a list of rules used to assign default values to new entries. The list should be terminated with a line that contains the single token END. Each line in this section should either begin with the token constant and be followed by the name of the attribute and a constant value to assign, or the line should begin with addersdn followed by the name of an attribute whose value will be the DN of the person who has authenticated to add the entry. E.g.,
constant associatedDomain umich.edu addersdn seeAlso END The last portion of the template is a list of items to display. It consists of one or more lines, followed by a terminating line that contains the single token END. Each line is must begin with the token samerow or the token item
It is assumed that each item appears on a row by itself unless it was preceded by a samerow line (in which case it should be displayed on the same line as the previous item, if possible). Lines that begin with samerow should not have any other tokens on them.
Lines that begin with item must have at least three more tokens on them: an item type, a label, and an attribute name. Any extra tokens are taken as extra arguments and are stored in the ti_args member of the ldap_tmplitem structure.
The item type token must be one of the following strings: cis (for case ignore string attributes), mls (for multiline string attributes), mail (for RFC-822 conformant mail address attributes), dn (for distinguished name pointer attributes), bool (for Boolean attributes), jpeg (for JPEG photo attributes), jpegbtn (for a button that will retrieve and show a JPEG photo attribute), fax (for FAX T.4 format image attributes), faxbtn (for a button that will retrieve and show a FAX photo attribute), audiobtn (for audio attributes), time (for UTC time attributes), date (for UTC time attributes where only the date portion should be shown), url (for labeled Uniform Resource Locator attributes), searchact (to define an action that will do a directory search for other entries), linkact (to define an action which is a link to another display template). See the ACTIONS section below for more information on search and link actions.
An example of an item line for the drink attribute (displayed with label
The following template configuration file contains two templates, one for display of people entries and one for display of contries.