|
Wildfire 3.2.4 Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jivesoftware.wildfire.ldap.LdapVCardProvider
public class LdapVCardProvider
Read-only LDAP provider for vCards.Configuration consists of adding a provider:
<provider> <vcard> <className>org.jivesoftware.wildfire.ldap.LdapVCardProvider</className> </vcard> </provider>and an xml vcard-mapping to wildfire.xml. The vcard attributes can be configured by adding an
attrs="attr1,attr2"
attribute to the vcard elements.
Arbitrary text can be used for the element values as well as MessageFormat
style placeholders for the ldap attributes. For example, if you wanted to map the LDAP
attribute displayName
to the vcard element FN
, the xml
nippet would be:<FN attrs="displayName">{0}</FN>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
attr
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.<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> ]]> </vcard-mapping> </ldap>
An easy way to get the vcard format your client needs, assuming you've been using the database store, is to do a
SELECT value FROM jivevcard WHERE
username='some_user'
in your favorite sql querier and paste the result
into the vcard-mapping
(don't forget the CDATA).
Constructor Summary | |
---|---|
LdapVCardProvider()
|
Method Summary | |
---|---|
void |
createVCard(String username,
org.dom4j.Element vCardElement)
Creates and saves the new user vcard. |
void |
deleteVCard(String username)
Delets a user vcard. |
boolean |
isReadOnly()
Returns true if this VCardProvider is read-only. |
org.dom4j.Element |
loadVCard(String username)
Loads the specified user vcard by username. |
void |
propertyDeleted(String property,
Map params)
A property was deleted. |
void |
propertySet(String property,
Map params)
A property was set. |
void |
updateVCard(String username,
org.dom4j.Element vCardElement)
Updates the user vcard in the backend store. |
void |
xmlPropertyDeleted(String property,
Map params)
An XML property was deleted. |
void |
xmlPropertySet(String property,
Map params)
An XML property was set. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LdapVCardProvider()
Method Detail |
---|
public org.dom4j.Element loadVCard(String username)
VCardProvider
loadVCard
in interface VCardProvider
username
- the username
public void createVCard(String username, org.dom4j.Element vCardElement) throws AlreadyExistsException
VCardProvider
createVCard
in interface VCardProvider
username
- the username.vCardElement
- the vCard to save.
AlreadyExistsException
- if the user already has a vCard.public void updateVCard(String username, org.dom4j.Element vCardElement) throws NotFoundException
VCardProvider
updateVCard
in interface VCardProvider
username
- the username.vCardElement
- the vCard to save.
NotFoundException
- if the vCard to update does not exist.public void deleteVCard(String username)
VCardProvider
deleteVCard
in interface VCardProvider
username
- the username to delete.public boolean isReadOnly()
VCardProvider
isReadOnly
in interface VCardProvider
public void propertySet(String property, Map params)
PropertyEventListener
propertySet
in interface PropertyEventListener
property
- the name of the property.params
- event parameters.public void propertyDeleted(String property, Map params)
PropertyEventListener
propertyDeleted
in interface PropertyEventListener
property
- the name of the property deleted.params
- event parameters.public void xmlPropertySet(String property, Map params)
PropertyEventListener
xmlPropertySet
in interface PropertyEventListener
property
- the name of the property.params
- event parameters.public void xmlPropertyDeleted(String property, Map params)
PropertyEventListener
xmlPropertyDeleted
in interface PropertyEventListener
property
- the name of the property.params
- event parameters.
|
Wildfire 3.2.4 Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |