Overview | Package | Class | Tree | Deprecated | Index | Help
| Copyright © 2006 BEA Systems, Inc. All Rights Reserved
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.bea.portal.tools.portal.controls
Interface CommunityContextControl

    public interface CommunityContextControl

Control for contextual Community functionality-- functionality pertaining to the currently authenticated user and the currently viewed community. Because users may not be allowed to view disabled communities or view communities if their membership is not active, some operations are not possible to expose through this control as it only pertains to the currently viewed community and currently authenticated user.

See Also
  `CommunityManagerControl`, `CommunityMemberControl`, `CommunityInvitationControl`, `CommunityContext`, `CommunityUserContext`

Method Summary
`void` | `activateMember(com.bea.portal.tools.common.ResourceContext context)` Activates the `CommunityMember` associated with the currently authenticated user globally for all Communities.
`void` | `addMembershipCapability(com.bea.netuix.application.communities.MembershipCapability capability, com.bea.portal.tools.common.ResourceContext context)` Adds a capability to the `CommunityMembership` associated with the currently viewed desktop and authenticated user.
`com.bea.netuix.application.communities.CommunityMember` | `createMember(boolean active, boolean external, com.bea.portal.tools.common.ResourceContext context)` Creates a new `CommunityMember` for the currently authenticated user.
`void` | `deactivateCommunity(com.bea.portal.tools.common.ResourceContext context)` Sets the state of the community associated with the currently viewed desktop to INACTIVE.
`void` | `disableMember(com.bea.portal.tools.common.ResourceContext context)` Disables the `CommunityMember` associated with the currently authenticated user globally for all Communities.
`void` | `disableMembership(com.bea.portal.tools.common.ResourceContext context)` Disables the `CommunityMembership` associated with the currently viewed desktop and authenticated user.
`void` | `disablePersonalPages(com.bea.portal.tools.common.ResourceContext context)` Disables members from adding personal pages to the community associated with the currently viewed desktop.
`void` | `enablePersonalPages(com.bea.portal.tools.common.ResourceContext context)` Enables members to add personal pages to the community associated with the currently viewed desktop.
`com.bea.netuix.application.definition.CommunityDefinition` | `getCommunity(com.bea.portal.tools.common.ResourceContext context)` Retrieves the `CommunityDefinition` for the community currently being viewed, or `null` if no community is currently being viewed.
`com.bea.netuix.servlets.manager.communities.CommunityContext` | `getCommunityContext(com.bea.netuix.application.identifier.CommunityDefinitionId communityId, com.bea.portal.tools.common.ResourceContext context)` Returns the `CommunityContext` object associated with the specified `CommunityDefinitionId`.
`com.bea.netuix.servlets.manager.communities.CommunityContext` | `getCommunityContext(com.bea.netuix.application.identifier.CommunityURI communityUri, com.bea.portal.tools.common.ResourceContext context)` Returns the `CommunityContext` object associated with the specified community.
`com.bea.netuix.servlets.manager.communities.CommunityContext` | `getCommunityContext(com.bea.portal.tools.common.ResourceContext context)` Retrieves the "default" `CommunityContext` object if it is appropriate.
`com.bea.portlet.GenericURL` | `getCommunityURL(HttpServletResponse response, com.bea.netuix.application.identifier.CommunityURI community, com.bea.portal.tools.common.ResourceContext context)` Returns a URL to the specified community, if the URL can be determined.
`com.bea.netuix.application.communities.CommunityMember` | `getMember(com.bea.portal.tools.common.ResourceContext context)` Retrieves the `CommunityMember` object populated with information for the community member currently logged in.
`com.bea.p13n.pagination.SortableFilterablePagedResult<com.bea.netuix.application.communities.CommunityMembership>` | `getMemberCommunityMemberships(com.bea.netuix.application.communities.MemberMembershipCriteria criteria, int pageSize, com.bea.portal.tools.common.ResourceContext context)` Returns a paginated set of all `CommunityMembership` objects for a specified user or the currently authenticated user that meet the specified criteria.
`com.bea.netuix.application.communities.MemberMembershipCriteria` | `getMemberMembershipCriteria(com.bea.portal.tools.common.ResourceContext context)` Returns a MemberMembershipCriteria object for the currently authenticated user.
`com.bea.netuix.application.communities.CommunityMembership` | `getMembership(com.bea.portal.tools.common.ResourceContext context)` Retrieves the `CommunityMembership` object assicated with this `CommunityContext` object, if a membership exists.
`boolean` | `isMembershipActive(com.bea.portal.tools.common.ResourceContext context)` Determines if the member and membership records associated with the authenticated principal (logged-in user) and the currently-viewed community are active or disabled.
`void` | `removeMember(com.bea.portal.tools.common.ResourceContext context)` Removes the `CommunityMember` associated with the currently authenticated user globally for all Communities.
`void` | `removeMembership(com.bea.portal.tools.common.ResourceContext context)` Destroys the `CommunityMembership` associated with the currently viewed desktop and authenticated user.
`void` | `removeMembershipCapability(com.bea.netuix.application.communities.MembershipCapability capability, com.bea.portal.tools.common.ResourceContext context)` Removes a capability from the `CommunityMembership` associated with the currently viewed desktop and authenticated user.
`void` | `setCommunityExpirationDate(Date expirationDate, com.bea.portal.tools.common.ResourceContext context)` Sets the expiration date for the community associated with the currently viewed desktop.
`com.bea.netuix.application.definition.CommunityDefinition` | `updateCommunity(com.bea.netuix.application.definition.CommunityDefinition communityDefinition, com.bea.portal.tools.common.ResourceContext context)` Updates the `CommunityDefinition` for the community associated with the currently viewed desktop.
`long` | `updateLastAccessDate(com.bea.portal.tools.common.ResourceContext context)` Updates the last access date for the membership associated with the currently viewed desktop and authenticated user.

