* @return the VCard
*/
public String createVCard(IContact contact, List<VCardContactField> vcards) {
String vcardMapping = "";
String attributeValue = "";
info.ineighborhood.cardme.VCard vcard = new VCardImpl();
VCardAddress vcardAddress = new VCardAddress();
try {
vcard.setVersion(info.ineighborhood.cardme.VCard.VERSION_3_0);
vcard.setRevisionDate(Calendar.getInstance());
vcard.setTimeZone(Calendar.getInstance().getTimeZone());
for (int i = 0; i < vcards.size(); i++) {
attributeValue = "";
VCardContactField card = vcards.get(i);
String profileAttribute = card.getProfileAttribute().trim();
if(card.isEnabled()) {
attributeValue = this.getVcardFieldValue(contact, profileAttribute);
}
String code = card.getCode().trim();
this.setVcardFields(attributeValue, code, vcard, vcardAddress);
}
vcard.addAddress(this.createAddress(vcardAddress, MailingAddressType.HOME_MAILING_ADDRESS));
vcardMapping = vcard.toString();
} catch (Throwable t) {
ApsSystemUtils.logThrowable(t, this, "createVCard");
}
return vcardMapping;
}