powered by Jive Software

Wildfire.vcard & the cache

Hello everyone,

i got a little problem here :/. To set the vcards per webpage I wrote a tiny plugin that receives the needed data and uses the vcard-class to set the them.

The data are written perfectly to the table but the information in the cache are still remaining until the server is updating.

Any ideas what I should do/use to get the server using the new information’'s directly ?

The code below is used:

Element vcard = VCardManager.getProvider().loadVCard(message.getSubject());

vcard.clearContent();

vcard = DocumentHelper.parseText(message.getBody()).getRootElement();

VCardManager.getProvider().updateVCard(message.getSubject(), vcard);

Hey Finn,

As explained in the comment of VCardManager#getProvider(), this method should not be used directly and the main reason is the problem you are having. We may change the visibility of that method and make it private so people may not be trapped in this case.

Instead, you should use VCardManager#getVCard(String) to load someone’'s vCard (or use the cached one) and VCardManager#setVCard(String, Element) to update a vCard both in the cache and in the database.

Thanks,

– Gato

Oh, I guess I read over it, thank you Gato

I hope you don’'t mind me asking, but do you need to log in with each user to set their vcard?

Hey Sabine,

The String parameter that you see in VCardManager#getVCard(String) and VCardManager#setVCard(String, Element) is the username of the user whose vCard you are retrieving or modifying. Therefore, there is no need to log in with each user to set their vcard.

Regards,

– Gato