|
Copyright © 2000, 2008, Oracle and/or its affiliates. All rights reserved. | ||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |
See
Description
Interface Summary | |
---|---|
CommunityCallback | Defines callback methods that the WLP framework makes in response to various community lifecycle events. |
Class Summary | |
---|---|
AbstractCommunityCallback | AbstractCommunityCallback - default implementation of the CommunityCallback
interface that no-ops all methods. |
CommunitiesConfigProperties | Represents a set of properties which have been configured via communities-config.xml. |
CommunityDesktop | CommunityDesktop - specifies the desktop to be used to create a community. |
CommunityInfo | A structure to pass information to the CommunityDefinition
constructor. |
CommunityMember | Represents a single CommunityMember . |
CommunityMembership | CommunityMembership - value object class that contains information
about a membership of a CommuntityMember to a
Community . |
CommunityMembershipCriteria | The CommunityMembershipCriteria object is used to specify attributes used to find specific CommunityMembership objects from a particular community. |
CommunityProperty | Represents a property associated with a community. |
CommunityPropertyValue | CommunityPropertyValue contains a value for a community property. |
CommunitySearchCriteria | CommunitySearchCriteria - search criteria for communities. |
InvitationSearchCriteria | SearchCriteria implementation used to specify a
search operation to retrieve Communities Invitations . |
MemberCriteria | The MemberCriteria object is used to specify a member to search for. |
MemberMembershipCriteria | The MemberMembershipCriteria object is used to specify attributes used to find specific CommunityMembership objects for a particular user. |
MembershipCapability | Represents a Capability that has been granted to a
CommunityMember with respect to a single
CommunityMembership . |
MembershipCriteria | The MembershipCriteria object is used to specify attributes used to find specific CommunityMembership objects. |
CommunityDefinition
object. The CommunityDefinition stores
attributes about a community instance which apply to the entire community, such as whether a community
requires users to be members of the community to view it. For a full discussion of community attributes,
see the CommunityDefinition Attributes documentation below.
CommunityMember
objects, which represent a link between users in WebLogic Server and the community framework.
Each WLS user may have zero or one CommunityMember objects; if the user has never participated in
any communities they may not have a CommunityMember object, but if they are to participate in a
community as a community member, a CommunityMember object must be created for them.
For a full discussion of CommunityMember attributes,
see the CommunityMember Attributes documentation below.
CommunityMembership
objects which represent the set of users (CommunityMembers) within the community. A single user
may have at most one CommunityMember object associated with them, but they may have many
CommunityMembership objects- one per community in which they are a member.
For a full discussion of CommunityMembership attributes,
see the CommunityMembership Attributes documentation below.
CommunityUserContext
and
CommunityContext
objects, which surface
most community framework functionality and provide access to other helper classes.
The CommunityUserContext serves as a cache container and accessor for community
member information (community-specific user information shared across all communities)
for a HttpSession
and provides access to community API's out of scope of a
specific CommunityContext object (methods not dealing with the currently authenticated
principal, and community creation). The CommunityContext object serves as a cache container and
accessor for community and membership information for a HttpSession
, for a single
community.
Both CommunityContext and CommunityUserContext objects may generally be obtained at the
servlet level via convenience methods that use the current HttpServletRequest
. Context
instances obtained in this manner should never be kept via references or set into request or
session attributes, as these references can end up existing across requests, and the context
objects maintain an internal reference to the request they were obtained on, which can result
in runtime errors. Instead, whenever one of these context objects is needed, it should be
obtained directly from the current request using one of the convenience methods.
CommunityDefinition
object determines how
a community is configured within the portal framework, and has the following major configurable attributes:
Attribute | Type | Description |
---|---|---|
accessTrackingEnabled | boolean | If this attribute is true , the portal framework will automatically update
the lastAccess attribute of
the user's CommunityMembership object when the user first accesses this community in a
session, if the user is authenticated and has a membership in the community.
This feature allows tracking of user visitation to communities, but is potentially
expensive as the database is updated at least once per community access per session,
so it is recommended that this is enabled only if it is being used. |
active | boolean | If false , the portal framework will not render the community but instead
redirect to the error page. This attribute is
automatically set to false by the community framework if the current time is after
the community's expiration date, but can also be set by an application framework.
In some circumstances it may be useful to temporarily or permanently disable a community to
prevent user access without deleting the community entirely. |
CommunityCallbackClass | String |
The fully-qualified class name of an optional class which receives callbacks from the portal framework when the community
instance is created, destroyed, activated or deactivated. The class must implement the
CommunityCallback interface. For more information
see the discussion of callback classes. |
description | String |
A description of the community. |
errorUri | String |
A URI to an error page for this community, which is displayed if there is an error accessing the community. There are many different cases where a user may be redirected to this error page, such as if the community is deactivated or the user does not have permission to access the community; for more information see the discussion of Community Error Pages. |
expirationDate | Date |
An optional date and time when the community will automatically
be deactivated by the framework. In some circumstances it may be
desirable to prevent access to a community beyond a predetermined time;
this is enabled by the exipirationDate feature. If set to null
the framework will never automatically expire the community. |
parentId | CommunityDefinitionId |
An optional ID of the community's "parent" community. In some circumstances, it may be useful to create communities in a hierarchical manner, so this attribute allows tracking of this relationship. |
personalPagesEnabled | boolean | If true , users are allowed to personalize pages in the community by adding
or removing portlets. If false , users are not allowed to add or remove portlets
from this community's pages. |
properties | Collection of CommunityProperty |
A set of arbitrary properties associated with the community. The application may set and use these properties to store information about the community useful to the application framework. |
public | boolean | If true , any user may view the community, whether they are authenticated or not,
whether they have a membership or not.
If false , a user must have a membership in the community to access it. See also the
publicRegistrationEnabled attribute below, as well as the
framework's decision tree for rendering
a community. |
publicRegistrationEnabled | boolean | If true , any user may register for membership in the community;
if false an invitation is required
to join the community. See also the public attribute above, as well as the
framework's decision tree for rendering
a community. |
registrationPageUri | String |
A URI to the community registration page, which allows users to register for membership in the community. Users are automatically redirected to this page in certain circumstances by the portal framework. For more information see the discussion of registration pages. |
timeZone | TimeZone |
A time zone associated with the community. The portal framework does not use this time zone in any manner, but it may be useful to applications written on the community framework to allow different communities to be localized to a specific time zone. |
title | String |
A localizable title for the community. |
CommunityDefinition
object; this is just a list of the
main attributes which apply to this overview of community functionality.
CommunityMember
object stores the following information:
Attribute | Type | Description |
---|---|---|
active | boolean | If false , this user is prevented from participating in any community
as a community member. This flag is intended for use to lock certain users out of all
community functionality, for example if they have abused their privelges in the past. |
external | boolean | This flag is not used internally by the communities framework, but is intended for possible use by community application implementations. The flag was conceived as a mechanism for storing whether the user was added to the system as a result of receiving an invitation or existed in the system previously. However, as this flag is not used internally be the communities or portal framework, applications may use it as they see fit. |
id | CommunityMemberId |
A unique ID for the CommunityMember object, used to correlate it with
CommunityMembership objects. |
wlsUserId | String | The WLS user id (login ID) of the user. |
CommunityMembership
object stores the following information:
Attribute | Type | Description |
---|---|---|
active | boolean | If false , this user is prevented from participating in the community
this membership belongs to. This flag is intended for use to lock certain users out of
community functionality for a particular community, for example if they have abused
their privelges in the past. |
capabilities | Collection of MembershipCapability |
A set of capabilities the user has within the community to which this membership object belongs. These capabilities can be defined and used by the application code to allow different levels of user access to a community. See the discussion of community capabilities for more information. |
communityDefinitionId | CommunityDefinitionId |
The community definition the membership belongs to. |
id | CommunityMembershipId |
A unique ID for the CommunityMembership object. |
joinDate | Date |
The date the membership was created. |
lastAccessDate | Date |
The date this user last accessed this community; this is tracked
only if the CommunityDefinition's accessTrackingEnabled flag is
true , and is updated automatically by the portal framework
only the first time a user accesses a community within a session. |
memberId | CommunityMemberId |
The ID of the CommunityMember object representing the user for this CommunityMembership. |
CommunityContext.checkPermissions(javax.servlet.http.HttpServletResponse, boolean)
method
for the community in scope. This method may be useful for community application code in some circumstances as well.
public
flag to false,
publicRegistrationEnabled
to true
, and accessTrackingEnabled
to true
, and set up a registration page which automatically creates memberships for authenticated
users. Thus, when a user without an existing membership attempts to access the community they
will be automatically redirected to the registration page,
which will automatically create a membership record for them, and the portal framework will automatically
track their access to the community in the membership object. The registration page could even be set
up to automatically redirect to the community after creating the membership- in this case, the user would
not even need to know that they had been redirected to the registration page.publicRegistrationEnabled
flag could be set to true
to allow users without
memberships attempting to access the community to be redirected
to the registration page so that they could apply for membership, even though they would need
to be approved before the membership is actually created.public
attribute is set to true
,
the registration page cannot be part of the community desktop, as the portal framework will not allow users without memberships
in the community to view any part of the community desktop.
Multiple community instances may share a single registration page.
Several utility classes exist which make implementing registration page functionality easier. For additional information,
see the following objects:
CommunityContext
is useful to get
information about the community being registered for. It also contains methods to:
CommunityInvitationContext
is useful for getting any invitations an authenticated user
may have to join a community.CommunityRedirectionHelper
is useful in determining if the user arrived at the
registration page due to an automatic redirect by the portal framework or by clicking on
a link in an invitation. If multiple community instances are sharing a registration page, it has a
method to determine which community instance
the registration page is being invoked for.
CommunityRedirectionHelper also has a
utility method
for generating a URL to a registration page for a community, which could be displayed in a community or elsewhere.CommunityRedirectionHelper
class can help to determine
which community instance
the error page is being rendered for and
why
the error page is being rendered.
If the community's public
and publicRegistrationEnabled
attributes are set to false
,
an unauthenticated user attempting to access the community will be automatically redriected to the error page,
so it may be useful to offer login functionality on the error page.
Error pages may be implemented using any technology; for example it could be a simple JSP, a single portlet or a portal.
A descriptive and feature-rich sample error page implementation can be found in the community sample.
META-INF/communities-config.xml
file.
Example: In a discussion community, a Moderator
capabality could be defined such that only
users with the Moderator
capabality in the community can approve or delete other members' submissions.
Membership capabilities are represented in the community framework by the
MembershipCapability
object. This object also gives access to
the complete set of membership capabilities configured for an enterprise application.
Each CommunityMembership
object stores
the set of all capabilities a membership has been granted.
The CapabilityRoleBootstrapper
class can be used at application deployment or configuration time to create default membership capability based role policies.
These allow community applications to perform standard isUserInRole
calls to determine if a
user has a particular capability in the community in scope. They are set up as
expression-based roles that use the current user's CommunityContext to determine capabilities,
and cause the role evaluation to map to whether or not that user has the specified capability in the current community.
When invitations are created, a set of membership capabilities can be
added to the invitation so that when the user creates a membership from the invitation they automatically are
given the capabilities.
CommunityDefinition
and must implement the
CommunityCallback
interface.
Communities may be created in a number of ways, both from the Portal Admin Tools or via programmatic means. Additionally, the Communities Framework supports mechanisms for assembling development time information necessary to create communities as well as means for creating templates from which actual Community Desktop instances can be created.
Programmatic creation of Communities is done via the CommunityManager
EJB persistence manager. Contained within this manager are methods to create Communities using only a reference
to a .portal file plus other required information in a CommunitiesInfo object, methods to create Communities based off
of other existing Community Desktops, methods to create Community Templates, and methods to create Communities based
off of an existing Community Template.
Community Templates are generally created, managed and accessed via the Portal Admin Tools, and may be part of either the Library or within individual Portals. Library Templates may be instantiated into Community Desktops anywhere within the enterprise application, while Templates within Portals are restricted to being instantiated within just that Portal.
Templates are useful for use cases where there is an archetypical type of Community that is expected to be created more than once, either by a Portal Admin or, via the Community Visitor Tools, by non-admin end users that are entitled to create Communities on their own. Communities created from a Template are identical to the Template Community Desktop except for desktop path (and portal path in the case of Library Templates), as well as anything else that is overriden on instantiation of the Community Desktop.
Using the Portal Admin tools, it is possible to create either a Community Template or a CommunityDesktop directly by specifying all of the required details for that type of resource. Since this typically involves a lot of information that may not originate with the Portal Administrator creating the Communities or Templates, developers have the option of creating .ctmeta files which can be used by the Portal Admin Tools to prepopulate the form fields on the Community Desktop and Template creation pages. This file type is ONLY used in the Portal Admin Tools, and is not something that can be read via the programmatic manager. Use of a .ctmeta file is not strictly required, but is highly recommended as manual input of all of the required information to create a Community Desktop or Template is complex and error prone.
Below is an example of a .ctmeta file. This is an XML file format that is based off of the netuix-communities-meta-1_0_0.xsd schema (netuix_schema.jar, /schema/netuix-communities-meta-1_0_0.xsd).
<communities-meta> <title>My Community</title> <description> <value>This is a Community.</value> </description> <community-dot-file>communities/myCommunity.portal</community-dot-file> <callback-class> <locked>true</locked> <value>com.bea.communities.MyCommunityCallback</value> </callback-class> <expiration> <value>2005-03-25T22:30:00</value> </expiration> <active> <value>true</value> </active> <public> <value>true</value> </public> <personal-pages> <locked>true</locked> <value>false</value> </personal-pages> <public-registration> <value>true</value> </public-registration> <registration-uri> <locked>true</locked> <value>communities/myCommunity/registration.jsp</value> </registration-uri> <error-uri> <locked>false</locked> <value>communities/myCommunity/error.jsp</value> </error-uri> <access-tracking> <locked>false</locked> <value>false</value> </access-tracking> <inviter-invoker-class> <locked>true</locked> <value>com.bea.communities.myCommunity.MyInviterInvoker</value> </inviter-invoker-class> </communities-meta>
|
Copyright © 2000, 2008, Oracle and/or its affiliates. All rights reserved. | ||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |