CentraSite Documentation : CentraSite Developer’s Guide : Application Framework : Mapping Beans to Registry Objects with Annotations : Standard Mappings : Standard Mappings Usage Sample
Standard Mappings Usage Sample
//Create a com.softwareag.centrasite.appl.framework.beans.standard.Organization
com.softwareag.centrasite.appl.framework.beans.standard.Organization
organization = beanPool.create(com.softwareag.centrasite.appl.framework.beans.s
tandard.Organization.class);
organization.setName("MyOrganization");
 
// Create StandardMappingManager for managing Standard non RegistryObjects
// mappings
StandardMappingManager smm = new StandardMappingManager(registryProvider);
 
//Create a postal address
com.softwareag.centrasite.appl.framework.beans.standard.PostalAddress pa =
smm.createPostalAddress("streetNumber", "street", "city",
"stateOrProvince", "country", "postalCode","type");
organization.setPostalAddress(pa);
 
// Get existing user and add it to the organization
com.softwareag.centrasite.appl.framework.beans.standard.User user =
beanPool.read( com.softwareag.centrasite.appl.framework.beans.standard.User.class,
USER_KEY);
Collection<User> users = new ArrayList<User>();
users.add(user);
organization.setUsers(users);
 
// save the changes
beanPool.flush();
Copyright © Software AG, Darmstadt, Germany.

Product LogoContact Support   |   Community   |   Feedback