oracle.portal.provider.v1.http
Class DefaultPortlet

java.lang.Object
  |
  +--oracle.portal.provider.v1.http.DefaultPortlet

public class DefaultPortlet
extends java.lang.Object
implements PortletXtra3, MutablePortletXtra3

A portlet is implemented as a set of controllers: a renderer and optionally a personalization manager and a security manager. The Portlet interface is a container for these controllers as well as portlet meta-data. The DefaultPortlet implements the Portlet interface. It is designed to work with the DefaultProvider/provider.xml mechanism that allows you to describe the characteristics of the portlet's controllers and meta-data using an XML syntax rather then program them directly.

The Portlet interface is a container interface; its function is to return (pre)set values vs. perform computation. Because of this DefaultPortlet should never need to be subclassed.

Portlets are encouraged to support multiple language versions of their portlet meta-data. This is accomplished by storing the meta-data strings in resource bundles and then registering the resource bundle with the Portlet (in the provider.xml file this is specified within the <resource> element of a <portlet> element). The DefaultPortlet defines constants for the resource names it uses to extract the meta-data from the resource file.


Constructor Summary
DefaultPortlet()
          Null Constructor
 
Method Summary
 void addAcceptContentType(java.lang.String type)
          Adds to the set of mime-types (represented as Strings) that this Portlet can render.
 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.
 boolean callGetPortlet()
          Returns true if calls to retrieve this Portlet's meta data should be made.
 boolean callIsRunnable()
          Returns true if calls to isPortletRunnable should be made to this Portlet before displaying in the portlet repository.
 java.lang.String[] getAcceptContentTypes()
          Gets an array of mime-types (represented as Strings) that this Portlet can render.
 PortletContainerRenderer getContainerRenderer()
          Returns the controller that will render this portlet's container.
 java.util.Locale getDefaultLocale()
          Gets this Portlet's default locale.
 java.lang.String getDescription(java.util.Locale l)
          Gets the Portlet description.
 long getId()
          Gets the Portlet unique ID.
 PortletParameter[] getInputParameters()
          Gets an array of (input) parameters that this portlet recognizes when requested to render to control/affect the rendering.
 int getMinEditAuthLevel()
          Returns the minimum user authentication level required for the customize link to be displayed in the portlet header If the authentication level of a user is less than the minimum authentication level specified, the customize link will not be displayed in the portlet header.
 MobileFlags getMobileFlags()
          Returns the portlet's mobile settings as a bitwise flag.
 java.lang.String getName(java.util.Locale l)
          Gets the Portlet name.
 PortletPersonalizationManager getPersonalizationManager()
          Gets the personalization manager for this portlet.
 Provider getProvider()
          Gets the Provider that created this instance.
 PortletRenderer getRenderer()
          Gets the renderer for this portlet.
 java.util.ResourceBundle getResourceBundle(java.util.Locale l)
          Gets the string resource (bundle) for this Portlet.
 PortletSecurityManager getSecurityManager()
          Gets the security manager for this portlet.
 java.lang.String getShortTitle(java.util.Locale l)
          Gets the Portlet short title.
 boolean getShowEditToPublic()
          Returns true if this Portlet exposes per user personalization to the public (non-logged in) user.
 int getTimeout()
          Gets the number of seconds the portal should wait before timing out a request to this portlet.
 java.lang.String getTimeoutMessage(java.util.Locale l)
          Gets the timeout messsage that the portal should use in its response when a request to this Portlet times out.
 java.lang.String getTitle(java.util.Locale l)
          Gets the Portlet title.
 boolean hasAbout()
          Return returns true if this Portlet is capable of displaying about information.
 boolean hasHelp()
          Return returns true if this Portlet is capable of displaying help information.
 boolean hasShowDetails()
          Return returns true if this Portlet is capable of displaying a full-screen (detailed) version of itself.
 boolean hasShowEdit()
          Returns true if this Portlet supports per user personalization, false otherwise.
 boolean hasShowEditDefault()
          Returns true if this Portlet supports per portlet customization, false otherwise.
 boolean hasShowLink()
          Returns true if this Portlet is capable of rendering content for link mode.
 boolean hasShowLinkMode()
          Returns true if this Portlet is capable of rendering content for link mode.
 boolean hasShowPreview()
          Returns true if this Portlet is capable of displaying a design-time preview of itself (after customization or personalization).
 void init(Provider p)
          Initializes the portlet.
 void setCallGetPortlet(boolean value)
          Controls whether calls to retrieve this Portlet's meta data should be made before displaying in the portlet repository.
 void setCallGetPortlet(java.lang.String value)
          Controls whether calls to retrieve this Portlet's meta data should be made before displaying in the portlet repository.
 void setCallIsRunnable(boolean value)
          Controls whether calls to isPortletRunnable should be made to this Portlet before displaying in the portlet repository.
 void setCallIsRunnable(java.lang.String value)
          Controls whether calls to isPortletRunnable should be made to this Portlet before displaying in the portlet repository.
 void setContainerRenderer(java.lang.Object renderer)
          Sets the controller that will render this portlet's container.
 void setContainerRenderer(PortletContainerRenderer 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 setDescription(java.lang.String description)
          Sets the Portlet description.
 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 setMinEditAuthLevel(java.lang.String authLevel)
          Sets the minimum user authentication level required for the customize link to be displayed in the portlet header If the authentication level of a user is less than the minimum authentication level specified, the customize link will not be displayed in the portlet header.
 void setMobileFlags(long flags)
          Sets the portlet's mobile settings.
 void setMobileFlags(java.lang.String flags)
          Sets the portlet's mobile settings.
 void setName(java.lang.String name)
          Sets the Portlet name.
 void setPersonalizationManager(java.lang.Object mgr)
          Sets the Portlet personalization manager.
 void setRenderer(java.lang.Object renderer)
          Sets the Portlet renderer.
 void setResource(java.lang.String resourceClassName)
          Sets the name of the default resource bundle class for this Portlet
 void setSecurityManager(java.lang.Object mgr)
          Sets the Portlet security manager.
 void setShortTitle(java.lang.String title)
          Sets the Portlet short title.
 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 setMinEditAuthLevel()
 void setShowLink(boolean value)
          Controls whether this Portlet is capable of rendering content for link mode.
 void setShowLink(java.lang.String value)
          Controls whether this Portlet is capable of rendering content for link mode.
 void setShowLinkMode(boolean value)
          Controls whether this Portlet is capable of rendering content for link mode.
 void setShowLinkMode(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 setTimeoutMessage(java.lang.String msg)
          Sets the timeout messsage that the portal should use in its response when a request to this Portlet times out.
 void setTitle(java.lang.String title)
          Sets the Portlet title.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultPortlet

public DefaultPortlet()
Null Constructor
Method Detail

init

public void init(Provider p)
Initializes the portlet. Portlets are instantiated by its provider via its null constructor. Following instantiation, providers are expected to call the portlet's init() method.
Parameters:
p - the provider that created this instance.

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.

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.

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 portlets must have a renderer.

getProvider

public Provider getProvider()
Gets the Provider that created this instance.
Returns:
the Provider that creatd this instance.

getDefaultLocale

public java.util.Locale getDefaultLocale()
Gets this Portlet's default locale. The default locale can be declared in the provider.xml file: en.US. The Locale is specified using the standard ISO 2 letter language and country codes. If not specified in provider.xml (or code) the VMs default locale is returned.

getResourceBundle

public java.util.ResourceBundle getResourceBundle(java.util.Locale l)
Gets the string resource (bundle) for this Portlet.
Parameters:
l - the Locale of the resource bundle being requested.
Returns:
the string resource (bundle) for this Portlet. null if there isn't one.

setResource

public void setResource(java.lang.String resourceClassName)
Sets the name of the default resource bundle class for this Portlet
Parameters:
resourceClassName - full name of class extending ResourceBundle.

getName

public java.lang.String getName(java.util.Locale l)
Gets the Portlet name.
Parameters:
l - the Locale (language) the requested name should be retrieved/returned in.
Returns:
the Portlet name. This is the Portlet's non-unique display name.

getId

public long getId()
Gets the Portlet unique ID.
Returns:
the Portlet (unique) ID. Value should be unique with respect to the Provider.

getTitle

public java.lang.String getTitle(java.util.Locale l)
Gets the Portlet title.
Parameters:
l - the Locale (language) the requested title should be retrieved/returned in.
Returns:
the title of this Portlet. This is the name that shows up in a portlet's title bar.

getShortTitle

public java.lang.String getShortTitle(java.util.Locale l)
Gets the Portlet short title.
Parameters:
l - the Locale (language) the requested shorttitle should be retrieved/returned in.
Returns:
the shorttitle of this Portlet. This is the name used when real estate is at a premium such as when rendering a mobile link.

getDescription

public java.lang.String getDescription(java.util.Locale l)
Gets the Portlet description.
Parameters:
l - the Locale (language) the requested description should be retrieved/returned in.
Returns:
a short description of what this portlet is. Displayed at design-time along with the name and thumbnail image when a user is choosing to add a portlet to a page.

getInputParameters

public PortletParameter[] getInputParameters()
Gets an array of (input) parameters that this portlet recognizes when requested to render to control/affect the rendering.
Returns:
array of PortletParameters.

getAcceptContentTypes

public java.lang.String[] getAcceptContentTypes()
Gets an array of mime-types (represented as Strings) that this Portlet can render. For example {"text/html", "text/xml"}.
Returns:
array containing a list of mime-types.

getTimeout

public int getTimeout()
Gets the number of seconds the portal should wait before timing out a request to this portlet.
Returns:
timeout period in seconds.

getTimeoutMessage

public java.lang.String getTimeoutMessage(java.util.Locale l)
Gets the timeout messsage that the portal should use in its response when a request to this Portlet times out.
Parameters:
l - the Locale (language) the requested timeout message should be retrieved/returned in.
Returns:
Timeout message.

hasShowEdit

public boolean hasShowEdit()
Returns true if this Portlet supports per user personalization, false otherwise.
Returns:
returns true if this Portlet supports per user personalization, false otherwise.

getShowEditToPublic

public boolean getShowEditToPublic()
Returns true if this Portlet exposes per user personalization to the public (non-logged in) user. The default for portlets is false. In general allowing the public user to personalize a portlet is a bad idea as the personalization is seen by all public users. Instead it is recommended that controlled users be allowed to edit the portlet's defaults which are then exposed through to the public users (and any other user that doesn't personalize the portlet).
Returns:
returns true if this Portlet exposes per user personalization to the public (non-logged in) user, false otherwise.

hasShowEditDefault

public boolean hasShowEditDefault()
Returns true if this Portlet supports per portlet customization, false otherwise. 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).
Returns:
returns true if this Portlet supports per portlet customization, false otherwise.

