Java URL Optimization API (SEO API) 2.1.1

com.endeca.soleng.urlformatter.seo
Class SeoUrlFormatter

java.lang.Object
  extended by com.endeca.soleng.urlformatter.basic.BasicUrlFormatter
      extended by com.endeca.soleng.urlformatter.seo.SeoUrlFormatter
All Implemented Interfaces:
com.endeca.soleng.urlformatter.UrlFormatter

public class SeoUrlFormatter
extends com.endeca.soleng.urlformatter.basic.BasicUrlFormatter

An UrlFormatter that parses and formats optimized URLs.

Property Summary
Property Type Default Value
pathSeparatorToken String _ (underscore)
pathKeyValueSeparator char - (hyphen)
navStateFormatter NavStateFormatter null
ERecFormatter ERecFormatter null
aggrERecFormatter AggrERecFormatter null
pathParamKeys String[] null
urlParamEncoders UrlParamEncoder[] null
navStateCanonicalizer NavStateCanonicalizer null
See properties inherited from BasicUrlFormatter


Field Summary
static char PATH_SEPARATOR
           
 
Constructor Summary
SeoUrlFormatter()
           
 
Method Summary
 com.endeca.soleng.urlformatter.AggrERecUrlParam createAggrERecUrlParam(com.endeca.soleng.urlformatter.UrlState pUrlState, com.endeca.navigation.AggrERec pAggrERec)
           
 com.endeca.soleng.urlformatter.ERecUrlParam createERecUrlParam(com.endeca.soleng.urlformatter.UrlState pUrlState, com.endeca.navigation.ERec pERec)
           
 com.endeca.soleng.urlformatter.NavStateUrlParam createNavStateUrlParam(com.endeca.soleng.urlformatter.UrlState pUrlState)
           
 com.endeca.soleng.urlformatter.UrlParam createUrlParam(com.endeca.soleng.urlformatter.UrlState pUrlState, java.lang.String pKey, java.lang.String pValue)
           
protected  java.lang.String formatAggrERec(com.endeca.soleng.urlformatter.UrlState pUrlState)
           
protected  java.lang.String formatERec(com.endeca.soleng.urlformatter.UrlState pUrlState)
           
protected  java.lang.String formatNavState(com.endeca.soleng.urlformatter.UrlState pUrlState)
           
protected  java.lang.String formatPathKeywords(com.endeca.soleng.urlformatter.UrlState pUrlState)
           
protected  java.lang.String formatPathParams(com.endeca.soleng.urlformatter.UrlState pUrlState)
           
protected  java.lang.String formatQueryString(com.endeca.soleng.urlformatter.UrlState pUrlState)
           
 java.lang.String formatUrl(com.endeca.soleng.urlformatter.UrlState pUrlState)
           
 AggrERecFormatter getAggrERecFormatter()
          The AggrERecFormatter used to render aggregate record attributes to the URL path keywords.
 ERecFormatter getERecFormatter()
          The ERecFormatter used to render endeca record attributes to the URL path keywords.
 NavStateCanonicalizer getNavStateCanonicalizer()
          Returns the canonicalizer used to sort the navigation state before rendering an UrlState.
 NavStateFormatter getNavStateFormatter()
          The NavStateFormatter property used to render navigation state information to the URL path keywords.
 char getPathKeyValueSeparator()
          The character used to separate key/value pairs in the path parameter section of the URL.
 java.lang.String[] getPathParamKeys()
          The parameter keys that will be appended to the path.
 java.lang.String getPathSeparatorToken()
          The separator token that is used to separate the misc-path section of the URL from the path parameter section.
 UrlParamEncoder[] mUrlParamEncoders()
          The UrlParamEncoder objects used by this SeoUrlFormatter.
protected  void parsePathInfo(com.endeca.soleng.urlformatter.UrlState pUrlState, java.lang.String pPathInfo)
           
