1 .TH LDAP_ENTRY2TEXT 3 "22 September 1998" "OpenLDAP LDVERSION"
3 .\" Copyright 1998-1999 The OpenLDAP Foundation All Rights Reserved.
4 .\" Copying restrictions apply. See COPYRIGHT/LICENSE.
6 ldap_entry2text, ldap_entry2text_search, ldap_vals2text \- LDAP entry display routines
15 int ldap_entry2text( ld, buf, entry, tmpl, defattrs, defvals, writeproc,
16 writeparm, eol, rdncount, opts )
21 struct ldap_disptmpl *tmpl;
31 int ldap_entry2text_search( ld, entry, tmpllist, defattrs, defvals,
32 writeproc, writeparm, eol, rdncount, opts )
38 struct ldap_disptmpl *tmpllist;
48 int ldap_vals2text( ld, buf, vals, label, labelwidth, syntaxid, writeproc,
49 writeparm, eol, rdncount )
56 unsigned long syntaxid;
63 int ldap_entry2html( ld, buf, entry, tmpl, defattrs, defvals, writeproc,
64 writeparm, eol, rdncount, opts )
69 struct ldap_disptmpl *tmpl;
81 int ldap_entry2html_search( ld, entry, tmpllist, defattrs, defvals,
82 writeproc, writeparm, eol, rdncount, opts )
87 struct ldap_disptmpl *tmpllist;
98 int ldap_vals2html( ld, buf, vals, label, labelwidth, syntaxid, writeproc,
99 writeparm, eol, rdncount )
106 unsigned long syntaxid;
116 #define LDAP_DISP_OPT_AUTOLABELWIDTH 0x00000001
117 #define LDAP_DISP_OPT_HTMLBODYONLY 0x00000002
119 #define LDAP_DTMPL_BUFSIZ 2048
123 These functions use the LDAP display template routines (see
124 ldap_disptmpl(3) and ldap_templates.conf(5)) to produce a plain text
125 or an HyperText Markup Language (HTML) display of an entry or a set of
126 values. Typical plain text output produced for an entry might look like:
129 "Barbara J Jensen, Information Technology Division"
135 bjensen@terminator.rs.itd.umich.edu
140 Mythical Manager, Research Systems
143 The exact output produced will depend on the display template configuration.
144 HTML output is similar to the plain text output, but more richly formatted.
146 .B ldap_entry2text(\|)
147 produces a text representation of
149 and writes the text by calling the
151 function. All of the attributes values to be displayed must be present
154 no interaction with the LDAP server will be performed within
157 is the LDAP pointer obtained by a previous call to
160 should be declared as:
164 int writeproc( writeparm, p, len )
173 is a pointer to text to be written and
175 is the length of the text.
177 is guaranteed to be zero-terminated. Lines of text are terminated
181 is a pointer to a buffer of size
186 then a buffer is allocated and freed internally.
188 is a pointer to the display template to be used (usually obtained by calling
189 .B ldap_oc2template).
193 no template is used and a generic display is produced.
195 is a NULL-terminated array of LDAP attribute names which you wish to
196 provide default values for (only used if
198 contains no values for the attribute). An array of NULL-terminated arrays of
199 default values corresponding to the attributes should be passed in
202 parameter is used to limit the number of Distinguished Name (DN) components
203 that are actually displayed for DN attributes. If
205 is zero, all components are shown.
207 is used to specify output options. The only values currently allowed
208 are zero (default output),
209 .B LDAP_DISP_OPT_AUTOLABELWIDTH
210 which causes the width for labels to be determined based on the longest
213 .B LDAP_DISP_OPT_HTMLBODYONLY.
215 .B LDAP_DISP_OPT_HTMLBODYONLY
216 option instructs the library not to include <HTML>, <HEAD>, <TITLE>, and
217 <BODY> tags. In other words, an HTML fragment is generated, and the
218 caller is responsible for prepending and appending the appropriate HTML
219 tags to construct a correct HTML document.
221 .B ldap_entry2text_search(\|)
224 and all of the like-named parameters have the same meaning except as noted
228 is not NULL, it is the search base to use when executing search actions. If
229 it is NULL, search action template items are ignored. If
231 is not NULL, it should contain the
233 attribute values for the entry to be displayed. If
237 must not be NULL, and
238 .B ldap_entry2text_search
239 will retrieve the objectClass values itself by calling
241 .B ldap_entry2text_search
242 will determine the appropriate display template to use by calling
246 to retrieve any attribute values to be displayed. The
248 parameter is a pointer to the entire list of templates available (usually
250 .B ldap_init_templates
252 .B ldap_init_templates_buf).
256 .B ldap_entry2text_search
257 will attempt to read a load templates from the default template configuration
258 file ETCDIR/ldaptemplates.conf.
261 produces a text representation of a single set of LDAP attribute values. The
269 parameters are the same as the like-named parameters for
272 is a NULL-terminated list of values, usually obtained by a call to
275 is a string shown next to the values (usually a friendly form of an
276 LDAP attribute name).
278 specifies the label margin, which is the number of blank spaces displayed
279 to the left of the values. If zero is passed, a default label width is
282 is a display template attribute syntax identifier (see ldap_disptmpl(3)
283 for a list of the pre-defined
288 produces an HTML representation of
290 It behaves exactly like ldap_entry2text(3), except for the formatted output
291 and the addition of two parameters.
293 is the starting text to use when constructing an LDAP URL. The default is
296 The second additional parameter,
298 the search base to use when executing search actions. If it is NULL, search
299 action template items are ignored.
301 .B ldap_entry2html_search
302 behaves exactly like ldap_entry2text_search(3), except HTML output is produced
303 and one additional parameter is required.
305 is the starting text to use when constructing an LDAP URL. The default is
310 behaves exactly like ldap_vals2text, except HTML output is produced
311 and one additional parameter is required.
313 is the starting text to use when constructing an LDAP URL. The default is
317 These routines all return an LDAP error code (LDAP_SUCCESS is returned
318 if no error occurs). See ldap_error(3) for details. The
322 parameter is also set to indicate the error.
324 ETCDIR/ldaptemplates.conf
327 .BR ldap_disptmpl (3),
328 .BR ldaptemplates.conf (5)
331 is developed and maintained by The OpenLDAP Project (http://www.openldap.org/).
333 is derived from University of Michigan LDAP 3.3 Release.