Method Detail

### activateMember

    void activateMember(com.bea.portal.tools.common.ResourceContext context)
                        throws com.bea.netuix.application.exception.ObjectNotFoundException,
                               com.bea.portal.tools.common.exceptions.ToolsException

  Activates the `CommunityMember` associated with the currently authenticated user globally for all Communities.

  Parameters
    `context` - the resource context
  Throws
    `com.bea.netuix.application.exception.ObjectNotFoundException` - if no member record exists for the currently-logged-in user or if no user is currently logged in.
    `com.bea.portal.tools.common.exceptions.ToolsException`

### createMember

    com.bea.netuix.application.communities.CommunityMember createMember(boolean active,
                                                                        boolean external,
                                                                        com.bea.portal.tools.common.ResourceContext context)
                                                                        throws com.bea.portal.tools.common.exceptions.ToolsException,
                                                                               com.bea.netuix.application.exception.DuplicateObjectException,
                                                                               com.bea.netuix.application.exception.NotEntitledException

  Creates a new `CommunityMember` for the currently authenticated user.

  Parameters
    `active` - `true` if the `CommunityMember` should be created with active status.
    `external` - the `external` flag for the new `CommunityMember`, which may be useful for tracking purposes in some situations but is not used in the framework.
    `context` - the resource context
  Returns
    the newly created `CommunityMember` object
  Throws
    `com.bea.netuix.application.exception.DuplicateObjectException` - if a `CommunityMember` already exists for the currently-logged-in user.
    `com.bea.netuix.application.exception.NotEntitledException` - if no user is currently logged in.
    `com.bea.portal.tools.common.exceptions.ToolsException`

### disableMember

    void disableMember(com.bea.portal.tools.common.ResourceContext context)
                       throws com.bea.netuix.application.exception.ObjectNotFoundException,
                              com.bea.portal.tools.common.exceptions.ToolsException

  Disables the `CommunityMember` associated with the currently authenticated user globally for all Communities.

  Parameters
    `context` - the resource context
  Throws
    `com.bea.netuix.application.exception.ObjectNotFoundException` - if no member record exists for the currently-logged-in user or if no user is currently logged in.
    `com.bea.portal.tools.common.exceptions.ToolsException`

