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

## oracle.portal.provider.v2
Class DefaultPortletDefinition

    java.lang.Object
      |
      +--oracle.portal.provider.v2.PortletDefinition
            |
            +--oracle.portal.provider.v2.DefaultPortletDefinition

All Implemented Interfaces:
  InitializableXMLObject, Validateable

Direct Known Subclasses:
  URLPortletDefinition

public class DefaultPortletDefinition
extends PortletDefinition
implements InitializableXMLObject

`DefaultPortletDefinition` extends the base `PortletDefinition` meta data class with a set of accessors compatible with the `DefaultProviderLoader` mechanism that loads provider definitions from XML files. It also further simplifies the `PortletInstance`'s task by allowing definition of a number of 'controller objects' to which it can delegate various parts of the portlet's functionality. This is the class most commonly used in the PDK-Java samples to define a portlet.

The table below summarizes the various portlet 'controller classes'.

`PortletRenderer` | For rendering the portlet's visual representation in all the various 'render modes' that it supports.
`PortletContainerRenderer` | For rendering the portlet's headers and footers with a standard 'look and feel'.
`PortletPersonalizationManager` | For persisting portlet customization data.
`PortletSecurityManager` | For deciding which users can access the portlet and its instances.

Constructor Summary
`DefaultPortletDefinition()`

Method Summary
`void` | `addEvent(java.lang.Object event)` Adds to the array of events that this portlet can raise to Portal
`void` | `addInputParameter(java.lang.Object parameter)` Adds to the array of (input) parameters that this portlet recognizes when requested to render to control/affect the rendering.
`void` | `deregister(ProviderInstance pi)` Called on each of a Provider instance's `PortletDefinition`s when the provider is deregistered from a Portal.
`PortletPersonalizationManager` | `getPersonalizationManager()` Gets the personalization manager for this portlet.
`PortletRenderer` | `getRenderer()` Gets the renderer for this portlet.
`PortletSecurityManager` | `getSecurityManager()` Gets the security manager for this portlet.
`boolean` | `hasAccess(ProviderInstance pi, ProviderUser user)` Verifies whether the user is authorized to use instances of this `PortletDefinition`.
`void` | `postInitialize()` Should be called to complete initialization of this `DefaultPortletDefinition`.
`void` | `preInitialize(java.lang.Object parent)` Should be called immediately after construction of a `DefaultPortletDefinition` to associate it with its parent `ProviderDefinition`.
`void` | `register(ProviderInstance pi)` Called on each of a Provider instance's `PortletDefinition`s when it is first registered on a Portal.
`void` | `setCacheLevel(java.lang.String cacheLevel)` Sets the caching level used for portlet render requests.
`void` | `setCallGetPortlet(java.lang.String value)` Controls whether calls to retrieve this Portlet's meta data should be made before displaying it in the portlet repository.
`void` | `setCallIsRunnable(java.lang.String value)` Controls whether calls to `hasAccess(oracle.portal.provider.v2.ProviderInstance, oracle.portal.provider.v2.ProviderUser)` should be made to determine whether this portlet is runnable, before displaying it in the portlet repository.
`void` | `setContainerRenderer(java.lang.Object renderer)` Sets the controller that will render this portlet's container.
`void` | `setDefaultLocale(java.lang.String lang)` Sets the default Locale for this Portal.
`void` | `setHasAbout(java.lang.String hasAbout)` Controls whether this portlet displays about information.
`void` | `setHasHelp(java.lang.String hasHelp)` Controls whether this portlet displays help information.
`void` | `setId(java.lang.String id)` Sets the Portlet unique ID.
`void` | `setLocalePersonalizationLevel(java.lang.String value)` Sets the locale personalization level for portlets defined by this `PortletDefinition`.
`void` | `setMobileFlags(java.lang.String flags)` Sets the portlet's mobile settings.
`void` | `setPassAllUrlParams(java.lang.String value)` Controls whether Portal will pass the requested page's URL parameters to the portlet.
`void` | `setPersonalizationManager(java.lang.Object mgr)` Sets the portlet personalization manager.
`void` | `setPortletBuilder(java.lang.Object portletBuilder)` Each portlet can specifiy the builder attached to edit this portlet.
`void` | `setPortletInstanceClass(java.lang.String className)` Defines the `PortletInstance` subclass that implements the portlet's behaviour.
`void` | `setRenderer(java.lang.Object renderer)` Sets the portlet renderer.
`void` | `setRewriteUrls(java.lang.String rewriteUrls)` Controls whether or not URL rewriting will be performed on the results of a portlet render request.
`void` | `setSecurityManager(java.lang.Object mgr)` Sets the portlet security manager.
`void` | `setShowDetails(java.lang.String hasDetails)` Controls whether this portlet displays "detailed" mode.
`void` | `setShowEdit(java.lang.String canEdit)` Controls whether this portlet supports per user personalization.
`void` | `setShowEditDefault(java.lang.String canEditDefault)` Controls whether this portlet supports per portlet customization.
`void` | `setShowEditToPublic(java.lang.String canEditString)` Deprecated. use `PortletDefinition.setMinEditAuthLevel(java.lang.String)` to specify the minimum authentication level needed to edit the portlet.
`void` | `setShowLink(java.lang.String value)` Controls whether this portlet is capable of rendering content for link mode.
`void` | `setShowPreview(java.lang.String canPreview)` Controls whether this portlet is capable of displaying a design-time preview of itself (after customization or personalization).
`void` | `setTimeout(java.lang.String timeout)` Sets the number of seconds the portal should wait before timing out a request to this portlet.
`void` | `validate(java.lang.String context, ValidationError errors)` Validates the internal state of this `DefaultPortletDefinition` instance.

