web based vCard service

Version 1


    The source is for Openfire 3.6.5 / 3.7 as it uses log4j for logging. You need to compile it. The old version is available here http://www.igniterealtime.org/projects/openfire/plugins-beta.jsp


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

    This is a very basic web frontend for Openfire 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/webvcard/vcard?user=foo to view the vCard of user foo.

    Use /plugins/webvcard/img?user=foo to view the image of user foo.


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


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


    plugin.webvcard.templateFileHead./template.head.htmlcontains the HTML header
    plugin.webvcard.templateFileFoot./template.foot.htmlcontains the HTML footer
    plugin.webvcard.templateFileBody./template.body.htmlcontains the HTML body
    plugin.webvcard.templateFileUserNotFound./template.user.not.found.htmlcontains the HTML body for user-not-found
    plugin.webvcard.templateFileGenericError./template.generic.error.htmlcontains the HTML body for generic errors
    plugin.webvcard.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.webvcard.separatorEnd}}Mark end of entry to replace.
    plugin.webvcard.proxyTypeDIRECTsets the proxy type if one is used, either ot HTTP os SOCKS (SOCKS not tested)
    plugin.webvcard.proxyName127.0.0.1set the proxy server name or IP
    plugin.webvcard.proxyPort8080set the proxy port
    set a name for "Basic" proxy authentication (not tested, NTLM is not supported)
    set a password for "Basic" proxy authentication (not tested, NTLM is not supported)

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


    A default example template.body.html 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.

    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 template.body.html file.


    /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.
    /vCard/internalPhotoalways returns a link to the VCardImageServlet.
    /vCard/externalPhotofor embedded images the VCardImageServlet is used, the URL of external images will be embedded in the vCard.
    /vCard/mixedPhotoreturns an embedded or external image depending on the vCard.


    It uses the same values as the WebVCard plugin, the proxy settings and image sizes are interesting.


    As every good application also here logging is available and can be configured using Log4J. The debug log is not recommended for production systems.

    <logger name="org.jivesoftware.openfire.plugin.webvcard">
        <level value="debug"/>

    Help for vCard entries

    You may either extract this plugin and take a look at the template.body.html file which works fine for Spark 2.0 vCards which do not comply to the XEP.

    Or you may use an XMPP debugger (using Spark one must activate it before login) and open your vCard to see all entries in it. This is just a small part:

    <vCard xmlns="vcard-temp">

    Use {{/vCard/NICKNAME}} in your template file to insert the nickname, if it does not exist 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 ZVON > Tutorials > XPath Tutorial.