version: 0.0.2
released: January 7th, 2007

Overview

Warning: This is beta software. Don't expect everything to be implemented or to work fine. Some things are striked as they are not implemented or yet available. If you feel the need to post a comment or feature report please use the (external link: Wildfire Dev) forum.

This is a very basic web frontend for Wildfire which allows to display vCards. It does not contain any security so everyone who has access to the server can view the vCards.

Use /plugins/vcard/?user=foo to view the vCard of user foo.

Installation

Copy the jar file into the plugins directory of your Wildfire installation. The plugin will then be automatically deployed. To upgrade to a new version, copy the new jar file over the existing one.

Configuration

No JSP is available at the moment. One can set these System Properties.

Properties

NameDefaultDescription
plugin.vcard.templateFileHead./template.head.htmlcontains the HTML header
plugin.vcard.templateFileFoot./template.foot.htmlcontains the HTML footer
plugin.vcard.templateFileBody./template.body.htmlcontains the HTML body
plugin.vcard.templateFileUserNotFound./template.user.not.found.htmlcontains the HTML body for user-not-found
plugin.vcard.templateFileGenericError./template.generic.error.htmlcontains the HTML body for generic errors
plugin.vcard.separatorStart{{Mark start of entry to replace. As it is used as a regular expression make sure to escape it properly when specifying something else like "\\{\\-" for "{-".
plugin.vcard.separatorEnd}}Mark end of entry to replace.

You may want to create your own template files which matches your design. Every value within a vCard can be used in the BODY file. There it will be replaced with the content depending on the user.

Customization

A default example BODY file is stored in this directory. You need to create your own one and set plugin.vcard.templateFileBody to its location in the file system. A very simple one could contain:

<body>
   First Name: {{/vCard/N/GIVEN}}<br/>
   Last Name: {{/vCard/N/FAMILY}}<br/>
   Email Address: {{/vCard/EMAIL/USERID}}<br/>
</body>

After changing a template file or a system property you need to reload the Plugin to activate the changes.

vCard pseudo image entries

To make the creation of a vCard containing an image a little bit more easy one can use one of these pseudo values one time in the BODY file.

Values

NameMeaning
/vCard/embeddedPhotoalways embeds the photo as base 64 in the html page. If EXTVAL is used within the vCard it will download the photo to embed it. This works fine with Firefox but not with IE.
/vCard/internalPhotoalways returns a link to the VCardImageServlet.
/vCard/externalPhotouses an external image, either using the EXTVAL value or the VCardImageServlet.
/vCard/mixedPhotoreturns an embedded or external image depending on the vCard.

VCardImageServlet

This must be written to make most of the vCard pseudo entries work.

Help for vCard entries

Use an xmpp debug window (F12 within Spark) and open your vCard to see all entries in it, this is just a small part:

<vCard xmlns="vcard-temp">
   <N>
      <FAMILY>Flintstone</FAMILY>
      <GIVEN>Fred</GIVEN>
      ...
   <N>
   ...
   <NICKNAME>Fred</NICKNAME>
   ...
   <TEL>
      <VOICE/>
      <HOME/>
      <NUMBER>007</NUMBER>
   </TEL>
   ...
   <TEL>
      <VOICE/>
      <WORK/>
   <NUMBER>666</NUMBER>
   </TEL>
   ...
</vCard">

Use {{/vCard/NICKNAME}} in your template file to insert the nickname, if it does not exisit nothing will be inserted.
{{/vCard/N/FAMILY}} will insert the family name.
A random telephone number may be inserted with {{/vCard/TEL/NUMBER}} but that's not what you want. Empty tags are used above NUMBER and to select the VOICE WORK number you may use {{/vCard/TEL/VOICE/parent::TEL/WORK/parent::TEL/NUMBER}} or any other DOM4J XPath which matches this node.
An XPath Tutorial may be found here (external link: ZVON > Tutorials > XPath Tutorial).