Methods inherited from class oracle.portal.provider.v2.PortletDefinition
`addAcceptContentType, addEvent, addInputParameter, callGetPortlet, callIsRunnable, getAcceptContentTypes, getCacheLevel, getContainerRenderer, getDefaultLocale, getDescription, getDescriptionKey, getEvents, getId, getInputParameters, getLocalePersonalizationLevel, getMinEditAuthLevel, getMobileFlags, getName, getNameKey, getPassAllUrlParams, getPortletBuilder, getPortletInstanceClass, getPreferenceStore, getProviderDefinition, getResourceBundle, getRewriteUrls, getShortTitle, getShortTitleKey, getShowEditToPublic, getTimeout, getTimeoutMessage, getTimeoutMessageKey, getTitle, getTitleKey, hasAbout, hasHelp, hasShowDetails, hasShowEdit, hasShowEditDefault, hasShowLink, hasShowPreview, init, setCacheLevel, setCallGetPortlet, setCallIsRunnable, setContainerRenderer, setDefaultLocale, setDescription, setDescriptionKey, setHasAbout, setHasHelp, setId, setLocalePersonalizationLevel, setMinEditAuthLevel, setMobileFlags, setName, setNameKey, setPassAllUrlParams, setPortletBuilder, setPortletInstanceClass, setPrefStoreName, setResource, setRewriteUrls, setShortTitle, setShortTitleKey, setShowDetails, setShowEdit, setShowEditDefault, setShowEditToPublic, setShowLink, setShowPreview, setTimeout, setTimeoutMessage, setTimeoutMessageKey, setTitle, setTitleKey, validate`

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

Constructor Detail

### DefaultPortletDefinition

    public DefaultPortletDefinition()

Method Detail

### preInitialize

    public void preInitialize(java.lang.Object parent)
                       throws NodeHandlerException

  Should be called immediately after construction of a `DefaultPortletDefinition` to associate it with its parent `ProviderDefinition`.

  Specified by:
    `preInitialize` in interface `InitializableXMLObject`
  Parameters:
    `parent` - the parent provider definition object. Sould be a `ProviderDefinition` or a subclass.
  Throws:
    `NodeHandlerException` - if an error occurs while initializing this application object

### postInitialize

    public void postInitialize()

  Should be called to complete initialization of this `DefaultPortletDefinition`.

  Specified by:
    `postInitialize` in interface `InitializableXMLObject`

### setPortletInstanceClass

    public void setPortletInstanceClass(java.lang.String className)
                                 throws java.lang.ClassNotFoundException

  Defines the `PortletInstance` subclass that implements the portlet's behaviour.

  Parameters:
    `className` - the fully qualifed name of the `PortletInstance` subclass that implements the portlet's behaviour.
    `java.lang.ClassNotFoundException`