### getMember

    com.bea.netuix.application.communities.CommunityMember getMember(com.bea.portal.tools.common.ResourceContext context)

  Retrieves the `CommunityMember` object populated with information for the community member currently logged in. If there is no WLS user currently logged in, or if the user is not a community member, null is returned.

  Parameters
    `context` - the resource context
  Returns
    the `CommunityMember` object for the currently-logged-in WLS user, or null if the user is not a community member or if no user is logged in.

### getMemberMembershipCriteria

    com.bea.netuix.application.communities.MemberMembershipCriteria getMemberMembershipCriteria(com.bea.portal.tools.common.ResourceContext context)
                                                                                                throws com.bea.netuix.application.exception.NotEntitledException

  Returns a MemberMembershipCriteria object for the currently authenticated user. This object can then be customized to specify which memberships should be included in search results from the `getMemberCommunityMemberships()` method.

  Parameters
    `context` - the resource context
  Returns
    a MemberMembershipCriteria object for the currently authenticated user.
  Throws
    `com.bea.netuix.application.exception.NotEntitledException` - if no user is logged in.
  See Also
    `MemberMembershipCriteria`

### getMemberCommunityMemberships

    com.bea.p13n.pagination.SortableFilterablePagedResult<com.bea.netuix.application.communities.CommunityMembership> getMemberCommunityMemberships(com.bea.netuix.application.communities.MemberMembershipCriteria criteria,
                                                                                                                                                    int pageSize,
                                                                                                                                                    com.bea.portal.tools.common.ResourceContext context)
                                                                                                                                                    throws com.bea.portal.tools.common.exceptions.ToolsException,
                                                                                                                                                           com.bea.netuix.application.exception.NotEntitledException

  Returns a paginated set of all `CommunityMembership` objects for a specified user or the currently authenticated user that meet the specified criteria.

  If the returned SortableFilterablePagedResult is re-filtered using the reFilter() method, the filter specified is used in addition to the original filter criteria specified in the MemberMembershipCriteria object. If the filter criteria specified in the reFilter() method conflicts with a criteria specified in the original MemberMembershipCriteria object, the newly specified filter criteria is used in place of the original MemberMembershipCriteria for that field only; all other field criteria specified in the MemberMembershipCriteria object will still be used as filter criteria.

  Parameters
    `criteria` - the criteria CommunityMemberships must match to be returned. If `null`, a MemberMembershipCriteria object is created specifying the currently authenticated user. Also see the `getMemberMembershipCriteria()` method to get a MemberMembershipCriteria object for the currently authenticated user.
    `pageSize` - the number of membership objects to return per result page.
    `context` - the resource context
  Returns
    a paginated collection of all memberships for the specified user that meet the specified criteria. Note that this method may return memberships in communities which are in multiple different web applications.
  Throws
    `com.bea.portal.tools.common.exceptions.ToolsException`
    `com.bea.netuix.application.exception.NotEntitledException` - if no user is logged in.
  See Also
    `MemberMembershipCriteria`

### removeMember

    void removeMember(com.bea.portal.tools.common.ResourceContext context)
                      throws com.bea.netuix.application.exception.ObjectNotFoundException,
                             com.bea.portal.tools.common.exceptions.ToolsException

  Removes the `CommunityMember` associated with the currently authenticated user globally for all Communities.

  Parameters
    `context` - the resource context
  Throws
    `com.bea.netuix.application.exception.ObjectNotFoundException` - if no member record exists for the currently-logged-in user or if no user is currently logged in.
    `com.bea.portal.tools.common.exceptions.ToolsException`

### getCommunityContext

    com.bea.netuix.servlets.manager.communities.CommunityContext getCommunityContext(com.bea.portal.tools.common.ResourceContext context)

  Retrieves the "default" `CommunityContext` object if it is appropriate. This is the `CommunityContext` appropriate for the Desktop viewed by the Request associated with this `CommunityUserContext`.

  Parameters
    `context` - the resource context
  Returns
    the "default" (desktop-associated) `CommunityContext` object associated with the request, or `null` if the desktop associated with the request is not a community desktop.

### getCommunityContext

    com.bea.netuix.servlets.manager.communities.CommunityContext getCommunityContext(com.bea.netuix.application.identifier.CommunityURI communityUri,
                                                                                     com.bea.portal.tools.common.ResourceContext context)

  Returns the `CommunityContext` object associated with the specified community.

  Parameters
    `communityUri` - the URI for the community.
    `context` - the resource context
  Returns
    the appropriate `CommunityContext` object, or `null`if no community with the specified URI exists.``

### getCommunityContext

    com.bea.netuix.servlets.manager.communities.CommunityContext getCommunityContext(com.bea.netuix.application.identifier.CommunityDefinitionId communityId,
                                                                                     com.bea.portal.tools.common.ResourceContext context)

  Returns the `CommunityContext` object associated with the specified `CommunityDefinitionId`.

  Parameters
    `communityId` - the community ID.
    `context` - the resource context
  Returns
    the appropriate `CommunityContext` object.

### getCommunityURL

    com.bea.portlet.GenericURL getCommunityURL(HttpServletResponse response,
                                               com.bea.netuix.application.identifier.CommunityURI community,
                                               com.bea.portal.tools.common.ResourceContext context)

  Returns a URL to the specified community, if the URL can be determined. If the specified community is in another web application which is not deployed on this server and the URL to the webapp cannot be determined, `null` will be returned.

  Parameters
    `response` - the response object.
    `community` - the community to get a URL to.
    `context` - the resource context
  Returns
    a URL to the specified community, if the URL can be determined. If the specified community is in another web application which is not deployed on this server and the URL to the webapp cannot be determined, `null` will be returned.

### isMembershipActive

    boolean isMembershipActive(com.bea.portal.tools.common.ResourceContext context)
                               throws IllegalStateException

  Determines if the member and membership records associated with the authenticated principal (logged-in user) and the currently-viewed community are active or disabled.

  Parameters
    `context` - the resource context
  Returns
    `true` if both the `CommunityMember` and `CommunityMembership` associated with the currently authenticated user and viewed community are active; `false` if the member or membership record does not exist or are disabled.
  Throws
    `IllegalStateException` - if the currently-viewed desktop is not a community.

### getCommunity

    com.bea.netuix.application.definition.CommunityDefinition getCommunity(com.bea.portal.tools.common.ResourceContext context)

  Retrieves the `CommunityDefinition` for the community currently being viewed, or `null` if no community is currently being viewed.

  Parameters
    `context` - the resource context
  Returns
    the `CommunityDefinition` object for the community associated with this request, or `null` if no community is associated with the request.

### getMembership

    com.bea.netuix.application.communities.CommunityMembership getMembership(com.bea.portal.tools.common.ResourceContext context)

  Retrieves the `CommunityMembership` object assicated with this `CommunityContext` object, if a membership exists.

  Parameters
    `context` - the resource context
  Returns
    the `CommunityMembership` object for the currently-logged-in user for the community associated with this `CommunityContext` object, or null if no such membership exists or if the currently viewed desktop is not a community.

### updateCommunity

    com.bea.netuix.application.definition.CommunityDefinition updateCommunity(com.bea.netuix.application.definition.CommunityDefinition communityDefinition,
                                                                              com.bea.portal.tools.common.ResourceContext context)
                                                                              throws com.bea.netuix.application.exception.ObjectNotFoundException,
                                                                                     com.bea.netuix.application.exception.NotEntitledException,
                                                                                     com.bea.netuix.application.exception.IllegalOperationException,
                                                                                     com.bea.netuix.application.exception.ObjectInUseException,
                                                                                     com.bea.portal.tools.common.exceptions.ToolsException,
                                                                                     IllegalStateException

  Updates the `CommunityDefinition` for the community associated with the currently viewed desktop.

  Parameters
    `communityDefinition` - community definition with updated attributes
    `context` - the resource context
  Returns
    The updated `CommunityDefinition`
  Throws
    `com.bea.netuix.application.exception.ObjectNotFoundException` - if community to be updated does not exist
    `com.bea.netuix.application.exception.NotEntitledException` - if current user does not have permission to update this community
    `com.bea.netuix.application.exception.IllegalOperationException` - if part of or all of the update is illegal based on the current state of the community for e.g. if the update tries to set expirationDate on or activate a community that is marked as a template
    `com.bea.netuix.application.exception.ObjectInUseException` - if the update tries to point the community to a desktop that is already in use by another community
    `com.bea.portal.tools.common.exceptions.ToolsException`
    `IllegalStateException` - if the currently-viewed desktop is not a community.

