org.hippoecm.hst.core.container
Class HstContainerURLProviderImpl

java.lang.Object
  extended by org.hippoecm.hst.core.container.HstContainerURLProviderImpl
All Implemented Interfaces:
HstContainerURLProvider

public class HstContainerURLProviderImpl
extends Object
implements HstContainerURLProvider

The default implementation providing HstContainerURL. This implementation assume the urls are like the following examples:

1) render url will not be encoded : http://localhost/site/content/news/2008/08 2) action url will be encoded : http://localhost/site/content/_hn:<encoded_params>/news/2008/08 the <encoded_params> : <request_type>|<action reference namespace> 3) resource url will be encoded : http://localhsot/site/content/_hn:<encoded_params>/news/2008/08 the <encoded_params> : <request_type>|<resource reference namespace>|<resource ID> 4)component rendering url will be encoded : http://localhsot/site/content/_hn:<encoded_params>/news/2008/08 the <encoded_params> : <request_type>|<resource reference namespace>

Version:
$Id: HstContainerURLProviderImpl.java 35818 2012-08-21 19:08:19Z aschrijvers $

Field Summary
protected static String DEFAULT_HST_URL_NAMESPACE_PREFIX
           
protected  HstEmbeddedPortletContainerURLWriter embeddedPortletContainerURLWriter
           
protected static org.slf4j.Logger log
           
protected  HstNavigationalStateCodec navigationalStateCodec
           
protected  String parameterNameComponentSeparator
           
protected  HstPortletContainerURLWriter portletContainerURLWriter
           
protected  boolean portletResourceURLEnabled
           
protected static String REQUEST_INFO_SEPARATOR
           
protected  String urlNamespacePrefix
           
protected  String urlNamespacePrefixedPath
           
 
Constructor Summary
HstContainerURLProviderImpl()
           
 
Method Summary
protected  String buildHstURLPath(HstContainerURL containerURL, HstRequestContext requestContext)
           
 HstContainerURL createURL(HstContainerURL baseContainerURL, HstURL hstUrl)
          Creates an HstContainerURL instance by merging the information of hstUrl based on the base HstContainerURL instance
 HstContainerURL createURL(HstContainerURL baseContainerURL, String pathInfo)
          Creates an HstContainerURL instance for a new pathInfo (without query parameters) based on the base HstContainerURL instance
 HstContainerURL createURL(Mount mount, HstContainerURL baseContainerURL, String pathInfo)
          Creates an HstContainerURL instance for a new pathInfo (without query parameters) based on the Mount and the base HstContainerURL instance.
protected  HstEmbeddedPortletContainerURLWriter getEmbeddedPortletContainerURLWriter()
           
 HstNavigationalStateCodec getNavigationalStateCodec()
           
 String getParameterNameComponentSeparator()
          Returns the parameter name component separator.
protected  HstPortletContainerURLWriter getPortletContainerURLWriter()
           
 String getUrlNamespacePrefix()
           
 boolean isPortletResourceURLEnabled()
           
 void mergeParameters(HstContainerURL containerURL, String referenceNamespace, Map<String,String[]> parameterMap)
          Merges the render parameters into the containerURL.
protected  void parseRequestInfo(HstContainerURL url, String encodedRequestInfo)
           
 HstContainerURL parseURL(HstRequestContext requestContext, ResolvedMount mount, String requestPath)
          Parses a specified requestPath with the current HstRequestContext for a new ResolvedMount and requestPath and creates an HstContainerURL instance.
 HstContainerURL parseURL(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, ResolvedMount resolvedMount)
          Parses the current request and creates an HstContainerURL instance.
 HstContainerURL parseURL(javax.servlet.http.HttpServletRequest request, ResolvedMount mount, String requestPath)
          Parses a request for a specific ResolvedMount and requestPath and creates an HstContainerURL instance.
 void setNavigationalStateCodec(HstNavigationalStateCodec navigationalStateCodec)
           
 void setParameterNameComponentSeparator(String parameterNameComponentSeparator)
          Sets the parameter name component separator.
 void setPortletResourceURLEnabled(boolean portletResourceURLEnabled)
           
 void setUrlNamespacePrefix(String urlNamespacePrefix)
           
