|
||||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |
See:
Description
Interface Summary | |
---|---|
AbstractRole | The interface represents a role type in the scope of the community API. |
CommunityController | The CommunityController provides functions to modify community
roles, domain roles and membership assignments. |
CommunityHome | This interface can be used to access the community administration component of WebSphere Portal. |
CommunityLocator | The CommunityLocator provides functions to retrieve
information about community roles, domain roles and membership.An instance of this Interface can be retrieved by calling CommunityHome , |
CommunityObjectFactory | The CommunityObjectFactory provides functions to create filled
Localized , LocalizedDomainRole and LocalizedCommunityRole
objects that can be used as input parameter for the Comunity API method calls.An instance of this Interface can be retrieved through the Home Interface: CommunityHome |
CommunityRole | The interface represents community roles. |
DomainRole | This interface represents domain specific roles that are exposed by business components. |
LocalizedCommunityRole | This interface represents extended community roles that provide localized titles and descriptions for the role. |
LocalizedDomainRole | This interface represents extended domain roles that provide localized titles and descriptions for the domain specific role. |
Class Summary | |
---|---|
LocalizedDataObject | Default implementation for the Localized interface. |
Enum Summary | |
---|---|
CommunityAccessPrivilege | The CommunityAccessPrivilege enum provides a fixed set of
access levels. |
This package and its subpackages define the portal community API.
The portal community API offers functionality to retrieve and modify access control related informatation of application communities (see also Composite Application Infrastructure APIs). In particular, the following data objects and relationships can be created, retrieved, modified and deleted:
MissingAccessRightsException
s during method execution. The required permissions for the various
operations are listed in the portal info center section 'Access Rights'
under 'Applications'.
CommunityHome
.
CommunityLocator
provides functions to retrieve
information about community roles, domain roles and membership.CommunityController
provides functions to modify
community roles, domain roles and membership assignments.CommunityObjectFactory
provides functions to create
filled Localized, LocalizedDomainRole,
LocalizedCommunityRole
objects that can be used as input parameter for
the Comunity API method calls.AbstractRole
interface represents a role type in the
scope of the community API. This is the common base interface for both,
the Domain and Community Role.Localized
interface. This
class can be used to construct data objects needed as input parameter
for CommunityController
functionality.Context ctx = new InitialContext(); CommunityHome chome = (CommunityHome) ctx.lookup(CommunityHome.JNDI_NAME); CommunityLocator locator = chome.getLocator(); CommunityController controller = chome.getController();
Context ctx = new InitialContext(); CommunityHome chome = (CommunityHome) ctx.lookup(CommunityHome.JNDI_NAME); CommunityLocator locator = chome.getLocator(); // use locator to query for community roles ObjectID applicationEntityObjectID = null; // use ObjectID from CompositeApplication environment SetcommunityRoles = locator.getCommunityRolesForCommunity(applicationEntityObjectID); // use locator to query for localized information of the all roles at the same time List sortedCommunityRoles = new ArrayList (communityRoles); List localizedCRData = locator.getLocalizedDataForRoles(sortedCommunityRoles); // loop over result and display role title for a available locale StringBuilder sb = new StringBuilder(100); Iterator crIterator = sortedCommunityRoles.iterator(); for (Localized localized : localizedCRData) { CommunityRole role = crIterator.next(); sb.append("- ").append(role.getRoleName()).append(": "); String localizedTitle = localized.getTitle(localized.getLocales().iterator().next()); sb.append(localizedTitle).append("\n"); } System.out.println(sb.toString());
Context ctx = new InitialContext(); CommunityHome chome = (CommunityHome) ctx.lookup(CommunityHome.JNDI_NAME); CommunityController controller = chome.getController(); CommunityObjectFactory objFactory = chome.getObjectFactory(); // use controller and object factory to create a new community role ObjectID applicationEntityObjectID = appEntityOID; // use ObjectID from CompositeApplication environment // create localized titles and descriptions for the role HashMaptitles = new HashMap (); HashMap descriptions = new HashMap (); titles.put(Locale.ENGLISH, "my english title"); titles.put(Locale.GERMAN, "my german title"); descriptions.put(Locale.ENGLISH, "my english description"); Localized locObj = objFactory.createLocalizedObject(titles, descriptions); // create role through controller CommunityRole newRole = controller.createCommunityRole(appEntityOID, "NewRolename", locObj); // map group as member to the new community role Principal group = null; // use Portal User and Group Management API to retrieve group data controller.addMemberToCommunityRole(newRole, Collections.singleton(group));
|
||||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |