Overview | Package | Class | Tree | Deprecated | Index | Help
| Copyright © 2008 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

    @ControlInterface
    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(ResourceContext context)` Activates the `CommunityMember` associated with the currently authenticated user globally for all Communities.
`void` | `addMembershipCapability(MembershipCapability capability, ResourceContext context)` Adds a capability to the `CommunityMembership` associated with the currently viewed desktop and authenticated user.
`CommunityMember` | `createMember(boolean active, boolean external, ResourceContext context)` Creates a new `CommunityMember` for the currently authenticated user.
`void` | `deactivateCommunity(ResourceContext context)` Sets the state of the community associated with the currently viewed desktop to INACTIVE.
`void` | `disableMember(ResourceContext context)` Disables the `CommunityMember` associated with the currently authenticated user globally for all Communities.
`void` | `disableMembership(ResourceContext context)` Disables the `CommunityMembership` associated with the currently viewed desktop and authenticated user.
`void` | `disablePersonalPages(ResourceContext context)` Disables members from adding personal pages to the community associated with the currently viewed desktop.
`void` | `enablePersonalPages(ResourceContext context)` Enables members to add personal pages to the community associated with the currently viewed desktop.
`CommunityDefinition` | `getCommunity(ResourceContext context)` Retrieves the `CommunityDefinition` for the community currently being viewed, or `null` if no community is currently being viewed.
`CommunityContext` | `getCommunityContext(CommunityDefinitionId communityId, ResourceContext context)` Returns the `CommunityContext` object associated with the specified `CommunityDefinitionId`.
`CommunityContext` | `getCommunityContext(CommunityURI communityUri, ResourceContext context)` Returns the `CommunityContext` object associated with the specified community.
`CommunityContext` | `getCommunityContext(ResourceContext context)` Retrieves the "default" `CommunityContext` object if it is appropriate.
`GenericURL` | `getCommunityURL(javax.servlet.http.HttpServletResponse response, CommunityURI community, ResourceContext context)` Returns a URL to the specified community, if the URL can be determined.
`CommunityMember` | `getMember(ResourceContext context)` Retrieves the `CommunityMember` object populated with information for the community member currently logged in.
`SortableFilterablePagedResult<CommunityMembership>` | `getMemberCommunityMemberships(MemberMembershipCriteria criteria, int pageSize, ResourceContext context)` Returns a paginated set of all `CommunityMembership` objects for a specified user or the currently authenticated user that meet the specified criteria.
`MemberMembershipCriteria` | `getMemberMembershipCriteria(ResourceContext context)` Returns a MemberMembershipCriteria object for the currently authenticated user.
`CommunityMembership` | `getMembership(ResourceContext context)` Retrieves the `CommunityMembership` object assicated with this `CommunityContext` object, if a membership exists.
`boolean` | `isMembershipActive(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(ResourceContext context)` Removes the `CommunityMember` associated with the currently authenticated user globally for all Communities.
`void` | `removeMembership(ResourceContext context)` Destroys the `CommunityMembership` associated with the currently viewed desktop and authenticated user.
`void` | `removeMembershipCapability(MembershipCapability capability, ResourceContext context)` Removes a capability from the `CommunityMembership` associated with the currently viewed desktop and authenticated user.
`void` | `setCommunityExpirationDate(Date expirationDate, ResourceContext context)` Sets the expiration date for the community associated with the currently viewed desktop.
`CommunityDefinition` | `updateCommunity(CommunityDefinition communityDefinition, boolean invokeCallbackClass, ResourceContext context)` Updates the `CommunityDefinition` for the community associated with the currently viewed desktop.
`CommunityDefinition` | `updateCommunity(CommunityDefinition communityDefinition, ResourceContext context)` Deprecated This method does not invoke CommunityCallback classes registered with the community if the community is activated or deactivated through this call. Use `updateCommunity(com.bea.netuix.application.definition.CommunityDefinition, boolean, ResourceContext)` instead.
`long` | `updateLastAccessDate(ResourceContext context)` Updates the last access date for the membership associated with the currently viewed desktop and authenticated user.

Method Detail

### activateMember

    void activateMember(ResourceContext context)
                        throws ObjectNotFoundException,
                               ToolsException

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

  Parameters
    `context` - the resource context
  Throws
    `ObjectNotFoundException` - if no member record exists for the currently-logged-in user or if no user is currently logged in.
    `ToolsException`

### createMember

    CommunityMember createMember(boolean active,
                                 boolean external,
                                 ResourceContext context)
                                 throws ToolsException,
                                        DuplicateObjectException,
                                        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
    `DuplicateObjectException` - if a `CommunityMember` already exists for the currently-logged-in user.
    `NotEntitledException` - if no user is currently logged in.
    `ToolsException`

### disableMember

    void disableMember(ResourceContext context)
                       throws ObjectNotFoundException,
                              ToolsException

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

  Parameters
    `context` - the resource context
  Throws
    `ObjectNotFoundException` - if no member record exists for the currently-logged-in user or if no user is currently logged in.
    `ToolsException`

### getMember

    CommunityMember getMember(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

    MemberMembershipCriteria getMemberMembershipCriteria(ResourceContext context)
                                                         throws 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
    `NotEntitledException` - if no user is logged in.
  See Also
    `MemberMembershipCriteria`

### getMemberCommunityMemberships

    SortableFilterablePagedResult<CommunityMembership> getMemberCommunityMemberships(MemberMembershipCriteria criteria,
                                                                                     int pageSize,
                                                                                     ResourceContext context)
                                                                                     throws ToolsException,
                                                                                            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
    `ToolsException`
    `NotEntitledException` - if no user is logged in.
  See Also
    `MemberMembershipCriteria`

### removeMember

    void removeMember(ResourceContext context)
                      throws ObjectNotFoundException,
                             ToolsException

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

  Parameters
    `context` - the resource context
  Throws
    `ObjectNotFoundException` - if no member record exists for the currently-logged-in user or if no user is currently logged in.
    `ToolsException`

### getCommunityContext

    CommunityContext getCommunityContext(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

    CommunityContext getCommunityContext(CommunityURI communityUri,
                                         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

    CommunityContext getCommunityContext(CommunityDefinitionId communityId,
                                         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

    GenericURL getCommunityURL(javax.servlet.http.HttpServletResponse response,
                               CommunityURI community,
                               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(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

    CommunityDefinition getCommunity(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

    CommunityMembership getMembership(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

    CommunityDefinition updateCommunity(CommunityDefinition communityDefinition,
                                        ResourceContext context)
                                        throws ObjectNotFoundException,
                                               NotEntitledException,
                                               IllegalOperationException,
                                               ObjectInUseException,
                                               ToolsException,
                                               IllegalStateException

  Deprecated This method does not invoke CommunityCallback classes registered with the community if the community is activated or deactivated through this call. Use `updateCommunity(com.bea.netuix.application.definition.CommunityDefinition, boolean, ResourceContext)` instead.

  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
    `ObjectNotFoundException` - if community to be updated does not exist
    `NotEntitledException` - if current user does not have permission to update this community
    `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
    `ObjectInUseException` - if the update tries to point the community to a desktop that is already in use by another community
    `ToolsException`
    `IllegalStateException` - if the currently-viewed desktop is not a community.

### updateCommunity

    CommunityDefinition updateCommunity(CommunityDefinition communityDefinition,
                                        boolean invokeCallbackClass,
                                        ResourceContext context)
                                        throws ObjectNotFoundException,
                                               NotEntitledException,
                                               IllegalOperationException,
                                               ObjectInUseException,
                                               ToolsException,
                                               IllegalStateException,
                                               CommunityCallbackException

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

  Parameters
    `communityDefinition` - community definition with updated attributes
    `invokeCallbackClass` - if `true` and the community is activated or deactivated by this call, invokes the appropriate methods on the CommunityCallback object associated with the community, if one exists. If `false`, no callback call is made.
    `context` - the resource context
  Returns
    The updated `CommunityDefinition`
  Throws
    `ObjectNotFoundException` - if community to be updated does not exist
    `NotEntitledException` - if current user does not have permission to update this community
    `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
    `ObjectInUseException` - if the update tries to point the community to a desktop that is already in use by another community
    `CommunityCallbackException` - if an error occurs when making a community callback
    `ToolsException`
    `IllegalStateException` - if the currently-viewed desktop is not a community.

### deactivateCommunity

    void deactivateCommunity(ResourceContext context)
                             throws IllegalArgumentException,
                                    ObjectNotFoundException,
                                    NotEntitledException,
                                    CommunityCallbackException,
                                    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
    `ObjectNotFoundException` - if community to be deactivated does not exist
    `NotEntitledException` - if current user does not have permission to deactivate this community
    `CommunityCallbackException` - if an error occurs when making a community callback
    `ToolsException`
    `IllegalStateException` - if the currently-viewed desktop is not a community.
    `IllegalArgumentException`

### setCommunityExpirationDate

    void setCommunityExpirationDate(Date expirationDate,
                                    ResourceContext context)
                                    throws IllegalArgumentException,
                                           ObjectNotFoundException,
                                           NotEntitledException,
                                           IllegalOperationException,
                                           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
    `ObjectNotFoundException` - if specified community does not exist
    `NotEntitledException` - if current user does not have permission to set the expirationDate for this community
    `IllegalOperationException` - if this community is a template
    `ToolsException`
    `IllegalStateException` - if the currently-viewed desktop is not a community.

### enablePersonalPages

    void enablePersonalPages(ResourceContext context)
                             throws ObjectNotFoundException,
                                    NotEntitledException,
                                    ToolsException,
                                    IllegalStateException

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

  Parameters
    `context` - the resource context
  Throws
    `ObjectNotFoundException` - if specified community does not exist
    `NotEntitledException` - if current user does not have permission to perform this operation
    `ToolsException`
    `IllegalStateException` - if the currently-viewed desktop is not a community.

### disablePersonalPages

    void disablePersonalPages(ResourceContext context)
                              throws ObjectNotFoundException,
                                     NotEntitledException,
                                     ToolsException,
                                     IllegalStateException

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

  Parameters
    `context` - the resource context
  Throws
    `ObjectNotFoundException` - if specified community does not exist
    `NotEntitledException` - if current user does not have permission to perform this operation
    `ToolsException`
    `IllegalStateException` - if the currently-viewed desktop is not a community.

### removeMembership

    void removeMembership(ResourceContext context)
                          throws ToolsException,
                                 ObjectNotFoundException,
                                 IllegalStateException

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

  Parameters
    `context` - the resource context
  Throws
    `ToolsException`
    `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(ResourceContext context)
                           throws ToolsException,
                                  ObjectNotFoundException,
                                  IllegalStateException

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

  Parameters
    `context` - the resource context
  Throws
    `ToolsException`
    `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(ResourceContext context)
                              throws ObjectNotFoundException,
                                     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
    `ObjectNotFoundException` - if no membership is associated with the currently authenticated user.
    `ToolsException`
    `IllegalStateException` - if the currently-viewed desktop is not a community.

### addMembershipCapability

    void addMembershipCapability(MembershipCapability capability,
                                 ResourceContext context)
                                 throws ToolsException,
                                        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
    `ToolsException`
    `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(MembershipCapability capability,
                                    ResourceContext context)
                                    throws ToolsException,
                                           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
    `ToolsException`
    `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 © 2008 BEA Systems, Inc. All Rights Reserved