Interface ResourceURL
-
- All Superinterfaces:
BaseURL
public interface ResourceURL extends BaseURL
TheResourceURL
defines a resource URL that when clicked will result in aserveResource
call of theResourceServingPortlet
interface.Each resource URL has a specific cache level assigned with it. This level can be either
FULL, PORTLET
orPAGE
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.- Since:
- 2.0
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
FULL
The URL of typeFULL
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 java.lang.String
PAGE
The URL of typePAGE
may contain artifacts that require knowledge of the state of the complete page, likePortletURLs
.static java.lang.String
PORTLET
The URL of typePORTLRET
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 java.lang.String
SHARED
Property that the portlet can set for resources with caching typeFULL
via thesetProperty
method on theResourceURL
.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.String
getCacheability()
Returns the cache level of this resource URL.void
setCacheability(java.lang.String cacheLevel)
Sets the cache level of this resource URL.void
setResourceID(java.lang.String resourceID)
Allows setting a resource ID that can be retrieved when serving the resource through theResourceRequest.getResourceID()
method.-
Methods inherited from interface javax.portlet.BaseURL
addProperty, getParameterMap, setParameter, setParameter, setParameters, setProperty, setSecure, toString, write, write
-
-
-
-
Field Detail
-
FULL
static final java.lang.String FULL
The URL of typeFULL
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 theserveResource
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 typeFULL
will result in anIllegalStateException
.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.- See Also:
- Constant Field Values
-
PORTLET
static final java.lang.String PORTLET
The URL of typePORTLRET
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
orFULL
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 typePORTLET
orFULL
will result in anIllegalStateException
.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.- See Also:
- Constant Field Values
-
PAGE
static final java.lang.String PAGE
The URL of typePAGE
may contain artifacts that require knowledge of the state of the complete page, likePortletURLs
.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.- See Also:
- Constant Field Values
-
SHARED
static final java.lang.String SHARED
Property that the portlet can set for resources with caching typeFULL
via thesetProperty
method on theResourceURL
.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()
.- See Also:
- Constant Field Values
-
-
Method Detail
-
setResourceID
void setResourceID(java.lang.String resourceID)
Allows setting a resource ID that can be retrieved when serving the resource through theResourceRequest.getResourceID()
method.- Parameters:
resourceID
- ID for this resource URL
-
getCacheability
java.lang.String getCacheability()
Returns the cache level of this resource URL.Possible return values are:
FULL, PORTLET
orPAGE
.- Returns:
- the cache level of this resource URL.
-
setCacheability
void setCacheability(java.lang.String cacheLevel)
Sets the cache level of this resource URL.Possible values are:
FULL, PORTLET
orPAGE
.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.- Parameters:
cacheLevel
- the cache level of this resource URL.- Throws:
java.lang.IllegalStateException
- if this resource URL has a weaker cache level than the parent resource URL.java.lang.IllegalArgumentException
- if the cacheLevel is unknown to the portlet container
-
-