protected  String[] splitPathInfo(ResolvedMount resolvedMount, javax.servlet.http.HttpServletRequest request, String characterEncoding)
           
protected  String[] splitPathInfo(String requestPath, String characterEncoding)
           
 String toContextRelativeURLString(HstContainerURL containerURL, HstRequestContext requestContext)
          Stringifying the containerURL as a context relative path.
 String toURLString(HstContainerURL containerURL, HstRequestContext requestContext)
          Stringifying the containerURL as a full URL string.
 String toURLString(HstContainerURL containerURL, HstRequestContext requestContext, String contextPath)
          Stringifying the containerURL as a full URL string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static final org.slf4j.Logger log

REQUEST_INFO_SEPARATOR

protected static final String REQUEST_INFO_SEPARATOR
See Also:
Constant Field Values

DEFAULT_HST_URL_NAMESPACE_PREFIX

protected static final String DEFAULT_HST_URL_NAMESPACE_PREFIX
See Also:
Constant Field Values

urlNamespacePrefix

protected String urlNamespacePrefix

urlNamespacePrefixedPath

protected String urlNamespacePrefixedPath

parameterNameComponentSeparator

protected String parameterNameComponentSeparator

navigationalStateCodec

protected HstNavigationalStateCodec navigationalStateCodec

portletResourceURLEnabled

protected boolean portletResourceURLEnabled

portletContainerURLWriter

protected HstPortletContainerURLWriter portletContainerURLWriter

embeddedPortletContainerURLWriter

protected HstEmbeddedPortletContainerURLWriter embeddedPortletContainerURLWriter
Constructor Detail

HstContainerURLProviderImpl

public HstContainerURLProviderImpl()
Method Detail

setPortletResourceURLEnabled

public void setPortletResourceURLEnabled(boolean portletResourceURLEnabled)

isPortletResourceURLEnabled

public boolean isPortletResourceURLEnabled()

setUrlNamespacePrefix

public void setUrlNamespacePrefix(String urlNamespacePrefix)

getUrlNamespacePrefix

public String getUrlNamespacePrefix()

setParameterNameComponentSeparator

public void setParameterNameComponentSeparator(String parameterNameComponentSeparator)
Description copied from interface: HstContainerURLProvider
Sets the parameter name component separator. If this is set to ':' and the parameter name is 'p1' with value 'v1', then the parameter pair for the HstComponent having the reference namespace 'a' should be 'a:p1=v1'.

Specified by:
setParameterNameComponentSeparator in interface HstContainerURLProvider

getParameterNameComponentSeparator

public String getParameterNameComponentSeparator()
Description copied from interface: HstContainerURLProvider
Returns the parameter name component separator.

Specified by:
getParameterNameComponentSeparator in interface HstContainerURLProvider
Returns:

setNavigationalStateCodec

public void setNavigationalStateCodec(HstNavigationalStateCodec navigationalStateCodec)

getNavigationalStateCodec

public HstNavigationalStateCodec getNavigationalStateCodec()

parseURL

public HstContainerURL parseURL(javax.servlet.http.HttpServletRequest request,
                                ResolvedMount mount,
                                String requestPath)
Description copied from interface: HstContainerURLProvider
Parses a request for a specific ResolvedMount and requestPath and creates an HstContainerURL instance.

Specified by:
parseURL in interface HstContainerURLProvider
Returns:

parseURL

public HstContainerURL parseURL(HstRequestContext requestContext,
                                ResolvedMount mount,
                                String requestPath)
Description copied from interface: HstContainerURLProvider
Parses a specified requestPath with the current HstRequestContext for a new ResolvedMount and requestPath and creates an HstContainerURL instance.

Specified by:
parseURL in interface HstContainerURLProvider
Returns:

