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.common
Class ResourceContext

    java.lang.Object
      com.bea.portal.tools.common.ResourceContext

    public class ResourceContext

extends Object

Encapsulates information needed for tools controls.

Method Summary
`static ResourceContext` | `createResourceContext(Collection<Locale> locales, javax.servlet.http.HttpServletRequest request, boolean visitorMode)` Create a ResourceContext using the specified locales.
`static ResourceContext` | `createResourceContext(javax.servlet.http.HttpServletRequest request, boolean visitorMode)` Create a ResourceContext using the default locale specified in the request.
`static ResourceContext` | `createResourceContext(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.ServletContext servletContext, boolean visitorMode)` Create a ResourceContext using web application parameters.
`static ResourceContext` | `createResourceContext(Locale locale, javax.servlet.http.HttpServletRequest request, boolean visitorMode)` Create a ResourceContext using the specified locale.
`String[]` | `getDaCapabilities()` Returns the delegated administration capabilities to check when calling some (usually paginated) methods.
`Collection<Locale>` | `getLocales()` Getter for the user's preferred locales.
`Locale` | `getPrimaryLocale()` Gets the user's primary locale.
`javax.servlet.http.HttpServletRequest` | `getRequest()` HttpServletRequest getter.
`javax.servlet.http.HttpServletResponse` | `getResponse()` HttpServletResponse getter.
`javax.servlet.ServletContext` | `getServletContext()` ServletContext getter.
`boolean` | `getVisitorMode()` Getter for visitorMode.
`String` | `getWebApp()` Returns the web app
`boolean` | `isCommunityAdmin()`
`boolean` | `isRetrieveResultsIfNoLocale()` Getter for retrieveResultsIfNoLocale.
`boolean` | `isUserInAdminRole()`
`void` | `setCommunityAdmin(CommunityMembership communityMembership)` Note that if the current user is actually a community admin, this will treat the user as such and changes will be made to shared resources.
`void` | `setDaCapabilities(String[] daCapabilities)` Specifies delegated administration capabilities to check when calling some (usually paginated) methods.
`void` | `setRetrieveResultsIfNoLocale(boolean retrieveResultsIfNoLocale)` Setter for retrieveResultsIfNoLocale.
`void` | `setVisitorMode(boolean visitorMode)` Setter for visitorMode.
`void` | `setWebApp(String webApp)` Specifies the current web app

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Method Detail

### createResourceContext

    public static ResourceContext createResourceContext(javax.servlet.http.HttpServletRequest request,
                                                        boolean visitorMode)

  Create a ResourceContext using the default locale specified in the request.

  Parameters
    `request` - the user's request
    `visitorMode` - true for visitor tools / false for admin tools
  Returns
    A resource context to use with tools APIs

### createResourceContext

    public static ResourceContext createResourceContext(Locale locale,
                                                        javax.servlet.http.HttpServletRequest request,
                                                        boolean visitorMode)

  Create a ResourceContext using the specified locale.

  Parameters
    `locale` - the user's locale
    `request` - the user's request
    `visitorMode` - true for visitor tools / false for admin tools
  Returns
    A resource context to use with tools APIs

### createResourceContext

    public static ResourceContext createResourceContext(Collection<Locale> locales,
                                                        javax.servlet.http.HttpServletRequest request,
                                                        boolean visitorMode)

  Create a ResourceContext using the specified locales.

  Parameters
    `locales` - the user's preferred locales
    `request` - the user's request. Cannot be null.
    `visitorMode` - true for visitor tools / false for admin tools
  Returns
    A resource context to use with tools APIs

### createResourceContext

    public static ResourceContext createResourceContext(javax.servlet.http.HttpServletRequest request,
                                                        javax.servlet.http.HttpServletResponse response,
                                                        javax.servlet.ServletContext servletContext,
                                                        boolean visitorMode)

  Create a ResourceContext using web application parameters.

  Parameters
    `request` - The user's request. Cannot be null.
    `response` - The user's response
    `servletContext` - The servlet context for this request.
    `visitorMode` - True if the visitor mode flag should be set on the CustomizationContext
  Returns
    A resource context to use with tools APIs
  See Also
    `CustomizationContext`

### getLocales

    public Collection<Locale> getLocales()

  Getter for the user's preferred locales.

  Returns
    the user's preferred locales

### getPrimaryLocale

    public Locale getPrimaryLocale()

  Gets the user's primary locale.

  Returns
    Calls getLocales and returns the first element in the Collection.

### getRequest

    public javax.servlet.http.HttpServletRequest getRequest()

  HttpServletRequest getter.

  Returns
    the user's request

### getResponse

    public javax.servlet.http.HttpServletResponse getResponse()

  HttpServletResponse getter.

  Returns
    response

### getServletContext

    public javax.servlet.ServletContext getServletContext()

  ServletContext getter.

  Returns
    servlet context

### getVisitorMode

    public boolean getVisitorMode()

  Getter for visitorMode. The flag has an impact on how elements of a pagedResult are returned.

  Returns
    true if visitorMode is set in the CustomizationContext
  See Also
    `CustomizationContext`

### isRetrieveResultsIfNoLocale

    public boolean isRetrieveResultsIfNoLocale()

  Getter for retrieveResultsIfNoLocale. The flag has an impact on how elements of a pagedResult are returned.

  Returns
    true if retrieveResultsIfNoLocale is set in the CustomizationContext
  See Also
    `CustomizationContext`

### setRetrieveResultsIfNoLocale

    public void setRetrieveResultsIfNoLocale(boolean retrieveResultsIfNoLocale)

  Setter for retrieveResultsIfNoLocale. The flag has an impact on how elements of a pagedResult are returned.

  Parameters
    `retrieveResultsIfNoLocale` - the value to set on the CustomizationContext
  See Also
    `CustomizationContext`

### setVisitorMode

    public void setVisitorMode(boolean visitorMode)

  Setter for visitorMode. The flag has an impact on how elements of a pagedResult are returned.

  Parameters
    `visitorMode` - the value to set on the CustomizationContext
  See Also
    `CustomizationContext`

### setDaCapabilities

    public void setDaCapabilities(String[] daCapabilities)

  Specifies delegated administration capabilities to check when calling some (usually paginated) methods. The system will grant access if access is allowed for at least one of these capabilities.

### getDaCapabilities

    public String[] getDaCapabilities()

  Returns the delegated administration capabilities to check when calling some (usually paginated) methods. The system will grant access if access is allowed for at least one of these capabilities.

### setWebApp

    public void setWebApp(String webApp)

  Specifies the current web app

  Parameters
    `webApp` - The webapp

### getWebApp

    public String getWebApp()

  Returns the web app

  Returns
    the web application name.

### isCommunityAdmin

    public boolean isCommunityAdmin()

### setCommunityAdmin

    public void setCommunityAdmin(CommunityMembership communityMembership)

  Note that if the current user is actually a community admin, this will treat the user as such and changes will be made to shared resources. DO NOT call this method if you want to make just a user customization

  Parameters
    `communityMembership` -

### isUserInAdminRole

    public boolean isUserInAdminRole()

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