1 .TH LDAP_ENTRY2TEXT 3 "22 September 1998" "OpenLDAP LDVERSION"
3 ldap_entry2text, ldap_entry2text_search, ldap_vals2text \- LDAP entry display routines
13 int ldap_entry2text( ld, buf, entry, tmpl, defattrs, defvals, writeproc,
14 writeparm, eol, rdncount, opts )
19 struct ldap_disptmpl *tmpl;
29 int ldap_entry2text_search( ld, entry, tmpllist, defattrs, defvals,
30 writeproc, writeparm, eol, rdncount, opts )
36 struct ldap_disptmpl *tmpllist;
46 int ldap_vals2text( ld, buf, vals, label, labelwidth, syntaxid, writeproc,
47 writeparm, eol, rdncount )
54 unsigned long syntaxid;
61 int ldap_entry2html( ld, buf, entry, tmpl, defattrs, defvals, writeproc,
62 writeparm, eol, rdncount, opts )
67 struct ldap_disptmpl *tmpl;
79 int ldap_entry2html_search( ld, entry, tmpllist, defattrs, defvals,
80 writeproc, writeparm, eol, rdncount, opts )
85 struct ldap_disptmpl *tmpllist;
96 int ldap_vals2html( ld, buf, vals, label, labelwidth, syntaxid, writeproc,
97 writeparm, eol, rdncount )
104 unsigned long syntaxid;
114 #define LDAP_DISP_OPT_AUTOLABELWIDTH 0x00000001
115 #define LDAP_DISP_OPT_HTMLBODYONLY 0x00000002
117 #define LDAP_DTMPL_BUFSIZ 2048
121 These functions use the LDAP display template routines (see
122 ldap_disptmpl(3) and ldap_templates.conf(5)) to produce a plain text
123 or an HyperText Markup Language (HTML) display of an entry or a set of
124 values. Typical plain text output produced for an entry might look like:
127 "Barbara J Jensen, Information Technology Division"
133 bjensen@terminator.rs.itd.umich.edu
138 Mythical Manager, Research Systems
141 The exact output produced will depend on the display template configuration.
142 HTML output is similar to the plain text output, but more richly formatted.
144 .B ldap_entry2text(\|)
145 produces a text representation of
147 and writes the text by calling the
149 function. All of the attributes values to be displayed must be present
152 no interaction with the LDAP server will be performed within
155 is the LDAP pointer obtained by a previous call to
158 should be declared as:
162 int writeproc( writeparm, p, len )
171 is a pointer to text to be written and
173 is the length of the text.
175 is guaranteed to be zero-terminated. Lines of text are terminated
179 is a pointer to a buffer of size
184 then a buffer is allocated and freed internally.
186 is a pointer to the display template to be used (usually obtained by calling
187 .B ldap_oc2template).
191 no template is used and a generic display is produced.
193 is a NULL-terminated array of LDAP attribute names which you wish to
194 provide default values for (only used if
196 contains no values for the attribute). An array of NULL-terminated arrays of
197 default values corresponding to the attributes should be passed in
200 parameter is used to limit the number of Distinguished Name (DN) components
201 that are actually displayed for DN attributes. If
203 is zero, all components are shown.
205 is used to specify output options. The only values currently allowed
206 are zero (default output),
207 .B LDAP_DISP_OPT_AUTOLABELWIDTH
208 which causes the width for labels to be determined based on the longest
211 .B LDAP_DISP_OPT_HTMLBODYONLY.
213 .B LDAP_DISP_OPT_HTMLBODYONLY
214 option instructs the library not to include <HTML>, <HEAD>, <TITLE>, and
215 <BODY> tags. In other words, an HTML fragment is generated, and the
216 caller is responsible for prepending and appending the appropriate HTML
217 tags to construct a correct HTML document.
219 .B ldap_entry2text_search(\|)
222 and all of the like-named parameters have the same meaning except as noted
226 is not NULL, it is the search base to use when executing search actions. If
227 it is NULL, search action template items are ignored. If
229 is not NULL, it should contain the
231 attribute values for the entry to be displayed. If
235 must not be NULL, and
236 .B ldap_entry2text_search
237 will retrieve the objectClass values itself by calling
239 .B ldap_entry2text_search
240 will determine the appropriate display template to use by calling
244 to retrieve any attribute values to be displayed. The
246 parameter is a pointer to the entire list of templates available (usually
248 .B ldap_init_templates
250 .B ldap_init_templates_buf).
254 .B ldap_entry2text_search
255 will attempt to read a load templates from the default template configuration
256 file ETCDIR/ldaptemplates.conf.
259 produces a text representation of a single set of LDAP attribute values. The
267 parameters are the same as the like-named parameters for
270 is a NULL-terminated list of values, usually obtained by a call to
273 is a string shown next to the values (usually a friendly form of an
274 LDAP attribute name).
276 specifies the label margin, which is the number of blank spaces displayed
277 to the left of the values. If zero is passed, a default label width is
280 is a display template attribute syntax identifier (see ldap_disptmpl(3)
281 for a list of the pre-defined
286 produces an HTML representation of
288 It behaves exactly like ldap_entry2text(3), except for the formatted output
289 and the addition of two parameters.
291 is the starting text to use when constructing an LDAP URL. The default is
294 The second additional parameter,
296 the search base to use when executing search actions. If it is NULL, search
297 action template items are ignored.
299 .B ldap_entry2html_search
300 behaves exactly like ldap_entry2text_search(3), except HTML output is produced
301 and one additional parameter is required.
303 is the starting text to use when constructing an LDAP URL. The default is
308 behaves exactly like ldap_vals2text, except HTML output is produced
309 and one additional parameter is required.
311 is the starting text to use when constructing an LDAP URL. The default is
315 These routines all return an LDAP error code (LDAP_SUCCESS is returned
316 if no error occurs). See ldap_error(3) for details. The
320 parameter is also set to indicate the error.
322 ETCDIR/ldaptemplates.conf
325 .BR ldap_disptmpl (3),
326 .BR ldaptemplates.conf (5)
329 is developed and maintained by The OpenLDAP Project (http://www.openldap.org/).
331 is derived from University of Michigan LDAP 3.3 Release.