Examples of OrganizationImpl


Examples of org.apache.shindig.social.core.model.OrganizationImpl

    canonical.setHeroes(Lists.newArrayList("Doug Crockford", "Charles Babbage"));
    canonical.setHumor("none to speak of");
    canonical.setInterests(Lists.newArrayList("PHP", "Java"));
    canonical.setJobInterests("will work for beer");

    Organization job1 = new OrganizationImpl();
    job1.setAddress(new AddressImpl("1 Shindig Drive"));
    job1.setDescription("lots of coding");
    job1.setEndDate(buildDate("2010-10-10"));
    job1.setField("Software Engineering");
    job1.setName("Apache.com");
    job1.setSalary("$1000000000");
    job1.setStartDate(buildDate("1995-01-01"));
    job1.setSubField("Development");
    job1.setTitle("Grand PooBah");
    job1.setWebpage("http://shindig.apache.org/");
    job1.setType("job");

    Organization job2 = new OrganizationImpl();
    job2.setAddress(new AddressImpl("1 Skid Row"));
    job2.setDescription("");
    job2.setEndDate(buildDate("1995-01-01"));
    job2.setField("College");
    job2.setName("School of hard Knocks");
    job2.setSalary("$100");
    job2.setStartDate(buildDate("1991-01-01"));
    job2.setSubField("Lab Tech");
    job2.setTitle("Gopher");
    job2.setWebpage("");
    job2.setType("job");

    canonical.setOrganizations(Lists.newArrayList(job1, job2));

    canonical.setUpdated(new Date());
    canonical.setLanguagesSpoken(Lists.newArrayList("English", "Dutch", "Esperanto"));
View Full Code Here

Examples of org.apache.shindig.social.core.model.OrganizationImpl

    canonical.setHeroes(Lists.newArrayList("Doug Crockford", "Charles Babbage"));
    canonical.setHumor("none to speak of");
    canonical.setInterests(Lists.newArrayList("PHP", "Java"));
    canonical.setJobInterests("will work for beer");

    Organization job1 = new OrganizationImpl();
    job1.setAddress(new AddressImpl("1 Shindig Drive"));
    job1.setDescription("lots of coding");
    job1.setEndDate(new Date());
    job1.setField("Software Engineering");
    job1.setName("Apache.com");
    job1.setSalary("$1000000000");
    job1.setStartDate(new Date());
    job1.setSubField("Development");
    job1.setTitle("Grand PooBah");
    job1.setWebpage("http://shindig.apache.org/");
    job1.setType("job");

    Organization job2 = new OrganizationImpl();
    job2.setAddress(new AddressImpl("1 Skid Row"));
    job2.setDescription("");
    job2.setEndDate(new Date());
    job2.setField("College");
    job2.setName("School of hard Knocks");
    job2.setSalary("$100");
    job2.setStartDate(new Date());
    job2.setSubField("Lab Tech");
    job2.setTitle("Gopher");
    job2.setWebpage("");
    job2.setType("job");

    canonical.setOrganizations(Lists.newArrayList(job1, job2));

    canonical.setUpdated(new Date());
    canonical.setLanguagesSpoken(Lists.newArrayList("English", "Dutch", "Esperanto"));