### deactivateCommunity

    void deactivateCommunity(com.bea.portal.tools.common.ResourceContext context)
                             throws IllegalArgumentException,
                                    com.bea.netuix.application.exception.ObjectNotFoundException,
                                    com.bea.netuix.application.exception.NotEntitledException,
                                    com.bea.netuix.application.communities.exception.CommunityCallbackException,
                                    com.bea.portal.tools.common.exceptions.ToolsException,
                                    IllegalStateException

  Sets the state of the community associated with the currently viewed desktop to INACTIVE. A community in the INACTIVE state does not support any interaction excepting that with certain priviledged users.

  Parameters
    `context` - the resource context
  Throws
    `com.bea.netuix.application.exception.ObjectNotFoundException` - if community to be deactivated does not exist
    `com.bea.netuix.application.exception.NotEntitledException` - if current user does not have permission to deactivate this community
    `com.bea.netuix.application.communities.exception.CommunityCallbackException` - if an error occurs when making a community callback
    `com.bea.portal.tools.common.exceptions.ToolsException`
    `IllegalStateException` - if the currently-viewed desktop is not a community.
    `IllegalArgumentException`

### setCommunityExpirationDate

    void setCommunityExpirationDate(Date expirationDate,
                                    com.bea.portal.tools.common.ResourceContext context)
                                    throws IllegalArgumentException,
                                           com.bea.netuix.application.exception.ObjectNotFoundException,
                                           com.bea.netuix.application.exception.NotEntitledException,
                                           com.bea.netuix.application.exception.IllegalOperationException,
                                           com.bea.portal.tools.common.exceptions.ToolsException,
                                           IllegalStateException

  Sets the expiration date for the community associated with the currently viewed desktop. The community is put into the INACTIVE state once this date has passed. Setting a new expiration date on a community resets the original expiration date and the community stays active until the new expiration date.

  Parameters
    `expirationDate` - The new expiration date.
    `context` - the resource context
  Throws
    `IllegalArgumentException` - If the `expirationDate` is before current date
    `com.bea.netuix.application.exception.ObjectNotFoundException` - if specified community does not exist
    `com.bea.netuix.application.exception.NotEntitledException` - if current user does not have permission to set the expirationDate for this community
    `com.bea.netuix.application.exception.IllegalOperationException` - if this community is a template
    `com.bea.portal.tools.common.exceptions.ToolsException`
    `IllegalStateException` - if the currently-viewed desktop is not a community.

### enablePersonalPages

    void enablePersonalPages(com.bea.portal.tools.common.ResourceContext context)
                             throws com.bea.netuix.application.exception.ObjectNotFoundException,
                                    com.bea.netuix.application.exception.NotEntitledException,
                                    com.bea.portal.tools.common.exceptions.ToolsException,
                                    IllegalStateException

  Enables members to add personal pages to the community associated with the currently viewed desktop.

  Parameters
    `context` - the resource context
  Throws
    `com.bea.netuix.application.exception.ObjectNotFoundException` - if specified community does not exist
    `com.bea.netuix.application.exception.NotEntitledException` - if current user does not have permission to perform this operation
    `com.bea.portal.tools.common.exceptions.ToolsException`
    `IllegalStateException` - if the currently-viewed desktop is not a community.

### disablePersonalPages

    void disablePersonalPages(com.bea.portal.tools.common.ResourceContext context)
                              throws com.bea.netuix.application.exception.ObjectNotFoundException,
                                     com.bea.netuix.application.exception.NotEntitledException,
                                     com.bea.portal.tools.common.exceptions.ToolsException,
                                     IllegalStateException

  Disables members from adding personal pages to the community associated with the currently viewed desktop.

  Parameters
    `context` - the resource context
  Throws
    `com.bea.netuix.application.exception.ObjectNotFoundException` - if specified community does not exist
    `com.bea.netuix.application.exception.NotEntitledException` - if current user does not have permission to perform this operation
    `com.bea.portal.tools.common.exceptions.ToolsException`
    `IllegalStateException` - if the currently-viewed desktop is not a community.