### setId

    public void setId(java.lang.String id)
               throws PortletException

  Sets the Portlet unique ID.

  Parameters:
    `id` - the Portlet (unique ID). Value should be a String representation of a long value, unique with respect to the provider.
  Throws:
    `PortletException` - if the given String does not represent a valid `long`.

### addInputParameter

    public void addInputParameter(java.lang.Object parameter)
                           throws PortletException

  Adds to the array of (input) parameters that this portlet recognizes when requested to render to control/affect the rendering.

  Parameters:
    `parameter` - an object representing an input parameter. Should be a `ParameterDefinition`.
  Throws:
    `PortletException` - if the given Object is not a valid `ParameterDefinition`

### addEvent

    public void addEvent(java.lang.Object event)
                  throws PortletException

  Adds to the array of events that this portlet can raise to Portal

  Parameters:
    `event` - an object representing an event. Should be a `EventDefinition`.
  Throws:
    `PortletException` - if the given Object is not a valid `EventDefinition`

### setTimeout

    public void setTimeout(java.lang.String timeout)
                    throws PortletException

  Sets the number of seconds the portal should wait before timing out a request to this portlet.

  Parameters:
    `timeout` - timeout period, as a String representation of an integer number of seconds.
  Throws:
    `PortletException` - if the given String does not represent a valid `int`.

### setShowEdit

    public void setShowEdit(java.lang.String canEdit)

  Controls whether this portlet supports per user personalization.

  Parameters:
    `canEdit` - String representation of boolean value. Should be `"true"` if this portlet is to support per user personalization, `"false"` otherwise.

### setShowEditToPublic

    public void setShowEditToPublic(java.lang.String canEditString)

  Deprecated. use `PortletDefinition.setMinEditAuthLevel(java.lang.String)` to specify the minimum authentication level needed to edit the portlet.

  Controls whether this portlet exposes per user personalization to the public non-logged in user.

### setShowEditDefault

    public void setShowEditDefault(java.lang.String canEditDefault)

  Controls whether this portlet supports per portlet customization. Per portlet customizations means that all users of this instance see a customized version of the portlet vs. the generic version. Users are then free to further personalize this instance (via showEdit).

  Parameters:
    `canEditDefault` - String representation of boolean value. Should be `"true"` if this portlet supports per portlet customization, `"false"` otherwise.

### setShowPreview

    public void setShowPreview(java.lang.String canPreview)

  Controls whether this portlet is capable of displaying a design-time preview of itself (after customization or personalization).

  Parameters:
    `canPreview` - String representation of boolean value. Should be `"true"` if this portlet is capable of displaying a design-time preview of itself (after customization or personalization), or `"false"` otherwise.

### setShowDetails

    public void setShowDetails(java.lang.String hasDetails)

  Controls whether this portlet displays "detailed" mode. Detailed mode is a full page mode where this portlet is expected to display a finer level of information.

  Parameters:
    `hasDetails` - String representation of boolean value. Should be `"true"` if this portlet is capable of displaying a "detailed" mode, or `"false"` otherwise.

### setHasHelp

    public void setHasHelp(java.lang.String hasHelp)

  Controls whether this portlet displays help information.

  Parameters:
    `hasHelp` - String representation of boolean value. Should be `"true"` if this portlet is capable of displaying a help information, or `"false"` otherwise.

### setHasAbout

    public void setHasAbout(java.lang.String hasAbout)

  Controls whether this portlet displays about information.

  Parameters:
    `hasAbout` - String representation of boolean value. Should be `"true"` if this portlet is capable of displaying about information, or `"false"` otherwise.

### setDefaultLocale

    public void setDefaultLocale(java.lang.String lang)

  Sets the default Locale for this Portal. The Locale is specified using the standard ISO 2 letter language and country codes, e.g. `en.US`.

  Parameters:
    `lang` - a String specifying a Locale

