Package javax.xml.registry.infomodel

Examples of javax.xml.registry.infomodel.Organization


            log.debug(" -- Matched " + orgs.size() + " organizations -- ");

            // then step through them
            for (Iterator orgIter = orgs.iterator(); orgIter.hasNext();)
            {
               Organization org = (Organization)orgIter.next();
               log.debug("Org name: " + getName(org));
               log.debug("Org description: " + getDescription(org));
               log.debug("Org key id: " + getKey(org));
               checkUser(org);
               checkServices(org);
View Full Code Here


   /**
    * Creates a Jaxr Organization with 1 or more services
    */
   protected Organization createOrganization(String orgname) throws JAXRException
   {
      Organization org = blm.createOrganization(getIString(orgname));
      org.setDescription(getIString("JBoss Inc"));
      Service service = blm.createService(getIString("JBOSS JAXR Service"));
      service.setDescription(getIString("Services of XML Registry"));
      //Create serviceBinding
      ServiceBinding serviceBinding = blm.createServiceBinding();
      serviceBinding.setDescription(blm.createInternationalString("Test Service Binding"));

      //Turn validation of URI off
      serviceBinding.setValidateURI(false);
      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");
      org.addClassification(classification);
      ClassificationScheme cScheme1 = getClassificationScheme("D-U-N-S", "");
      Key cKey1 = blm.createKey("uuid:3367C81E-FF1F-4D5A-B202-3EB13AD02423");
      cScheme1.setKey(cKey1);
      ExternalIdentifier ei = blm.createExternalIdentifier(cScheme1, "D-U-N-S number", "08-146-6849");
      org.addExternalIdentifier(ei);
      org.addService(service);
      return org;
   }
View Full Code Here

          
            InternationalString idesc = service.getDescription();
   
           addDescriptions(bs.getDescription(), idesc);

            Organization o = service.getProvidingOrganization();

            /*
             * there may not always be a key...
             */
            if (o != null) {
                Key k = o.getKey();

        if (k != null && k.getId() != null) {
                    bs.setBusinessKey(k.getId());
                }
                   
View Full Code Here

    List<Description> descriptionList = businessEntity.getDescription();
    Description desc =null;
    if (descriptionList.size()>0) desc = descriptionList.get(0);

    Organization org = new OrganizationImpl(lifeCycleManager);
    if(n != null ) {
      org.setName(getIString(n.getLang(), n.getValue(), lifeCycleManager));
    }
    if( desc != null) {
      org.setDescription(getIString(desc.getLang(), desc.getValue(), lifeCycleManager));
    }
    org.setKey(lifeCycleManager.createKey(businessEntity.getBusinessKey()));

    //Set Services also
    BusinessServices services = businessEntity.getBusinessServices();
    if(services != null)
    {
      List<BusinessService> bizServiceList = services.getBusinessService();
      for (BusinessService businessService : bizServiceList) {
        org.addService(getService(businessService, lifeCycleManager));
      }
    }

    /*
     *  Users
     *
     *  we need to take the first contact and designate as the
     *  'primary contact'.  Currently, the OrganizationImpl
     *  class does that automatically as a safety in case
     *  user forgets to set - lets be explicit here as to not
     *  depend on that behavior
     */

    Contacts contacts = businessEntity.getContacts();
    if(contacts != null)
    {
      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);
          }
        }
      }
    }

    //External Links
    DiscoveryURLs durls = businessEntity.getDiscoveryURLs();
    if (durls != null)
    {
      List<DiscoveryURL> discoveryURL_List = durls.getDiscoveryURL();
      for (DiscoveryURL discoveryURL : discoveryURL_List) {
        ExternalLink link = new ExternalLinkImpl(lifeCycleManager);
        link.setExternalURI(discoveryURL.getValue());
        org.addExternalLink(link);
      }
    }

    org.addExternalIdentifiers(getExternalIdentifiers(businessEntity.getIdentifierBag(), lifeCycleManager));
    org.addClassifications(getClassifications(businessEntity.getCategoryBag(), lifeCycleManager));

    return org;
  }
