|
Oracle Fusion Middleware Java API Reference for Oracle PDK Java 11g Release 1 (11.1.1) E10691-01 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object oracle.portal.provider.v2.PortletDefinition oracle.portal.provider.v2.DefaultPortletDefinition
public class DefaultPortletDefinition
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 |
setCipherManager(java.lang.Object cipherManager)
Sets the the CipherManager
which will be employed to encrypt exported data and decrypt imported
data. |
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 java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultPortletDefinition()
Method Detail |
---|
public void preInitialize(java.lang.Object parent) throws NodeHandlerException
DefaultPortletDefinition
to associate it with its parent
ProviderDefinition
.
preInitialize
in interface InitializableXMLObject
parent
- the parent provider definition object. Sould be a ProviderDefinition
or a subclass.
NodeHandlerException
- if an error occurs while initializing
this application objectpublic void postInitialize()
DefaultPortletDefinition
.
postInitialize
in interface InitializableXMLObject
public void setPortletInstanceClass(java.lang.String className) throws java.lang.ClassNotFoundException
PortletInstance
subclass that implements the
portlet's behaviour.
className
- the fully qualifed name of the PortletInstance
subclass that implements the portlet's behaviour.
java.lang.ClassNotFoundException
public void setId(java.lang.String id) throws PortletException
id
- the Portlet (unique ID). Value should be a String
representation of a long value, unique with respect to the provider.
PortletException
- if the given String does not represent a
valid long
.public void addInputParameter(java.lang.Object parameter) throws PortletException
parameter
- an object representing an input parameter. Should be a
ParameterDefinition
.
PortletException
- if the given Object is not a valid ParameterDefinition
public void addEvent(java.lang.Object event) throws PortletException
event
- an object representing an event. Should be a EventDefinition
.
PortletException
- if the given Object is not a valid EventDefinition
public void setTimeout(java.lang.String timeout) throws PortletException
timeout
- timeout period, as a String representation of an integer
number of seconds.
PortletException
- if the given String does not represent a
valid int
.public void setShowEdit(java.lang.String canEdit)
canEdit
- String representation of boolean value. Should be
"true"
if this portlet is to support per user
personalization, "false"
otherwise.public void setShowEditToPublic(java.lang.String canEditString)
PortletDefinition.setMinEditAuthLevel(java.lang.String)
to specify the minimum
authentication level needed to edit the portlet.
canEditString
- String representation of boolean value. Should be
"true"
if this portlet exposes per user personalization to
the public non-logged in user, "false"
otherwise.public void setShowEditDefault(java.lang.String canEditDefault)
canEditDefault
- String representation of boolean value. Should be
"true"
if this portlet supports per portlet customization, "false"
otherwise.public void setShowPreview(java.lang.String canPreview)
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.public void setShowDetails(java.lang.String hasDetails)
hasDetails
- String representation of boolean value. Should be
"true"
if this portlet is capable of displaying a "detailed" mode, or
"false"
otherwise.public void setHasHelp(java.lang.String hasHelp)
hasHelp
- String representation of boolean value. Should be "true"
if this portlet is capable of displaying a help information, or "false"
otherwise.public void setHasAbout(java.lang.String hasAbout)
hasAbout
- String representation of boolean value. Should be "true"
if this portlet is capable of displaying about information, or "false"
otherwise.public void setDefaultLocale(java.lang.String lang)
en.US
.
lang
- a String specifying a Localepublic void setShowLink(java.lang.String value)
value
- String representation of boolean value. Should be
"true"
if this portlet is capable of rendering content for
link mode, "false"
otherwise.public void setCallIsRunnable(java.lang.String value)
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.
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.public void setCallGetPortlet(java.lang.String value)
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.public void setPassAllUrlParams(java.lang.String value)
value
- String representation of boolean value.
"true"
, then the portlet will receive all the
(non-system) parameters from the page URL."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.public void setCacheLevel(java.lang.String cacheLevel) throws PortletException
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.
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:
PortletException
public void setRewriteUrls(java.lang.String rewriteUrls)
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.
rewriteUrls
- String "true" if URL rewriting is to be performed.
Otherwise "false".public void setMobileFlags(java.lang.String flags) throws java.lang.IllegalArgumentException
MobileFlags
class for the possible
flags and their String names.
flags
- the portlet's mobile flags expressed as a String.
java.lang.IllegalArgumentException
public void setLocalePersonalizationLevel(java.lang.String value) throws PortletException
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.
value
- the string representation of the locale personalization
level.
PortletException
- if the value is not recognized.public void setContainerRenderer(java.lang.Object renderer) throws PortletException
The container renderer is responsible for rendering the portlet container in each of the show modes the portlet supports.
renderer
- the portlet container renderer. Even though the type of
the parameter is Object, the parameter must be an instance of PortletContainerRenderer
.
PortletException
- if the given object is not a valid
PortletContainerRenderer
.public PortletSecurityManager getSecurityManager()
null
otherwise.public PortletPersonalizationManager getPersonalizationManager()
null
otherwise.public PortletRenderer getRenderer()
DefaultPortletDefinition
s must have a renderer.
public void setSecurityManager(java.lang.Object mgr) throws PortletException
mgr
- the portlet security manager. Should be a PortletSecurityManager
.
PortletException
- if the given Object is not a valid PortletSecurityManager
public void setPersonalizationManager(java.lang.Object mgr) throws PortletException
mgr
- the personalization manager. Should be a PortletPersonalizationManager
.
PortletException
- if the given Object is not a valid PortletPersonalizationManager
public void setRenderer(java.lang.Object renderer) throws PortletException
renderer
- the renderer. Should be a PortletRenderer
.
PortletException
- if the given Object is not a valid PortletRenderer
public void setCipherManager(java.lang.Object cipherManager) throws PortletException
CipherManager
which will be employed to encrypt exported data and decrypt imported
data. A null value indicates that exported data will not be encrypted.
The PortletDefinition
level cipher manager overides any set at
ProviderDefinition
level.
cipherManager
- an object of type CipherManager
which will be
employed to encrypt exported data and decrypt imported data.
PortletException
public void register(ProviderInstance pi) throws java.io.IOException, AccessControlException
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.
register
in class PortletDefinition
java.io.IOException
AccessControlException
public void deregister(ProviderInstance pi) throws java.io.IOException, AccessControlException
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.
deregister
in class PortletDefinition
java.io.IOException
AccessControlException
public boolean hasAccess(ProviderInstance pi, ProviderUser user)
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.
hasAccess
in class PortletDefinition
user
- the current user we are being asked to authorize.
true
is this user is authorized to access this
portlet.public void setPortletBuilder(java.lang.Object portletBuilder) throws PortletException
portletBuilder
- the PortletBuilder attribute for this Portlet
PortletException
- if the given Object is not a valid BuilderMetaData
.public void validate(java.lang.String context, ValidationError errors)
DefaultPortletDefinition
instance. Errors found are
reported using the supplied ValidationError
instance.
validate
in interface Validateable
validate
in class PortletDefinition
context
- The context of the calling instance.errors
- The current list of errors.
|
Oracle Fusion Middleware Java API Reference for Oracle PDK Java 11g Release 1 (11.1.1) E10691-01 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |