The easiest way would be to use Smack API to create and retrieve vCards. If you need to create vCards from the server side for some reason (e.g. import from legacy system) then you will need to pass the following parameters to VCardManager#setVCard(String username, Element vCardElement):
Parameters:
username = the node of the user JID. That would be the first part before the @.
vCardElement = a DOM Element that contains the vCard element. An example of the vCard element XML would be:
Do you think I’'d better use vCard api on client side (Smack) AND[/b] on server side? And if yes, is there a best practice (code snippet) to use Dom4j to create the java representation of your sample XML code?
Is there a more efficient way to set and grab custom properties using JM api and Smack api together (=> my core problem)?
I don’'t know your requirements but my first approach would be to use the simplest solution that would be using only Smack API for doing any vCard related work. And only have a mix solution (ie. server side and client side) if there is a real reason for having a more complex solution.
I’'m running JM on Tomcat and using a Smack client embedded in an applet…
I just want to keep control on custom user properties created on server side, and only allow Smack client to read those properties (for example to spread them in client gui…).