powered by Jive Software

How to publish vcard info of many users directly

how can i publish the vcard info of all the registered users, if i’'m running openfire in my server? which database file should i write to? is there a tool to do such a thing in openfire?

thanks for any advice.

There are two possbile ways:

  1. Write a plugin and use VCardManager class. You can set a vCard in the following way:
import org.dom4j.DocumentFactory;
import org.dom4j.Element;
import org.jivesoftware.openfire.vcard.VCardManager; /* ... */ Element vCard = documentFactory.createElement("vCard", "vcard-temp");
vCard.addElement("FN").addText(name); // set fullname field
Element vCardEMail = vCard.addElement("EMAIL");
vCardEMail.addElement("INTERNET");
vCardEMail.addElement("USERID").addText(email); // set email field
vCardManager.setVCard(username, vCard);
  1. Insert your data directly into database. vCards are stored as XML in table jiveVCard.

To get info about the used data format, read XEP-0054.

Coolcat