protected  void parseQueryString(com.endeca.soleng.urlformatter.UrlState pUrlState, java.lang.String pQueryString)
           
 com.endeca.soleng.urlformatter.UrlState parseRequest(javax.servlet.http.HttpServletRequest pRequest)
           
 com.endeca.soleng.urlformatter.UrlState parseRequest(java.lang.String pQueryString, java.lang.String pPathInfo, java.lang.String pCharacterEncoding)
           
 void setAggrERecFormatter(AggrERecFormatter pAggrERecFormatter)
          Sets the aggrERecFormatter property, which is used to render directory-style (path-encoded) keywords for UrlState objects containing an Endeca aggregate record.
 void setERecFormatter(ERecFormatter pERecFormatter)
          Sets the ERecFormatter property, which is used to render directory-style (path-encoded) keywords for UrlState objects containing an Endeca record.
 void setNavStateCanonicalizer(NavStateCanonicalizer pNavStateCanonicalizer)
          Specifies the canonicalizer used to sort the navigation state before rendering an UrlState.
 void setNavStateFormatter(NavStateFormatter pNavStateFormatter)
          Sets the navStateFormatter property, which is used to render directory-style (path-encoded) keywords for UrlState objects containing dimensional navigation state.
 void setPathKeyValueSeparator(char pPathKeyValueSeparator)
          Specifies the character used to separate key/value pairs in the path parameter section of the URL.
 void setPathParamKeys(java.lang.String[] pPathParamKeys)
          Specifies the parameter keys that will be appended to the path, rather than the query string, which is the default setting for any given key.
 void setPathSeparatorToken(java.lang.String pPathSeparatorToken)
          Specifies the separator token that is used to separate the misc-path section of the URL from the path parameter section.
 void setUrlParamEncoders(UrlParamEncoder[] pUrlParamEncoders)
          Specifies the UrlParamEncoder objects used by this SeoUrlFormatter.
 
Methods inherited from class com.endeca.soleng.urlformatter.basic.BasicUrlFormatter
getAggrERecParamKey, getDefaultEncoding, getERecParamKey, getNavStateParamKey, getPrependQuestionMark, parseRequest, setAggrERecParamKey, setDefaultEncoding, setERecParamKey, setNavStateParamKey, setPrependQuestionMark
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PATH_SEPARATOR

public static final char PATH_SEPARATOR
See Also:
Constant Field Values
Constructor Detail

SeoUrlFormatter

public SeoUrlFormatter()
Method Detail

getPathSeparatorToken

public java.lang.String getPathSeparatorToken()
The separator token that is used to separate the misc-path section of the URL from the path parameter section.


setPathSeparatorToken

public void setPathSeparatorToken(java.lang.String pPathSeparatorToken)
Specifies the separator token that is used to separate the misc-path section of the URL from the path parameter section.

In the following URL, "XX" is the pathSeparatorToken:

 http://www.mysite.com/controller/Wine+Type/Sparkling/Blanc+de+Blancs/XX/N-6202
 

Parameters:
pPathSeparatorToken - Path separator token to set. Cannot be null.
Throws:
java.lang.IllegalArgumentException - if pPathSeparatorToken is null.

getPathKeyValueSeparator

public char getPathKeyValueSeparator()
The character used to separate key/value pairs in the path parameter section of the URL.


setPathKeyValueSeparator

public void setPathKeyValueSeparator(char pPathKeyValueSeparator)
Specifies the character used to separate key/value pairs in the path parameter section of the URL.

In the following URL, '*' is the keyValueSeparator:

 http://www.mysite.com/controller/Wine+Type/Sparkling/Blanc+de+Blancs/_/N*6202
 

Parameters:
pPathKeyValueSeparator - key value separator. Cannot be null.

getNavStateFormatter

public NavStateFormatter getNavStateFormatter()
The NavStateFormatter property used to render navigation state information to the URL path keywords.


setNavStateFormatter

public void setNavStateFormatter(NavStateFormatter pNavStateFormatter)
Sets the navStateFormatter property, which is used to render directory-style (path-encoded) keywords for UrlState objects containing dimensional navigation state.

Parameters:
pNavStateFormatter - object that is used to format the UrlState.
See Also:
SeoNavStateFormatter

getERecFormatter

public ERecFormatter getERecFormatter()
The ERecFormatter used to render endeca record attributes to the URL path keywords.


setERecFormatter

