com.arsdigita.acs
Class ACSRequest

java.lang.Object
  |
  +--com.arsdigita.acs.ACSRequest

public class ACSRequest
extends java.lang.Object

Class to represent a requested URL. Maps the requested URL to a package instance (ACSPackage); the requested mounting of that package instance (SiteNode); and to the actual file served for a requested URL.


Field Summary
static java.lang.String cvsId
           
 
Constructor Summary
protected ACSRequest(java.lang.String contextPath, java.lang.String requestedUrlNoContext, boolean calledRecursively)
          Protected constructor.
protected ACSRequest(java.lang.String contextPath, java.lang.String requestedUrlNoContext, SiteNode sn)
          Protected constructor.
 
Method Summary
static ACSRequest get()
           
 java.lang.String getConcreteUrl()
          Returns the actual resolved/concrete URL served by this request.
 java.lang.String getConcreteUrl(javax.servlet.ServletContext ctx)
          given the unresolved (in a package) abstract (without extension URL requested, resolve to an actual file to be served either from the global pageroot (first priority) or a package pageroot (second priority).
 java.lang.String getContextPath()
          Path where ACS is mounted on server.
 java.lang.String getExtraPathInfo()
           
 java.lang.String getExtraUrl()
           
 ACSPackage getPackage()
           
 java.lang.String getPackageUrl()
           
 SiteNode getSiteNode()
           
 java.lang.String getUrl()
           
 java.lang.String getUrlNoContext()
           
static void set(ACSRequest request)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cvsId

public static java.lang.String cvsId
Constructor Detail

ACSRequest

protected ACSRequest(java.lang.String contextPath,
                     java.lang.String requestedUrlNoContext,
                     SiteNode sn)
Protected constructor. Should only be called by factory class or subclasses.
Parameters:
contextPath - the base URL for the ACS/Java webapp
requestedUrl - the original, unresolved abstract URL requested by the user
siteNode - the site node that this URL is mapped to in the site map

ACSRequest

protected ACSRequest(java.lang.String contextPath,
                     java.lang.String requestedUrlNoContext,
                     boolean calledRecursively)
Protected constructor. Should only be called by factory class.
Parameters:
contextPath - the base URL for the ACS/Java webapp
requestedUrl - the original, unresolved abstract URL requested by the user
calledRecursively - if true, indicates that this request is being processed re-entrantly site map
Method Detail

set

public static void set(ACSRequest request)

get

public static ACSRequest get()

getUrl

public java.lang.String getUrl()
Returns:
the original unresolved URL requested by the user.

getUrlNoContext

public java.lang.String getUrlNoContext()
Returns:
the unresolved URL requested by the user, without context path.

getContextPath

public java.lang.String getContextPath()
Path where ACS is mounted on server.

getSiteNode

public SiteNode getSiteNode()
Returns:
the site node that corresponds to the URL requested by the user.

getPackage

public ACSPackage getPackage()
Returns:
an ACSPackage object that represents the package instance mounted on this site node.

getPackageUrl

public java.lang.String getPackageUrl()
Returns:
The URL for this particular package instance requested. This is the URL where the package, as a whole, is mounted; that is, the URL for the site node.

getExtraUrl

public java.lang.String getExtraUrl()
Returns:
The portion of the requested URL in excess of the site node URL, for locating an individual page within a package or subsite. For example, if the News package is mounted at /news, and the request is for /news/a/b, getPackageUrl() will return /news/ and getExtraUrl() should return "a/b".

getExtraPathInfo

public java.lang.String getExtraPathInfo()
Returns:
The extra path info that is not used by the RequestProcessor for this request (only interesting if request is handled by a VUH file). There is no leading /. This is equivalent to [ad_conn path_info] in TCL.

getConcreteUrl

public java.lang.String getConcreteUrl()
Returns the actual resolved/concrete URL served by this request. Useful when a page needs to ascertain its location.
Returns:
the URL corresponding to the actual file in the filesystem served by this request.

getConcreteUrl

public java.lang.String getConcreteUrl(javax.servlet.ServletContext ctx)
                                throws RedirectException,
                                       java.io.FileNotFoundException,
                                       javax.servlet.ServletException
given the unresolved (in a package) abstract (without extension URL requested, resolve to an actual file to be served either from the global pageroot (first priority) or a package pageroot (second priority).

if the URL for this ACSRequest has already been resolved, return the file that was previously served.

may be called with null arguments if and only if the request was previously served

Parameters:
ctx - a servlet context, needed for resolving pathnames
Throws:
RedirectException - if the caller should redirect rather than forward to a particular URL
java.lang.IllegalArgumentException - if ctx is null and the request has not been resolved previously
javax.servlet.ServletException - thrown from errors during translation, if any tranlsation step is required.