### setShowLink

    public void setShowLink(java.lang.String value)

  Controls whether this portlet is capable of rendering content for link mode.

  Parameters:
    `value` - String representation of boolean value. Should be `"true"` if this portlet is capable of rendering content for link mode, `"false"` otherwise.

### setCallIsRunnable

    public void setCallIsRunnable(java.lang.String value)

  Controls whether calls to `hasAccess(oracle.portal.provider.v2.ProviderInstance, oracle.portal.provider.v2.ProviderUser)` should be made to determine whether this portlet is runnable, before displaying it in the portlet repository.

  Parameters:
    `value` - String representation of boolean value. Should be `"true"` if access checks should be made on a per-user basis before displaying the portlet in the portlet repository. If `"false"`, the portlet is treated as a public portlet visible to all users.

### setCallGetPortlet

    public void setCallGetPortlet(java.lang.String value)

  Controls whether calls to retrieve this Portlet's meta data should be made before displaying it in the portlet repository.

  Parameters:
    `value` - String representation of boolean value. If `"true"`, portal will retrieve the portlet meta data before displaying it in the portlet repository. If `"false"`, the default meta data will be used for all users.

### setPassAllUrlParams

    public void setPassAllUrlParams(java.lang.String value)

  Controls whether Portal will pass the requested page's URL parameters to the portlet.

  Parameters:
    `value` - String representation of boolean value.
    - If `"true"`, then the portlet will receive all the (non-system) parameters from the page URL.
    - If `"false"` (the default) and the portlet declares input parameters, then the portlet 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(java.lang.String cacheLevel)
                       throws PortletException

  Sets the caching level used for portlet render requests. This controls the set of parameters sent to the provider in a render request and hence the "cache key" under which the returned markup is stored. This overrides the User/Session information entered for the provider on registration. The possible settings are:
  - `session`: both user and portal session information is required.
  - `user`: user information is required but no session information is required.
  - `system`: neither user information nor portal session information is required.

  Parameters:
    `cacheLevel` - String indicates the caching level - should be one of PortletConstants.CACHE_LEVEL_SYSTEM_STR, PortletConstants.CACHE_LEVEL_USER_STR, or PortletConstants.CACHE_LEVEL_SESSION_STR. 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
    `PortletException`

### setRewriteUrls

    public void setRewriteUrls(java.lang.String rewriteUrls)

  Controls whether or not URL rewriting will be performed on the results of a portlet render request.

  If this method is called then the specified setting will override any equivalent provider setting. If this method is not called then the equivalent provider setting will be used for this portlet.

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

### setMobileFlags

    public void setMobileFlags(java.lang.String flags)
                        throws java.lang.IllegalArgumentException

  Sets the portlet's mobile settings. This form allows you to set the flags as a string. The string can either be the (case insensitive) delimited names of the flags or the number itself (as a String). E.g. passing "MOBILE_ONLY | INLINE_OUTPUT" is the same as passing the string "3" to the method. See the `MobileFlags` class for the possible flags and their String names.

    `java.lang.IllegalArgumentException`

### setLocalePersonalizationLevel

    public void setLocalePersonalizationLevel(java.lang.String value)
                                       throws PortletException

  Sets the locale personalization level for portlets defined by this `PortletDefinition`. For more information regarding the locale personalization level, see `PortletDefinition.setLocalePersonalizationLevel(int)`.

  The value supplied should be one of

  - `PortletConstants.PERSONALIZATION_LEVEL_NONE_STR`
  - `PortletConstants.PERSONALIZATION_LEVEL_LANGUAGE_STR`
  - `PortletConstants.PERSONALIZATION_LEVEL_LOCALE_STR`

  Failing that, a `PortletException` will result.

  Parameters:
    `value` - the string representation of the locale personalization level.
  Throws:
    `PortletException` - if the value is not recognized.

### setContainerRenderer

    public void setContainerRenderer(java.lang.Object renderer)
                              throws PortletException

  Sets the controller that will render this portlet's container.

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

  Parameters:
    `renderer` - the portlet container renderer. Even though the type of the parameter is Object, the parameter must be an instance of `PortletContainerRenderer`.
  Throws:
    `PortletException` - if the given object is not a valid `PortletContainerRenderer`.

