Overview | Package | Class | Tree | Deprecated | Index | Help
| The PDK Java API is part of the Portal Developer Kit on Portal Studio
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## oracle.portal.provider.v2
Class ProviderDefinition

    java.lang.Object
      |
      +--oracle.portal.provider.v2.ProviderDefinition

All Implemented Interfaces:
  Validateable

Direct Known Subclasses:
  DefaultProviderDefinition

public class ProviderDefinition
extends java.lang.Object
implements Validateable

A `ProviderDefinition` is a 'blueprint' for a provider. It is simply a container for meta data that drives the behaviour of one or more `ProviderInstance` objects.

This base class follows basic JavaBeans design patterns in order to expose the properties required by every `ProviderDefinition`. This allows a `ProviderDefinition`'s initialization to be managed by a generic mechanism (a `ProviderLoader`) and gives scope for provider meta data to be loaded from a variety of storage mechanisms (e.g. XML file or database). Users who require a richer set of provider-level properties or accessors to these properties should feel free to use their own subclass.

Constructor Summary
`ProviderDefinition()`

Method Summary
`void` | `addPortletDefinition(PortletDefinition pd)` Associates with the provider a `PortletDefinition` object containing the meta data for one of the portlets it owns.
`void` | `addPreferenceStore(PreferenceStore ps)` Adds to the set of `PreferenceStore` objects that may be used by the provider for persistent storage.
`int` | `getCacheLevel()` Returns the caching level for portlets belonging to this provider.
`PortletContainerRenderer` | `getContainerRenderer()` Returns the default portlet container renderer.
`boolean` | `getHasSession()` Determines whether the `ProviderInstance` will start a (servlet) session in its `ProviderInstance.initSession(oracle.portal.provider.v2.ProviderUser, oracle.portal.provider.v2.externalApp.ExternalPrincipal)` method.
`OidManager` | `getOidManager()` Gets the OidManager.
`boolean` | `getPassAllUrlParams()` Determines whether Portal will pass the requested page's URL parameters to the provider's portlets by default.
`PortletDefinition` | `getPortletDefinition(long id)` Retrieves the `PortletDefinition` object containing the meta data for the portlet with the given id.
`java.util.List` | `getPortletDefinitions()` Returns the list of associated `PortletDefinition` objects containing the portlet-level meta data for each of the provider's portlets.
`PreferenceStore` | `getPreferenceStore()` Gets the default `PreferenceStore` that should be used by the provider and all its child objects for which a preference store has not been chosen explicitly.
`PreferenceStore` | `getPreferenceStore(java.lang.String preferenceStoreName)` Retrieves the `PreferenceStore` with the given name.
`oracle.webdb.provider.v2.builder.BuilderMetaData` | `getProviderBuilder()` Each provider can specifiy the builder attached to edit this provider.
`ProviderContext` | `getProviderContext()` Gets the context object that describes the deployment environment of the provider.
`java.lang.Class` | `getProviderInstanceClass()` Returns the `Class` representing the `ProviderInstance` class or subclass that implements the provider's behaviour.
`boolean` | `getRewriteUrls()` Determines whether URL rewriting will be performed for portlets belonging to this provider.
`boolean` | `getUseOldStyleHeaders()` Deprecated. use `getContainerRenderer()` to determine the default container renderer that should be used to render portlet containers for this provider
`void` | `init(ProviderContext pc)` Should be called immediately after construction of a `ProviderDefinition` to associate it with a shared `ProviderContext` object describing its deployment environment.
`void` | `setCacheLevel(int cacheLevel)` Sets the caching level used for portlet render requests for portlets belonging to this provider.
`void` | `setContainerRenderer(PortletContainerRenderer renderer)` Sets the default portlet container renderer.
`void` | `setHasSession(boolean session)` Controls whether the `ProviderInstance` starts a (servlet) session in its `ProviderInstance.initSession(oracle.portal.provider.v2.ProviderUser, oracle.portal.provider.v2.externalApp.ExternalPrincipal)` method.
`void` | `setPassAllUrlParams(boolean value)` Controls whether Portal will pass the requested page's URL parameters to the provider's portlets by default.
`void` | `setPrefStoreName(java.lang.String preferenceStoreName)` Selects the default `PreferenceStore` that should be used by the provider and all its child objects for which a preference store has not been chosen explicitly.
`void` | `setProviderBuilder(oracle.webdb.provider.v2.builder.BuilderMetaData builderMetaData)` Each provider can specifiy the builder attached to edit this provider.
`void` | `setProviderInstanceClass(java.lang.Class c)` Defines the `ProviderInstance` subclass that implements the provider's behaviour.
`void` | `setRewriteUrls(boolean rewriteUrls)` Controls whether or not URL rewriting will be performed on the results of portlet render requests for portlets belonging to this provider.
`void` | `setUseOldStyleHeaders(boolean useOldStyleHeaders)` Deprecated. use `setContainerRenderer(oracle.portal.provider.v2.render.PortletContainerRenderer)` with `ContainerRenderer306` to get equivalent behavior. Alternatively, create your own container renderer by extending `PortletContainerRenderer`
`void` | `validate(java.lang.String context, ValidationError errors)` Validates the internal state of this `ProviderDefinition` instance.

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