hasShowPreview

public boolean hasShowPreview()
Returns true if this Portlet is capable of displaying a design-time preview of itself (after customization or personalization). Returns false otherwise.
Returns:
returns true if this Portlet is capable of displaying a design-time preview of itself (after customization or personalization). Returns false otherwise.

hasShowDetails

public boolean hasShowDetails()
Return returns true if this Portlet is capable of displaying a full-screen (detailed) version of itself.
Returns:
returns true if this Portlet is capable of displaying a full-screen (detailed) version of itself.

hasHelp

public boolean hasHelp()
Return returns true if this Portlet is capable of displaying help information.
Returns:
returns true if this Portlet is capable of displaying help information.

hasAbout

public boolean hasAbout()
Return returns true if this Portlet is capable of displaying about information.
Returns:
returns true if this Portlet is capable of displaying about information.

hasShowLinkMode

public boolean hasShowLinkMode()
Deprecated. as of iAS 9.0.1 this is deprecated for hasShowLink()

Returns true if this Portlet is capable of rendering content for link mode.

Description copied from interface: MobilePortlet
Returns true if this Portlet is capable of rendering content for link mode.
Returns:
returns true if this Portlet is capable of rendering content for link mode.

hasShowLink

public boolean hasShowLink()
Returns true if this Portlet is capable of rendering content for link mode.
Returns:
returns true if this Portlet is capable of rendering content for link mode.