View Full Code Here

    List<Description> descriptionList = entity.getDescription();
    Description desc =null;
    if (descriptionList.size()>0) desc = descriptionList.get(0);

    Organization org = new OrganizationImpl(lifeCycleManager);
    if( n != null ) {
      org.setName(getIString(n.getLang(), n.getValue(), lifeCycleManager));
    }
    if( desc != null ) {
      org.setDescription(getIString(desc.getLang(), desc.getValue(), lifeCycleManager));
    }
    org.setKey(lifeCycleManager.createKey(entity.getBusinessKey()));

    //Set Services also
    BusinessServices services = entity.getBusinessServices();
    List<BusinessService> bizServiceList = services.getBusinessService();
    for (BusinessService businessService : bizServiceList) {
      org.addService(getService(businessService, lifeCycleManager));
    }

    /*
     *  Users
     *
     *  we need to take the first contact and designate as the
     *  'primary contact'.  Currently, the OrganizationImpl
     *  class does that automatically as a safety in case
     *  user forgets to set - lets be explicit here as to not
     *  depend on that behavior
     */
    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);
      }
    }

    //External Links
    DiscoveryURLs durls = entity.getDiscoveryURLs();
    if (durls != null)
    {
      List<DiscoveryURL> discoveryURL_List = durls.getDiscoveryURL();
      for (DiscoveryURL discoveryURL : discoveryURL_List) {
        ExternalLink link = new ExternalLinkImpl(lifeCycleManager);
        link.setExternalURI(discoveryURL.getValue());
        org.addExternalLink(link);
      }
    }

    org.addExternalIdentifiers(getExternalIdentifiers(entity.getIdentifierBag(), lifeCycleManager));
    org.addClassifications(getClassifications(entity.getCategoryBag(), lifeCycleManager));

    return org;
  }
View Full Code Here

    public LocalizedString createLocalizedString(Locale locale, String value, String charsetName) throws JAXRException {
        return new LocalizedStringImpl(locale, value, charsetName);
    }

    public Organization createOrganization(InternationalString name) throws JAXRException {
        Organization org = (Organization) this.createObject(LifeCycleManager.ORGANIZATION);
        org.setName(name);
        return org;
    }
View Full Code Here

        org.setName(name);
        return org;
    }

    public Organization createOrganization(String name) throws JAXRException {
        Organization org = (Organization) this.createObject(LifeCycleManager.ORGANIZATION);
        org.setName(this.createInternationalString(name));
        return org;
    }
View Full Code Here

                BusinessInfos infos = list.getBusinessInfos();
                //Object infos2 = list.getBusinessInfos();
               
                //get each businessInfo
                //BusinessInfos infos = (BusinessInfos)infos2;
                Organization org = null;
                if (infos != null) {
                    //for (int i = 0; i < infos.getBusinessInfoLength(); i++) {
                       
                        Collection binfos = infos.getBusinessInfo();
                        Iterator iter = binfos.iterator();
View Full Code Here

               Collection entities =
                       detail.getBusinessEntity();
               if (entities != null) {
                   Iterator iter = entities.iterator();
                   while (iter.hasNext()){
                       Organization org =
                               mapper.businessEntity2Organization((BusinessEntity)iter.next());
                       if (type.equalsIgnoreCase(mapper.FIND))
                           fbResponse.add(org);
                       else
                           fbResponse.add(org.getKey());
                   }
                   bResponse.setCollection(fbResponse);
               }
           }
           return bResponse;
View Full Code Here

               bResponse = new BulkResponseImpl();
               Collection fbResponse = new ArrayList();

               BusinessInfos infos = info.getBusinessInfos();
               Collection  binfos = infos.getBusinessInfo();
               Organization org = null;
               Iterator iter = binfos.iterator();
               while (iter.hasNext()){
                   org = mapper.businessInfo2Organization((BusinessInfo)iter.next());
                   fbResponse.add(org);
               }
View Full Code Here

TOP

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

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.