Examples of OrganizationImpl


Examples of org.apache.ws.scout.registry.infomodel.OrganizationImpl

    Organization createOrganization(BusinessInfo info) throws JAXRException {
        String key = info.getBusinessKey();
        Name[] names = info.getNameArray();
        Description[] descriptions = info.getDescriptionArray();
        ServiceInfo[] serviceInfos = info.getServiceInfos().getServiceInfoArray();
        OrganizationImpl org = new OrganizationImpl(this);
        org.setKey(createKey(key));
        if (names != null && names.length > 0) {
            org.setName(createInternationalString(((Name) names[0]).getStringValue()));
        }
        if (descriptions != null && descriptions.length > 0) {
            org.setDescription(createInternationalString(((Description) descriptions[0]).getStringValue()));
        }
        if (serviceInfos != null && serviceInfos.length > 0) {
            List<Service> services = new ArrayList<Service>(serviceInfos.length);
            for (int i = 0; i < serviceInfos.length; i++) {
                ServiceInfo serviceInfo = (ServiceInfo) serviceInfos[i];
                services.add(createService(serviceInfo));
            }
            org.addServices(services);
        }

        return org;
    }
View Full Code Here

Examples of org.apache.ws.scout.registry.infomodel.OrganizationImpl

      Name n = namearray != null && namearray.length > 0 ? namearray[0] : null;
      String name = n != null ? n.getStringValue() : null;
      Description[] descarray = entity.getDescriptionArray();
      Description desc = descarray != null && descarray.length > 0 ? descarray[0]: null;

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

      //Set Services also
      BusinessServices services = entity.getBusinessServices();
      BusinessService[] sarr = services != null ? services.getBusinessServiceArray() : null;
      for (int i = 0; sarr != null && i < sarr.length; i++)
      {
         BusinessService s = (BusinessService)sarr[i];
         org.addService(getService(s, lcm));
      }

      /*
       *  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();
      Contact[] carr = contacts != null ? contacts.getContactArray() : null;

      for (int i = 0; carr != null && i < carr.length; i++)
      {
         Contact contact = (Contact)carr[i];
         User user = new UserImpl(null);
         String pname = contact.getPersonName();
         user.setPersonName(new PersonNameImpl(pname));
         if (i == 0)
         {
            org.setPrimaryContact(user);
         }
         else
         {
            org.addUser(user);
         }
      }

      //External Links
      DiscoveryURLs durls = entity.getDiscoveryURLs();
      if (durls != null)
      {
         DiscoveryURL[] darr = durls.getDiscoveryURLArray();
         for (int j = 0; darr != null && j < darr.length; j++)
         {
            DiscoveryURL durl = (DiscoveryURL)darr[j];
            ExternalLink link = new ExternalLinkImpl(lcm);
            link.setExternalURI(durl.getStringValue());
            org.addExternalLink(link);
         }
      }

      org.addExternalIdentifiers(getExternalIdentifiers(entity.getIdentifierBag(), lcm));
      org.addClassifications(getClassifications(entity.getCategoryBag(), lcm));
     
      return org;
   }
View Full Code Here

Examples of org.apache.ws.scout.registry.infomodel.OrganizationImpl

      Name n = namearr != null && namearr.length > 0 ? namearr[0] : null;
      String name = n != null ? n.getStringValue(): null;
      Description[] descarr = entity.getDescriptionArray();
      Description desc = descarr != null && descarr.length > 0 ? descarr[0] : null;

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

      //Set Services also
      BusinessServices services = entity.getBusinessServices();
      BusinessService[] sarr = services != null ? services.getBusinessServiceArray() : null;
      for (int i = 0; sarr != null && i < sarr.length; i++)
      {
         BusinessService s = (BusinessService)sarr[i];
         org.addService(getService(s, lcm));
        
      }

      /*
       *  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();
      Contact[] carr = contacts != null ? contacts.getContactArray():null;
      for (int i = 0; carr != null && i < carr.length; i++)
      {
         Contact contact = carr[i];
         User user = new UserImpl(null);
         String pname = contact.getPersonName();
         user.setType(contact.getUseType());
         user.setPersonName(new PersonNameImpl(pname));
        

         Email[] emails = (Email[]) contact.getEmailArray();
         ArrayList<EmailAddress> tempEmails = new ArrayList<EmailAddress>();
         for (int x = 0; x < emails.length; x++) {
           tempEmails.add(new EmailAddressImpl(emails[x].getStringValue(), null));
         }
         user.setEmailAddresses(tempEmails);
        
         Address[] addresses = (Address[]) contact.getAddressArray();
         ArrayList<PostalAddress> tempAddresses = new ArrayList<PostalAddress>();
         for (int x = 0; x < addresses.length; x++) {
           AddressLine[] alines = addresses[x].getAddressLineArray();
           PostalAddress pa = getPostalAddress(alines);
           tempAddresses.add(pa);
         }
         user.setPostalAddresses(tempAddresses);
         Phone[] phones = contact.getPhoneArray();
         ArrayList<TelephoneNumber> tempPhones = new ArrayList<TelephoneNumber>();
         for (int x = 0; x < phones.length; x++) {
           TelephoneNumberImpl tni = new TelephoneNumberImpl();
           tni.setType(phones[x].getUseType());
           tni.setNumber(phones[x].getStringValue());
           tempPhones.add(tni);
         }
         user.setTelephoneNumbers(tempPhones);
        
         if (i == 0)
         {
            org.setPrimaryContact(user);
         }
         else
         {
            org.addUser(user);
         }
      }

      //External Links
      DiscoveryURLs durls = entity.getDiscoveryURLs();
      if (durls != null)
      {
         DiscoveryURL[] darr = durls.getDiscoveryURLArray();
         for (int j = 0; darr != null && j < darr.length; j++)
         {
            DiscoveryURL durl = darr[j];
            ExternalLink link = new ExternalLinkImpl(lcm);
            link.setExternalURI(durl.getStringValue());
            org.addExternalLink(link);
         }
      }

      org.addExternalIdentifiers(getExternalIdentifiers(entity.getIdentifierBag(), lcm));
      org.addClassifications(getClassifications(entity.getCategoryBag(), lcm));
     
      return org;
   }
View Full Code Here

Examples of org.apache.ws.scout.registry.infomodel.OrganizationImpl

        }
        else if (LifeCycleManager.LOCALIZED_STRING.equals(interfaceName)) {
            return new LocalizedStringImpl();
        }
        else if (LifeCycleManager.ORGANIZATION.equals(interfaceName)) {
            return new OrganizationImpl(this);
        }
        else if (LifeCycleManager.PERSON_NAME.equals(interfaceName)) {
            return new PersonNameImpl();
        }
        else if (LifeCycleManager.POSTAL_ADDRESS.equals(interfaceName)) {
View Full Code Here

Examples of org.apache.ws.scout.registry.infomodel.OrganizationImpl

    Organization createOrganization(BusinessInfo info) throws JAXRException {
        String key = info.getBusinessKey();
        Vector names = info.getNameVector();
        Vector descriptions = info.getDescriptionVector();
        Vector serviceInfos = info.getServiceInfos().getServiceInfoVector();
        OrganizationImpl org = new OrganizationImpl(this);
        org.setKey(createKey(key));
        if (names != null && !names.isEmpty()) {
            org.setName(createInternationalString(((Name) names.get(0)).getValue()));
        }
        if (descriptions != null && !descriptions.isEmpty()) {
            org.setDescription(createInternationalString(((Description) descriptions.get(0)).getValue()));
        }
        if (serviceInfos != null && !serviceInfos.isEmpty()) {
            List services = new ArrayList(serviceInfos.size());
            for (int i = 0; i < serviceInfos.size(); i++) {
                ServiceInfo serviceInfo = (ServiceInfo) serviceInfos.elementAt(i);
                services.add(createService(serviceInfo));
            }
            org.addServices(services);
        }

        return org;
    }
View Full Code Here

Examples of org.apache.ws.scout.registry.infomodel.OrganizationImpl

    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

Examples of org.apache.ws.scout.registry.infomodel.OrganizationImpl

    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

Examples of org.apache.ws.scout.registry.infomodel.OrganizationImpl

        }
        else if (LifeCycleManager.LOCALIZED_STRING.equals(interfaceName)) {
            return new LocalizedStringImpl();
        }
        else if (LifeCycleManager.ORGANIZATION.equals(interfaceName)) {
            return new OrganizationImpl(this);
        }
        else if (LifeCycleManager.PERSON_NAME.equals(interfaceName)) {
            return new PersonNameImpl();
        }
        else if (LifeCycleManager.POSTAL_ADDRESS.equals(interfaceName)) {
View Full Code Here

Examples of org.apache.ws.scout.registry.infomodel.OrganizationImpl

        List<Name> names = bizInfo.getName();
       
        List<Description> descriptions = bizInfo.getDescription();
        List<ServiceInfo> serviceInfos = bizInfo.getServiceInfos().getServiceInfo();
       
        OrganizationImpl org = new OrganizationImpl(this);
        org.setKey(createKey(key));
        if (names != null && names.size() > 0) {
            org.setName(createInternationalString(names.get(0).getValue()));
        }
        if (descriptions != null && descriptions.size() > 0) {
            org.setDescription(createInternationalString(descriptions.get(0).getValue()));
        }
        if (serviceInfos != null && serviceInfos.size() > 0) {
            List<Service> services = new ArrayList<Service>(serviceInfos.size());
            for (int i = 0; i < serviceInfos.size(); i++) {
                ServiceInfo serviceInfo = serviceInfos.get(i);
                services.add(createService(serviceInfo));
            }
            org.addServices(services);
        }

        return org;
    }
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.