callIsRunnable

public boolean callIsRunnable()
Returns true if calls to isPortletRunnable should be made to this Portlet before displaying in the portlet repository. If false, the portlet is treated as a public portlet visible to all users.
Returns:
returns true if calls to isPortletRunnable should be made to this Portlet.

callGetPortlet

public boolean callGetPortlet()
Returns true if calls to retrieve this Portlet's meta data should be made. before displaying in the portlet repository. If false, the default meta data will be displayed for all users.
Returns:
returns true if calls to retrieve this Portlet's meta data should be made.

getMobileFlags

public MobileFlags getMobileFlags()
Returns the portlet's mobile settings as a bitwise flag. The flags values are defined in the interface MobileFlags.
Returns:
the portlet's mobile setting in a bitwise flag

setSecurityManager

public void setSecurityManager(java.lang.Object mgr)
                        throws PortletException
Sets the Portlet security manager.
Parameters:
mgr - Object implementing the PortletSecurityManager interface.
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 - Object implementing the PortletPersonalizationManager interface.
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 - Object implementing the PortletRenderer interface.
Throws:
PortletException - if the given Object is not a valid PortletRenderer

setName

public void setName(java.lang.String name)
Sets the Portlet name.
Parameters:
name - the Portlet name. This is the Portlet's non-unique display name.

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.

setTitle

public void setTitle(java.lang.String title)
Sets the Portlet title.
Parameters:
title - the title of this Portlet. This is the name that shows up in a portlet's title bar.

setShortTitle

public void setShortTitle(java.lang.String title)
Sets the Portlet short title.
Parameters:
sthe - short title of this Portlet. This is the name used when real estate is at a premium such as when rendering a mobile link.

setDescription

public void setDescription(java.lang.String description)
Sets the Portlet description.
Parameters:
description - a short description of what this portlet is. Displayed at design-time along with the name and thumbnail image when a user is choosing to add a portlet to a page.

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 - Object implementing the PortletParameter interface.
Throws:
PortletException - if the given Object is not a valid PortletParameter

