org.apache.pluto.internal.impl
Class ResourceURLImpl

java.lang.Object
  extended by org.apache.pluto.internal.impl.BaseURLImpl
      extended by org.apache.pluto.internal.impl.ResourceURLImpl
All Implemented Interfaces:
BaseURL, ResourceURL

public class ResourceURLImpl
extends BaseURLImpl
implements ResourceURL

Implementation of JSR-286 ResourceURL.

Since:
2.0

Field Summary
 
Fields inherited from class org.apache.pluto.internal.impl.BaseURLImpl
container, context, internalPortletWindow, isAction, isResourceServing, mode, parameters, publicRenderParameters, secure, servletRequest, servletResponse, state
 
Fields inherited from interface javax.portlet.ResourceURL
FULL, PAGE, PORTLET, SHARED
 
Constructor Summary
ResourceURLImpl(PortletContainer container, InternalPortletWindow internalPortletWindow, javax.servlet.http.HttpServletRequest servletRequest, javax.servlet.http.HttpServletResponse servletResponse)
           
 
Method Summary
 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 setParameter(java.lang.String name, java.lang.String value)
          Sets the given String parameter to this URL.
 void setParameter(java.lang.String name, java.lang.String[] values)
          Sets the given String array parameter to this URL.
 void setParameters(java.util.Map<java.lang.String,java.lang.String[]> parameters)
          Sets a parameter map for this URL.
 void setResourceID(java.lang.String resourceID)
          Allows setting a resource ID that can be retrieved when serving the resource through the ResourceRequest.getResourceID() method.
 
Methods inherited from class org.apache.pluto.internal.impl.BaseURLImpl
addProperty, getParameter, getParameterMap, getParameters, getPortletMode, getWindowState, isPortletModeAllowed, isWindowStateAllowed, setProperty, setSecure, toString, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.portlet.BaseURL
addProperty, getParameterMap, setProperty, setSecure, toString, write, write
 

Constructor Detail

ResourceURLImpl

public ResourceURLImpl(PortletContainer container,
                       InternalPortletWindow internalPortletWindow,
                       javax.servlet.http.HttpServletRequest servletRequest,
                       javax.servlet.http.HttpServletResponse servletResponse)
Method Detail

setResourceID

public void setResourceID(java.lang.String resourceID)
Description copied from interface: ResourceURL
Allows setting a resource ID that can be retrieved when serving the resource through the ResourceRequest.getResourceID() method.

Specified by:
setResourceID in interface ResourceURL
Parameters:
resourceID - ID for this resource URL

getCacheability

public java.lang.String getCacheability()
Description copied from interface: ResourceURL
Returns the cache level of this resource URL.

Possible return values are: FULL, PORTLET or PAGE.

Specified by:
getCacheability in interface ResourceURL
Returns:
the cache level of this resource URL.

setCacheability

public void setCacheability(java.lang.String cacheLevel)
Description copied from interface: ResourceURL
Sets the cache level of this resource URL.

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.

Specified by:
setCacheability in interface ResourceURL
Parameters:
cacheLevel - the cache level of this resource URL.

setParameter

public void setParameter(java.lang.String name,
                         java.lang.String value)
Description copied from interface: BaseURL
Sets the given String parameter to this URL.

This method replaces all parameters with the given key.

The PortletURL implementation 'x-www-form-urlencoded' encodes all parameter names and values. Developers should not encode them.

A portlet container may prefix the attribute names internally in order to preserve a unique namespace for the portlet.

A parameter value of null indicates that this parameter should be removed.

Specified by:
setParameter in interface BaseURL
Overrides:
setParameter in class BaseURLImpl
Parameters:
name - the parameter name
value - the parameter value

setParameter

public void setParameter(java.lang.String name,
                         java.lang.String[] values)
Description copied from interface: BaseURL
Sets the given String array parameter to this URL.

This method replaces all parameters with the given key.

The PortletURL implementation 'x-www-form-urlencoded' encodes all parameter names and values. Developers should not encode them.

A portlet container may prefix the attribute names internally in order to preserve a unique namespace for the portlet.

Specified by:
setParameter in interface BaseURL
Overrides:
setParameter in class BaseURLImpl
Parameters:
name - the parameter name
values - the parameter values

setParameters

public void setParameters(java.util.Map<java.lang.String,java.lang.String[]> parameters)
Description copied from interface: BaseURL
Sets a parameter map for this URL.

All previously set parameters are cleared.

The PortletURL implementation 'x-www-form-urlencoded' encodes all parameter names and values. Developers should not encode them.

A portlet container may prefix the attribute names internally, in order to preserve a unique namespace for the portlet.

Specified by:
setParameters in interface BaseURL
Overrides:
setParameters in class BaseURLImpl
Parameters:
parameters - Map containing parameter names for the render phase as keys and parameter values as map values. The keys in the parameter map must be of type String. The values in the parameter map must be of type String array (String[]).


Copyright © 2003-2010 Apache Software Foundation. All Rights Reserved.