public interface ResourceURL extends BaseURL
ResourceURL
defines a resource URL that when clicked will
result in a serveResource
call of the
ResourceServingPortlet
interface.
Each resource URL has a specific cache level assigned with it. This level
can be either FULL, PORTLET
or PAGE
and denotes
the cacheability of the resource in the browser.
The default cache level of a resource URL is either the cache level of the
parent resource URL, or PAGE
if no parent resource URL is
available.
Modifier and Type | Field and Description |
---|---|
static String |
FULL
The URL of type
FULL does not need to contain the current
state of the page or the current render parameters, portlet mode, or
window state of the portlet. |
static String |
PAGE
The URL of type
PAGE may contain artifacts that require
knowledge of the state of the complete page, like
PortletURLs . |
static String |
PORTLET
The URL of type
PORTLRET does not need to contain the
current state of the page, but the current render parameters, portlet
mode, or window state of the portlet must be accessible to the portlet. |
static String |
SHARED
Property that the portlet can set for resources with caching
type
FULL via the setProperty method
on the ResourceURL . |
Modifier and Type | Method and Description |
---|---|
String |
getCacheability()
Returns the cache level of this resource URL.
|
String |
getResourceID()
Returns the resource ID set on the ResourceURL or
null
if no resource ID was set on the URL. |
MutableResourceParameters |
getResourceParameters()
Gets the resource parameter values set for this URL.
|
void |
setCacheability(String cacheLevel)
Sets the cache level of this resource URL.
|
void |
setResourceID(String resourceID)
Allows setting a resource ID that can be retrieved when serving the
resource through the
ResourceRequest.getResourceID() method. |
addProperty, append, append, getParameterMap, setParameter, setParameter, setParameters, setProperty, setSecure, toString, write, write
getPortletMode, getRenderParameters, getWindowState
static final String FULL
FULL
does not need to contain the current
state of the page or the current render parameters, portlet mode, or
window state of the portlet. Thus the portlet may not be able to
access the portlet mode, window state, or render parameters in the
serveResource
call.
Only URLs of the type FULL
are allowed in the response.
The same restriction is true for all downstream URLs that result from
this response call. Attempts to create URLs that are not of type
FULL
will result in an IllegalStateException
.
URLs of the type FULL
have the highest cacheability in the
browser as they do not depend on any state of the portlet or page.
static final String PORTLET
PORTLRET
does not need to contain the
current state of the page, but the current render parameters, portlet
mode, or window state of the portlet must be accessible to the portlet.
Only URLs of the type PORTLET
or FULL
are
allowed in the response. The same restriction
is true for all downstream URLs that result from this response.
Attempts to create URLs that are not of type
PORTLET
or FULL
will result in an
IllegalStateException
.
URLs of the type PORTLET
are cacheable on the portlet
level in the browser and can be served from the browser cache for as long
as the state of this portlet does not change.
static final String PAGE
PAGE
may contain artifacts that require
knowledge of the state of the complete page, like
PortletURLs
.
URLs of the type PAGE
are only cacheable on the page level
and can only be served from the browser cache as long as no state on the
page changes.
static final String SHARED
FULL
via the setProperty
method
on the ResourceURL
.
When set, this property indicates to the portal application that it can share this resource across different portlet applications.
The value of this property should be a QName in the
format of javax.xml.namespace.QName.toString()
.
MutableResourceParameters getResourceParameters()
Resource parameters are additional portlet parameters added to the URL that extend the state information provided by the render parameters.
Initially the returned object is empty.
Modifying the parameter values encapsulated by the returned object directly modifies the resource parameters applied to the URL.
PortletParameters
provides a description of the parameter concept.
PortletParameters
object representing
the private and public render parametersPortletParameters
,
MutableResourceParameters
,
ResourceRequest
void setResourceID(String resourceID)
ResourceRequest.getResourceID()
method.resourceID
- ID for this resource URLString getResourceID()
null
if no resource ID was set on the URL.null
if no resource ID was set on the URL.String getCacheability()
Possible return values are: FULL, PORTLET
or PAGE
.
void setCacheability(String cacheLevel)
Possible values are: FULL, PORTLET
or PAGE
.
Note that if this URL is created inside a
serveResource
call it must have
at minimum the same cacheablity, or a more
restrictive one, as the parent resource URL,
otherwise an IllegalStateException is thrown.
The default cache level of a resource URL is either the cache level of the
parent resource URL, or PAGE
if no parent resource URL is
available.
cacheLevel
- the cache level of this resource URL.IllegalStateException
- if this resource URL has a weaker cache level
than the parent resource URL.IllegalArgumentException
- if the cacheLevel is unknown to the portlet containerJava Portlet 3.0 API Specification. See the Copyright and License provided with this distribution. Use is subject to license terms.