|
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.render.ManagedRenderer oracle.portal.provider.v2.render.http.BaseManagedRenderer oracle.portal.provider.v2.webservice.WebServiceRenderer
public abstract class WebServiceRenderer
WebServiceRenderer
is the base class for web service enabled
renderers. A WebServiceRenderer
is responsible for invoking a
web service and presenting its results as a portlet. Parameters in the
request to the web service can be bound to any of the following sources:
WebServiceRenderer.ConstParam
)WebServiceRenderer.RequestParam
)WebServiceRenderer.URLParam
)WebServiceRenderer.SessionAttrib
)NameValuePersonalizationObject
(see WebServiceRenderer.EditData
)literal
property, when
the request to the web service is a literal XML structure, or through
properties in a subclass (e.g. the param
property on RPCWebServiceRenderer
).
The transformation from web service response to portlet response is
controlled by an XSL stylesheet, named by the responseXSL
property. Although, this file must be specified, it need not exist,
since a default stylesheet is generated based on the parameter bindings if
one does not exist.
A WebServiceRenderer
supports an XML logging feature, where XML
documents corresponding to various stages in the renderering process are
dumped to the filesystem to help debugging. The feature is controlled by the
logging
boolean property. When activated, one or more XML
documents are dumped to the directory named by the
loggingDirectory
property if it is set, or the provider
'repository path' otherwise (usually the same directory as the XML provider
definition). Each document has a filename that has the portlet instance name
as a prefix, and one of the following suffixes
_literal.xml
: A dump of the instantiated literal XML
structure which was sent to the web service. This is only written when the
web service arguments are defined with the literal
property._request.xml
: A snapshot of the combined response document
before the web service was invoked. This helps when validating that all the
correct arguments are being passed._response.xml
: A snapshot of the combined response document
after the web service has been invoked and its response has been added. This
is the XML document to which the stylesheet is applied. If this document is
missing, it probably means that an exception occurred when calling the web
service. You should check application.log
to find a log of all
the exceptions that occurred.renderBody(oracle.portal.provider.v2.render.PortletRenderRequest)
method.
Nested Class Summary | |
---|---|
static class |
WebServiceRenderer.ConstParam
Class representing a parameter bound to a constant value |
static class |
WebServiceRenderer.DefaultableParameterBinding
Superclass for ParameterBinding s that can have a default
value. |
static class |
WebServiceRenderer.EditData
Class representing a parameter bound to an item of customization data from a NameValuePersonalizationObject . |
static class |
WebServiceRenderer.ParameterBinding
Base class for objects representing a parameter in the request to the web service to that can be 'bound' to a variety of sources. |
static class |
WebServiceRenderer.PromptedBinding
Base class for objects representing a prompt in the request to the web service to that is used show prompt in edit mode. |
static class |
WebServiceRenderer.RequestParam
Class representing a parameter bound to an item of data in the current WebServiceRenderRequest . |
static class |
WebServiceRenderer.SessionAttrib
Class representing a parameter bound to an item of session data in the ProviderSession . |
static class |
WebServiceRenderer.URLParam
Class representing a parameter bound to the value of a parmeter in the query string of the request to the provider. |
Constructor Summary | |
---|---|
WebServiceRenderer()
|
Method Summary | |
---|---|
void |
addLiteral(java.lang.Object literal)
Defines the literal XML structure that should be sent in the request to the web service. |
WebServiceRenderer.ParameterBinding[] |
getBindings()
Gets an array of all the ParameterBinding s declared for the
request to the web service. |
boolean |
getEscapeOutput()
Determines whether control characters in the response from the web service (such as '<' and '&') are to be escaped in the portlet response so that they display in HTML. |
LiteralXML |
getLiteral()
Gets an object representing the literal XML structure that should be sent in the request to the web service (if applicable). |
boolean |
getLogging()
Determines whether the XML logging debug feature is activated (see class doc for more information). |
java.lang.String |
getLoggingDirectory(WebServiceRenderRequest wrr)
Gets the directory where files are created by the XML logging debug feature. |
abstract void |
invokeService(WebServiceRenderRequest wrr,
org.w3c.dom.Element docEl)
Determines the values of parameter bindings using the given WebServiceRenderRequest , invokes the web service, and adds
an XML representation of its response to the response XML
document. |
void |
postInitialize()
Performs the extra steps required to initialize and validate a WebServiceRenderer once its properties have been set with
the appropriate accessor methods. |
void |
renderBody(PortletRenderRequest pr)
The main rendering method, responsible for calling the respective mode depending on PortletRenderRequest mode. |
void |
renderEdit(PortletRenderRequest pr)
This method is responsible for displaying a screen that allows customization of the portlet title and parameters bound to edit data. |
void |
renderEditDefaults(PortletRenderRequest pr)
This method is responsible for displaying a screen that allows default (system) customization of the portlet title and parameters to edit data. |
void |
renderLink(PortletRenderRequest pr)
This method is responsible for displaying the portlet in link mode. |
void |
renderShow(PortletRenderRequest pr)
The show mode method, responsible for calling a web service and presenting its results as a portlet. |
void |
setEscapeOutput(java.lang.String escapeOutput)
Controls whether control characters in the response from the web service (such as '<' and '&') are escaped in the portlet response so that they display in HTML. |
void |
setLogging(java.lang.String logging)
Controls whether the XML logging debug feature is activated (see class doc for more information). |
void |
setLoggingDirectory(java.lang.String loggingDirectory)
Sets the directory where files are created by the XML logging debug feature. |
void |
setResponseXSL(java.lang.String responseXSL)
Sets the filename of the XSL stylesheet used to transform the XML result document into a portlet response. |
void |
validate(java.lang.String context,
ValidationError errors)
Validates the internal state of this WebServiceRenderer
instance. |
Methods inherited from class oracle.portal.provider.v2.render.http.BaseManagedRenderer |
---|
addParameter, getContentType, getGeneratesESI, preInitialize, prepareResponse, setContentType, setGeneratesESI, setGeneratesESI, setPageExpires, setPageExpires, setUseInvalidationCaching, setUseInvalidationCaching |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public WebServiceRenderer()
Method Detail |
---|
public void postInitialize() throws NodeHandlerException
WebServiceRenderer
once its properties have been set with
the appropriate accessor methods.
postInitialize
in interface InitializableXMLObject
postInitialize
in class BaseManagedRenderer
NodeHandlerException
- if not all properties have been set
correctlypublic final void setLogging(java.lang.String logging)
logging
- String representation of boolean value. Should be
"true"
if the feature should be activated,
"false"
otherwise.public final boolean getLogging()
true
if the feature is active, false
otherwise.public final void setLoggingDirectory(java.lang.String loggingDirectory) throws PortletException
loggingDirectory
- the name of directory where files are created by
the XML logging debug feature
PortletException
- if a directory with the given name does not
existpublic java.lang.String getLoggingDirectory(WebServiceRenderRequest wrr)
setLoggingDirectory(java.lang.String)
, the provider 'repository path' (usually the same
directory as the XML provider definition) is returned.
wrr
- an object exposing the relevant properties of the current
render request
public final void setEscapeOutput(java.lang.String escapeOutput)
escapeOutput
- String representation of boolean value. Should be
"true"
if control character escaping is to be enabled,
"false"
otherwise.public final boolean getEscapeOutput()
true
if control character escaping is enabled,
false
otherwise.public void setResponseXSL(java.lang.String responseXSL)
responseXSL
- filename of the XSL stylesheet used to transform the
XML result document into a portlet reponsepublic void addLiteral(java.lang.Object literal) throws PortletException
literal
- object representing the literal XML structure that should
be sent in the request to the web service. Should be an instance of
LiteralXML
.
PortletException
- if the given object is not a valid LiteralXML
public LiteralXML getLiteral()
null
if not
applicable.public abstract void invokeService(WebServiceRenderRequest wrr, org.w3c.dom.Element docEl) throws PortletException
WebServiceRenderRequest
, invokes the web service, and adds
an XML representation of its response to the response XML
document. Subclasses should implement.
wrr
- an object exposing the relevant properties of the current
render requestdocEl
- the document element of the XML document to which an XML
representation of the response should be added
PortletException
- if an error occurs.public final WebServiceRenderer.ParameterBinding[] getBindings()
ParameterBinding
s declared for the
request to the web service. These are set up either indirectly through
addLiteral(java.lang.Object)
or directly through a subclass method.
ParameterBinding
s declared for
the request to the web servicepublic void renderBody(PortletRenderRequest pr) throws PortletException
renderShow(oracle.portal.provider.v2.render.PortletRenderRequest)
to render the show mode.renderEdit(oracle.portal.provider.v2.render.PortletRenderRequest)
to render the edit mode.renderEditDefaults(oracle.portal.provider.v2.render.PortletRenderRequest)
to render the edit mode.renderLink(oracle.portal.provider.v2.render.PortletRenderRequest)
to render the link mode.
renderBody
in class ManagedRenderer
pr
- a PortletRenderRequest
PortletException
- if an error occurs while rendereringpublic void renderShow(PortletRenderRequest pr) throws PortletException
WebServiceRenderRequest
from the given
PortletRenderRequest
.invokeService(oracle.portal.provider.v2.webservice.WebServiceRenderRequest, org.w3c.dom.Element)
to send the request to the web service
and add the response to the output XML document.responseXSL
does not yet
exist, generate a default one (that includes HTML form input fields for
all declared WebServiceRenderer.URLParam
s).
pr
- a PortletRenderRequest
PortletException
- if an error occurs while rendereringpublic void renderEdit(PortletRenderRequest pr) throws PortletException
pr
- a PortletRenderRequest
PortletException
- if an error occurs while rendereringpublic void renderLink(PortletRenderRequest pr) throws PortletException
pr
- a PortletRenderRequest
PortletException
- if an error occurs while rendereringpublic void renderEditDefaults(PortletRenderRequest pr) throws PortletException
pr
- a PortletRenderRequest
PortletException
- if an error occurs while rendereringpublic void validate(java.lang.String context, ValidationError errors)
WebServiceRenderer
instance. Errors found are reported using the supplied ValidationError
instance.
validate
in interface Validateable
validate
in class BaseManagedRenderer
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 |