Examples of VCard


Examples of net.suberic.pooka.vcard.Vcard

  /**
   * Creates a new, empty AddressBookEntry.
   */
  public AddressBookEntry newAddressBookEntry() {
    return new Vcard();
  }
View Full Code Here

Examples of nu.fw.jeti.plugins.vcard.VCard

        avatars.put(hash, icon);
        jidStatus.setAvatar(icon);
      }
      else
      {
        backend.send(new InfoQuery(jidStatus.getJID(),"get", new VCard()),new IQResultListener()
        {
          public void iqResult(InfoQuery iq)
          {
            IQExtension iqe = iq.getIQExtension();
            if(iqe instanceof VCard)
View Full Code Here

Examples of nu.fw.jeti.plugins.vcard.VCard

  }
 
  public void getVCard(Connect connect)
  {
    this.connect = connect;
    backend.send(new InfoQuery("get", new VCard()),new IQResultListener()
    {
      public void iqResult(InfoQuery iq)
      {
        IQExtension iqe = iq.getIQExtension();
        if(iqe instanceof VCard)
View Full Code Here

Examples of org.jivesoftware.smackx.packet.VCard

                XMPPConnection connection = jabberProvider.getConnection();

                if(connection == null || !connection.isAuthenticated())
                    return null;

                VCard card = new VCard();
                card.load(connection, contactAddress);

                String tmp = null;

                tmp = checkForFullName(card);
                if(tmp != null)
                    result.add(new ServerStoredDetails.DisplayNameDetail(tmp));

                tmp = card.getFirstName();
                if(tmp != null)
                    result.add(new ServerStoredDetails.FirstNameDetail(tmp));

                tmp = card.getMiddleName();
                if(tmp != null)
                    result.add(new ServerStoredDetails.MiddleNameDetail(tmp));

                tmp = card.getLastName();
                if(tmp != null)
                    result.add(new ServerStoredDetails.LastNameDetail(tmp));

                tmp = card.getNickName();
                if(tmp != null)
                    result.add(new ServerStoredDetails.NicknameDetail(tmp));

                // Home Details
                // addrField one of
                // POSTAL, PARCEL, (DOM | INTL), PREF, POBOX, EXTADR, STREET,
                // LOCALITY, REGION, PCODE, CTRY
                tmp = card.getAddressFieldHome("STREET");
                if(tmp != null)
                    result.add(new ServerStoredDetails.AddressDetail(tmp));

                tmp = card.getAddressFieldHome("LOCALITY");
                if(tmp != null)
                    result.add(new ServerStoredDetails.CityDetail(tmp));

                tmp = card.getAddressFieldHome("REGION");
                if(tmp != null)
                    result.add(new ServerStoredDetails.ProvinceDetail(tmp));

                tmp = card.getAddressFieldHome("PCODE");
                if(tmp != null)
                    result.add(new ServerStoredDetails.PostalCodeDetail(tmp));

//                tmp = card.getAddressFieldHome("CTRY");
//                if(tmp != null)
//                    result.add(new ServerStoredDetails.CountryDetail(tmp);

                // phoneType one of
                //VOICE, FAX, PAGER, MSG, CELL, VIDEO, BBS, MODEM, ISDN, PCS, PREF

                tmp = card.getPhoneHome("VOICE");
                if(tmp != null)
                    result.add(new ServerStoredDetails.PhoneNumberDetail(tmp));

                tmp = card.getPhoneHome("FAX");
                if(tmp != null)
                    result.add(new ServerStoredDetails.FaxDetail(tmp));

                tmp = card.getPhoneHome("PAGER");
                if(tmp != null)
                    result.add(new ServerStoredDetails.PagerDetail(tmp));

                tmp = card.getPhoneHome("CELL");
                if(tmp != null)
                    result.add(new ServerStoredDetails.MobilePhoneDetail(tmp));

                tmp = card.getEmailHome();
                if(tmp != null)
                    result.add(new ServerStoredDetails.EmailAddressDetail(tmp));

                // Work Details
                // addrField one of
                // POSTAL, PARCEL, (DOM | INTL), PREF, POBOX, EXTADR, STREET,
                // LOCALITY, REGION, PCODE, CTRY
                tmp = card.getAddressFieldWork("STREET");
                if(tmp != null)
                    result.add(new ServerStoredDetails.WorkAddressDetail(tmp));

                tmp = card.getAddressFieldWork("LOCALITY");
                if(tmp != null)
                    result.add(new ServerStoredDetails.WorkCityDetail(tmp));

                tmp = card.getAddressFieldWork("REGION");
                if(tmp != null)
                    result.add(new ServerStoredDetails.WorkProvinceDetail(tmp));

                tmp = card.getAddressFieldWork("PCODE");
                if(tmp != null)
                    result.add(new ServerStoredDetails.WorkPostalCodeDetail(tmp));

//                tmp = card.getAddressFieldWork("CTRY");
//                if(tmp != null)
//                    result.add(new ServerStoredDetails.WorkCountryDetail(tmp);

                // phoneType one of
                //VOICE, FAX, PAGER, MSG, CELL, VIDEO, BBS, MODEM, ISDN, PCS, PREF

                tmp = card.getPhoneWork("VOICE");
                if(tmp != null)
                    result.add(new ServerStoredDetails.WorkPhoneDetail(tmp));

                tmp = card.getPhoneWork("FAX");
                if(tmp != null)
                    result.add(new WorkFaxDetail(tmp));

                tmp = card.getPhoneWork("PAGER");
                if(tmp != null)
                    result.add(new WorkPagerDetail(tmp));

                tmp = card.getPhoneWork("CELL");
                if(tmp != null)
                    result.add(new ServerStoredDetails.WorkMobilePhoneDetail(tmp));


                tmp = card.getEmailWork();
                if(tmp != null)
                    result.add(new ServerStoredDetails.EmailAddressDetail(tmp));

                tmp = card.getOrganization();
                if(tmp != null)
                    result.add(new ServerStoredDetails.WorkOrganizationNameDetail(tmp));

                tmp = card.getOrganizationUnit();
                if(tmp != null)
                    result.add(new WorkDepartmentNameDetail(tmp));

                byte[] imageBytes = card.getAvatar();
                if(imageBytes != null && imageBytes.length > 0)
                    result.add(new ServerStoredDetails.ImageDetail(
                        "Image", imageBytes));
            }
            catch (Exception exc)
View Full Code Here

Examples of org.jivesoftware.smackx.packet.VCard

  private void loadVCard(final String user) {
    messageField.setText("Retrieving vCard information ...");
    new Thread() {
      public void run() {
        try{
          VCard newVCard = new VCard();
          newVCard.load(account.xmpp.getConnection(), user);
          vCard = newVCard;
          System.out.println("vCard Loaded Successfully");
          vCShell.getDisplay().asyncExec(new Runnable() {
            public void run() {
              messageField.setText("vCard Retrieved Successfully");
View Full Code Here

Examples of org.jivesoftware.smackx.packet.VCard

    return buf.toString();
  }

  //Send current vCard to server
  private void saveVCard() {
    vCard = new VCard();
    vCard.setFirstName(textFirstName.getText());
    vCard.setMiddleName(textMiddleName.getText());
    vCard.setLastName(textLastName.getText());
    vCard.setNickName(textNickname.getText());
    vCard.setOrganization(textOrganization.getText());
View Full Code Here

Examples of org.jivesoftware.smackx.packet.VCard

      } catch (IOException e) {
          e.printStackTrace();
      }

      String xmlText = sb.toString();
      VCard vCard = new VCard();
      try {
          DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
          DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
          Document document = documentBuilder.parse(new ByteArrayInputStream(xmlText.getBytes()));
View Full Code Here

Examples of org.jivesoftware.smackx.packet.VCard

        try {
          getContainer().run(true,true,new IRunnableWithProgress() {
            public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
              monitor.beginTask("Retrieving VCard.",2);
              monitor.worked(1);
              VCard vCard = new VCard();
              try {
                vCard.load(account.xmpp.getConnection(),lastJid);
              } catch (XMPPException e) {
                // ignored for now ...
                //throw new RuntimeException(e);
              }
              String nickname = vCard.getNickName();
              if(nickname == null || nickname.equals(""))
                nickname = lastJid;
              final String nick = nickname;
              txtNickname.getDisplay().asyncExec(new Runnable() { public void run() {
                txtNickname.setText(nick);
View Full Code Here

Examples of org.jivesoftware.smackx.packet.VCard

        assertEquals("Should load another user's VCard successfully", origVCard.toString(), loaded.toString());
    }

    public void testNoWorkHomeSpecifier_EMAIL() throws Throwable {
        VCard card = VCardProvider.createVCardFromXML("<vcard><EMAIL><USERID>foo@fee.www.bar</USERID></EMAIL></vcard>");
        assertEquals("foo@fee.www.bar", card.getEmailHome());
    }
View Full Code Here

Examples of org.jivesoftware.smackx.packet.VCard

        VCard card = VCardProvider.createVCardFromXML("<vcard><EMAIL><USERID>foo@fee.www.bar</USERID></EMAIL></vcard>");
        assertEquals("foo@fee.www.bar", card.getEmailHome());
    }

    public void testNoWorkHomeSpecifier_TEL() throws Throwable {
        VCard card = VCardProvider.createVCardFromXML("<vcard><TEL><FAX/><NUMBER>3443233</NUMBER></TEL></vcard>");
        assertEquals("3443233", card.getPhoneWork("FAX"));
    }
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.