Constructor Detail

### ProviderDefinition

    public ProviderDefinition()

Method Detail

### init

    public void init(ProviderContext pc)

  Should be called immediately after construction of a `ProviderDefinition` to associate it with a shared `ProviderContext` object describing its deployment environment. Generally, all providers running in the same environment (e.g. within the same adapter servlet) share the same `ProviderContext`.
  Parameters:
    `pc` - an object describing the deployment environment of the provider.

### getProviderContext

    public ProviderContext getProviderContext()

  Gets the context object that describes the deployment environment of the provider. Generally, all providers running in the same environment share the same `ProviderContext`.
  Returns:
    context object describing the deployment environment of the provider.

### getProviderInstanceClass

    public java.lang.Class getProviderInstanceClass()

  Returns the `Class` representing the `ProviderInstance` class or subclass that implements the provider's behaviour.
  Returns:
    a `Class` representing the `ProviderInstance` subclass that implements the provider's behaviour.

### setProviderInstanceClass

    public void setProviderInstanceClass(java.lang.Class c)

  Defines the `ProviderInstance` subclass that implements the provider's behaviour.
  Parameters:
    `c` - a `Class` representing the `ProviderInstance` subclass that implements the provider's behaviour.

### setHasSession

    public void setHasSession(boolean session)

  Controls whether the `ProviderInstance` starts a (servlet) session in its `ProviderInstance.initSession(oracle.portal.provider.v2.ProviderUser, oracle.portal.provider.v2.externalApp.ExternalPrincipal)` method.
  Parameters:
    `session` - `true` if the ProviderInstance is to start a session in `initSession`, or `false` otherwise.

### getHasSession

    public boolean getHasSession()

  Determines whether the `ProviderInstance` will start a (servlet) session in its `ProviderInstance.initSession(oracle.portal.provider.v2.ProviderUser, oracle.portal.provider.v2.externalApp.ExternalPrincipal)` method.
  Returns:
    `true` if the ProviderInstance will start a session in `initSession`, or `false` otherwise.

### setPassAllUrlParams

    public void setPassAllUrlParams(boolean value)

  Controls whether Portal will pass the requested page's URL parameters to the provider's portlets by default.

  Parameters:
    `value` - boolean indicating whether Portal will pass the requested page's URL parameters to portlets by default.
    - If `true`, then each portlet whose definition doesn't explicitly override this setting will receive all the (non-system) parameters from the page URL.
    - If `false` (the default), then each portlet which declares input parameters and doesn't explicitly override this setting (with `PortletDefinition.setPassAllUrlParams(boolean)`) will only receive values for its declared input parameters and private parameters which have been generated using `PortletRendererUtil.portletParameter(oracle.portal.provider.v2.render.PortletRenderRequest, java.lang.String)`. The parameter values will be determined by the usage of the portlet on a particular page.

### setCacheLevel

    public void setCacheLevel(int cacheLevel)
                       throws ProviderException

  Sets the caching level used for portlet render requests for portlets belonging to this provider.

  Parameters:
    `cacheLevel` - int indicates the caching level - should be one of PortletConstants.CACHE_LEVEL_SYSTEM, PortletConstants.CACHE_LEVEL_USER, or PortletConstants.CACHE_LEVEL_SESSION. The cache level for a portlet render request is determined using the following order of precedence:
    - If specified, the portlet setting is used
    - If specified, the provider setting is used
    - If the provider is registered as "public" then the portlet will be called using the "public" user and cached at the system level
    - If the provider is registered as "user" and "portal session data" is requested then portlet will be cached at the session level
    - Otherwise, the portlet will be cached at user level

