Examples of VCardContactField


Examples of com.agiletec.plugins.jpaddressbook.aps.system.services.vcard.model.VCardContactField

    this.setDoc(new Document());
    this.setRoot(new Element(VCARD_FIELDS_ELEMENT));
    Element fieldElement = null;
    if(vcards != null){
      for (int i = 0; i < vcards.size(); i++) {
        VCardContactField vcard = vcards.get(i);
        fieldElement = new Element(VCARD_FIELD_ELEMENT);
        this.getRoot().addContent(fieldElement);

        this.setCode(vcard.getCode(), fieldElement);
        this.setDescription(vcard.getDescription(), fieldElement);
        this.setEnabled(vcard.isEnabled(), fieldElement);
        this.setProfileAttribute(vcard.getProfileAttribute(), fieldElement);
      }
    }
    this.getDoc().setRootElement(this.getRoot());
  }
View Full Code Here

Examples of com.agiletec.plugins.jpaddressbook.aps.system.services.vcard.model.VCardContactField

  public List<VCardContactField> parseVcardMapping() {
    Element element = null;
    List<VCardContactField> cards = new ArrayList<VCardContactField>();
    Element root = this.getDoc().getRootElement();
    List<Element> fields = root.getChildren();
    VCardContactField vcard = null;
    for (int i = 0; i < fields.size(); i++) {
      element = fields.get(i);
      vcard = new VCardContactField();
      if(element.getAttribute(ATTRIBUTE_CODE_FIELD) != null) vcard.setCode(element.getAttribute(ATTRIBUTE_CODE_FIELD).getValue());
      if(element.getAttribute(ATTRIBUTE_DESCRIPTION_FIELD) != null) vcard.setDescription(element.getAttribute(ATTRIBUTE_DESCRIPTION_FIELD).getValue());
      if(element.getAttribute(ATTRIBUTE_ENABLED_FIELD) != null) vcard.setEnabled(Boolean.valueOf(element.getAttribute(ATTRIBUTE_ENABLED_FIELD).getValue()));
      if(element.getAttribute(ATTRIBUTE_PROFILE_FIELD) != null) vcard.setProfileAttribute(element.getAttribute(ATTRIBUTE_PROFILE_FIELD).getValue());
      cards.add(vcard);
    }
    return  cards;
  }
View Full Code Here

Examples of com.agiletec.plugins.jpaddressbook.aps.system.services.vcard.model.VCardContactField

      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) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.