parseURL

public HstContainerURL parseURL(javax.servlet.http.HttpServletRequest request,
                                javax.servlet.http.HttpServletResponse response,
                                ResolvedMount resolvedMount)
Description copied from interface: HstContainerURLProvider
Parses the current request and creates an HstContainerURL instance.

Specified by:
parseURL in interface HstContainerURLProvider
Returns:

createURL

public HstContainerURL createURL(HstContainerURL baseContainerURL,
                                 String pathInfo)
Description copied from interface: HstContainerURLProvider
Creates an HstContainerURL instance for a new pathInfo (without query parameters) based on the base HstContainerURL instance

Specified by:
createURL in interface HstContainerURLProvider
Returns:

createURL

public HstContainerURL createURL(Mount mount,
                                 HstContainerURL baseContainerURL,
                                 String pathInfo)
Description copied from interface: HstContainerURLProvider
Creates an HstContainerURL instance for a new pathInfo (without query parameters) based on the Mount and the base HstContainerURL instance.

Specified by:
createURL in interface HstContainerURLProvider
Returns:

createURL

public HstContainerURL createURL(HstContainerURL baseContainerURL,
                                 HstURL hstUrl)
Description copied from interface: HstContainerURLProvider
Creates an HstContainerURL instance by merging the information of hstUrl based on the base HstContainerURL instance

Specified by:
createURL in interface HstContainerURLProvider
Returns:

mergeParameters

public void mergeParameters(HstContainerURL containerURL,
                            String referenceNamespace,
                            Map<String,String[]> parameterMap)
Description copied from interface: HstContainerURLProvider
Merges the render parameters into the containerURL.

Specified by:
mergeParameters in interface HstContainerURLProvider

toContextRelativeURLString

public String toContextRelativeURLString(HstContainerURL containerURL,
                                         HstRequestContext requestContext)
                                  throws UnsupportedEncodingException,
                                         ContainerException
Description copied from interface: HstContainerURLProvider
Stringifying the containerURL as a context relative path.

Specified by:
toContextRelativeURLString in interface HstContainerURLProvider
Returns:
Throws:
UnsupportedEncodingException
ContainerException

getPortletContainerURLWriter

protected HstPortletContainerURLWriter getPortletContainerURLWriter()

getEmbeddedPortletContainerURLWriter

protected HstEmbeddedPortletContainerURLWriter getEmbeddedPortletContainerURLWriter()

buildHstURLPath

protected String buildHstURLPath(HstContainerURL containerURL,
                                 HstRequestContext requestContext)
                          throws UnsupportedEncodingException
Throws:
UnsupportedEncodingException

parseRequestInfo

protected void parseRequestInfo(HstContainerURL url,
                                String encodedRequestInfo)

splitPathInfo

protected String[] splitPathInfo(String requestPath,
                                 String characterEncoding)

splitPathInfo

protected String[] splitPathInfo(ResolvedMount resolvedMount,
                                 javax.servlet.http.HttpServletRequest request,
                                 String characterEncoding)

toURLString

public String toURLString(HstContainerURL containerURL,
                          HstRequestContext requestContext)
                   throws UnsupportedEncodingException,
                          ContainerException
Description copied from interface: HstContainerURLProvider
Stringifying the containerURL as a full URL string.

Specified by:
toURLString in interface HstContainerURLProvider
Returns:
Throws:
UnsupportedEncodingException
ContainerException

toURLString

public String toURLString(HstContainerURL containerURL,
                          HstRequestContext requestContext,
                          String contextPath)
                   throws UnsupportedEncodingException,
                          ContainerException
Description copied from interface: HstContainerURLProvider
Stringifying the containerURL as a full URL string.

By this method, you can specify the context path such as '/mycontext'.

Specified by:
toURLString in interface HstContainerURLProvider
Returns:
Throws:
UnsupportedEncodingException
ContainerException


Copyright © 2008-2012 Hippo. All Rights Reserved.