Package rocks.xmpp.extensions.vcard.temp.model

Examples of rocks.xmpp.extensions.vcard.temp.model.VCard$Class


     * @see org.andromda.metafacades.uml.FrontEndActivityGraph#getController()
     */
    protected java.lang.Object handleGetController()
    {
        // Take the frist class inside the FSM
        Class controller = null;
        for (Iterator it = ((StateMachine)this.metaObject).getOwnedMembers().iterator();
            it.hasNext() && controller == null;)
        {
            Object next = it.next();
            if (next instanceof Class)
View Full Code Here


    Iterator it = res.iterator();
    while (it.hasNext()) {
      GroupDataItem level01 = (GroupDataItem)it.next();
      String className = level01.getDataName();
     
      Class c = getClass(p, className);
      if (c == null) {
        addClass(p, className);
        System.out.println("INFO [jIvalo] Added class: " + className);
        c = getClass(p, className);
      }
View Full Code Here

        }
      }
      else if ( level01.getDataItems()[i] instanceof GroupDataItem ) {
        GroupDataItem gdi = (GroupDataItem)level01.getDataItems()[i];
        String className = c.getName() + "_" + gdi.getDataName();
        Class cl = getClass(p, className);
        if (cl == null) {
          addClass(p, className);
          System.out.println("INFO [jIvalo] Added class: " + className);
          cl = getClass(p, className);
        }
        else {
          System.out.println("INFO [jIvalo] Updating existing class: " + className);
        }
       
        if (cl != null) {
          addAttributes(gdi, p, cl, model);
   
          Property newAttr = null;
          if ( level01.getDataItems()[i] instanceof GroupDataItemOccurs ) {
            GroupDataItemOccurs gdio = (GroupDataItemOccurs)level01.getDataItems()[i];
            newAttr = c.createOwnedAttribute(className,p.getOwnedType(cl.getName()),gdio.getOccurs(),gdio.getOccurs());
          }
          else {
            newAttr = c.createOwnedAttribute(className,p.getOwnedType(cl.getName()),1,1);
          }
          if (newAttr != null) {
            newAttr.setVisibility(VisibilityKind.PUBLIC_LITERAL);
            addStereotype(newAttr, jIvaloAttributeStereotype);
            setTagValue(newAttr, "timestampFormat", "");
View Full Code Here

    setTagValue(p, "fraction", fraction);
    return p;
  }

  private Class addClass(Package p, String name) {
    Class newclass = p.createOwnedClass(name, false);
    setTagValue(newclass, "dataGroupName", name);
    return newclass;
  }
View Full Code Here

                "    <CLASS><PUBLIC/></CLASS>\n" +
                "  </vCard>\n" +
                "</iq>\n";

        IQ iq = unmarshal(xml, IQ.class);
        VCard vCard = iq.getExtension(VCard.class);
        Assert.assertNotNull(vCard);
        Assert.assertEquals(vCard.getFormattedName(), "Peter Saint-Andre");
        Assert.assertNotNull(vCard.getName());
        Assert.assertEquals(vCard.getName().getFamilyName(), "Saint-Andre");
        Assert.assertEquals(vCard.getName().getGivenName(), "Peter");
        Assert.assertEquals(vCard.getName().getMiddleName(), "");
        Assert.assertEquals(vCard.getNickName(), "stpeter");
        Assert.assertEquals(vCard.getUrl().toString(), new URL("http://www.xmpp.org/xsf/people/stpeter.shtml").toString());
        Calendar calendar = new GregorianCalendar();
        calendar.setTime(vCard.getBirthday());
        Assert.assertEquals(calendar.get(Calendar.YEAR), 1966);
        Assert.assertEquals(calendar.get(Calendar.MONTH), Calendar.AUGUST);
        Assert.assertEquals(calendar.get(Calendar.DATE), 6);
        Assert.assertNotNull(vCard.getOrganization());
        Assert.assertEquals(vCard.getOrganization().getOrganizationName(), "XMPP Standards Foundation");
        Assert.assertEquals(vCard.getOrganization().getOrgUnits().size(), 1);
        Assert.assertEquals(vCard.getTitle(), "Executive Director");
        Assert.assertEquals(vCard.getRole(), "Patron Saint");

        Assert.assertEquals(vCard.getTelephoneNumbers().size(), 6);
        Assert.assertEquals(vCard.getTelephoneNumbers().get(0).getNumber(), "303-308-3282");
        Assert.assertTrue(vCard.getTelephoneNumbers().get(0).isVoice());
        Assert.assertTrue(vCard.getTelephoneNumbers().get(0).isWork());
        Assert.assertTrue(vCard.getTelephoneNumbers().get(1).isFax());
        Assert.assertTrue(vCard.getTelephoneNumbers().get(1).isWork());
        Assert.assertTrue(vCard.getTelephoneNumbers().get(2).isMsg());
        Assert.assertTrue(vCard.getTelephoneNumbers().get(2).isWork());
        Assert.assertEquals(vCard.getTelephoneNumbers().get(3).getNumber(), "303-555-1212");
        Assert.assertTrue(vCard.getTelephoneNumbers().get(3).isVoice());
        Assert.assertTrue(vCard.getTelephoneNumbers().get(3).isHome());
        Assert.assertTrue(vCard.getTelephoneNumbers().get(4).isFax());
        Assert.assertTrue(vCard.getTelephoneNumbers().get(4).isHome());
        Assert.assertTrue(vCard.getTelephoneNumbers().get(5).isMsg());
        Assert.assertTrue(vCard.getTelephoneNumbers().get(5).isHome());

        Assert.assertTrue(vCard.getEmails().get(0).isPreferred());
        Assert.assertTrue(vCard.getEmails().get(0).isInternet());
        Assert.assertEquals(vCard.getEmails().get(0).getEmail(), "stpeter@jabber.org");
        Assert.assertEquals(vCard.getJid(), Jid.valueOf("stpeter@jabber.org"));
        Assert.assertEquals(vCard.getCategories().size(), 1);
        Assert.assertEquals(vCard.getCategories().get(0), "test");

        Assert.assertEquals(vCard.getDesc(), "\n" +
                "      More information about me is located on my \n" +
                "      personal website: http://www.saint-andre.com/\n" +
                "    ");

    }
View Full Code Here

    }

    @Test
    public void marshalVCard() throws JAXBException, XMLStreamException {
        VCard vCard = new VCard();
        String xml = marshal(vCard);
        Assert.assertEquals("<vCard xmlns=\"vcard-temp\" version=\"3.0\"></vCard>", xml);
    }
View Full Code Here

        Assert.assertEquals("<vCard xmlns=\"vcard-temp\" version=\"3.0\"></vCard>", xml);
    }

    @Test
    public void marshalBirthDayVCard() throws JAXBException, XMLStreamException {
        VCard vCard = new VCard();
        Calendar calendar = new GregorianCalendar();
        calendar.set(Calendar.YEAR, 2004);
        calendar.set(Calendar.MONTH, Calendar.MARCH);
        calendar.set(Calendar.DATE, 19);
        calendar.set(Calendar.HOUR_OF_DAY, 23);
        vCard.setBirthday(calendar.getTime());
        String xml = marshal(vCard);
        Assert.assertEquals("<vCard xmlns=\"vcard-temp\" version=\"3.0\"><BDAY>2004-03-19Z</BDAY></vCard>", xml);
    }