### getSecurityManager

    public PortletSecurityManager getSecurityManager()

  Gets the security manager for this portlet. The security manager is used to check whether a user is authorized to perform a specific action. It is valid for a portlet to not have a security manager. I.e. this method can return null. If there is no security manager it is assumed that all users have unrestricted access.

  Returns:
    the security manager for this portlet if it has one, or `null` otherwise.

### getPersonalizationManager

    public PortletPersonalizationManager getPersonalizationManager()

  Gets the personalization manager for this portlet. The personalization manager provides the interface between the renderer and the personalization store that allows the renderer to get the user customizations for this rendition. It is valid for a portlet to not have a personalization manager. I.e. this method can return null.

  Returns:
    the personalization manager for this portlet if it has one, or `null` otherwise.

### getRenderer

    public PortletRenderer getRenderer()

  Gets the renderer for this portlet. The renderer is responsible for emitting the visual aspects of the portlet (as markup). All `DefaultPortletDefinition`s must have a renderer.

  Returns:
    the renderer for this portlet.

### setSecurityManager

    public void setSecurityManager(java.lang.Object mgr)
                            throws PortletException

  Sets the portlet security manager.

  Parameters:
    `mgr` - the portlet security manager. Should be a `PortletSecurityManager`.
  Throws:
    `PortletException` - if the given Object is not a valid `PortletSecurityManager`

### setPersonalizationManager

    public void setPersonalizationManager(java.lang.Object mgr)
                                   throws PortletException

  Sets the portlet personalization manager.

  Parameters:
    `mgr` - the personalization manager. Should be a `PortletPersonalizationManager`.
  Throws:
    `PortletException` - if the given Object is not a valid `PortletPersonalizationManager`

### setRenderer

    public void setRenderer(java.lang.Object renderer)
                     throws PortletException

  Sets the portlet renderer.

  Parameters:
    `renderer` - the renderer. Should be a `PortletRenderer`.
  Throws:
    `PortletException` - if the given Object is not a valid `PortletRenderer`

### register

    public void register(ProviderInstance pi)
                  throws java.io.IOException,
                         AccessControlException

  Called on each of a Provider instance's `PortletDefinition`s when it is first registered on a Portal. This gives a `DefaultPortletDefinition` a chance to ask its `PortletPersonalizationManager` to initialize storage for the portlet.

  Overrides:
    `register` in class `PortletDefinition`
    `java.io.IOException`
    `AccessControlException`

### deregister

    public void deregister(ProviderInstance pi)
                    throws java.io.IOException,
                           AccessControlException

  Called on each of a Provider instance's `PortletDefinition`s when the provider is deregistered from a Portal. This gives a `DefaultPortletDefinition` a chance to ask its `PortletPersonalizationManager` to release storage for the portlet.

  Overrides:
    `deregister` in class `PortletDefinition`
    `java.io.IOException`
    `AccessControlException`

### hasAccess

    public boolean hasAccess(ProviderInstance pi,
                             ProviderUser user)

  Verifies whether the user is authorized to use instances of this `PortletDefinition`. That is, does this user have the necessary privileges to create, get, copy, and destroy instances of this `PortletDefinition`. A `DefaultPortletDefinition` is able to use its `PortletSecurityManager` to perform this check.

  Overrides:
    `hasAccess` in class `PortletDefinition`
  Parameters:
    `user` - the current user we are being asked to authorize.
  Returns:
    `true` is this user is authorized to access this portlet.

### setPortletBuilder

    public void setPortletBuilder(java.lang.Object portletBuilder)
                           throws PortletException

  Each portlet can specifiy the builder attached to edit this portlet. This method sets a PortletBuilder with this portletdefinition.

  Parameters:
    `portletBuilder` - the PortletBuilder attribute for this Portlet
  Throws:
    `PortletException` - if the given Object is not a valid `BuilderMetaData`.

### validate

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

  Validates the internal state of this `DefaultPortletDefinition` instance. Errors found are reported using the supplied `ValidationError` instance.

  Specified by:
    `validate` in interface `Validateable`
  Overrides:
    `validate` in class `PortletDefinition`
  Parameters:
    `context` - The context of the calling instance.
    `errors` - The current list of errors.

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

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