The portal framework provides instances of subclasses of PresentationContext
during portal rendering, actions, and in backing files. PresentationContext subclasses are used to
represent portal framework components during the portal's rendering phase and are almost exclusively read
only (the exception being the setVisible method to allow fine-grained rendering of components in
skeleton files). PresentationContext subclasses are primarily targeted for use by skeleton JSPs in
portal look and feel implementations.

getTagName

Get the tag name of the component this context represents. The tag name is a short name used to identify the
component of the form namespace:tagname, where the namespace corresponds to the parent package
in which the context is defined (e.g. a book's full tag name would be page:book).

Returns

The tag name of the component this context represents; this should never be null

getResolvedLocale

Returns the Locale associated with the best matching
portal component resource based on user request locale preferences.
If no information is available about the matching Locale, the default
locale as specified in netuix-config.xml is returned.
This method is most useful for portlets and JSPs included by portlets.

Note that in streaming mode, the resolved locale for a portlet is
always the default locale, since the portlet is disassembled from the
default locale portal and inlined for requests.

getPropertyAsInt

Get a property of the underlying component, using the specified default if
none exists. The key argument should not be null. This is
a convenience method that attempts a conversion of the value from a
String to an int. Failure during conversion or the key being null
causes the default value to be returned.

Parameters

key - The property key

defaultValue - The value to use if no value is found for the specified key

Returns

The value associated with the specified key, if it exists, or the default

getPropertyAsBoolean

Get a property of the underlying component, using the specified default if
none exists. The key argument should not be null. This is
a convenience method that attempts a conversion of the value from a
String to a boolean. Failure during conversion causes a
value of false to be returned. The default value is used
if the key lookup in the properties instance returned null
or if the key itself was null.

Parameters

key - The property key

defaultValue - The value to use if no value is found for the specified key

Returns

The value associated with the specified key, if it exists, or the default

getChildren

Returns a list of PresentationContext children of this context, if any, narrowed by by the specified
tag name. If no children exist for that tag name, an empty list is returned. Elements of the list are all
descendants of the type PresentationContext. The returned list is for immediate children only --
there is no recursion into childrens' children. This list is unmodifiable.

Parameters

tagName - The namespace-qualified tag name namespace:tagname

Returns

The list of all immediate children with the given tag name

getChildren

Returns a list of PresentationContext children of this context, if any. If no children exist, an
empty list is returned. Elements of the list are all descendants of the type PresentationContext,
and are returned with like elements grouped together, but otherwise in no particular order. The returned list is
for immediate children only -- there is no recursion into childrens' children.

Note, this list is modifiable! Avoid mutating the list (or at least use caution if you do).

getOrderedChildren

Returns a list of PresentationContext children of this context, if any, in the order that they are
specified in the portal tree hierarchy. Elements of the list are all descendants of the type
PresentationContext. The returned list is for immediate children only -- there is no recursion
into childrens' children.

Note, this list is modifiable! Avoid mutating the list (or at least use caution if you do).

Returns

The list of all immediate children in hierarchical order, or an empty list if no children exist

setVisible

Set the visibility state of the component. Setting the state to false
will cause the beginRender and endRender methods to
not be called during the render lifecycle stage.

Parameters

visible - The boolean value to set the visibility state

isVisible

public boolean isVisible()

Tests whether or not the component represented by this context is visible, and therefore whether or not it should
be rendered. Typically, this is only important to the renderer and not the skeletons using this context.

Returns

The true if visible

getRenderFormat

Returns the currently configured render format information detailing the format in which the portal will be
rendered for the current request. Checking this information allows skeleton files and content areas to
attempt to tailor their rendered output to the overall doctype of the rendered portal.

Returns

A RenderFormat instance describing the current request's output format

addCookie

public void addCookie(javax.servlet.http.Cookie cookie)

Add a cookie on the response, if possible, even if the servlet
specification would normally not allow it to be done.
Normally, the response is committed during the render lifecycle
and adding headers on a response has no effect. In
addition, if this action is done inside a RequestDispatcher.include()
call, the servlet specification does not allow cookies or headers to
be set. However, if the avoid-response-commit setting in the
WEB-INF/wlp-framework-common-config.xml file is "true"
this method will add a cookie on the underlying response, even
if RequestDispatcher.include() has been used, so long as the
underlying response has not been committed.
In addition, in portlets rendering on the producer in WSRP,
this method will work during the getMarkup phase (render lifecycle)
for adding cookies if a RequestDispatcher.include() is being used,
as long as the underlying response has not been committed.
(Note that in a WSRP portlet on the producer, the cookies
set will be on the WSRP SOAP response and it is up to the consumer
whether they make it to the client or not.)
If the underlying response is already committed, this method will
have no effect. If the avoid-response-commit setting is
false or unset, this method will add the
cookie on the response, but it most likely will not make it
to the underlying response.

addDateHeader

Add a header on the response, if possible, even if the servlet
specification would normally not allow it to be done.
Normally, the response is committed during the render lifecycle
and adding headers on a response has no effect. In
addition, if this action is done inside a RequestDispatcher.include()
call, the servlet specification does not allow cookies or headers to
be set. However, if the avoid-response-commit setting in the
WEB-INF/wlp-framework-common-config.xml file is "true"
this method will add the header on the underlying response, even
if RequestDispatcher.include() has been used, so long as the
underlying response has not been committed.
In addition, in portlets rendering on the producer in WSRP,
this method will work during the getMarkup phase (render lifecycle)
for adding headers if a RequestDispatcher.include() is being used,
as long as the underlying response has not been committed.
(Note that in a WSRP portlet on the producer, the headers
set will be on the WSRP SOAP response and it is up to the consumer
whether they make it to the client or not.)
If the underlying response is already committed, this method will
have no effect. If the avoid-response-commit setting is
false or unset, this method will add the
header on the response, but it most likely will not make it
to the underlying response.

addHeader

Add a header on the response, if possible, even if the servlet
specification would normally not allow it to be done.
Normally, the response is committed during the render lifecycle
and adding headers on a response has no effect. In
addition, if this action is done inside a RequestDispatcher.include()
call, the servlet specification does not allow cookies or headers to
be set. However, if the avoid-response-commit setting in the
WEB-INF/wlp-framework-common-config.xml file is "true"
this method will add the header on the underlying response, even
if RequestDispatcher.include() has been used, so long as the
underlying response has not been committed.
In addition, in portlets rendering on the producer in WSRP,
this method will work during the getMarkup phase (render lifecycle)
for adding headers if a RequestDispatcher.include() is being used,
as long as the underlying response has not been committed.
(Note that in a WSRP portlet on the producer, the headers
set will be on the WSRP SOAP response and it is up to the consumer
whether they make it to the client or not.)
If the underlying response is already committed, this method will
have no effect. If the avoid-response-commit setting is
false or unset, this method will add the
header on the response, but it most likely will not make it
to the underlying response.

addIntHeader

Add a header on the response, if possible, even if the servlet
specification would normally not allow it to be done.
Normally, the response is committed during the render lifecycle
and adding headers on a response has no effect. In
addition, if this action is done inside a RequestDispatcher.include()
call, the servlet specification does not allow cookies or headers to
be set. However, if the avoid-response-commit setting in the
WEB-INF/wlp-framework-common-config.xml file is "true"
this method will add the header on the underlying response, even
if RequestDispatcher.include() has been used, so long as the
underlying response has not been committed.
In addition, in portlets rendering on the producer in WSRP,
this method will work during the getMarkup phase (render lifecycle)
for adding headers if a RequestDispatcher.include() is being used,
as long as the underlying response has not been committed.
(Note that in a WSRP portlet on the producer, the headers
set will be on the WSRP SOAP response and it is up to the consumer
whether they make it to the client or not.)
If the underlying response is already committed, this method will
have no effect. If the avoid-response-commit setting is
false or unset, this method will add the
header on the response, but it most likely will not make it
to the underlying response.

setCharacterEncoding

Set the charset in the Content-Type header on the response, if possible, even if the servlet
specification would normally not allow it to be done.
Normally, the response is committed during the render lifecycle
and adding headers on a response has no effect. In
addition, if this action is done inside a RequestDispatcher.include()
call, the servlet specification does not allow cookies or headers to
be set. However, if the avoid-response-commit setting in the
WEB-INF/wlp-framework-common-config.xml file is "true"
this method will add the header on the underlying response, even
if RequestDispatcher.include() has been used, so long as the
underlying response has not been committed.
In addition, in portlets rendering on the producer in WSRP,
this method will work during the getMarkup phase (render lifecycle)
for adding headers if a RequestDispatcher.include() is being used,
as long as the underlying response has not been committed.
(Note that in a WSRP portlet on the producer, the headers
set will be on the WSRP SOAP response and it is up to the consumer
whether they make it to the client or not.)
If the underlying response is already committed, this method will
have no effect. If the avoid-response-commit setting is
false or unset, this method will add the
header on the response, but it most likely will not make it
to the underlying response.

setContentType

Set the Content-Type header on the response, if possible, even if the servlet
specification would normally not allow it to be done.
Normally, the response is committed during the render lifecycle
and adding headers on a response has no effect. In
addition, if this action is done inside a RequestDispatcher.include()
call, the servlet specification does not allow cookies or headers to
be set. However, if the avoid-response-commit setting in the
WEB-INF/wlp-framework-common-config.xml file is "true"
this method will add the header on the underlying response, even
if RequestDispatcher.include() has been used, so long as the
underlying response has not been committed.
In addition, in portlets rendering on the producer in WSRP,
this method will work during the getMarkup phase (render lifecycle)
for adding headers if a RequestDispatcher.include() is being used,
as long as the underlying response has not been committed.
(Note that in a WSRP portlet on the producer, the headers
set will be on the WSRP SOAP response and it is up to the consumer
whether they make it to the client or not.)
If the underlying response is already committed, this method will
have no effect. If the avoid-response-commit setting is
false or unset, this method will add the
header on the response, but it most likely will not make it
to the underlying response.