Package javax.xml.registry.infomodel

Examples of javax.xml.registry.infomodel.User


   }

   private void checkUser(Organization org) throws JAXRException
   {
      // Display primary contact information
      User pc = org.getPrimaryContact();
      if (pc != null)
      {
         PersonName pcName = pc.getPersonName();
         log.debug(" Contact name: " + pcName.getFullName());
         assertEquals("Anil S", pcName.getFullName());
         Collection phNums = pc.getTelephoneNumbers(pc.getType());
         for (Iterator phIter = phNums.iterator(); phIter.hasNext();)
         {
            TelephoneNumber num = (TelephoneNumber)phIter.next();
            log.debug("  Phone number: " + num.getNumber());
         }
         Collection eAddrs = pc.getEmailAddresses();
         for (Iterator eaIter = eAddrs.iterator(); eaIter.hasNext();)
         {
            log.debug("  Email Address: " + (EmailAddress)eaIter.next());
         }
      }
View Full Code Here


      serviceBinding.setAccessURI("http://testjboss.org");

      // Add the serviceBinding to the service
      service.addServiceBinding(serviceBinding);

      User user = blm.createUser();
      org.setPrimaryContact(user);
      PersonName personName = blm.createPersonName("Anil S");
      TelephoneNumber telephoneNumber = blm.createTelephoneNumber();
      telephoneNumber.setNumber("111-111-7777");
      telephoneNumber.setType(null);
      PostalAddress address = blm.createPostalAddress("111", "My Drive", "BuckHead", "GA", "USA", "1111-111", "");
      Collection postalAddresses = new ArrayList();
      postalAddresses.add(address);
      Collection emailAddresses = new ArrayList();
      EmailAddress emailAddress = blm.createEmailAddress("anil@apache.org");
      emailAddresses.add(emailAddress);

      Collection numbers = new ArrayList();
      numbers.add(telephoneNumber);
      user.setPersonName(personName);
      user.setPostalAddresses(postalAddresses);
      user.setEmailAddresses(emailAddresses);
      user.setTelephoneNumbers(numbers);

      ClassificationScheme cScheme = getClassificationScheme("ntis-gov:naics", "");
      Key cKey = blm.createKey("uuid:C0B9FE13-324F-413D-5A5B-2004DB8E5CC2");
      cScheme.setKey(cKey);
      Classification classification = blm.createClassification(cScheme, "Computer Systems Design and Related Services", "5415");
View Full Code Here

    //Listing out the services and their Bindings
    logger.debug("-------------------------------------------------");
    logger.debug("Organization name: " + org.getName().getValue());
    logger.debug("Description: " + org.getDescription().getValue());
    logger.debug("Key id: " + org.getKey().getId());
    User primaryContact = org.getPrimaryContact();
    logger.debug("Primary Contact: " + primaryContact.getPersonName().getFullName());
    Collection services = org.getServices();
    for (Iterator serviceIter = services.iterator();serviceIter.hasNext();) {
      Service service = (Service) serviceIter.next();
      logger.debug("- Service Name: " + service.getName().getValue());
      logger.debug("  Service Key : " + service.getKey().getId());
View Full Code Here

      //Building organization
      BusinessLifeCycleManager blm = rs.getBusinessLifeCycleManager();
      Organization organization = blm.createOrganization(blm.createInternationalString("Red Hat/JBossESB"));
        organization.setDescription(blm.createInternationalString("Red Hat/JBoss Professional Open Source, Services for the JBossESB"));

      User user = blm.createUser();
      organization.setPrimaryContact(user);
      PersonName personName = blm.createPersonName("JBossESB");
      TelephoneNumber telephoneNumber = blm.createTelephoneNumber();
      telephoneNumber.setNumber("404 467-8555");
      telephoneNumber.setType(null);
      PostalAddress address = blm.createPostalAddress("3340",
          "Peachtree Road, NE, Suite 1200", "Atlanta", "GA", "USA",
          "30326", "Office");
      Collection<PostalAddress> postalAddresses = new ArrayList<PostalAddress>();
      postalAddresses.add(address);
      Collection<EmailAddress> emailAddresses = new ArrayList<EmailAddress>();
      EmailAddress emailAddress = blm
          .createEmailAddress("jbossesb@jboss.com");
      emailAddresses.add(emailAddress);

      Collection<TelephoneNumber> numbers = new ArrayList<TelephoneNumber>();
      numbers.add(telephoneNumber);
      user.setPersonName(personName);
      user.setPostalAddresses(postalAddresses);
      user.setEmailAddresses(emailAddresses);
      user.setTelephoneNumbers(numbers);

  //    Scout does not support this (yet), so leaving it out for now.
  //    ClassificationScheme cScheme = getClassificationScheme(blm,
  //        blm.createInternationalString("uddi-org:general_keywords"), blm.createInternationalString(""));
  //    Classification classification = blm.createClassification(cScheme,
View Full Code Here

            Collection orgs = new ArrayList();
            Organization org = blm.createOrganization(getIString("USA"));
            org.setDescription(getIString("Apache Software Foundation"));
            Service service = blm.createService(getIString("Apache JAXR Service"));
            service.setDescription(getIString("Services of UDDI Registry"));
            User user = blm.createUser();
            org.setPrimaryContact(user);
            PersonName personName = blm.createPersonName("Steve Viens");
            TelephoneNumber telephoneNumber = blm.createTelephoneNumber();
            telephoneNumber.setNumber("410-666-7777");
            telephoneNumber.setType(null);
            PostalAddress address
                    = blm.createPostalAddress("1901",
                            "Munsey Drive", "Forest Hill",
                            "MD", "USA", "21050-2747", "");
            Collection postalAddresses = new ArrayList();
            postalAddresses.add(address);
            Collection emailAddresses = new ArrayList();
            EmailAddress emailAddress = blm.createEmailAddress("sviens@apache.org");
            emailAddresses.add(emailAddress);
            Collection numbers = new ArrayList();
            numbers.add(telephoneNumber);
            user.setPersonName(personName);
            user.setPostalAddresses(postalAddresses);
            user.setEmailAddresses(emailAddresses);
            user.setTelephoneNumbers(numbers);

            //Concepts for NAICS and computer          
            ClassificationScheme cScheme = getClassificationScheme("ntis-gov:naics", "");
            Key cKey = blm.createKey("uuid:C0B9FE13-324F-413D-5A5B-2004DB8E5CC2");
            cScheme.setKey(cKey);
View Full Code Here

    {
      List<Contact> contactList = contacts.getContact();
      if (contactList!=null) {
        boolean isFirst=true;
        for (Contact contact : contactList) {
          User user = new UserImpl(null);
          List<PersonName> pname = contact.getPersonName();
          if (pname != null && pname.size() > 0) {
            String name = pname.get(0).getValue();
            user.setPersonName(new PersonNameImpl(name));           
          }
          if (isFirst) {
            isFirst=false;
            org.setPrimaryContact(user);
          } else {
View Full Code Here

    Contacts contacts = entity.getContacts();
    if (contacts != null) {
      List<Contact> contactList = contacts.getContact();
      boolean isFirst=true;
      for (Contact contact : contactList) {
        User user = new UserImpl(null);
        List<PersonName> pnames = (List<PersonName>) contact.getPersonName();
        String pname = null;
        if (pnames != null && pnames.size() > 0) {
          PersonName personname = pnames.get(0);
          pname = personname.getValue();
        }
        user.setType(contact.getUseType());
        user.setPersonName(new PersonNameImpl(pname));
 
        List<Email> emailList = contact.getEmail();
        ArrayList<EmailAddress> tempEmails = new ArrayList<EmailAddress>();
        for (Email email : emailList) {
          tempEmails.add(new EmailAddressImpl(email.getValue(), null));
        }
        user.setEmailAddresses(tempEmails);
 
        List<Address> addressList = contact.getAddress();
        ArrayList<PostalAddress> tempAddresses = new ArrayList<PostalAddress>();
        for (Address address : addressList) {
          ArrayList<AddressLine> addressLineList = new ArrayList<AddressLine>(address.getAddressLine());
          AddressLine[] alines = new AddressLine[addressLineList.size()];
          addressLineList.toArray(alines);
 
          PostalAddress pa = getPostalAddress(alines);
          tempAddresses.add(pa);
        }
        user.setPostalAddresses(tempAddresses);
 
        List<Phone> phoneList = contact.getPhone();
        ArrayList<TelephoneNumber> tempPhones = new ArrayList<TelephoneNumber>();
        for (Phone phone : phoneList) {
          TelephoneNumberImpl tni = new TelephoneNumberImpl();
          tni.setType(phone.getUseType());
          tni.setNumber(phone.getValue());
          tempPhones.add(tni);
        }
        user.setTelephoneNumbers(tempPhones);
        if (isFirst) {
          isFirst=false;
          org.setPrimaryContact(user);
        } else {
          org.addUser(user);
View Full Code Here

    {
      List<Contact> contactList = contacts.getContact();
      if (contactList!=null) {
        boolean isFirst=true;
        for (Contact contact : contactList) {
          User user = new UserImpl(null);
          String pname = contact.getPersonName();
          user.setPersonName(new PersonNameImpl(pname));
          if (isFirst) {
            isFirst=false;
            org.setPrimaryContact(user);
          } else {
            org.addUser(user);
View Full Code Here

     */
    Contacts contacts = entity.getContacts();
    List<Contact> contactList = contacts.getContact();
    boolean isFirst=true;
    for (Contact contact : contactList) {
      User user = new UserImpl(null);
      String pname = contact.getPersonName();
      user.setType(contact.getUseType());
      user.setPersonName(new PersonNameImpl(pname));

      List<Email> emailList = contact.getEmail();
      ArrayList<EmailAddress> tempEmails = new ArrayList<EmailAddress>();
      for (Email email : emailList) {
        tempEmails.add(new EmailAddressImpl(email.getValue(), null));
      }
      user.setEmailAddresses(tempEmails);

      List<Address> addressList = contact.getAddress();
      ArrayList<PostalAddress> tempAddresses = new ArrayList<PostalAddress>();
      for (Address address : addressList) {
        ArrayList<AddressLine> addressLineList = new ArrayList<AddressLine>(address.getAddressLine());
        AddressLine[] alines = new AddressLine[addressLineList.size()];
        addressLineList.toArray(alines);

        PostalAddress pa = getPostalAddress(alines);
        tempAddresses.add(pa);
      }
      user.setPostalAddresses(tempAddresses);

      List<Phone> phoneList = contact.getPhone();
      ArrayList<TelephoneNumber> tempPhones = new ArrayList<TelephoneNumber>();
      for (Phone phone : phoneList) {
        TelephoneNumberImpl tni = new TelephoneNumberImpl();
        tni.setType(phone.getUseType());
        tni.setNumber(phone.getValue());
        tempPhones.add(tni);
      }
      user.setTelephoneNumbers(tempPhones);
      if (isFirst) {
        isFirst=false;
        org.setPrimaryContact(user);
      } else {
        org.addUser(user);
View Full Code Here

             */

      Contacts cts = objectFactory.createContacts();
      Contact[] carr = new Contact[0];

            User primaryContact = organization.getPrimaryContact();
            Collection<User> users = organization.getUsers();

            // Expand array to necessary size only (xmlbeans does not like
            // null items in cases like this)

            int carrSize = 0;

            if (primaryContact != null) {
                carrSize += 1;
            }

            // TODO: Clean this up and make it more efficient
            Iterator<User> it = users.iterator();
            while (it.hasNext()) {
                User u = (User) it.next();
                if (u != primaryContact) {
                    carrSize++;
                }
            }

            carr = new Contact[carrSize];

            /*
             * first do primary, and then filter that out in the loop
             */
            if (primaryContact != null) {
                Contact ct = getContactFromJAXRUser(primaryContact);
                carr[0] = ct;
            }

            it = users.iterator();
            int carrPos = 1;
            while (it.hasNext()) {
                User u = (User) it.next();

                if (u != primaryContact) {
                    Contact ct = getContactFromJAXRUser(u);
                    carr[carrPos] = ct;
                    carrPos++;
View Full Code Here

TOP

Related Classes of javax.xml.registry.infomodel.User

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.