⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ldap_disptmpl.3

📁 开放源码的ldap系统
💻 3
字号:
.TH LDAP_DISPTMPL 3 "22 September 1998" "OpenLDAP LDVERSION".\" $OpenLDAP: pkg/ldap/doc/man/man3/ldap_disptmpl.3,v 1.2.12.1 2000/06/13 17:57:11 kurt Exp $.\" Copyright 1998-2000 The OpenLDAP Foundation All Rights Reserved..\" Copying restrictions apply.  See COPYRIGHT/LICENSE..SH NAMEldap_init_templates, ldap_init_templates_buf, ldap_free_templates, ldap_first_disptmpl, ldap_next_disptmpl, ldap_oc2template, ldap_tmplattrs, ldap_first_tmplrow, ldap_next_tmplrow, ldap_first_tmplcol, ldap_next_tmplcol, \- LDAP display template routines.SH SYNOPSIS.nf.ft B#include <disptmpl.h>.ft.LP.ft Bint ldap_init_templates( file, tmpllistp ).ftchar			*file;struct ldap_disptmpl	**tmpllistp;.LP.ft Bint ldap_init_templates_buf( buf, buflen, tmpllistp ).ftchar			*buf;unsigned long		len;struct ldap_disptmpl	**tmpllistp;.LP.ft Bvoid ldap_free_templates( tmpllist ).ftstruct ldap_disptmpl	*tmpllist;.LP.ft Bstruct ldap_disptmpl *ldap_first_disptmpl( tmpllist ).ftstruct ldap_disptmpl	*tmpllist;.LP.ft Bstruct ldap_disptmpl *ldap_next_disptmpl( tmpllist, tmpl ).ftstruct ldap_disptmpl	*tmpllist;struct ldap_disptmpl	*tmpl;.LP.ft Bstruct ldap_disptmpl *ldap_oc2template( oclist, tmpllist ).ftchar			**oclist;struct ldap_disptmpl	*tmpllist;.LP.ft Bstruct ldap_disptmpl *ldap_name2template( name, tmpllist ).ftchar			*name;struct ldap_disptmpl	*tmpllist;.LP.ft Bchar **ldap_tmplattrs( tmpl, includeattrs, exclude, syntaxmask ).ftstruct ldap_disptmpl	*tmpl;char			**includeattrs;int			exclude;unsigned long		syntaxmask;.LP.ft Bstruct ldap_tmplitem *ldap_first_tmplrow( tmpl ).ftstruct ldap_disptmpl	*tmpl;.LP.ft Bstruct ldap_tmplitem *ldap_next_tmplrow( tmpl, row ).ftstruct ldap_disptmpl	*tmpl;struct ldap_tmplitem	*row;.LP.ft Bstruct ldap_tmplitem *ldap_first_tmplcol( tmpl, row ).ftstruct ldap_disptmpl	*tmpl;struct ldap_tmplitem	*row;.LP.ft Bstruct ldap_tmplitem *ldap_next_tmplcol( tmpl, row, col ).ftstruct ldap_disptmpl	*tmpl;struct ldap_tmplitem	*row;struct ldap_tmplitem	*col;.fi.SH DESCRIPTIONThese functions provide a standard way to access LDAP entry displaytemplates.  Entry display templates provide a standard way for LDAPapplications to display directory entries.  The general idea is that itis possible to map the list of object class values present in an entryto an appropriate display template.  Display templates are defined in aconfiguration file (see ldaptemplates.conf(5)).  Each display templatecontains a pre-determined list of items, where each item generallycorresponds to an attribute to be displayed.  The items containinformation and flags that the caller can use to display the attribute andvalues in a reasonable fashion.  Each item has a syntaxid, which aredescribed in the SYNTAX IDS section below.  The ldap_entry2text(3)routines use the display template functions and produce text output..LPldap_init_templates() reads a sequence of templates from a valid LDAPtemplate configuration file (see ldaptemplates.conf(5)).I Zerois returned upon success, and.I tmpllistpis set to point to a list of templates.  Each member of the list is anldap_disptmpl structure (defined below in the DISPTMPL STRUCTURE ELEMENTSsection)..LP.LPldap_init_templates_buf() reads a sequence of templates from.I buf(whose size is.I buflen)..I bufshould point to the data in the format defined for an LDAP templateconfiguration file (see ldaptemplates.conf(5)).I Zerois returned upon success, and.I tmpllistpis set to point to a list of templates..LPThe.B LDAP_SET_DISPTMPL_APPDATA()macro is used to set the value of the dt_appdata field in an ldap_disptmplstructure.  This field is reserved for the calling application to use; itis not used internally..LPThe.B LDAP_GET_DISPTMPL_APPDATA()macro is used to retrieve the value in the dt_appdata field..LPThe.B LDAP_IS_DISPTMPL_OPTION_SET()macro is used to test a ldap_disptmpl structure for the existence of atemplate option.  The options currently defined are:.B LDAP_DTMPL_OPT_ADDABLE(it is appropriate to allow entries of this type to be added),.B LDAP_DTMPL_OPT_ALLOWMODRDN(it is appropriate to offer the "modify rdn" operation),.B LDAP_DTMPL_OPT_ALTVIEW(this template is merely an alternate view of another template, typicallyused for templates pointed to be an LDAP_SYN_LINKACTION item)..LPldap_free_templates() disposes of the templates allocated byldap_init_templates()..LPldap_first_disptmpl() returns the first template in the list.I tmpllist.The.I tmpllistis typically obtained by calling ldap_init_templates()..LPldap_next_disptmpl() returns the template after.I tmplin the template list.I tmpllist.  A.SM NULLpointer is returned if.I tmplis the last template in the list..LPldap_oc2template() searches.I tmpllistfor the best template to use to display an entry that has a specificset of objectClass values..I oclistshould be a null-terminated array of strings that contains the valuesof the objectClass attribute of the entry.  A pointer to the firsttemplate where all of the object classes listed in one of thetemplate's dt_oclist elements are contained in.I oclistis returned.  A.B NULLpointer is returned if no appropriate template is found..LPldap_tmplattrs() returns a null-terminated array that contains thenames of attributes that need to be retrieved if the template.I tmplis to be used to display an entry.  The attribute list should be freedusing ldap_value_free().  The.I includeattrsparameter contains a null-terminated array of attributes that shouldalways be included (it may be.B NULLif no extra attributes are required).  If.I syntaxmaskis non-zero, it is used to restrict the attribute set returned.  If.I excludeis zero, only attributes where the logical AND of the template itemsyntax id and the.I syntaxmaskis non-zero are included.  If.I excludeis non-zero, attributes where the logical AND of the template itemsyntax id and the.I  syntaxmaskis non-zero are excluded..LPldap_first_tmplrow() returns a pointer to the first row of items intemplate.I tmpl..LPldap_next_tmplrow() returns a pointer to the row that follows.I rowin template.I tmpl..LPldap_first_tmplcol() returns a pointer to the first item (in the firstcolumn) of row.I rowwithin template.I tmpl.  A pointer to an ldap_tmplitem structure (defined belowin the TMPLITEM STRUCTURE ELEMENTS section) is returned..LPThe.B LDAP_SET_TMPLITEM_APPDATA()macro is used to set the value of the ti_appdata field in a ldap_tmplitemstructure.  This field is reserved for the calling application to use; itis not used internally..LPThe.B LDAP_GET_TMPLITEM_APPDATA()macro is used to retrieve the value of the ti_appdata field..LPThe.B LDAP_IS_TMPLITEM_OPTION_SET()macro is used to test a ldap_tmplitem structure for the existence of anitem option.  The options currently defined are:.B LDAP_DITEM_OPT_READONLY(this attribute should not be modified),.B LDAP_DITEM_OPT_SORTVALUES(it makes sense to sort the values),.B LDAP_DITEM_OPT_SINGLEVALUED(this attribute can only hold a single value),.B LDAP_DITEM_OPT_VALUEREQUIRED(this attribute must contain at least one value),.B LDAP_DITEM_OPT_HIDEIFEMPTY(do not show this item if there are no values), and.B LDAP_DITEM_OPT_HIDEIFFALSE(for boolean attributes only:  hide this item if the value is FALSE)..LPldap_next_tmplcol() returns a pointer to the item (column) that follows column.I colwithin row.I rowof template.I tmpl..SH DISPTMPL STRUCTURE ELEMENTSThe ldap_disptmpl structure is defined as:.nf.ft Bstruct ldap_disptmpl {	char                    *dt_name;	char			*dt_pluralname;	char                    *dt_iconname;	unsigned long           dt_options;	char                    *dt_authattrname;	char                    *dt_defrdnattrname;	char                    *dt_defaddlocation;	struct ldap_oclist	*dt_oclist;	struct ldap_adddeflist	*dt_adddeflist;	struct ldap_tmplitem	*dt_items;	void			*dt_appdata;	struct ldap_disptmpl	*dt_next;};.ft.fiThe dt_name member is the singular name of the template.  The dt_pluralnameis the plural name.  The dt_iconname member will contain the name of anicon or other graphical element that can be used to depict entries thatcorrespond to this display template.  The dt_options contains options whichmay be tested using the LDAP_IS_TMPLITEM_OPTION_SET() macro..LPThe dt_authattrname contains the name of the DN-syntax attribute whosevalue(s) should be used to authenticate to make changes to an entry.  Ifdt_authattrname is NULL, then authenticating as the entry itself isappropriate.  The dt_defrdnattrname is the name of the attribute thatis normally used to name entries of this type, e.g., "cn" for personentries.  The dt_defaddlocation is the distinguished name of an entrybelow which new entries of this type are typically created (its value issite-dependent)..LPdt_oclist is a pointer to a linked list of object class arrays, defined as:.nf.ft Bstruct ldap_oclist {	char			**oc_objclasses;	struct ldap_oclist	*oc_next;};.ft.fiThese are used by the ldap_oc2template() routine..LPdt_adddeflist is a pointer to a linked list of rules for defaulting thevalues of attributes when new entries are created.  The ldap_adddefliststructure is defined as:.nf.ft Bstruct ldap_adddeflist {	int			ad_source;	char			*ad_attrname;	char			*ad_value;	struct ldap_adddeflist	*ad_next;};.ft.fiThe ad_attrname member contains the name of the attribute whose value thisrule sets.  If ad_source is .B LDAP_ADSRC_CONSTANTVALUEthen the ad_value member contains the (constant) value to use.If  ad_source is.B LDAP_ADSRC_ADDERSDNthen ad_value is ignored and the distinguished name of the person whois adding the new entry is used as the default value for ad_attrname. .SH TMPLITEM STRUCTURE ELEMENTSThe ldap_tmplitem structure is defined as:.nf.ft Bstruct ldap_tmplitem {	unsigned long		ti_syntaxid;	unsigned long		ti_options;	char			*ti_attrname;	char			*ti_label;	char			**ti_args;	struct ldap_tmplitem	*ti_next_in_row;	struct ldap_tmplitem	*ti_next_in_col;	void			*ti_appdata;};.ft.fi.SH SYNTAX IDSSyntax ids are found in the ldap_tmplitem structure element ti_syntaxid,and they can be used to determine how to display the values for theattribute associated with an item.  The LDAP_GET_SYN_TYPE() macro canbe used to return a general type from a syntax id.  The five general typescurrently defined are:.B LDAP_SYN_TYPE_TEXT(for attributes that are most appropriately shown as text),.B LDAP_SYN_TYPE_IMAGE(for JPEG or FAX format images),.B LDAP_SYN_TYPE_BOOLEAN(for boolean attributes),.B LDAP_SYN_TYPE_BUTTON(for attributes whose values are to be retrieved and display only upon request, e.g., in response to the press of a button, a JPEG image isretrieved, decoded, and displayed), and.B LDAP_SYN_TYPE_ACTION(for special purpose actions such as "search for the entries where thisentry is listed in the seeAlso attribute")..LPThe.B LDAP_GET_SYN_OPTIONSmacro can be used to retrieve an unsigned long bitmap that definesoptions.  The only currently defined option is.B LDAP_SYN_OPT_DEFER,which (if set) implies that the values for the attribute should notbe retrieved until requested..LPThere are sixteen distinct syntax ids currently defined.  These generallycorrespond to one or more X.500 syntaxes..LP.B LDAP_SYN_CASEIGNORESTRis used for text attributes which are simple strings whose case is ignoredfor comparison purposes..LP.B LDAP_SYN_MULTILINESTRis used for text attributes which consist of multiple lines,e.g., postalAddress, homePostalAddress, multilineDescription, or anyattributes of syntax caseIgnoreList..LP.B LDAP_SYN_RFC822ADDRis used for case ignore string attributes that are RFC-822 conformantmail addresses, e.g., mail..LP.B LDAP_SYN_DNis used for attributes with a Distinguished Name syntax, e.g., seeAlso..LP.B LDAP_SYN_BOOLEANis used for attributes with a boolean syntax..LP.B LDAP_SYN_JPEGIMAGEis used for attributes with a jpeg syntax, e.g., jpegPhoto..LP.B LDAP_SYN_JPEGBUTTONis used to provide a button (or equivalent interface element) that can beused to retrieve, decode, and display an attribute of jpeg syntax..LP.B LDAP_SYN_FAXIMAGEis used for attributes with a photo syntax, e.g., Photo.  These areactually Group 3 Fax (T.4) format images..LP.B LDAP_SYN_FAXBUTTONis used to provide a button (or equivalent interface element) that can beused to retrieve, decode, and display an attribute of photo syntax..LP.B LDAP_SYN_AUDIOBUTTONis used to provide a button (or equivalent interface element) that can beused to retrieve and play an attribute of audio syntax.  Audio values arein the "mu law" format, also known as "au" format..LP.B LDAP_SYN_TIMEis used for attributes with the UTCTime syntax, e.g., lastModifiedTime.The value(s) should be displayed in complete date and time fashion..LP.B LDAP_SYN_DATEis used for attributes with the UTCTime syntax, e.g., lastModifiedTime.Only the date portion of the value(s) should be displayed..LP.B LDAP_SYN_LABELEDURLis used for labeledURL attributes..LP.B LDAP_SYN_SEARCHACTIONis used to define a search that is used to retrieve related information.If ti_attrname is not NULL, it is assumed to be a boolean attribute whichwill cause no search to be performed if its value is FALSE.  The ti_argsstructure member will have four strings in it:  ti_args[ 0 ] should bethe name of an attribute whose values are used to help construct a searchfilter or "-dn" is the distinguished name of the entry being displayedshould be used, ti_args[ 1 ] should be a filter pattern where any occurrencesof "%v" are replaced with the value derived from ti_args[ 0 ], ti_args[ 2 ]should be the name of an additional attribute to retrieve when performingthe search, and ti_args[ 3 ] should be a human-consumable name for thatattribute.  The ti_args[ 2 ] attribute is typically displayed along witha list of distinguished names when multiple entries are returned by thesearch..LP.B LDAP_SYN_LINKACTIONis used to define a link to another template by name.  ti_args[ 0 ] willcontain the name of the display template to use.  The ldap_name2template()routine can be used to obtain a pointer to the correct ldap_disptmpl structure..LP.B LDAP_SYN_ADDDNACTIONand.B LDAP_SYN_VERIFYDNACTIONare reserved as actions but currently undefined..SH ERRORSThe init template functions return.B LDAP_TMPL_ERR_VERSIONif buf points to data that is newer than can be handled,.B LDAP_TMPL_ERR_MEMif there is a memory allocation problem,.B LDAP_TMPL_ERR_SYNTAXif there is a problem with the format of the templates buffer or file..B LDAP_TMPL_ERR_FILEis returned by.B ldap_init_templatesif the file cannot be read.   Other routines generally return.B NULLupon error..SH SEE ALSO.BR ldap (3),.BR ldap_entry2text (3),.BR ldaptemplates.conf (5).SH ACKNOWLEDGEMENTS.B	OpenLDAPis developed and maintained by The OpenLDAP Project (http://www.openldap.org/)..B	OpenLDAPis derived from University of Michigan LDAP 3.3 Release.  

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -