This appendix describes directives used in gateway HTML object class and search result templates. The appendix contains the following sections:
The display of LDAP directory information is controlled by HTML template files containing directives. Directives are HTML comments that can be interpreted by the gateway CGIs.
The most commonly used directive is DS_ATTRIBUTE, used to display attributes present in LDAP entries. Here are some other examples of directives:
<!-- DS_HELPBUTTON "topic=HELP-ME-NOW" -->
<!-- DS_ATTRIBUTE "attr=sn" "size=>20" -->
<!-- IF "BoundAsThisEntry" -->
Directory entry display, edit, and add templates generally have the following structure:
<HTML>
<HEAD>
<!--
DS_ENTRYBEGIN -->
<!--
DS_EMIT_BASE_HREF -->
<!-- BODY
-->
<!--
DS_LAST_OP_INFO -->
<!--
DS_BEGIN_ENTRYFORM -->
<!--
attribute directives, e.g., -->
<!--
DS_ATTRIBUTE "attr=givenName" "size=>20" -->
<!--
DS_ATTRIBUTE "attr=sn" "size=>20" -->
<!-- etc.
-->
<!--
DS_SAVEBUTTON "label= SAVE " -->
<!--
DS_END_ENTRYFORM -->
<!--
DS_ENTRYEND -->
<!--
ENDHTML -->
Directory entry list templates generally have the following structure:
<HTML>
<!-- TITLE
"Search Results" -->
<!--
DS_SEARCHDESC -->
<!-- IF
"FoundEntries" -->
<!--
DS_SORTENTRIES "attr=XXX" -->
<!--
DS_ENTRY_BEGIN -->
<!-- stuff
that is repeated for each entry found, e.g., -->
<!--
DS_ATTRIBUTE "attr=dn" "syntax=dn" -->
<!-- etc.
-->
<!--
DS_ENTRYEND -->
<!-- ELSE
-->
<!-- stuff
to be rendered if no entries were found, e.g.,-->
Please try a
different search....
<!-- ENDIF
-->
<!--
ENDHTML -->
The context-related directives
GCONTEXT and
PCONTEXT appear within a line and are not required to appear at
the beginning of a line. This is an exception to the rule. All other
directives must appear at the beginning of a line to be recognized by
the Directory Server.
The <!-- GCONTEXT
--> directive appears within an URL and is used in the
invocation of CGIs through GET operations.
<!-- GCONTEXT --> can appear anywhere on a line, and more
than once within a line. The gateway CGI reading
<!--
GCONTEXT --> replaces it with the gateway context it has at
the time.
Entry-related directives are supported by the
dosearch and edit CGIs.
Delimits the beginning of an entry. The DS_ENTRYBEGIN directive is used in display or edit templates to mark the start of an LDAP entry and in list templates to mark the beginning of a section which should be repeated for each entry which is returned by the search. Always paired with DS_ENTRYBEGIN.
The
DS_ATTRIBUTE directive is replaced with the contents of an
attribute (its values). This directive must appear within a
DS_ENTRYBEGIN...DS_ENTRYEND
block.
attr=attribute-name. Displays the named attribute. Any attribute may be displayed. The special attribute "dn" is recognized and causes the distinguished name of the entry to be displayed.
syntax=syntax-type. Displays the attribute as if it were of syntax=syntax-type. If no syntax= argument is given, it is assumed to be syntax=cis. Legal values are described in Table B-1.
type=how-to-display.
Renders the attribute on-screen in a particular format. Legal values
described in Table B-2
correspond roughly to HTML form element names.
|
Show as an HTML password text box (characters are not echoed). |
|
options=option.
Modifies how the attribute is displayed. Legal values are described in Table B-3.
defaultvalue=default-value.
Supplies a default value for the attribute, which is shown if no
attribute was read from the Directory Server.
within=string-to-embed-in. For each value, outputs the text in string-to-embed-in, replacing all occurrences of the string --value-- with an attribute value.
href=href. Specifies the HREF used for the hyperlink. For example, you can specify anonMouseOver JavaScript handler using the "href=" option.
hrefextra=extra-text. Specifies additional text which is inserted after the closing quote of the HREF tag.
dncomponents=number. Gives the number of DN components to show when displaying a DN. For example, if you include dncomponents=2 and display the DN cn=James Doe,o=Example Corporation,c=US, the output will be James Doe, Example Corporation.
size=number. Same as cols argument.
rows=number, rows=+number, rows=>number. Controls the number of rows used to display the entry. For type=text, this controls the number of editable HTML INPUT fields. For type=textarea, this controls the number of rows in the textarea. If number is preceded by a plus (+) sign, then number extra rows are included. If the number is preceded by a greater-than sign, then at least that number of rows is included.
cols=number, cols=+number, cols=>number. Controls the width of the displayed attribute. If a number is given by itself, then the attribute is displayed with exactly that number of columns. If a plus (+) sign is given before the number, then the attribute is given that number number of extra columns. For example, if the value is 10 characters wide, and the number is 10, then 20 columns are used when displaying the number. If a greater-than sign (>) is given before number, then the displayed width is at least that number of columns.
numfields=number, numfields=+number, numfields=>number. Controls the number of editable fields displayed when editing. If the number is preceded by a plus (+) sign, then the number of fields displayed is however many values were read from the server plus number. If the number is preceded by a greater-than sign (>), then at least that numberof values are displayed when editing.
true=string. Label used for Boolean values that are true.
false=string. Label used for Boolean values that are false.
value=string.
Value associated with an instance of a checkbox that is used to display
strings values (not syntax=bool values).
<!-- DS_ATTRIBUTE "attr=dn" "syntax=dn" "dncomponents=2" "options=nolink" -->
<!-- DS_ATTRIBUTE "attr=givenName" "cols=>32" -->
<!-- DS_ATTRIBUTE "attr=sn" "cols=>32" -->
<!-- DS_ATTRIBUTE "attr=uid" "numfields=1" "cols=>16" "options=unique" -->
<!-- DS_ATTRIBUTE "attr=mail" "syntax=mail" "cols=>20" -->
<!-- DS_ATTRIBUTE "attr=telephoneNumber" "syntax=tel" "cols=>16" "numfields=+1" -->
<!-- DS_ATTRIBUTE "attr=modifyTimestamp" "syntax=time" "defaultvalue=N/A" "options=readonly" -->
<!-- DS_ATTRIBUTE "attr=modifiersName" "syntax=dn" "defaultvalue=N/A" "options=readonly" -->
<!-- DS_ATTRIBUTE "attr=mailDeliveryOption" "type=CHECKBOX" "value=mailbox" -->
<!-- DS_ATTRIBUTE "attr=mailDeliveryOption" "type=CHECKBOX" "value=native" -->
<!-- DS_ATTRIBUTE
"attr=mailForwardingAddress" "syntax=mail" "type=textarea" "rows=2"
"cols=30" -->
Describes the type of directory entries for
which a given template should be used.
Display a widget that provides access to all
views that are appropriate for this entry. Usually this directive will
be used without any arguments at all, which causes a table that
contains one cell for each available view to be displayed.
prefix=text. HTML text to emit before view elements (optional).
suffix=text. HTML text to emit after view elements (optional).
curprefix=text. HTML text to emit before the link to the current (active) view element (optional).
cursuffix=text. HTML text to emit after the link to the current view element (optional).
altprefix=text. HTML text to emit before each link to an alternative view element (optional).
altsuffix=text.
HTML text to emit after each link to an alternative view element
(optional).
Specifies that entries should be sorted;
typically used within list templates. This directive must appear within
a
DS_ENTRYBEGIN...DS_ENTRYEND block. Up to two
DS_SORTENTRIES directives are honored (the attribute from the
first one that appears is used as the primary sort key, and the second
one is used as a secondary sort key).
Specifies that text describing the type of
search done should be displayed. For example, "Found 14 entries where
the phone number ends with '25.'"
Displays a button which, when clicked, brings
up an editable view of an entry. This directive must appear within a
DS_ENTRYBEGIN...DS_ENTRYEND block. Typically used in display
templates.
Displays a button which, when clicked, allows
deletion of an entry. This directive must appear within a
DS_ENTRYBEGIN...DS_ENTRYEND block. Typically used in edit
templates.
Displays a button which, when clicked, saves changes to an entry. Typically used in edit templates. This directive must appear within a DS_ENTRYBEGIN...DS_ENTRYEND block.
Displays a button which, when clicked, allows
editing of an entry using a non-default template. This directive must
appear within a DS_ENTRYBEGIN...DS_ENTRYEND
block.
Displays an HTML password INPUT field. This
directive must appear within a DS_ENTRYBEGIN...DS_ENTRYEND
block.
Displays an HTML password INPUT field. The
gateway compares the value supplied by the user in this field to the
value in the
DS_NEWPASSWORD field and saves only the new password value if
the two match. This directive must appear within a
DS_ENTRYBEGIN...DS_ENTRYEND block.
Displays an HTML password field for the old
password. This directive must appear within a
DS_ENTRYBEGIN...DS_ENTRYEND block.
Displays a Close button, which causes the
containing window to be closed.
Causes the gateway to emit an
HTML FORM directive and several hidden form elements which are
required for proper operation of the gateway. This directive must
appear within a DS_ENTRYBEGIN...DS_ENTRYEND
block.
Causes the gateway to emit a </FORM>
tag. This directive must appear within a DS_ENTRYBEGIN...DS_ENTRYEND
block.
Display an attribute based on an "attrvset"
as defined in the dsgw.conf
file.
Set of directives that can be used to include
HTML text conditionally.
condition. Boolean condition; if true, include following block of text.
!condition.
Boolean condition; if false, include following block of text.
<!-- IF
"!DirectoryIsLocalDB" -->
The entry was
last modified by <!-- DS_ATTRIBUTE "attr=modifiersName" "syntax=dn"
"defaultvalue=N/A" "options=readonly" -->
<!-- ENDIF
---->
<!-- IF
"AttributeHasThisValue" "objectclass" "cis" "mailRecipient" --> //
this entry is a mail recipient... do something special here
<!-- ENDIF
---->
Display a Help button (same effect as
DS_HELPBUTTON directive but can be used from any gateway
directory CGI).
Include the contents of another HTML file. You cannot nest include directives.
Include the contents of an HTML-based
configuration file. You cannot nest include
directives.
Display a string that shows the result of the
last domodify run. Note that this directive works only when the
genscreen or edit CGIs are invoked via domodify's
completion_javascript feature.
Emit an HTML form element that contains a
list of all the
o's and
ou's that are in the directory. If there is only one, a hidden
field is produced; otherwise, an HTML select field is produced.
Emit a string containing the version of the
directory gateway CGI being executed.
Same as those
supported by the dosearch and edit CGIs. However, conditionals marked
with an asterisk (*) are supported.
| Previous |
Contents |
Index |
DocHome | Next |