Customizing the VCARD XSLT file
Once you know what fields are being returned from your look up, you can map them to fields on the device.
Mapping for Android, Windows™ Mobile
and Nokia devices is done by customizing the file nameLookup-VCARD.xslt
.
The file is located in the data\traveler\cfg\namelookupTemplate
directory.
To customize the file, create a new directory called data\traveler\cfg\namelookup
and
copy the file there. Customize the copied file only, the version in
the namelookupTemplate
directory will be overwritten
during an upgrade and any changes lost. A server restart is required
the first time this file is created, after which changes to the file
will be picked up dynamically.
By default, this file is configured to map the standard Domino® Directory fields to the device fields. The fields that can be used and understood by the device are defined by the VCARD 3.0 Specifications. VCARD 3.0 is defined by several RFC publications, but a simplified description can be found here: http://en.wikipedia.org/wiki/VCard.
In general, it should not be necessary to modify the VCARD mapping. Regardless, the following examples show changes that may be desiredable when customizing the mapping from server to device.
OfficePhoneNumber
is mapped to the device field
of Work Phone
. If your LDAP used WorkPhone
instead
of OfficePhoneNumber
then you would change the XSLT
as shown below:<!-- BEGIN: PERFORM CUSTOMIZATION HERE -->
BEGIN:VCARD
VERSION:3.0
FN;ENCODING=QUOTED-PRINTABLE;CHARSET=UTF-8:<xsl:value-of select="FullName"/>
N;ENCODING=QUOTED-PRINTABLE;CHARSET=UTF-8:<xsl:value-of select="LastName"/>;<xsl:value-of select="FirstName"/>;<xsl:value-of select="MiddleInitial"/>;<xsl:value-of select="Title"/>;<xsl:value-of select="Suffix"/>
ADR;ENCODING=QUOTED-PRINTABLE;CHARSET=UTF-8;TYPE=WORK;TYPE=PREF:;;<xsl:value-of select="OfficeStreetAddress"/>;<xsl:value-of select="OfficeCity"/>;<xsl:value-of select="OfficeState"/>;<xsl:value-of select="OfficeZIP"/>;<xsl:value-of select="OfficeCountry"/>
ADR;ENCODING=QUOTED-PRINTABLE;CHARSET=UTF-8;TYPE=HOME;TYPE=PREF:;;<xsl:value-of select="StreetAddress"/>;<xsl:value-of select="City"/>;<xsl:value-of select="State"/>;<xsl:value-of select="Zip"/>;<xsl:value-of select="Country"/>
TITLE;ENCODING=QUOTED-PRINTABLE;CHARSET=UTF-8:<xsl:value-of select="JobTitle"/>
ORG;ENCODING=QUOTED-PRINTABLE;CHARSET=UTF-8:<xsl:value-of select="CompanyName"/>;<xsl:value-of select="Department"/>
EMAIL;ENCODING=QUOTED-PRINTABLE;CHARSET=UTF-8;TYPE=INTERNET:<xsl:value-of select="InternetAddress"/>
TEL;ENCODING=QUOTED-PRINTABLE;CHARSET=UTF-8;TYPE=CELL:<xsl:value-of select="CellPhoneNumber"/>
TEL;ENCODING=QUOTED-PRINTABLE;CHARSET=UTF-8;TYPE=HOME:<xsl:value-of select="PhoneNumber"/>
TEL;ENCODING=QUOTED-PRINTABLE;CHARSET=UTF-8;TYPE=WORK:<xsl:value-of select="WorkPhone"/>
URL;ENCODING=QUOTED-PRINTABLE;CHARSET=UTF-8:<xsl:value-of select="WebSite"/>
X-IBM-LOOKUP-TYPE:<xsl:value-of select="Type"/>
END:VCARD
<!-- END: PERFORM CUSTOMIZATION HERE -->
Post Office Address (first field) Extended Address (second field), Street (third field), Locality (fourth field), Region (fifth field), Postal Code (six field), and Country (seventh field)
PostOfficeAddress
to
the Home address, and use State or County for Region, the XSLT would
look like the following:<!-- BEGIN: PERFORM CUSTOMIZATION HERE -->
BEGIN:VCARD
VERSION:3.0
FN;ENCODING=QUOTED-PRINTABLE;CHARSET=UTF-8:<xsl:value-of select="FullName"/>
N;ENCODING=QUOTED-PRINTABLE;CHARSET=UTF-8:<xsl:value-of select="LastName"/>;<xsl:value-of select="FirstName"/>;<xsl:value-of select="MiddleInitial"/>;<xsl:value-of select="Title"/>;<xsl:value-of select="Suffix"/>
ADR;ENCODING=QUOTED-PRINTABLE;CHARSET=UTF-8;TYPE=WORK;TYPE=PREF:;;<xsl:value-of select="OfficeStreetAddress"/>;<xsl:value-of select="OfficeCity"/>;<xsl:value-of select="OfficeState"/>;<xsl:value-of select="OfficeZIP"/>;<xsl:value-of select="OfficeCountry"/>
ADR;ENCODING=QUOTED-PRINTABLE;CHARSET=UTF-8;TYPE=HOME;TYPE=PREF:<xsl:value-of select="PostOfficeAddress"/>;;<xsl:value-of select="StreetAddress"/>;<xsl:value-of select="City"/>;<xsl:value-of select="State"/><xsl:value-of select="County"/>;<xsl:value-of select="Zip"/>;<xsl:value-of select="Country"/>
TITLE;ENCODING=QUOTED-PRINTABLE;CHARSET=UTF-8:<xsl:value-of select="JobTitle"/>
ORG;ENCODING=QUOTED-PRINTABLE;CHARSET=UTF-8:<xsl:value-of select="CompanyName"/>;<xsl:value-of select="Department"/>
EMAIL;ENCODING=QUOTED-PRINTABLE;CHARSET=UTF-8;TYPE=INTERNET:<xsl:value-of select="InternetAddress"/>
TEL;ENCODING=QUOTED-PRINTABLE;CHARSET=UTF-8;TYPE=CELL:<xsl:value-of select="CellPhoneNumber"/>
TEL;ENCODING=QUOTED-PRINTABLE;CHARSET=UTF-8;TYPE=HOME:<xsl:value-of select="PhoneNumber"/>
TEL;ENCODING=QUOTED-PRINTABLE;CHARSET=UTF-8;TYPE=WORK:<xsl:value-of select="OfficePhoneNumber"/>
URL;ENCODING=QUOTED-PRINTABLE;CHARSET=UTF-8:<xsl:value-of select="WebSite"/>
X-IBM-LOOKUP-TYPE:<xsl:value-of select="Type"/>
END:VCARD
<!-- END: PERFORM CUSTOMIZATION HERE -->