public interface SEOURLMapper
SEOURLMapperImpl
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COPYRIGHT
IBM copyright field.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
constructDynamicURLByPatternName(java.lang.String patternName,
TypedProperty requestProperties,
javax.servlet.jsp.PageContext pageContext)
This method constructs the dynamic url using the patternName and set of
request properties.
|
java.lang.String |
constructSEOURLByPatternName(java.lang.String patternName,
TypedProperty requestProperties,
javax.servlet.jsp.PageContext pageContext,
java.lang.String mappingName,
java.util.Map params)
This method constructs the SEO URL using the URL pattern name and request
properties specified.
|
java.util.List<java.lang.String> |
constructSEOUrlPrefixByUsageAndDevice(java.lang.String usage,
java.lang.String device,
TypedProperty urlProperties)
This method constructs all the valid URL prefixes for the usage and
device specified.The method looks up all the URL pattern configurations
for the store specified based on the usage to find all the applicable URL
patterns.
|
javax.servlet.http.HttpServletRequest |
deconstructHttpRequest(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.lang.Integer storeId)
This method deconstructs the incoming SEO URL to its dynamic equivalent.
|
java.lang.Integer |
getStoreIdFromSEOURL(java.lang.String seoURL)
This method parses the input
seoUrl and returns storeId. |
boolean |
isSEOURLPatternFeatureEnabled(java.lang.Integer storeId)
Check if SEO URL pattern based feature is enabled for the given store or
not.
|
java.util.List |
processRequestURL(javax.servlet.http.HttpServletRequest request)
This method checks if the incoming URL in the request is actually an SEO
URL or not.
|
static final java.lang.String COPYRIGHT
java.util.List<java.lang.String> constructSEOUrlPrefixByUsageAndDevice(java.lang.String usage, java.lang.String device, TypedProperty urlProperties) throws AbstractApplicationException
The storeId
and langId
are expected to be
passed in the request properties.
The URL prefix would have the location of the primary token for the
usage, tagged with a special marker. All the other tokens in the URL
pattern would be fully resolved. The marker used to identify the primary
token location in the URL is $SEO:PRIMARYTOKEN$
.
Assuming there is an URL pattern /StoreToken/LangToken/ProductToken for usage PRODUCT and device mobile, the method would construct the following URL prefix if the storeId, langId are specified in the properties. http://localhost/shop/Madisons/en/$SEO:PRIMARYTOKEN$ Where, localhost is the host name for the web server, //shop is the context root simplification defined for the site Madisons/en/$SEO:PRIMARYTOKEN$ is the URL prefix.
usage
- The usage of the URL prefixes being constructed. For example,
ITEM, PRODUCT etc.device
- The device for which the URL is being constructed. Values
supported are: SEOConstants#DEVICE_TYPE_MOBILE
or
SEOConstants#DEVICE_TYPE_STANDARD_BROWSER
urlProperties
- The input properties to construct the URL prefix.AbstractApplicationException
- When an error occurs while building the URL. Possible errors
are:
javax.servlet.http.HttpServletRequest deconstructHttpRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.Integer storeId) throws AbstractApplicationException
request
- The incoming servlet request.response
- The incoming servlet response object.storeId
- - Store Id for which the url needs to be deconstructedAbstractApplicationException
- When the deconstruction fails.java.lang.String constructSEOURLByPatternName(java.lang.String patternName, TypedProperty requestProperties, javax.servlet.jsp.PageContext pageContext, java.lang.String mappingName, java.util.Map params) throws AbstractApplicationException
storeId
and langId
are expected to be part of the request properties. If SEO URL based on
pattern feature is needed, then patternName parameter is mandatory and
should be non-null while mappingName will be ignored and null can be
passed for mappingName If SEO URL based on mapper file feature is needed,
then mappingName parameter is mandatory and should be non-null, while
patternName will be ignored and null can be passed for patternName.patternName
- The URL pattern name to be used for constructing the SEO URL based on pattern feature.requestProperties
- The input request properties for constructing the URL.pageContext
- The page context of the page on which the URL is being
constructed.mappingName
- The mapping name used in old SEO implementation.params
- Map of parameters passed to be used while constructing SEO URL based on mapping name.
Will be ignored when construction is done based on patternNameAbstractApplicationException
- When an error occurs while building the URL. Possible errors
are:
java.lang.String constructDynamicURLByPatternName(java.lang.String patternName, TypedProperty requestProperties, javax.servlet.jsp.PageContext pageContext) throws AbstractApplicationException
patternName
- - Name of the pattern. ViewName will be retrieved based on
this pattern name.requestProperties
- - Request properties which goes in as query parameters in the
resulting URL.pageContext
- - JSP page context object.AbstractApplicationException
boolean isSEOURLPatternFeatureEnabled(java.lang.Integer storeId)
storeId
- - StoreId for which this check needs to be donetrue
- if SEO based on URL pattern is enabled.
false
, otherwise.SEOURLPatternConfigurationRegistry#isSEOURLPatternFeatureEnabled(Integer)
java.lang.Integer getStoreIdFromSEOURL(java.lang.String seoURL)
seoUrl
and returns storeId.
Input string is parsed and each token in the string is matched against
the available tokens whose usageType is set to 'Store'
SEOConfigurationRegistry#getAllStaticSEOTokenUsageTypesForStore(Integer)
.
Token value of the matched token will be returned as storeId.seoURL
- - Input string which will be tokenized and parsed.java.util.List processRequestURL(javax.servlet.http.HttpServletRequest request)
/
in the request path
of the request object is used to do this check. The incoming URL is
considered as SEO URL only if it satisfies all of the below conditions:
/
in the
request path)
request
- - HttpServletRequest object. Note that this object might be
modified in certain scenario's.Boolean.TRUE
if the
incoming URL is SEO URL based on pattern feature. Otherwise,
Boolean FALSE