org.springframework.extensions.webscripts
Class WebScriptRequestURLImpl

java.lang.Object
  extended by org.springframework.extensions.webscripts.WebScriptRequestImpl
      extended by org.springframework.extensions.webscripts.WebScriptRequestURLImpl
All Implemented Interfaces:
WebScriptRequest
Direct Known Subclasses:
LocalWebScriptRequest, WebScriptJSFRequest, WebScriptPortletRequest

public abstract class WebScriptRequestURLImpl
extends WebScriptRequestImpl

Web Script Request implementation that acts upon a string representation of a URL

Author:
davidc

Field Summary
protected  String contextPath
          Script Url components
protected  String pathInfo
           
protected  Map<String,String> queryArgs
           
protected  Map<String,List<String>> queryArgsMulti
           
protected  String queryString
           
protected  Match serviceMatch
          Service bound to this request
protected  String servletPath
           
 
Fields inherited from class org.springframework.extensions.webscripts.WebScriptRequestImpl
logger
 
Constructor Summary
WebScriptRequestURLImpl(Runtime runtime, String[] scriptUrlParts, Match serviceMatch)
          Construct
WebScriptRequestURLImpl(Runtime runtime, String scriptUrl, Match serviceMatch)
          Construct Note: It's assumed scriptUrl contains context path
 
Method Summary
 String getContextPath()
          Gets the Alfresco Context Path
 String getParameter(String name)
          Gets the value of the named parameter
 String[] getParameterNames()
          Gets the names of all parameters on the Url
 String[] getParameterValues(String name)
          Gets the (array) value of the named parameter Note: An array of one item is returned when a "single value" named parameter is requested
 String getPathInfo()
          Gets the service specific path
 String getQueryString()
          Gets the query String
 String getServiceContextPath()
          Gets the Alfresco Web Script Context Path
 Match getServiceMatch()
          Gets the matching API Service for this request
 String getServicePath()
          Gets the Alfresco Service Path
 String getURL()
          Gets the full request URL
static String[] splitURL(boolean context, String scriptUrl)
          Splits a Web Script Url into its component parts
static String[] splitURL(String scriptUrl)
          Splits a Web Script Url into its component parts
 String toString()
           
 
Methods inherited from class org.springframework.extensions.webscripts.WebScriptRequestImpl
forceSuccessStatus, getContentType, getExtensionPath, getFormat, getFormatStyle, getJSONCallback, getRuntime, isGuest, parseContent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.springframework.extensions.webscripts.WebScriptRequest
getAgent, getContent, getHeader, getHeaderNames, getHeaderValues, getServerPath
 

Field Detail

contextPath

protected String contextPath
Script Url components


servletPath

protected String servletPath

pathInfo

protected String pathInfo

queryString

protected String queryString

queryArgs

protected Map<String,String> queryArgs

queryArgsMulti

protected Map<String,List<String>> queryArgsMulti

serviceMatch

protected Match serviceMatch
Service bound to this request

Constructor Detail

WebScriptRequestURLImpl

public WebScriptRequestURLImpl(Runtime runtime,
                               String scriptUrl,
                               Match serviceMatch)
Construct Note: It's assumed scriptUrl contains context path

Parameters:
scriptUrl -
serviceMatch -

WebScriptRequestURLImpl

public WebScriptRequestURLImpl(Runtime runtime,
                               String[] scriptUrlParts,
                               Match serviceMatch)
Construct

Parameters:
scriptUrlParts -
serviceMatch -
Method Detail

splitURL

public static String[] splitURL(String scriptUrl)
Splits a Web Script Url into its component parts

Parameters:
scriptUrl - url e.g. /alfresco/service/mytasks?f=1
Returns:
url parts [0] = context (e.g. alfresco), [1] = servlet (e.g. service), [2] = script (e.g. mytasks), [3] = args (e.g. f=1)

splitURL

public static String[] splitURL(boolean context,
                                String scriptUrl)
Splits a Web Script Url into its component parts

Parameters:
context - true => context path is included in scriptUrl
scriptUrl - url e.g. /alfresco/service/mytasks?f=1
Returns:
url parts [0] = context (e.g. alfresco, or empty if no context), [1] = servlet (e.g. service), [2] = script (e.g. mytasks), [3] = args (e.g. f=1)

toString

public String toString()
Overrides:
toString in class Object

getServiceMatch

public Match getServiceMatch()
Description copied from interface: WebScriptRequest
Gets the matching API Service for this request

Returns:
the service match

getContextPath

public String getContextPath()
Description copied from interface: WebScriptRequest
Gets the Alfresco Context Path

Returns:
context url e.g. /alfresco

getServiceContextPath

public String getServiceContextPath()
Description copied from interface: WebScriptRequest
Gets the Alfresco Web Script Context Path

Returns:
service url e.g. /alfresco/service

getServicePath

public String getServicePath()
Description copied from interface: WebScriptRequest
Gets the Alfresco Service Path

Returns:
service url e.g. /alfresco/service/search/keyword

getURL

public String getURL()
Description copied from interface: WebScriptRequest
Gets the full request URL

Returns:
request url e.g. /alfresco/service/search/keyword?q=term

getPathInfo

public String getPathInfo()
Description copied from interface: WebScriptRequest
Gets the service specific path

Returns:
request path e.g. /search/keyword

getQueryString

public String getQueryString()
Description copied from interface: WebScriptRequest
Gets the query String

Returns:
query string e.g. q=alfresco&format=atom

getParameterNames

public String[] getParameterNames()
Description copied from interface: WebScriptRequest
Gets the names of all parameters on the Url

Returns:
the names (empty, if none)

getParameter

public String getParameter(String name)
Description copied from interface: WebScriptRequest
Gets the value of the named parameter

Parameters:
name - parameter name
Returns:
parameter value (or null, if parameter does not exist)

getParameterValues

public String[] getParameterValues(String name)
Description copied from interface: WebScriptRequest
Gets the (array) value of the named parameter Note: An array of one item is returned when a "single value" named parameter is requested

Parameters:
name - parameter name
Returns:
array of values (or null, if parameter does not exist)


Copyright © 2009 SpringSource, Inc. All Rights Reserved.