public void setERecFormatter(ERecFormatter pERecFormatter)
Sets the ERecFormatter property, which is used to render directory-style (path-encoded) keywords for UrlState objects containing an Endeca record.

Parameters:
pERecFormatter - object that is used to format the UrlState.
See Also:
SeoERecFormatter

getAggrERecFormatter

public AggrERecFormatter getAggrERecFormatter()
The AggrERecFormatter used to render aggregate record attributes to the URL path keywords.


setAggrERecFormatter

public void setAggrERecFormatter(AggrERecFormatter pAggrERecFormatter)
Sets the aggrERecFormatter property, which is used to render directory-style (path-encoded) keywords for UrlState objects containing an Endeca aggregate record.

Parameters:
pAggrERecFormatter - object that is used to format the UrlState.
See Also:
SeoAggrERecFormatter

getPathParamKeys

public java.lang.String[] getPathParamKeys()
The parameter keys that will be appended to the path.


setPathParamKeys

public void setPathParamKeys(java.lang.String[] pPathParamKeys)
Specifies the parameter keys that will be appended to the path, rather than the query string, which is the default setting for any given key. In the following Url, N has been added to the pathParamKeys:
 http://www.mysite.com/controller/Wine-Sparkling-Blanc-de-Blancs/Other-US/_/N-6202+4294963118
 

If N had not been added to the pathParamKeys, the URL would be output as follows:

 http://www.mysite.com/controller/Wine-Sparkling-Blanc-de-Blancs/Other-US?N=6202+4294963118
 

Parameters:
pPathParamKeys - Array of keys that will be added to the path, rather than the query string.

mUrlParamEncoders

public UrlParamEncoder[] mUrlParamEncoders()
The UrlParamEncoder objects used by this SeoUrlFormatter.


setUrlParamEncoders

public void setUrlParamEncoders(UrlParamEncoder[] pUrlParamEncoders)
Specifies the UrlParamEncoder objects used by this SeoUrlFormatter.

Parameters:
pUrlParamEncoders - array of encoders that are used to encode various URL parameters.

getNavStateCanonicalizer

public NavStateCanonicalizer getNavStateCanonicalizer()
Returns the canonicalizer used to sort the navigation state before rendering an UrlState.


setNavStateCanonicalizer

public void setNavStateCanonicalizer(NavStateCanonicalizer pNavStateCanonicalizer)
Specifies the canonicalizer used to sort the navigation state before rendering an UrlState.

Parameters:
pNavStateCanonicalizer - the NavStateCanonicalizer class to use.

parseRequest

public com.endeca.soleng.urlformatter.UrlState parseRequest(javax.servlet.http.HttpServletRequest pRequest)
                                                     throws com.endeca.soleng.urlformatter.UrlFormatException
Specified by:
parseRequest in interface com.endeca.soleng.urlformatter.UrlFormatter
Overrides:
parseRequest in class com.endeca.soleng.urlformatter.basic.BasicUrlFormatter
Throws:
com.endeca.soleng.urlformatter.UrlFormatException

parseRequest

public com.endeca.soleng.urlformatter.UrlState parseRequest(java.lang.String pQueryString,
                                                            java.lang.String pPathInfo,
                                                            java.lang.String pCharacterEncoding)
                                                     throws com.endeca.soleng.urlformatter.UrlFormatException
Throws:
com.endeca.soleng.urlformatter.UrlFormatException

formatUrl

public java.lang.String formatUrl(com.endeca.soleng.urlformatter.UrlState pUrlState)
                           throws com.endeca.soleng.urlformatter.UrlFormatException
Specified by:
formatUrl in interface com.endeca.soleng.urlformatter.UrlFormatter
Overrides:
formatUrl in class com.endeca.soleng.urlformatter.basic.BasicUrlFormatter
Throws:
com.endeca.soleng.urlformatter.UrlFormatException

createUrlParam

public com.endeca.soleng.urlformatter.UrlParam createUrlParam(com.endeca.soleng.urlformatter.UrlState pUrlState,
                                                              java.lang.String pKey,
                                                              java.lang.String pValue)
