Top Description Constructors Methods
javax.portlet.filter

public Class HeaderResponseWrapper

extends MimeResponseWrapper
implements HeaderResponse
Class Inheritance
All Implemented Interfaces
javax.portlet.HeaderResponse, javax.portlet.MimeResponse, javax.portlet.PortletResponse
Imports
javax.portlet.HeaderResponse

The HeaderResponseWrapper provides a convenient implementation of the HeaderResponse interface that can be subclassed by developers. This class implements the Wrapper or Decorator pattern. Methods default to calling through to the wrapped Response object.
Since
3.0

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
addDependency(String
the resource name
name
,
String
the resource scope, may be null or empty
scope
,
String
the resource version, may be null or empty
version
)

Implements javax.portlet.HeaderResponse.addDependency.

Adds a dependency on a page-level resource that is managed by the portal.
public void
addDependency(String
the resource name
name
,
String
the resource scope, may be null or empty
scope
,
String
the resource version, may be null or empty
version
,
String
the markup for adding the resource to the page
markup
)

Implements javax.portlet.HeaderResponse.addDependency.

Adds a dependency on a page-level resource that is managed by the portal and adds a resource for addition to the page for the dependency.
public HeaderResponse

Returns:

the wrapped response
getResponse
()

Overrides javax.portlet.filter.MimeResponseWrapper.getResponse.

Return the wrapped response object.
public void
setResponse(HeaderResponse
the response to set
response
)

Sets the response object being wrapped.

public void
setTitle(String
portlet title as text String or resource URI
title
)

Implements javax.portlet.HeaderResponse.setTitle.

This method sets the title of the portlet.
Inherited from javax.portlet.filter.MimeResponseWrapper:
createActionURLcreateActionURLcreateRenderURLcreateRenderURLcreateResourceURLflushBuffergetBufferSizegetCacheControlgetCharacterEncodinggetContentTypegetLocalegetPortletOutputStreamgetWriterisCommittedresetresetBuffersetBufferSizesetContentTypesetResponse

Constructor Detail

HeaderResponseWrapperback to summary
public HeaderResponseWrapper(HeaderResponse response)

Method Detail

addDependencyback to summary
public void addDependency(String name, String scope, String version)

Implements javax.portlet.HeaderResponse.addDependency.

Doc from javax.portlet.HeaderResponse.addDependency.

Adds a dependency on a page-level resource that is managed by the portal.

When a portlet is aggregated onto a page, it may designate resources such as JavaScript files or style sheets that it needs to have on the page in order to operate correctly. These resources typically should be added to the aggregated document head section. Such resources are known as portlet dependencies.

The portal implementation is responsible for adding the portlet dependencies to the page during aggregation. The resources declared as dependencies are typically such that they should be added to the page only a single time, but may be used by multiple portlets.

Portlet dependencies may be configured statically either through annotations or through the portlet deployment descriptor. The resources to satisfy such dependencies will be made available on all pages on which the portlet is rendered.

The dependency added dynamically through this method is added to the statically declared dependencies for the portlet for the current rendering cycle only.

This method should only be used to add portlet dependencies that can potentially be required by or shared with other portlets as well. Strictly private dependencies, such as JavaScript code needed by this portlet only, should be added to to document head section using the PortletResponse#addProperty(String, Element) method or by using either the PrintWriter or OutputStream object obtained through the HeaderResponse.

The manner in which the portal maps the specified name, scope, and version to specific resources is left to the portal implementation.

Parameters
name:String

the resource name

scope:String

the resource scope, may be null or empty

version:String

the resource version, may be null or empty

Annotations
@Override
addDependencyback to summary
public void addDependency(String name, String scope, String version, String markup)

Implements javax.portlet.HeaderResponse.addDependency.

Doc from javax.portlet.HeaderResponse.addDependency.

Adds a dependency on a page-level resource that is managed by the portal and adds a resource for addition to the page for the dependency.

See addDependency(String, String, String) for a discussion of dependencies.

The specified markup element representing the resource must be suitable for inclusion in the aggregated portal document HEAD section. It will generally be either a LINK or SCRIPT tag.

This method does not directly place markup into the aggregated page document. The aggregating portal will use the identifying information name, scope, and version along with identifying information for other available page resources to determine which resources will be added to the page.

For example, if a portlet provides a resource with a version of 2.0.0 but another portlet on the same page provides a resource with the same name and scope but a version of 2.1.0, the aggregating portal may choose to include the later version of the resource on the page.

Parameters
name:String

the resource name

scope:String

the resource scope, may be null or empty

version:String

the resource version, may be null or empty

markup:String

the markup for adding the resource to the page

Annotations
@Override
getResponseback to summary
public HeaderResponse getResponse()

Overrides javax.portlet.filter.MimeResponseWrapper.getResponse.

Return the wrapped response object.

Returns:HeaderResponse

the wrapped response

setResponseback to summary
public void setResponse(HeaderResponse response)

Sets the response object being wrapped.

Parameters
response:HeaderResponse

the response to set

Exceptions
IllegalArgumentException:
if the response is null.
setTitleback to summary
public void setTitle(String title)

Implements javax.portlet.HeaderResponse.setTitle.

Doc from javax.portlet.HeaderResponse.setTitle.

This method sets the title of the portlet.

The value can be a text String

Parameters
title:String

portlet title as text String or resource URI

Annotations
@Override