|
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.ProviderDefinition
public class ProviderDefinition
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. |
CipherManager |
getCipherManager()
Gets the the CipherManager
which will be employed to encrypt exported data and decrypt imported
data. |
PortletContainerRenderer |
getContainerRenderer()
Returns the default portlet container renderer. |
java.util.Locale |
getDefaultLocale()
Gets this ProviderDefinition 's default locale. |
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. |
int |
getLocalePersonalizationLevel()
Retrieves the locale personalization level which will be used for portlets whose defintion does not include a portlet specific setting. |
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 |
setCipherManager(CipherManager cipherManager)
Sets the the CipherManager
which will be employed to encrypt exported data and decrypt imported
data. |
void |
setContainerRenderer(PortletContainerRenderer renderer)
Sets the default portlet container renderer. |
void |
setDefaultLocale(java.util.Locale l)
Sets this ProviderDefinition 's default locale. |
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 |
setLocalePersonalizationLevel(int level)
Sets the locale personalization level which will be used for portlets whose defintion does not include a portlet specific setting. |
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 |
---|
public ProviderDefinition()
Method Detail |
---|
public void init(ProviderContext pc)
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
.
pc
- an object describing the deployment environment of the
provider.public ProviderContext getProviderContext()
ProviderContext
.
public java.lang.Class getProviderInstanceClass()
Class
representing the ProviderInstance
class or subclass that implements the provider's behaviour.
Class
representing the ProviderInstance
subclass that implements the provider's behaviour.public void setProviderInstanceClass(java.lang.Class c)
ProviderInstance
subclass that implements the
provider's behaviour.
c
- a Class
representing the ProviderInstance
subclass that implements the provider's behaviour.public void setHasSession(boolean session)
ProviderInstance
starts a (servlet)
session in its ProviderInstance.initSession(oracle.portal.provider.v2.ProviderUser, oracle.portal.provider.v2.externalApp.ExternalPrincipal)
method.
session
- true
if the ProviderInstance is to start a
session in initSession
, or false
otherwise.public boolean getHasSession()
ProviderInstance
will start a (servlet)
session in its ProviderInstance.initSession(oracle.portal.provider.v2.ProviderUser, oracle.portal.provider.v2.externalApp.ExternalPrincipal)
method.
true
if the ProviderInstance will start a session
in initSession
, or false
otherwise.public void setPassAllUrlParams(boolean value)
value
- boolean indicating whether Portal will pass the requested
page's URL parameters to portlets by default.
true
, then each portlet whose definition doesn't
explicitly override this setting will receive all the
(non-system) parameters from the page URL.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.public void setCacheLevel(int cacheLevel) throws ProviderException
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
- 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:
ProviderException
public void setRewriteUrls(boolean rewriteUrls)
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:
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.NameValue[], 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.
rewriteUrls
- boolean true if URL rewriting is to be performed.
Otherwise false.public boolean getPassAllUrlParams()
setPassAllUrlParams(boolean)
public int getCacheLevel()
The portlet setting for cache level takes precedence over the provider setting.
setCacheLevel(int)
public boolean getRewriteUrls()
setRewriteUrls(boolean)
public void setLocalePersonalizationLevel(int level)
PortletDefinition.setLocalePersonalizationLevel(int)
.
level
- the locale personalization level, see
PortletConstants
.public int getLocalePersonalizationLevel()
PortletDefinition.setLocalePersonalizationLevel(int)
.
PortletConstants
.public void setDefaultLocale(java.util.Locale l)
ProviderDefinition
's default locale. This default
locale will be used as the default for all contained portlets which do
not specify an overiding setting. If not set, this will default to the
JVM default locale, see Locale.getDefault()
.
l
- the required default locale.public java.util.Locale getDefaultLocale()
ProviderDefinition
's default locale. This default
locale will be used as the default for all contained portlets which do
not specify an overiding setting. If not set, this will default to the
JVM default locale, see Locale.getDefault()
.
ProviderDefinition
's default locale.public java.util.List getPortletDefinitions()
PortletDefinition
objects
containing the portlet-level meta data for each of the provider's
portlets.
ProviderDefinition
s containing the meta
data for each of the provider's portlets.public void addPortletDefinition(PortletDefinition pd)
PortletDefinition
object
containing the meta data for one of the portlets it owns. Note that each
PortletDefinition
added should have a unique id.
pd
- a ProviderDefinition
containing the portlet-level
meta data for one of the provider's portlets.public PortletDefinition getPortletDefinition(long id)
PortletDefinition
object containing the meta
data for the portlet with the given id.
id
- a long
identifying the portlet within the
provider
ProviderDefinition
containing the portlet-level
meta data for the portlet with the given id, or null
if no
such portlet has been defined.public void addPreferenceStore(PreferenceStore ps)
PreferenceStore
objects that may be used
by the provider for persistent storage. Note that each
PreferenceStore
added should have a unique identifying
name.
ps
- a PreferenceStore
.public void setPrefStoreName(java.lang.String preferenceStoreName) throws PreferenceStoreException
PreferenceStore
that should be used by the
provider and all its child objects for which a preference store has not
been chosen explicitly.
preferenceStoreName
- the name of one of the provider's
PreferenceStore
s, which should have been added with addPreferenceStore(oracle.portal.provider.v2.preference.PreferenceStore)
.
PreferenceStoreException
- if a PreferenceStore
with the given name has not been defined.getPreferenceStore()
public PreferenceStore getPreferenceStore()
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.
PreferenceStore
that should be used by child objects
by default if one has been defined, or null
otherwise.public PreferenceStore getPreferenceStore(java.lang.String preferenceStoreName) throws PreferenceStoreException
PreferenceStore
with the given name.
preferenceStoreName
- name of the PreferenceStore
to
be retrieved, which should have been added with addPreferenceStore(oracle.portal.provider.v2.preference.PreferenceStore)
.
PreferenceStoreException
- if a PreferenceStore
with the given name has not been defined.public void setUseOldStyleHeaders(boolean useOldStyleHeaders)
setContainerRenderer(oracle.portal.provider.v2.render.PortletContainerRenderer)
with ContainerRenderer306
to get equivalent
behavior. Alternatively, create your own container renderer by extending
PortletContainerRenderer
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.
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.public boolean getUseOldStyleHeaders()
getContainerRenderer()
to determine the default
container renderer that should be used to render portlet containers for
this provider
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.
PortletRendererUtil
.true
- render portal 3.0.6 style headers and footers. false
-
render new style headers and footers.public PortletContainerRenderer getContainerRenderer()
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.
setContainerRenderer(oracle.portal.provider.v2.render.PortletContainerRenderer)
, then a DefaultContainerRenderer
object
will ve returned.public void setContainerRenderer(PortletContainerRenderer 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.
renderer
- the portlet container rendererpublic oracle.webdb.provider.v2.builder.BuilderMetaData getProviderBuilder()
public void setProviderBuilder(oracle.webdb.provider.v2.builder.BuilderMetaData builderMetaData)
builderMetaData
- the ProviderBuilder attribute for this Provider
Defintion.public void validate(java.lang.String context, ValidationError errors)
ProviderDefinition
instance. Errors found are reported using the supplied ValidationError
instance.
validate
in interface Validateable
context
- The context of the calling instance.errors
- The current list of errors.public OidManager getOidManager() throws ProviderException
ProviderException
public CipherManager getCipherManager()
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 ProviderDefinition
level cipher manager serves as the
default for all contained portlets.
CipherManager
which will be employed to encrypt exported data and decrypt imported
data.public void setCipherManager(CipherManager cipherManager)
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 ProviderDefinition
level cipher manager serves as the
default for all contained portlets.
cipherManager
- the CipherManager
which will be
employed to encrypt exported data and decrypt imported data.
|
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 |