org.xwiki.portlet.url
Class DispatchURLFactory

java.lang.Object
  extended by org.xwiki.portlet.url.DispatchURLFactory

public class DispatchURLFactory
extends Object

Creates portlet URLs that tell to their target where to dispatch the associated request.

Version:
$Id: 9b9ef9577bf8cf91b1b20a8c1345900a388ae9ce $

Field Summary
static String PARAMETER_DISPATCH_URL
          The name of the portlet URL parameter holding the URL to dispatch the request to.
 
Constructor Summary
DispatchURLFactory(javax.portlet.MimeResponse response, URLRequestTypeMapper urlRequestTypeMapper, String defaultDispatchURL)
          Creates a new URL factory based on the given response.
 
Method Summary
 javax.portlet.BaseURL createURL()
           
 javax.portlet.BaseURL createURL(RequestType requestType)
          Creates a dispatch URL with the specified type that targets the current page.
 javax.portlet.BaseURL createURL(String dispatchURL)
          Creates a dispatch URL with the type determined from configuration.
 javax.portlet.BaseURL createURL(String dispatchURL, RequestType requestType)
          Creates a dispatch URL with the specified type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PARAMETER_DISPATCH_URL

public static final String PARAMETER_DISPATCH_URL
The name of the portlet URL parameter holding the URL to dispatch the request to.

See Also:
Constant Field Values
Constructor Detail

DispatchURLFactory

public DispatchURLFactory(javax.portlet.MimeResponse response,
                          URLRequestTypeMapper urlRequestTypeMapper,
                          String defaultDispatchURL)
Creates a new URL factory based on the given response.

Parameters:
response - the object used to create the portlet URLs
urlRequestTypeMapper - the object used to get the portlet request type associated with a given servlet URL
defaultDispatchURL - the URL to use when the dispatch URL is not specified or is null
Method Detail

createURL

public javax.portlet.BaseURL createURL()
Returns:
a dispatch URL pointing to the current page

createURL

public javax.portlet.BaseURL createURL(String dispatchURL)
Creates a dispatch URL with the type determined from configuration.

Parameters:
dispatchURL - where to dispatch the request to
Returns:
a portlet URL that tells to its target to dispatch the request to the given dispatch URL

createURL

public javax.portlet.BaseURL createURL(RequestType requestType)
Creates a dispatch URL with the specified type that targets the current page.

Parameters:
requestType - the type of URL to create
Returns:
a dispatch URL with the specified type, pointing to the current page

createURL

public javax.portlet.BaseURL createURL(String dispatchURL,
                                       RequestType requestType)
Creates a dispatch URL with the specified type.

Parameters:
dispatchURL - where to dispatch the request to
requestType - the type of URL to create
Returns:
a portlet URL that tells to its target to dispatch the request to the given dispatch URL


Copyright © 2004-2013 XWiki. All Rights Reserved.