View Full Code Here

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

  throws JAXRException
  {
    List<Name> namesList = businessEntity.getName();
    List<Description> descriptionList = businessEntity.getDescription();

    Organization org = new OrganizationImpl(lifeCycleManager);
    if ((namesList != null) && (namesList.size() > 0)) {
      InternationalString is = null;
      for (Name n : namesList)  {
        if (is == null) {
          is = getIString(n.getLang(), n.getValue(), lifeCycleManager);
        } else {
          is.setValue(getLocale(n.getLang()), n.getValue());
        }
      }
      org.setName(is);
    }
    if ((descriptionList != null) && (descriptionList.size() > 0)) {
      InternationalString is = null;
      for (Description desc : descriptionList)  {
        if (is == null) {
          is = getIString(desc.getLang(), desc.getValue(), lifeCycleManager);
        } else {
          is.setValue(getLocale(desc.getLang()), desc.getValue());
        }
      }
      org.setDescription(is);
    }
    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

    }
    BusinessEntity entity = bizEntityList.get(0);
    List<Name> namesList = entity.getName();
    List<Description> descriptionList = entity.getDescription();

    Organization org = new OrganizationImpl(lifeCycleManager);
    if ((namesList != null) && (namesList.size() > 0)) {
      InternationalString is = null;
      for (Name n : namesList)  {
        if (is == null) {
          is = getIString(n.getLang(), n.getValue(), lifeCycleManager);
        } else {
          is.setValue(getLocale(n.getLang()), n.getValue());
        }
      }
      org.setName(is);
    }
    if ((descriptionList != null) && (descriptionList.size() > 0)) {
      InternationalString is = null;
      for (Description desc : descriptionList)  {
        if (is == null) {
          is = getIString(desc.getLang(), desc.getValue(), lifeCycleManager);
        } else {
          is.setValue(getLocale(desc.getLang()), desc.getValue());
        }
      }
      org.setDescription(is);
    }

    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

        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

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

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

  public static Organization getOrganization(BusinessEntity businessEntity,
      LifeCycleManager lifeCycleManager)
  throws JAXRException
  {
    Organization org = new OrganizationImpl(lifeCycleManager);
    List<Name> namesList = businessEntity.getName();
    if ((namesList != null) && (namesList.size() > 0)) {
      InternationalString is = null;
      for (Name n : namesList)  {
        if (is == null) {
          is = getIString(n.getLang(), n.getValue(), lifeCycleManager);
        } else {
          is.setValue(getLocale(n.getLang()), n.getValue());
        }
      }
      org.setName(is);
    }

    List<Description> descriptionList = businessEntity.getDescription();
    if ((descriptionList != null) && (descriptionList.size() > 0)) {
      InternationalString is = null;
      for (Description desc : descriptionList)  {
        if (is == null) {
          is = getIString(desc.getLang(), desc.getValue(), lifeCycleManager);
        } else {
          is.setValue(getLocale(desc.getLang()), desc.getValue());
        }
      }
      org.setDescription(is);
    }
    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);
          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 {
            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

  public static Organization getOrganization(BusinessDetail bizdetail,
      LifeCycleManager lifeCycleManager)
  throws JAXRException
  {
    List<BusinessEntity> bizEntityList = bizdetail.getBusinessEntity();
    Organization org = new OrganizationImpl(lifeCycleManager);
    if (bizEntityList.size() != 1) {
      throw new JAXRException("Unexpected count of organizations in BusinessDetail: " + bizEntityList.size());
    }
    BusinessEntity entity = bizEntityList.get(0);
    List<Name> namesList = entity.getName();
    if ((namesList != null) && (namesList.size() > 0)) {
      InternationalString is = null;
      for (Name n : namesList)  {
        if (is == null) {
          is = getIString(n.getLang(), n.getValue(), lifeCycleManager);
        } else {
          is.setValue(getLocale(n.getLang()), n.getValue());
        }
      }
      org.setName(is);
    }

    List<Description> descriptionList = entity.getDescription();
    if ((descriptionList != null) && (descriptionList.size() > 0)) {
      InternationalString is = null;
      for (Description desc : descriptionList)  {
        if (is == null) {
          is = getIString(desc.getLang(), desc.getValue(), lifeCycleManager);
        } else {
          is.setValue(getLocale(desc.getLang()), desc.getValue());
        }
      }
      org.setDescription(is);
    }
    org.setKey(lifeCycleManager.createKey(entity.getBusinessKey()));

    //Set Services also
    BusinessServices services = entity.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 = 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);
        }
      }
    }
    //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

        }
        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
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.