public class SeoUrlFormatter extends BasicUrlFormatter
UrlFormatter that parses and formats optimized URLs.
| Property Summary | ||
|---|---|---|
| Property | Type | Default Value |
pathSeparatorToken |
String |
_ (underscore) |
pathKeyValueSeparator |
char |
- (hyphen) |
navStateFormatter |
|
null |
ERecFormatter |
|
null |
aggrERecFormatter |
|
null |
pathParamKeys |
String[] |
null |
urlParamEncoders |
|
null |
navStateCanonicalizer |
|
null |
| See properties inherited from BasicUrlFormatter | ||
| Modifier and Type | Field and Description |
|---|---|
static char |
PATH_SEPARATOR |
| Constructor and Description |
|---|
SeoUrlFormatter() |
| Modifier and Type | Method and Description |
|---|---|
AggrERecUrlParam |
createAggrERecUrlParam(UrlState pUrlState,
com.endeca.navigation.AggrERec pAggrERec)
Creates an URL parameter containing an
AggrERec. |
ERecUrlParam |
createERecUrlParam(UrlState pUrlState,
com.endeca.navigation.ERec pERec)
Creates an URL parameter containing an
ERec. |
NavStateUrlParam |
createNavStateUrlParam(UrlState pUrlState)
Creates an URL parameter containing an empty
NavState. |
UrlParam |
createUrlParam(UrlState pUrlState,
String pKey,
String pValue)
Creates an URL parameter for the specified
UrlState. |
protected String |
formatAggrERec(UrlState pUrlState) |
String |
formatCanonicalUrl(UrlState pUrlState)
Formats a canonical url.
|
protected String |
formatERec(UrlState pUrlState) |
protected String |
formatNavState(UrlState pUrlState) |
protected String |
formatPathKeywords(UrlState pUrlState) |
protected String |
formatPathParams(UrlState pUrlState) |
protected String |
formatQueryString(UrlState pUrlState) |
String |
formatUrl(UrlState pUrlState)
Formats the specified
UrlState into an URL string. |
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.
|
String[] |
getPathParamKeys()
The parameter keys that will be appended to the path.
|
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(UrlState pUrlState,
String pPathInfo) |
protected void |
parseQueryString(UrlState pUrlState,
String pQueryString) |
UrlState |
parseRequest(javax.servlet.http.HttpServletRequest pRequest)
Parses the specified request into an
UrlState. |
UrlState |
parseRequest(String pQueryString,
String pPathInfo,
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(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(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. |
void |
setUseNavStateCanonicalizer(boolean useNavStateCanonicalizer)
Determines whether or not to use canonicalizers when formatting the URL.
|
boolean |
useNavStateCanonicalizer()
The
useNavStateCanonicalizer property used determine whether to use any
canonicalizers associated with this formatter. |
getAggrERecParamKey, getDefaultEncoding, getERecParamKey, getNavStateParamKey, getPrependQuestionMark, parseRequest, setAggrERecParamKey, setDefaultEncoding, setERecParamKey, setNavStateParamKey, setPrependQuestionMarkpublic static final char PATH_SEPARATOR
public String getPathSeparatorToken()
public void setPathSeparatorToken(String pPathSeparatorToken)
http://www.mysite.com/controller/Wine+Type/Sparkling/Blanc+de+Blancs/XX/N-6202
pPathSeparatorToken - Path separator token to set. Cannot be null.IllegalArgumentException - if pPathSeparatorToken is null.public char getPathKeyValueSeparator()
public void setPathKeyValueSeparator(char pPathKeyValueSeparator)
In the following URL, '*' is the keyValueSeparator:
http://www.mysite.com/controller/Wine+Type/Sparkling/Blanc+de+Blancs/_/N*6202
pPathKeyValueSeparator - key value separator. Cannot be null.public boolean useNavStateCanonicalizer()
useNavStateCanonicalizer property used determine whether to use any
canonicalizers associated with this formatter.TRUE if the canonicalizer will be used.public void setUseNavStateCanonicalizer(boolean useNavStateCanonicalizer)
useNavStateCanonicalizer - If set to TRUE, the canonicalizer will
be used.public NavStateFormatter getNavStateFormatter()
NavStateFormatter property used to render navigation
state information to the URL path keywords.public void setNavStateFormatter(NavStateFormatter pNavStateFormatter)
navStateFormatter property, which is used to render
directory-style (path-encoded) keywords for UrlState objects
containing dimensional navigation state.pNavStateFormatter - object that is used to format the UrlState.SeoNavStateFormatterpublic ERecFormatter getERecFormatter()
ERecFormatter used to render endeca record
attributes to the URL path keywords.public void setERecFormatter(ERecFormatter pERecFormatter)
ERecFormatter property, which is used to render
directory-style (path-encoded) keywords for UrlState objects
containing an Endeca record.pERecFormatter - object that is used to format the UrlState.SeoERecFormatterpublic AggrERecFormatter getAggrERecFormatter()
AggrERecFormatter used to render aggregate record
attributes to the URL path keywords.public void setAggrERecFormatter(AggrERecFormatter pAggrERecFormatter)
aggrERecFormatter property, which is used to render
directory-style (path-encoded) keywords for UrlState objects
containing an Endeca aggregate record.pAggrERecFormatter - object that is used to format the UrlState.SeoAggrERecFormatterpublic String[] getPathParamKeys()
public void setPathParamKeys(String[] pPathParamKeys)
http://www.mysite.com/controller/Wine-Sparkling-Blanc-de-Blancs/Other-US/_/N-6202+4294963118If 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
pPathParamKeys - Array of keys that will be added to the path, rather than the query string.public UrlParamEncoder[] mUrlParamEncoders()
UrlParamEncoder objects used by this SeoUrlFormatter.public void setUrlParamEncoders(UrlParamEncoder[] pUrlParamEncoders)
UrlParamEncoder objects used by this SeoUrlFormatter.pUrlParamEncoders - array of encoders that are used to encode various URL parameters.public NavStateCanonicalizer getNavStateCanonicalizer()
UrlState.public void setNavStateCanonicalizer(NavStateCanonicalizer pNavStateCanonicalizer)
UrlState.pNavStateCanonicalizer - the NavStateCanonicalizer class to use.public UrlState parseRequest(javax.servlet.http.HttpServletRequest pRequest) throws UrlFormatException
UrlFormatterUrlState.parseRequest in interface UrlFormatterparseRequest in class BasicUrlFormatterpRequest - the request to parse.UrlFormatException - if the request cannot be parsed.public UrlState parseRequest(String pQueryString, String pPathInfo, String pCharacterEncoding) throws UrlFormatException
parseRequest in interface UrlFormatterparseRequest in class BasicUrlFormatterUrlFormatExceptionpublic String formatUrl(UrlState pUrlState) throws UrlFormatException
UrlFormatterUrlState into an URL string.formatUrl in interface UrlFormatterformatUrl in class BasicUrlFormatterpUrlState - the UrlState to format.UrlFormatException - if the UrlState cannot be formatted.public String formatCanonicalUrl(UrlState pUrlState) throws UrlFormatException
UrlFormatterformatCanonicalUrl in interface UrlFormatterformatCanonicalUrl in class BasicUrlFormatterpUrlState - The URL State to use to format the URL.UrlFormatException - Throws formatting exception.public UrlParam createUrlParam(UrlState pUrlState, String pKey, String pValue)
UrlFormatterUrlState. This is
an internal method used by an UrlState. You shouldn't need to
use this method unless you are implementing a custom UrlFormatter.createUrlParam in interface UrlFormattercreateUrlParam in class BasicUrlFormatterpUrlState - the UrlState that will contain the parameter.pKey - the parameter key.pValue - the parameter string value (fully decoded).public ERecUrlParam createERecUrlParam(UrlState pUrlState, com.endeca.navigation.ERec pERec)
UrlFormatterERec. This is
an internal method used by an UrlState. You shouldn't need to
use this method unless you are implementing a custom UrlFormatter.createERecUrlParam in interface UrlFormattercreateERecUrlParam in class BasicUrlFormatterpUrlState - the UrlState that will contain the parameter.pERec - the ERec to be contained in the UrlState.UrlFormatter.getERecParamKey()public AggrERecUrlParam createAggrERecUrlParam(UrlState pUrlState, com.endeca.navigation.AggrERec pAggrERec)
UrlFormatterAggrERec. This is
an internal method used by an UrlState. You shouldn't need to
use this method unless you are implementing a custom UrlFormatter.createAggrERecUrlParam in interface UrlFormattercreateAggrERecUrlParam in class BasicUrlFormatterpUrlState - the UrlState that will contain the parameter.pAggrERec - the AggrERec to be contained in the UrlState.UrlFormatter.getAggrERecParamKey()public NavStateUrlParam createNavStateUrlParam(UrlState pUrlState)
UrlFormatterNavState. This is
an internal method used by an UrlState. You shouldn't need to
use this method unless you are implementing a custom UrlFormatter.createNavStateUrlParam in interface UrlFormattercreateNavStateUrlParam in class BasicUrlFormatterpUrlState - the UrlState that will contain the parameter.UrlFormatter.getNavStateParamKey()protected String formatPathKeywords(UrlState pUrlState) throws UrlFormatException
UrlFormatExceptionprotected String formatNavState(UrlState pUrlState) throws UrlFormatException
UrlFormatExceptionprotected String formatERec(UrlState pUrlState) throws UrlFormatException
UrlFormatExceptionprotected String formatAggrERec(UrlState pUrlState) throws UrlFormatException
UrlFormatExceptionprotected String formatPathParams(UrlState pUrlState) throws UrlFormatException
UrlFormatExceptionprotected String formatQueryString(UrlState pUrlState) throws UrlFormatException
UrlFormatExceptionprotected void parsePathInfo(UrlState pUrlState, String pPathInfo) throws UrlFormatException
UrlFormatExceptionprotected void parseQueryString(UrlState pUrlState, String pQueryString) throws UrlFormatException
UrlFormatExceptionCopyright © 2019, Oracle and/or its affiliates. All rights reserved.