### removeMembership

    void removeMembership(com.bea.portal.tools.common.ResourceContext context)
                          throws com.bea.portal.tools.common.exceptions.ToolsException,
                                 com.bea.netuix.application.exception.ObjectNotFoundException,
                                 IllegalStateException

  Destroys the `CommunityMembership` associated with the currently viewed desktop and authenticated user.

  Parameters
    `context` - the resource context
  Throws
    `com.bea.portal.tools.common.exceptions.ToolsException`
    `com.bea.netuix.application.exception.ObjectNotFoundException` - if there is no `CommunityMembership` associated with this community for the authenticated user.
    `IllegalStateException` - if the currently-viewed desktop is not a community.

### disableMembership

    void disableMembership(com.bea.portal.tools.common.ResourceContext context)
                           throws com.bea.portal.tools.common.exceptions.ToolsException,
                                  com.bea.netuix.application.exception.ObjectNotFoundException,
                                  IllegalStateException

  Disables the `CommunityMembership` associated with the currently viewed desktop and authenticated user.

  Parameters
    `context` - the resource context
  Throws
    `com.bea.portal.tools.common.exceptions.ToolsException`
    `com.bea.netuix.application.exception.ObjectNotFoundException` - if no membership exists for the currently authenticated user for this community.
    `IllegalStateException` - if the currently-viewed desktop is not a community.

### updateLastAccessDate

    long updateLastAccessDate(com.bea.portal.tools.common.ResourceContext context)
                              throws com.bea.netuix.application.exception.ObjectNotFoundException,
                                     com.bea.portal.tools.common.exceptions.ToolsException,
                                     IllegalStateException

  Updates the last access date for the membership associated with the currently viewed desktop and authenticated user.

  Parameters
    `context` - the resource context
  Returns
    the new last access timestamp for the membership.
  Throws
    `com.bea.netuix.application.exception.ObjectNotFoundException` - if no membership is associated with the currently authenticated user.
    `com.bea.portal.tools.common.exceptions.ToolsException`
    `IllegalStateException` - if the currently-viewed desktop is not a community.

### addMembershipCapability

    void addMembershipCapability(com.bea.netuix.application.communities.MembershipCapability capability,
                                 com.bea.portal.tools.common.ResourceContext context)
                                 throws com.bea.portal.tools.common.exceptions.ToolsException,
                                        com.bea.netuix.application.exception.ObjectNotFoundException,
                                        IllegalArgumentException,
                                        IllegalStateException

  Adds a capability to the `CommunityMembership` associated with the currently viewed desktop and authenticated user.

  Parameters
    `capability` - the capability to add to the membership
    `context` - the resource context
  Throws
    `com.bea.portal.tools.common.exceptions.ToolsException`
    `com.bea.netuix.application.exception.ObjectNotFoundException` - if there is no `CommunityMembership` associated with the authenticated user.
    `IllegalArgumentException` - if the capability specified is not valid.
    `IllegalStateException` - if the currently-viewed desktop is not a community.

### removeMembershipCapability

    void removeMembershipCapability(com.bea.netuix.application.communities.MembershipCapability capability,
                                    com.bea.portal.tools.common.ResourceContext context)
                                    throws com.bea.portal.tools.common.exceptions.ToolsException,
                                           com.bea.netuix.application.exception.ObjectNotFoundException,
                                           IllegalArgumentException,
                                           IllegalStateException

  Removes a capability from the `CommunityMembership` associated with the currently viewed desktop and authenticated user.

  Parameters
    `capability` - the capability to remove from the membership
    `context` - the resource context
  Throws
    `com.bea.portal.tools.common.exceptions.ToolsException`
    `com.bea.netuix.application.exception.ObjectNotFoundException` - if there is no `CommunityMembership` associated with the authenticated user.
    `IllegalArgumentException` - if the capability specified is not valid.
    `IllegalStateException` - if the currently-viewed desktop is not a community.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2006 BEA Systems, Inc. All Rights Reserved