|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--oracle.portal.provider.v1.http.DefaultProvider
The DefaultProvider is the JPDKs base implementation class for the Provider interface. It not only implements default/common behaviors for the Provider's method, but as importantly, is responsible for bootstrapping all the portlets and their components. This later function is managed by processing the provider.xml file which describes the characteristics of each portlet managed by this provider.
When the DefaultProvider is instantiated by the HttpProvider servlet, the instance processes the provider.xml file. For each portlet (and controller) described in the file, the DefaultProvider creates the instance and pushes the corresponding meta and configuration data.
| Constructor Summary | |
DefaultProvider()
|
|
| Method Summary | |
void |
addPortlet(java.lang.Object portlet)
Called during the processing of provider.xml to associate a portlet as a child of this provider. |
void |
deregister()
Deregister this provider. |
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. |
int |
getDebugLevel()
Returns the current debug level. |
Portlet |
getPortlet(long id,
ProviderUser user)
Returns the Portlet with the given ID. |
Portlet[] |
getPortlets(int start,
int count,
boolean byUser,
ProviderUser user)
Returns array of Portlets managed by this Provider. |
ParameterMap |
getProviderContext()
Gets the ParameterMap which contains the
Provider's contextual information. |
long |
getProviderId()
Returns this provider's ID. |
ProviderLog |
getProviderLog()
Returns the ProviderLog associated with this Provider. |
java.lang.String |
getProviderRepositoryPath()
Gets the default storage path used for meta data associated with this provider, if any |
ProviderSubscriber |
getSubscriber()
Returns the subscriber for this portal. |
boolean |
getUseOldStyleHeaders()
Deprecated. use get/setContainerRenderer() to specify the default container renderer that should be used to render portlet containers for this provider |
int |
getVersion()
Provider's version -- version of the PDK API it implements |
void |
init(long providerId,
ProviderLog logger)
Initialize the provider. |
void |
init(ParameterMap param)
Performs the steps necessary to fully initialize this DefaultProvider. |
java.lang.Object[] |
initSession(ProviderUser user)
Deprecated. As of Portal 3.0.8 use initSession that receives the externalApp parameter. |
java.lang.Object[] |
initSession(ProviderUser user,
ExternalPrincipal externalApp)
Called to initialize the Provider in a particular user session. |
boolean |
isDebugEnabled()
Returns true if debug mode is enabled. |
boolean |
isReloadRequired(int action)
Used to determine if this provider needs to be re-initialized from the provider.xml file. |
void |
log(java.lang.String msg)
Writes the specified message to a provider log, which is usually an event log. |
void |
log(java.lang.String message,
java.lang.Throwable throwable)
Writes the stack trace and an explanatory message for a given Throwable exception
to the provider log file. |
ProviderSubscriber |
register(java.lang.String subscriberId,
java.lang.String portalVersion)
Register this newly created provider. |
void |
setContainerRenderer(java.lang.Object 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 |
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 |
void |
setSession(java.lang.String session)
Controls whether this provider starts a (servlet) session in its initSession(ProviderUser,ExternalPrincipal) method. |
void |
setUseOldStyleHeaders(boolean useOldStyleHeaders)
Deprecated. use setContainerRenderer(new ContainerRenderer306())
to get equivalent behavior. Alternatively, create
your own container renderer by extending
PortletContainerRenderer |
void |
setUseOldStyleHeaders(java.lang.String useOldStyleHeaders)
Deprecated. use setContainerRenderer(new ContainerRenderer306())
to get equivalent behavior. Alternatively, create
your own container renderer by extending
PortletContainerRenderer |
| Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Constructor Detail |
public DefaultProvider()
| Method Detail |
public void init(long providerId,
ProviderLog logger)
throws ProviderException
providerId - the portal provider identifier this instance represents.logger - the system the Provider uses to log error and status messages
to.
public void init(ParameterMap param)
throws ProviderException
DefaultProvider.parameters - a ParameterMap containing all parameters
necessary to initialize the object.public ParameterMap getProviderContext()
ParameterMap which contains the
Provider's contextual information.public void setUseOldStyleHeaders(boolean useOldStyleHeaders)
setContainerRenderer(new ContainerRenderer306())
to get equivalent behavior. Alternatively, create
your own container renderer by extending
PortletContainerRenderer
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 void setUseOldStyleHeaders(java.lang.String useOldStyleHeaders)
setContainerRenderer(new ContainerRenderer306())
to get equivalent behavior. Alternatively, create
your own container renderer by extending
PortletContainerRenderer
useOldStyleHeaders - String representation of boolean ("true" or
"false") indicating which style of form headers and footers should be
rendered by PortletRendererUtil.setUseOldStyleHeaders(boolean)public boolean getUseOldStyleHeaders()
true - render
portal 3.0.6 style headers and footers. false - render new
style headers and footers.
public void addPortlet(java.lang.Object portlet)
throws ProviderException
portlet - portlet to be added to this provider. Should implement
the Portlet interface.Portletpublic void setSession(java.lang.String session)
initSession(ProviderUser,ExternalPrincipal) method.session - String representation of boolean value. Should be "true"
if this provider is to start a session in initSession, or
"false" otherwise.public java.lang.String getProviderRepositoryPath()
public long getProviderId()
public int getVersion()
public ProviderSubscriber getSubscriber()
null.
Subclass and override if you need this behavior.null if this Provider doesn't use/support
subscription.
public ProviderSubscriber register(java.lang.String subscriberId,
java.lang.String portalVersion)
throws ProviderException
In response to this method call, the DefaultProvider enumerates its Portlets and for each Portlet that has a PersonalizationManager, it invokes the PersonalizationManager init(Portlet p) method. This gives the Portlet's PersonalizationManagers the opportunity to do one time initialization.
Recognizing that many providers want a lightweight mechanism for securing the communication between them and the portal, register has an additional optional function. In addition to SSL/HTTPS support, the portal supports a simple key encryption mechanism. In this case, the administrator is expected to receive the encryption key (along with a subscriber id) from the organization providing the service. The subscriber ID and the encryption key are entered when the administrator registers the provider in the portal. All communication between the portal and the provider are encrypted using this key.
The major drawback of this facility is the service provider must provide a mechanism for supplying the key in the first place. When a service provider merely wants a more secure communication link between the portal and itself but doesn't require complete/guaranteed security, we allow the the provider to return the subscriber ID and encryption key from the register method. Though, obviously, this communication occurs in open text and can therefore be compromised, it ensures that all subsequent communication is encrypted, greatly reducing the opportunity for misbehavior.
The DefaultProvider doesn't support using encryption keys. Hence it always
returns null. Subclass and override to add this behavior.
subscriberId - Provider defined key customer supplies when the provider
is registered in the portal. It is expected the Provider will use this
key information to help provision this instance.portalVersion - the version number of the portal you are being registered with.null should be returned if the encryption key is entered by the
administrator when registering the Provider or encryption isn't used. Currently,
the DefaultProvider doesn't implement encryption support, hence always returns null.
public void deregister()
throws ProviderException
public java.lang.Object[] initSession(ProviderUser user,
ExternalPrincipal externalApp)
throws ProviderException
A session is established via the ProviderUser user object. I.e. the
user object contains the methods for creating and retrieving a
session. For HttpProviders, further HTTP-specific information can be
accessed by casting the user object to a ServletProviderUser. In particular,
this allows access to any existing Cookies already established between
the user and provider, via the ServletProviderUser.getCookies()
method.
As this interface is designed for use in both servlet and non-serlvet environments servlet interfaces could not be used. initSession returns an array of cookie objects of the type expected in the particular framework the provider is executing in. For HttpProviders this is servlets and hence the returned object array should contain objects of type javax.servlet.http.Cookie.
Note: in order to support backwards compatibility for providers that
subclass the DefaultProvider and override initSession(),
the current implementation of this method merely turns around and calls
the old deprecated form of initSession(). This ensures
that subclasses with existing overrides continue to work unchanged. If
you have implemented such a subclass consider this when you "upgrade"
to the new form of initSession(). I.e. if your
initSession() (new form) calls super()
remember this will in turn call the old form of
initSession(). If you haven't removed your old form or
modified its implementation your code could redo/overwrite work you
have already done in the new form of initSession. Our
recommendation is to remove your existing (old form)
initSession() when upgrading to the new form. This means
all will continue to work correctly when we remove the deprecated old
form in the future.
user - Current portal user.externalApp - External Application information (if it exists).
public java.lang.Object[] initSession(ProviderUser user)
throws ProviderException
A session is established via the user object. I.e. the user object contains the methods for creating and retrieving a session.
As this interface is designed for use in both servlet and non-serlvet environments servlet interfaces could not be used. initSession returns an array of cookie objects of the type expected in the particular framework the provider is executing in. For HttpProviders this is servlets and hence the returned object array should contain object of type javax.servlet.http.Cookie.
user - Current portal user.
public Portlet[] getPortlets(int start,
int count,
boolean byUser,
ProviderUser user)
throws ProviderException
start and count.
Providers should return only count Portlets starting at start.
If there are fewer then count Portlets then a shorter array is
returned.
The Portlets returned by getPortlets() are constrained to those the user
is authorized to access if byUser is true.
The DefaultProvider implements these semantics based on the set of portlets registered with it via the provider.xml descriptor file.
start - The ordinal of the first portlet that should be returned.count - The maximum number of portlets that should be returned.byUser - If true, indicates the returned list is constrained to those
portlets the user is authorized to access.user - The current user on whose behalf the request is being made.
public Portlet getPortlet(long id,
ProviderUser user)
throws ProviderException
The DefaultProvider implements this semantic based on the set of portlets registered with it via the provider.xml descriptor file.
id - Portlet Id.user - Current user.null if no portlet
matches that Id or if the user isn't authorized to access the portlet.public void log(java.lang.String msg)
msg - a String specifying the explanatory
message to be written to the log file
public void log(java.lang.String message,
java.lang.Throwable throwable)
Throwable exception
to the provider log file. The stack trace is
part of the Throwable object, and
the message is the one you specify in the message
parameter. The name and type of the provider log file is specific to
the provider engine, but it is usually an event log.message - a String that
describes the error or exceptionthrowable - the Throwable error
or exceptionpublic PortletContainerRenderer getContainerRenderer()
public void setContainerRenderer(PortletContainerRenderer renderer)
throws ProviderException
renderer - the portlet container renderer
public void setContainerRenderer(java.lang.Object renderer)
throws ProviderException
renderer - the default portlet container renderer. Even though the
type of the parameter is Object, the parameter must be an
instance of PortletContainerRendererpublic boolean isReloadRequired(int action)
The mechanism used should work when providers are load-balanced. This means it cannot be drived by communication from the portal such as a repository refresh (as it used to be) because only one server will receive the refresh request and reloaded the definition. This leads to the servers being out of sync.
The simplest way to do this is to trigger reload (or at least a modification check) on a time interval.
This feature requires auto-reload to be enabled.action - not currently usedpublic boolean isDebugEnabled()
public int getDebugLevel()
public ProviderLog getProviderLog()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||