View Full Code Here

                                @Override
                                public void handle(ActionEvent actionEvent) {
                                    VCardManager vCardManager = xmppSession.getExtensionManager(VCardManager.class);
                                    try {
                                        Jid jid = new Jid(item.contact.get().getJid().getLocal(), item.contact.get().getJid().getDomain());
                                        VCard vCard = vCardManager.getVCard(jid);
                                        int i = 0;
                                    } catch (XmppException e) {
                                        e.printStackTrace();
                                    }
View Full Code Here

     * @return The vCard.
     * @throws rocks.xmpp.core.stanza.model.StanzaException If the entity returned a stanza error.
     * @throws rocks.xmpp.core.session.NoResponseException  If the entity did not respond.
     */
    public VCard getVCard() throws XmppException {
        IQ result = xmppSession.query(new IQ(IQ.Type.GET, new VCard()));
        return result.getExtension(VCard.class);
    }
View Full Code Here

     */
    public VCard getVCard(Jid jid) throws XmppException {
        if (jid == null) {
            throw new IllegalArgumentException("jid must not be null.");
        }
        IQ result = xmppSession.query(new IQ(jid.asBareJid(), IQ.Type.GET, new VCard()));
        return result.getExtension(VCard.class);
    }
View Full Code Here

TOP

Related Classes of rocks.xmpp.extensions.vcard.temp.model.VCard$Class

Copyright © 2018 www.massapicom. 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.