public class CombinedUrlFormatter extends Object implements UrlFormatter
UrlFormatter that formats either traditional or SEO optimized URL, based on the URL pattern.
instances of this class are not reentrant -- and they must be instantiated separately for each incoming request
(i.e. they must be request-scoped, not session or global scope).
| Property Summary | ||
|---|---|---|
| Property | Type | Default Value |
basicUrlFormatter |
|
null |
seoUrlPatterns |
|
null |
seoUrlFormatter |
|
null |
| Constructor and Description |
|---|
CombinedUrlFormatter() |
| 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. |
String |
formatCanonicalUrl(UrlState pUrlState)
Formats a canonical url.
|
String |
formatSeoUrl(UrlState pUrlState) |
String |
formatUrl(UrlState pUrlState)
Formats the specified
UrlState into an URL string. |
String |
getAggrERecParamKey()
The parameter key used for aggregate record detail links - typically "A".
|
UrlFormatter |
getBasicUrlFormatter() |
String |
getDefaultEncoding()
Returns the default character encoding that should be used when
transforming URLs to and from various string forms.
|
String |
getERecParamKey()
The parameter key used for record detail links - typically "R".
|
String |
getNavStateParamKey()
The parameter key used for navigation state - typically "N".
|
UrlFormatter |
getSeoUrlFormatter() |
SeoUrlPatterns |
getSeoUrlPatterns() |
UrlFormatter |
getUrlFormatterInAction() |
boolean |
isSeoUrl(String pPathInfo)
Determine if an inbound URL should be treated as an SEO URL.
|
UrlState |
parseRequest(javax.servlet.http.HttpServletRequest pRequest)
Parses the specified request into an
UrlState. |
UrlState |
parseRequest(String pQueryString,
String pPathInfo,
String pCharacterEncoding) |
UrlState |
parseRequest(String pQueryString,
String pPathInfo,
String pCharacterEncoding,
Boolean useSeoUrlFormatter) |
void |
setBasicUrlFormatter(UrlFormatter pBasicUrlFormatter)
Specifies the
UrlFormatter for handling traditional Endeca URL. |
void |
setSeoUrlFormatter(UrlFormatter pSeoUrlFormatter)
Specifies the
UrlFormatter for handling SEO optimized URL. |
void |
setSeoUrlPatterns(SeoUrlPatterns pSeoUrlPatterns)
Register SEO URL patterns.
|
public SeoUrlPatterns getSeoUrlPatterns()
public void setSeoUrlPatterns(SeoUrlPatterns pSeoUrlPatterns)
pSeoUrlPatterns - the URL patterns for SEO URLs.public boolean isSeoUrl(String pPathInfo)
TRUE if the inbound URL should be treated as an SEO URL.public UrlFormatter getBasicUrlFormatter()
UrlFormatter for handling traditional Endeca URL.public void setBasicUrlFormatter(UrlFormatter pBasicUrlFormatter)
UrlFormatter for handling traditional Endeca URL.pBasicUrlFormatter - the UrlFormatter class for handling traditional Endeca URL.public UrlFormatter getSeoUrlFormatter()
UrlFormatter for handling SEO optimized URL.public void setSeoUrlFormatter(UrlFormatter pSeoUrlFormatter)
UrlFormatter for handling SEO optimized URL.pSeoUrlFormatter - the UrlFormatter class for handling SEO optimized URL.public UrlFormatter getUrlFormatterInAction()
UrlFormatter used for handling the current URL.public UrlState parseRequest(javax.servlet.http.HttpServletRequest pRequest) throws UrlFormatException
UrlFormatterUrlState.parseRequest in interface UrlFormatterpRequest - 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 UrlFormatterUrlFormatExceptionpublic UrlState parseRequest(String pQueryString, String pPathInfo, String pCharacterEncoding, Boolean useSeoUrlFormatter) throws UrlFormatException
UrlFormatExceptionpublic String formatUrl(UrlState pUrlState) throws UrlFormatException
UrlFormatterUrlState into an URL string.formatUrl in interface UrlFormatterpUrlState - the UrlState to format.UrlFormatException - if the UrlState cannot be formatted.public String formatSeoUrl(UrlState pUrlState) throws UrlFormatException
UrlFormatExceptionpublic String formatCanonicalUrl(UrlState pUrlState) throws UrlFormatException
UrlFormatterformatCanonicalUrl in interface UrlFormatterpUrlState - The URL State to use to format the URL.UrlFormatException - Throws formatting exception.public String getDefaultEncoding()
UrlFormatterUrlState.getDefaultEncoding in interface UrlFormatterUrlState.UrlState(UrlFormatter,String)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 UrlFormatterpUrlState - 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 UrlFormatterpUrlState - 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 UrlFormatterpUrlState - 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 UrlFormatterpUrlState - the UrlState that will contain the parameter.UrlFormatter.getNavStateParamKey()public String getNavStateParamKey()
UrlFormattergetNavStateParamKey in interface UrlFormatterUrlFormatter.createNavStateUrlParam(UrlState)public String getERecParamKey()
UrlFormattergetERecParamKey in interface UrlFormatterUrlFormatter.createERecUrlParam(UrlState,com.endeca.navigation.ERec)public String getAggrERecParamKey()
UrlFormattergetAggrERecParamKey in interface UrlFormatterUrlFormatter.createAggrERecUrlParam(UrlState,com.endeca.navigation.AggrERec)Copyright © 2019, Oracle and/or its affiliates. All rights reserved.