### setRewriteUrls

    public void setRewriteUrls(boolean rewriteUrls)

  Controls whether or not URL rewriting will be performed on the results of portlet render requests for portlets belonging to this provider.

  When `true`, this tag enables URL rewriting to improve portlet caching. URL Rewriting can be specified at both the provider and portlet levels. The order of precedence is as follows:

  - If specified, the portlet setting is used.
  - If specified, the provider setting is used.
  - Otherwise, URL rewriting is not performed.

  In other words, the provider URL rewriting setting will be used by those of its portlets that have not specified their own setting by calling `PortletDefinition.setRewriteUrls(boolean)`. The default provider setting is `false`.

  URL rewriting is a technique that allows you to create links or HTML forms without Portal having to send the base URL to the web provider. This means that the URLs, which can vary alot, do not get used as part of the cache key for your portlet. In most cases, this will increase the effectiveness of portlet caching.

  For example, you might want to create a link based on the Page URL, but with your own parameters appended to it. If URL rewriting is disabled, the base URL is sent to the web provider, the PDK framework appends your parameters to the base URL and then you include the resulting URL in your portlet.

  If URL rewriting is enabled, the base URL is never sent to the web provider. Instead, when you call the methods to create URLs such as `UrlUtils.constructHTMLLink(oracle.portal.provider.v2.render.PortletRenderRequest, int, java.lang.String, java.lang.String, oracle.portal.utils.v2.NameValuePair[], boolean, boolean)`, the framework constructs a specially formatted String that you embed in your portlet. This String is then processed by Portal to create the same URL that would have been constructed if URL rewriting was disabled.

  In order to enable URL rewriting you may need to make some small changes to your portlet code. You will need to make changes if you are submitting data via an HTML form or if you are appending encoded parameters to a simple link.

  In the case of HTML forms, you should use the `UrlUtils.htmlFormName(oracle.portal.provider.v2.render.PortletRenderRequest, java.lang.String)` method to construct a qualified form name that is unique to the current portlet instance.

  In the case of simple links, you should use `UrlUtils.constructHTMLLink`. This method constructs an entire HTML <a>..</a> tag sequence embedding your link within it.

  Parameters:
    `rewriteUrls` - boolean true if URL rewriting is to be performed. Otherwise false.

### getPassAllUrlParams

    public boolean getPassAllUrlParams()

  Determines whether Portal will pass the requested page's URL parameters to the provider's portlets by default.
  Returns:
    boolean indicating whether Portal will pass a requested page's URL parameters to portlets by default.
  See Also:
    `setPassAllUrlParams(boolean)`

### getCacheLevel

    public int getCacheLevel()

  Returns the caching level for portlets belonging to this provider.

  The portlet setting for cache level takes precedence over the provider setting.

  Returns:
    int the provider's cache level.
  See Also:
    `setCacheLevel(int)`

### getRewriteUrls

    public boolean getRewriteUrls()

  Determines whether URL rewriting will be performed for portlets belonging to this provider. The portlet setting for rewrite URLs takes precedence over the provider setting.
  Returns:
    boolean true if URL rewriting is to be performed. Otherwise false.
  See Also:
    `setRewriteUrls(boolean)`

### getPortletDefinitions

    public java.util.List getPortletDefinitions()

  Returns the list of associated `PortletDefinition` objects containing the portlet-level meta data for each of the provider's portlets.
  Returns:
    a list of `ProviderDefinition`s containing the meta data for each of the provider's portlets.

### addPortletDefinition

    public void addPortletDefinition(PortletDefinition pd)

  Associates with the provider a `PortletDefinition` object containing the meta data for one of the portlets it owns. Note that each `PortletDefinition` added should have a unique id.
  Parameters:
    `pd` - a `ProviderDefinition` containing the portlet-level meta data for one of the provider's portlets.

### getPortletDefinition

    public PortletDefinition getPortletDefinition(long id)

  Retrieves the `PortletDefinition` object containing the meta data for the portlet with the given id.
  Parameters:
    `id` - a `long` identifying the portlet within the provider
  Returns:
    a `ProviderDefinition` containing the portlet-level meta data for the portlet with the given id, or `null` if no such portlet has been defined.

### addPreferenceStore

    public void addPreferenceStore(PreferenceStore ps)

  Adds to the set of `PreferenceStore` objects that may be used by the provider for persistent storage. Note that each `PreferenceStore` added should have a unique identifying name.
  Parameters:
    `ps` - a `PreferenceStore`.

### setPrefStoreName

    public void setPrefStoreName(java.lang.String preferenceStoreName)
                          throws PreferenceStoreException

  Selects the default `PreferenceStore` that should be used by the provider and all its child objects for which a preference store has not been chosen explicitly.
  Parameters:
    `preferenceStoreName` - the name of one of the provider's `PreferenceStore`s, which should have been added with `addPreferenceStore(oracle.portal.provider.v2.preference.PreferenceStore)`.
  Throws:
    `PreferenceStoreException` - if a `PreferenceStore` with the given name has not been defined.
  See Also:
    `getPreferenceStore()`