addAcceptContentType

public void addAcceptContentType(java.lang.String type)
Adds to the set of mime-types (represented as Strings) that this Portlet can render.
Parameters:
type - mime-type String, e.g. "text/html" or "text/xml".

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.

setTimeoutMessage

public void setTimeoutMessage(java.lang.String msg)
Sets the timeout messsage that the portal should use in its response when a request to this Portlet times out.
Parameters:
msg - timeout message.

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 setMinEditAuthLevel()

Controls whether this Portlet exposes per user personalization to the public non-logged in user.
Parameters:
canEdit - String representation of boolean value. Should be "true" if this Portlet exposes per user personalization to the public non-logged in user, "false" otherwise.

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
Parameters:
lang - a String specifying a Locale, in the form "language.country".

setShowLinkMode

public void setShowLinkMode(boolean value)
Deprecated. as of iAS 9.0.1 this is deprecated for setShowLink()

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

Description copied from interface: MutableMobilePortlet
Controls whether this Portlet is capable of rendering content for link mode.
Parameters:
value - boolean flag.

setShowLinkMode

public void setShowLinkMode(java.lang.String value)
Deprecated. as of iAS 9.0.1 this is deprecated for setShowLink()

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

Description copied from interface: MutableMobilePortlet
Controls whether this Portlet is capable of rendering content for link mode.
Parameters:
value - String representing a boolean.

setShowLink

public void setShowLink(boolean value)
Controls whether this Portlet is capable of rendering content for link mode.
Parameters:
value - boolean flag.

setShowLink

public void setShowLink(java.lang.String value)
Controls whether this Portlet is capable of rendering content for link mode.
Parameters:
value - String representing a boolean.

setCallIsRunnable

public void setCallIsRunnable(boolean value)
Controls whether calls to isPortletRunnable should be made to this Portlet before displaying in the portlet repository. If false, the portlet is treated as a public portlet visible to all users.
Parameters:
value - boolean flag.

setCallIsRunnable

public void setCallIsRunnable(java.lang.String value)
Controls whether calls to isPortletRunnable should be made to this Portlet before displaying in the portlet repository. If false, the portlet is treated as a public portlet visible to all users.
Parameters:
value - String representing a boolean.

setCallGetPortlet

public void setCallGetPortlet(boolean value)
Controls whether calls to retrieve this Portlet's meta data should be made before displaying in the portlet repository. If false, the default meta data will be displayed for all users.
Parameters:
value - boolean flag.

setCallGetPortlet

public void setCallGetPortlet(java.lang.String value)
Controls whether calls to retrieve this Portlet's meta data should be made before displaying in the portlet repository. If false, the default meta data will be displayed for all users.
Parameters:
value - String representing a boolean.

setMobileFlags

public void setMobileFlags(long flags)
Sets the portlet's mobile settings. The flags values are defined in the MobileFlags inteface.
Parameters:
the - portlet's mobile setting in a bitwise flag

setMobileFlags

public void setMobileFlags(java.lang.String flags)
                    throws java.lang.IllegalArgumentException
Sets the portlet's mobile settings. The flags values are defined by the MobileFlags interface. 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 | EXTERNAL_SHOW" is the same as passing the string "3" to the method.
Parameters:
the - portlet's mobile setting in a bitwise flag

getMinEditAuthLevel

public int getMinEditAuthLevel()
Returns the minimum user authentication level required for the customize link to be displayed in the portlet header If the authentication level of a user is less than the minimum authentication level specified, the customize link will not be displayed in the portlet header.
Specified by:
getMinEditAuthLevel in interface PortletXtra3
Returns:
the min. authentication level required to edit the portlet.

setMinEditAuthLevel

public void setMinEditAuthLevel(java.lang.String authLevel)
                         throws PortletException
Sets the minimum user authentication level required for the customize link to be displayed in the portlet header If the authentication level of a user is less than the minimum authentication level specified, the customize link will not be displayed in the portlet header.
Specified by:
setMinEditAuthLevel in interface MutablePortletXtra3
Parameters:
authLevel - minimum authentication level. Possible values are "PUBLIC", "WEAK", "STRONG"

getContainerRenderer

public PortletContainerRenderer getContainerRenderer()
Returns 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
Specified by:
getContainerRenderer in interface PortletXtra3
Returns:
the portlet container renderer that should be used to render the container for this portlet

setContainerRenderer

public void setContainerRenderer(PortletContainerRenderer 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
Specified by:
setContainerRenderer in interface MutablePortletXtra3
Parameters:
renderer - the portlet container renderer

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
Specified by:
setContainerRenderer in interface MutablePortletXtra3
Parameters:
renderer - the portlet container renderer. Even though the type of the parameter is Object, the parameter must be an instance of PortletContainerRenderer