Package javax.xml.registry.infomodel

Examples of javax.xml.registry.infomodel.Organization


        try {
            RegistryService rs = connection.getRegistryService();
            blm = rs.getBusinessLifeCycleManager();
            Creator creator = new Creator(blm);
            Collection<Organization> orgs = new ArrayList<Organization>();
            Organization organization = creator.createOrganization(this.getClass().getName());
            orgs.add(organization);
//          save the Organization
            BulkResponse br = blm.saveOrganizations(orgs);
            assertEquals(JAXRResponse.STATUS_SUCCESS, br.getStatus());
            organization.setKey((Key)br.getCollection().iterator().next());
           
            Service service = creator.createService(this.getClass().getName());
            ArrayList<Service> services = new ArrayList<Service>();
            organization.addService(service);
            services.add(service);
            //save service
            BulkResponse br2 = blm.saveServices(services);
            assertEquals(BulkResponse.STATUS_SUCCESS, br2.getStatus());
           
View Full Code Here


            blm = rs.getBusinessLifeCycleManager();
            bqm = rs.getBusinessQueryManager();
            Creator creator = new Creator(blm);
           
            System.out.println("\nCreating temporary organizations...\n");
            Organization sOrg = creator.createOrganization("sourceOrg");
            Organization tOrg = creator.createOrganization("targetOrg");
            Collection<Organization> organizations = new ArrayList<Organization>();
            organizations.add(sOrg);
            organizations.add(tOrg);
            BulkResponse br = blm.saveOrganizations(organizations);
            assertEquals(BulkResponse.STATUS_SUCCESS, br.getStatus());
            //setting the keys on the organizations
            Collection<Key> keys = (Collection<Key>) br.getCollection();
            Iterator<Key> iterator = keys.iterator();
            sOrg.setKey(iterator.next());
            tOrg.setKey(iterator.next());
            //creating the RelatedTo Association between these two organizations
            Concept type = bqm.findConceptByPath("/AssociationType/RelatedTo");
            Association association = blm.createAssociation(tOrg, type);
            sOrg.addAssociation(association);
            ArrayList<Association> associations = new ArrayList<Association>();
View Full Code Here

     * @return JAXR Organization
     * @throws JAXRException
     */
    public Organization createOrganization(String name) throws JAXRException
    {
        Organization org = blm.createOrganization(getIString(name));
        org.setDescription(getIString(name + ":description"));
        User user = blm.createUser();
        org.setPrimaryContact(user);
        PersonName personName = blm.createPersonName("John AXel Rose");
        TelephoneNumber telephoneNumber = blm.createTelephoneNumber();
        telephoneNumber.setNumber("111-222-3333");
        telephoneNumber.setType(null);
        PostalAddress address = blm.createPostalAddress("1",
View Full Code Here

        Key key;
        Locale locale = Locale.GERMAN;

        // create Organization
       
        Organization organization = (Organization) blm.createObject(BusinessLifeCycleManager.ORGANIZATION);

        is = getIString(locale, "Apache Scout Org");
        is.setValue(Locale.JAPANESE, "Apache Scoot Org");
        organization.setName(is);
        is = getIString(locale, "This is the org for Apache Scout Test");
        is.setValue(Locale.JAPANESE, "This is the org for Apache Scout Test");
        organization.setDescription(is);

        Collection<Organization> organizations = new ArrayList<Organization>();
        organizations.add(organization);

        br = blm.saveOrganizations(organizations);
        checkResponse(br);

        assertEquals(1, br.getCollection().size());
        key = (Key) br.getCollection().iterator().next();

        Organization organization1 = (Organization) bqm.getRegistryObject(key.getId(), LifeCycleManager.ORGANIZATION);

        System.out.println(organization1.getName().getValue() + " " + organization1.getDescription().getValue());
       
        assertEquals(organization.getName().getValue(locale),
                     organization1.getName().getValue(locale));
        assertEquals(organization.getName().getValue(Locale.JAPANESE),
                organization1.getName().getValue(Locale.JAPANESE));
       
        assertEquals(organization.getDescription().getValue(locale),
                     organization1.getDescription().getValue(locale));
        assertEquals(organization.getDescription().getValue(Locale.JAPANESE),
                organization1.getDescription().getValue(Locale.JAPANESE));

        // create Service
        Service service = (Service) blm.createObject(BusinessLifeCycleManager.SERVICE);

        is = getIString(locale, "Apache Scout Service");
        is.setValue(Locale.JAPANESE, "Apache Scoot Service");
        service.setName(is);
        is = getIString(locale, "This is the service for Apache Scout Test");
        is.setValue(Locale.JAPANESE, "This is the service for Apache Scoot Test");
        service.setDescription(is);

        organization1.addService(service);
       
        Collection<Service> services = new ArrayList<Service>();
        services.add(service);

        br = blm.saveServices(services);
        checkResponse(br);

        assertEquals(1, br.getCollection().size());
        key = (Key) br.getCollection().iterator().next();

        Service service1 = (Service) bqm.getRegistryObject(key.getId(), LifeCycleManager.SERVICE);

        System.out.println(service1.getName().getValue() + " " + service1.getDescription().getValue());
       
        assertEquals(service.getName().getValue(locale),
                     service1.getName().getValue(locale));
        assertEquals(service.getName().getValue(Locale.JAPANESE),
              service1.getName().getValue(Locale.JAPANESE));
       
        assertEquals(service.getDescription().getValue(locale),
                     service1.getDescription().getValue(locale));
       
        //Cleanup
        Collection<Key> serviceKeys = new ArrayList<Key>();
        serviceKeys.add(key);
        blm.deleteServices(serviceKeys);
       
        Collection<Key> orgKeys = new ArrayList<Key>();
        orgKeys.add(organization1.getKey());
        blm.deleteOrganizations(orgKeys);
    }
View Full Code Here

          } catch (Exception e) {
            }

            String orgOne = "Organization One";
            String orgTwo = "Organization Two";
            Organization source = blm.createOrganization(blm.createInternationalString(orgOne));
            Organization target = blm2.createOrganization(blm2.createInternationalString(orgTwo));
             
      Collection orgs = new ArrayList();
      orgs.add(source);
      br = blm.saveOrganizations(orgs);
      if (br.getExceptions() != null)
      {
        fail("Save Organization failed");
      }
     
      Collection sourceKeys = br.getCollection();
      Iterator iter = sourceKeys.iterator();
      Key savekey = null;
      while (iter.hasNext())
      {
        savekey = (Key) iter.next();
      }
      String sourceid  = savekey.getId();
      Organization queried = (Organization) bqm.getRegistryObject(sourceid, LifeCycleManager.ORGANIZATION);
      assertNotNull("Source Org", queried.getName().getValue());
           
      Collection orgstwo = new ArrayList();
      orgstwo.add(target);
            br = blm2.saveOrganizations(orgstwo);
            if (br.getExceptions() != null)
      {
              fail("Save Organizations failed");
            }
            Collection targetKeys = br.getCollection();
            iter = targetKeys.iterator();
            while (iter.hasNext())
            {
              savekey = (Key) iter.next();
            }
           
            String targetid = savekey.getId();
            Organization targetOrg = (Organization) bqm2.getRegistryObject(targetid, LifeCycleManager.ORGANIZATION);
            assertNotNull("Target Org", targetOrg.getName().getValue());

            Concept associationType = null;           
            ClassificationScheme associationTypes =
                bqm.findClassificationSchemeByName(null, "AssociationType");
            Collection types = associationTypes.getChildrenConcepts();
View Full Code Here

    public void testCreateObjectLocalizedString() throws JAXRException {
        assertEquals(LocalizedStringImpl.class, manager.createObject(LifeCycleManager.LOCALIZED_STRING).getClass());
    }

    public void testCreateObjectOrganization() throws JAXRException {
        Organization organization = (Organization) manager.createObject(LifeCycleManager.ORGANIZATION);
        assertEquals(OrganizationImpl.class, organization.getClass());
        assertSame(manager, organization.getLifeCycleManager());
    }
View Full Code Here

            blm = rs.getBusinessLifeCycleManager();
            bqm = rs.getBusinessQueryManager();
            Finder finder = new Finder(bqm, uddiversion);

            System.out.println("\nCreating temporary organization...\n");
            Organization tmpOrg = createTempOrg();
            Key tmpOrgKey = tmpOrg.getKey();
           
            System.out.println("\nCreating service...\n");
            Service tmpSvc = createTempService(tmpOrg);
            Key tmpSvcKey = tmpSvc.getKey();
           
View Full Code Here

    }
   
    private Organization createTempOrg() throws JAXRException {

        Key orgKey = null;
        Organization org = blm.createOrganization(getIString(tempOrgName));
        org.setDescription(getIString("Temporary organization to test saveService()"));

        Collection<Organization> orgs = new ArrayList<Organization>();
        orgs.add(org);
        BulkResponse br = blm.saveOrganizations(orgs);
       
        if (br.getStatus() == JAXRResponse.STATUS_SUCCESS)
        {
          orgKey = (Key) br.getCollection().iterator().next();
            System.out.println("Temporary Organization Created with id=" + orgKey.getId());
            org.setKey(orgKey);
        else
        {
            System.err.println("JAXRExceptions " +
                    "occurred during creation of temporary organization:");
           
View Full Code Here

    }

   
    private Organization createTempOrg(String tempOrgName, BusinessLifeCycleManager blm) throws JAXRException {
        Key orgKey = null;
        Organization org = blm.createOrganization(getIString(tempOrgName));
        org.setDescription(getIString("Temporary organization to test saveService()"));

        Collection<Organization> orgs = new ArrayList<Organization>();
        orgs.add(org);
        BulkResponse br = blm.saveOrganizations(orgs);

        if (br.getStatus() == JAXRResponse.STATUS_SUCCESS)
        {
            orgKey = (Key) br.getCollection().iterator().next();
            System.out.println("Temporary Organization Created with id=" + orgKey.getId());
            org.setKey(orgKey);
        else
        {
            System.err.println("JAXRExceptions " +
                    "occurred during creation of temporary organization:");
View Full Code Here

  public void testGetRegistryObjects() {

      login();
        try {

          Organization org1 = createTempOrg("OWNERSHIPTEST Organization 1", blm);
          Organization org2 = createTempOrg("OWNERSHIPTEST Organization 2", blm);
         
          BulkResponse br = bqm.getRegistryObjects(LifeCycleManager.ORGANIZATION);
            if (br.getStatus() == JAXRResponse.STATUS_SUCCESS)
            {
              System.out.println("BR.size : " + br.getCollection().size());
              Collection coll1 = br.getCollection();
              Iterator iterator = coll1.iterator();
              Collection<String> orgKeys = new ArrayList<String>();
              while (iterator.hasNext()) {
                Organization org = (Organization) iterator.next();
                System.out.println("BR " + org.getName().getValue(Locale.US));
                orgKeys.add(org.getKey().getId());
              }

              if (br.getCollection().size() == 0) {
                fail("Found no organizations for user 1");
              }
             
              BulkResponse br2 = bqm2.getRegistryObjects(LifeCycleManager.ORGANIZATION);
                if (br2.getStatus() == JAXRResponse.STATUS_SUCCESS)
                {
                  Collection coll = br2.getCollection();
                  Iterator iterator2 = coll.iterator();
                  while (iterator2.hasNext()) {
                    Organization org = (Organization) iterator2.next();
                    System.out.println("BR2 " + org.getName().getValue(Locale.US));
                    if (orgKeys.contains(org.getKey().getId())) {
                      fail("Should not find organizations from user1");
                    }
                   
                  }
                }         
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.