### getPreferenceStore

    public PreferenceStore getPreferenceStore()

  Gets the default `PreferenceStore` that should be used by the provider and all its child objects for which a preference store has not been chosen explicitly. If this has not been set with `setPrefStoreName(java.lang.String)`, then the first `PreferenceStore` to be associated with `addPreferenceStore(oracle.portal.provider.v2.preference.PreferenceStore)` will be returned; otherwise `null` will be returned.
  Returns:
    the `PreferenceStore` that should be used by child objects by default if one has been defined, or `null` otherwise.

### getPreferenceStore

    public PreferenceStore getPreferenceStore(java.lang.String preferenceStoreName)
                                       throws PreferenceStoreException

  Retrieves the `PreferenceStore` with the given name.
  Parameters:
    `preferenceStoreName` - name of the `PreferenceStore` to be retrieved, which should have been added with `addPreferenceStore(oracle.portal.provider.v2.preference.PreferenceStore)`.
  Throws:
    `PreferenceStoreException` - if a `PreferenceStore` with the given name has not been defined.

### setUseOldStyleHeaders

    public void setUseOldStyleHeaders(boolean useOldStyleHeaders)

  Deprecated. use `setContainerRenderer(oracle.portal.provider.v2.render.PortletContainerRenderer)` with `ContainerRenderer306` to get equivalent behavior. Alternatively, create your own container renderer by extending `PortletContainerRenderer`

  Specifies whether or not `PortletRendererUtil` should render headers and footers for this provider's portlets in the style used by a 3.0.6 portal or earlier, rather than the style used by a post-3.0.6 portal.
  Parameters:
    `useOldStyleHeaders` - boolean indicating which style of form headers and footers should be rendered by `PortletRendererUtil`.`true` - render portal 3.0.6 style headers and footers. `false` - render new style headers and footers.

### getUseOldStyleHeaders

    public boolean getUseOldStyleHeaders()

  Deprecated. use `getContainerRenderer()` to determine the default container renderer that should be used to render portlet containers for this provider

  Signals whether `PortletRendererUtil` will render headers and footers for this provider's portlets in the style used by a 3.0.6 portal or earlier, rather than the style used by a post-3.0.6 portal.
  Returns:
    boolean indicating which style of form headers and footers should be rendered by `PortletRendererUtil`.`true` - render portal 3.0.6 style headers and footers. `false` - render new style headers and footers.

### getContainerRenderer

    public PortletContainerRenderer getContainerRenderer()

  Returns the default portlet container renderer.

  The portlet container renderer is responsible for rendering the portlet container in each of the show modes the portlet supports.

  Each portlet can specify its own container renderer and you can specify a default at the provider level to be used by any portlet that does not explicitly specify it's own container renderer.

  Returns:
    the default portlet container renderer. Note that if a default container renderer has not been specified with `setContainerRenderer(oracle.portal.provider.v2.render.PortletContainerRenderer)`, then a `DefaultContainerRenderer` object will ve returned.

### setContainerRenderer

    public void setContainerRenderer(PortletContainerRenderer renderer)

  Sets the default portlet container renderer.

  The container renderer is responsible for rendering the portlet container in each of the show modes the portlet supports.

  Each portlet can specify it's own container renderer and you can specify a default at the provider level to be used by any portlet that does not explicitly specify it's own container renderer.

  Parameters:
    `renderer` - the portlet container renderer

### getProviderBuilder

    public oracle.webdb.provider.v2.builder.BuilderMetaData getProviderBuilder()

  Each provider can specifiy the builder attached to edit this provider. This method returns the ProviderBuilder associated with this provider.

### setProviderBuilder

    public void setProviderBuilder(oracle.webdb.provider.v2.builder.BuilderMetaData builderMetaData)

  Each provider can specifiy the builder attached to edit this provider. This method sets a ProviderBuilder with this providerdefintion.
  Parameters:
    `builderMetaData` - the ProviderBuilder attribute for this Provider Defintion.

### validate

    public void validate(java.lang.String context,
                         ValidationError errors)

  Validates the internal state of this `ProviderDefinition` instance. Errors found are reported using the supplied `ValidationError` instance.
  Specified by:
    `validate` in interface `Validateable`
  Parameters:
    `context` - The context of the calling instance.
    `errors` - The current list of errors.

### getOidManager

    public OidManager getOidManager()
                             throws ProviderException

  Gets the OidManager. The OidManager provides access to user details.
  Returns:
    the OidManager or null depeneding on whether the OidManager has been configured.

Overview | Package | Class | Tree | Deprecated | Index | Help
| The PDK Java API is part of the Portal Developer Kit on Portal Studio
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright (c) 2002, Oracle Corporation. All Rights Reserved.