Specified by:
createUrlParam in interface com.endeca.soleng.urlformatter.UrlFormatter
Overrides:
createUrlParam in class com.endeca.soleng.urlformatter.basic.BasicUrlFormatter

createERecUrlParam

public com.endeca.soleng.urlformatter.ERecUrlParam createERecUrlParam(com.endeca.soleng.urlformatter.UrlState pUrlState,
                                                                      com.endeca.navigation.ERec pERec)
Specified by:
createERecUrlParam in interface com.endeca.soleng.urlformatter.UrlFormatter
Overrides:
createERecUrlParam in class com.endeca.soleng.urlformatter.basic.BasicUrlFormatter

createAggrERecUrlParam

public com.endeca.soleng.urlformatter.AggrERecUrlParam createAggrERecUrlParam(com.endeca.soleng.urlformatter.UrlState pUrlState,
                                                                              com.endeca.navigation.AggrERec pAggrERec)
Specified by:
createAggrERecUrlParam in interface com.endeca.soleng.urlformatter.UrlFormatter
Overrides:
createAggrERecUrlParam in class com.endeca.soleng.urlformatter.basic.BasicUrlFormatter

createNavStateUrlParam

public com.endeca.soleng.urlformatter.NavStateUrlParam createNavStateUrlParam(com.endeca.soleng.urlformatter.UrlState pUrlState)
Specified by:
createNavStateUrlParam in interface com.endeca.soleng.urlformatter.UrlFormatter
Overrides:
createNavStateUrlParam in class com.endeca.soleng.urlformatter.basic.BasicUrlFormatter

formatPathKeywords

protected java.lang.String formatPathKeywords(com.endeca.soleng.urlformatter.UrlState pUrlState)
                                       throws com.endeca.soleng.urlformatter.UrlFormatException
Throws:
com.endeca.soleng.urlformatter.UrlFormatException

formatNavState

protected java.lang.String formatNavState(com.endeca.soleng.urlformatter.UrlState pUrlState)
                                   throws com.endeca.soleng.urlformatter.UrlFormatException
Throws:
com.endeca.soleng.urlformatter.UrlFormatException

formatERec

protected java.lang.String formatERec(com.endeca.soleng.urlformatter.UrlState pUrlState)
                               throws com.endeca.soleng.urlformatter.UrlFormatException
Throws:
com.endeca.soleng.urlformatter.UrlFormatException

formatAggrERec

protected java.lang.String formatAggrERec(com.endeca.soleng.urlformatter.UrlState pUrlState)
                                   throws com.endeca.soleng.urlformatter.UrlFormatException
Throws:
com.endeca.soleng.urlformatter.UrlFormatException

formatPathParams

protected java.lang.String formatPathParams(com.endeca.soleng.urlformatter.UrlState pUrlState)
                                     throws com.endeca.soleng.urlformatter.UrlFormatException
Throws:
com.endeca.soleng.urlformatter.UrlFormatException

formatQueryString

protected java.lang.String formatQueryString(com.endeca.soleng.urlformatter.UrlState pUrlState)
                                      throws com.endeca.soleng.urlformatter.UrlFormatException
Throws:
com.endeca.soleng.urlformatter.UrlFormatException

parsePathInfo

protected void parsePathInfo(com.endeca.soleng.urlformatter.UrlState pUrlState,
                             java.lang.String pPathInfo)
                      throws com.endeca.soleng.urlformatter.UrlFormatException
Throws:
com.endeca.soleng.urlformatter.UrlFormatException

parseQueryString

protected void parseQueryString(com.endeca.soleng.urlformatter.UrlState pUrlState,
                                java.lang.String pQueryString)
                         throws com.endeca.soleng.urlformatter.UrlFormatException
Throws:
com.endeca.soleng.urlformatter.UrlFormatException

Java URL Optimization API (SEO API) 2.1.1

Copyright © 2012 Endeca Technologies, Inc. All Rights Reserved.
@VERSION
PRODUCT: Java URL Optimization API (SEO API) (urlFormatterSeo)
VERSION: 2.1.1
BUILD:   12083DEV
ARCH_OS: n/a
DATE:    2012-02-16T20:40:10-0500