📄 ldapvcardprovider.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><!--NewPage--><HTML><HEAD><!-- Generated by javadoc (build 1.5.0_15) on Thu Aug 28 21:12:45 PDT 2008 --><TITLE>LdapVCardProvider (Openfire 3.6.0a Javadoc)</TITLE><META NAME="keywords" CONTENT="org.jivesoftware.openfire.ldap.LdapVCardProvider class"><LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style"><SCRIPT type="text/javascript">function windowTitle(){ parent.document.title="LdapVCardProvider (Openfire 3.6.0a Javadoc)";}</SCRIPT><NOSCRIPT></NOSCRIPT></HEAD><BODY BGCOLOR="white" onload="windowTitle();"><!-- ========= START OF TOP NAVBAR ======= --><A NAME="navbar_top"><!-- --></A><A HREF="#skip-navbar_top" title="Skip navigation links"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_top_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM><b>Openfire 3.6.0a Javadoc</b></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../org/jivesoftware/openfire/ldap/LdapUserProvider.html" title="class in org.jivesoftware.openfire.ldap"><B>PREV CLASS</B></A> NEXT CLASS</FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../index.html?org/jivesoftware/openfire/ldap/LdapVCardProvider.html" target="_top"><B>FRAMES</B></A> <A HREF="LdapVCardProvider.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--></SCRIPT><NOSCRIPT> <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A></NOSCRIPT></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_top"></A><!-- ========= END OF TOP NAVBAR ========= --><HR><!-- ======== START OF CLASS DATA ======== --><H2><FONT SIZE="-1">org.jivesoftware.openfire.ldap</FONT><BR>Class LdapVCardProvider</H2><PRE><A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html" title="class or interface in java.lang">java.lang.Object</A> <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>org.jivesoftware.openfire.ldap.LdapVCardProvider</B></PRE><DL><DT><B>All Implemented Interfaces:</B> <DD><A HREF="../../../../org/jivesoftware/openfire/vcard/VCardProvider.html" title="interface in org.jivesoftware.openfire.vcard">VCardProvider</A>, <A HREF="../../../../org/jivesoftware/util/PropertyEventListener.html" title="interface in org.jivesoftware.util">PropertyEventListener</A></DD></DL><HR><DL><DT><PRE>public class <B>LdapVCardProvider</B><DT>extends <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A><DT>implements <A HREF="../../../../org/jivesoftware/openfire/vcard/VCardProvider.html" title="interface in org.jivesoftware.openfire.vcard">VCardProvider</A>, <A HREF="../../../../org/jivesoftware/util/PropertyEventListener.html" title="interface in org.jivesoftware.util">PropertyEventListener</A></DL></PRE><P>Read-only LDAP provider for vCards.Configuration consists of adding a provider:<p/> <tt>provider.vcard.className = org.jivesoftware.openfire.ldap.LdapVCardProvider</tt> and an xml vcard-mapping in the system properties.<p/> The vcard attributes can be configured by adding an <code>attrs="attr1,attr2"</code> attribute to the vcard elements.<p/> Arbitrary text can be used for the element values as well as <code>MessageFormat</code> style placeholders for the ldap attributes. For example, if you wanted to map the LDAP attribute <code>displayName</code> to the vcard element <code>FN</code>, the xml nippet would be:<br><pre><FN attrs="displayName">{0}</FN></pre><p/> The vCard XML must be escaped in CDATA and must also be well formed. It is the exact XML this provider will send to a client after after stripping <code>attr</code> attributes and populating the placeholders with the data retrieved from LDAP. This system should be flexible enough to handle any client's vCard format. An example mapping follows.<br> <tt>ldap.vcard-mapping = <![CDATA[ <vCard xmlns='vcard-temp'> <FN attrs="displayName">{0}</FN> <NICKNAME attrs="uid">{0}</NICKNAME> <BDAY attrs="dob">{0}</BDAY> <ADR> <HOME/> <EXTADR>Ste 500</EXTADR> <STREET>317 SW Alder St</STREET> <LOCALITY>Portland</LOCALITY> <REGION>Oregon</REGION> <PCODE>97204</PCODE> <CTRY>USA</CTRY> </ADR> <TEL> <HOME/> <VOICE/> <NUMBER attrs="telephoneNumber">{0}</NUMBER> </TEL> <EMAIL> <INTERNET/> <USERID attrs="mail">{0}</USERID> </EMAIL> <TITLE attrs="title">{0}</TITLE> <ROLE attrs="">{0}</ROLE> <ORG> <ORGNAME attrs="o">{0}</ORGNAME> <ORGUNIT attrs="">{0}</ORGUNIT> </ORG> <URL attrs="labeledURI">{0}</URL> <DESC attrs="uidNumber,homeDirectory,loginShell"> uid: {0} home: {1} shell: {2} </DESC> </vCard> ]]> </tt> <p/> An easy way to get the vcard format your client needs, assuming you've been using the database store, is to do a <code>SELECT value FROM ofVCard WHERE username='some_user'</code> in your favorite sql querier and paste the result into the <code>vcard-mapping</code> (don't forget the CDATA).<P><P><DL><DT><B>Author:</B></DT> <DD>rkelly</DD></DL><HR><P><!-- ======== CONSTRUCTOR SUMMARY ======== --><A NAME="constructor_summary"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"><B>Constructor Summary</B></FONT></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../../../../org/jivesoftware/openfire/ldap/LdapVCardProvider.html#LdapVCardProvider()">LdapVCardProvider</A></B>()</CODE>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -