|
Java URL Optimization API (SEO API) 2.1.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.endeca.soleng.urlformatter.seo.SeoDimLocationFormatter
public class SeoDimLocationFormatter
A formatter that generates URL path keywords from a DimLocation
object in the order [root][ancestors][descriptor]. Optional StringFormatter
objects can be added to process the DimVal names.
| Property Summary | ||
|---|---|---|
| Property | Type | Default Value |
key |
Object (String or Long) |
null |
appendRoot |
boolean |
true |
appendAncestors |
boolean |
true |
appendDescriptor |
boolean |
true |
separator |
char |
- (hyphen) |
rootStringFormatter |
StringFormatter |
NOOP_STRING_FORMATTER |
dimValStringFormatter |
StringFormatter |
NOOP_STRING_FORMATTER |
| Constructor Summary | |
|---|---|
SeoDimLocationFormatter()
|
|
SeoDimLocationFormatter(java.lang.Object pKey,
boolean pAppendRoot,
boolean pAppendAncestors,
boolean pAppendDescriptor,
char pSeparator)
|
|
| Method Summary | |
|---|---|
java.lang.String |
formatDimLocation(com.endeca.soleng.urlformatter.UrlState pUrlState,
com.endeca.navigation.DimLocation pDimLocation)
Formats the specified DimLocation for the specified
UrlState. |
boolean |
getAppendAncestors()
Indicates whether or not to append ancestor DimVal
names to the URL. |
boolean |
getAppendDescriptor()
Indicates whether or not to append the descriptor DimVal
name to the URL. |
boolean |
getAppendRoot()
Indicates whether or not to append the root DimVal
name to the URL. |
StringFormatter |
getDimValStringFormatter()
The StringFormatter that is used to process the
ancestor and descriptor DimVal names. |
java.lang.Object |
getKey()
The dimension name or id used to associate a DimLocationFormatter
with a specific dimension. |
StringFormatter |
getRootStringFormatter()
The StringFormatter that is used to process the
root DimVal name. |
char |
getSeparator()
The separator character that is used to separate root, ancestor, and descriptor DimVal names. |
void |
setAppendAncestors(boolean pAppendAncestors)
Specifies whether or not to append ancestor DimVal
names to the URL. |
void |
setAppendDescriptor(boolean pAppendDescriptor)
Specifies whether or not to append the descriptor DimVal
name to the URL. |
void |
setAppendRoot(boolean pAppendRoot)
Specifies whether or not to append the root DimVal
name to the URL. |
void |
setDimValStringFormatter(StringFormatter pDimValStringFormatter)
Specifies the StringFormatter that is used to process the
ancestor and descriptor DimVal names. |
void |
setKey(java.lang.Object pKey)
Specifies the dimension name or id used to associate a DimLocationFormatter
with a specific dimension. |
void |
setRootStringFormatter(StringFormatter pRootStringFormatter)
Specifies the StringFormatter that is used to process the
root DimVal name. |
void |
setSeparator(char pSeparator)
Specifies the separator character that is used to separate root, ancestor, and descriptor DimVal names. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SeoDimLocationFormatter()
public SeoDimLocationFormatter(java.lang.Object pKey,
boolean pAppendRoot,
boolean pAppendAncestors,
boolean pAppendDescriptor,
char pSeparator)
| Method Detail |
|---|
public java.lang.Object getKey()
DimLocationFormatter
with a specific dimension.
getKey in interface DimLocationFormatterString or Long respectively).SeoNavStateFormatter.setUseDimensionNameAsKey(boolean),
SeoERecFormatter.setUseDimensionNameAsKey(boolean)public void setKey(java.lang.Object pKey)
DimLocationFormatter
with a specific dimension.
pKey - the dimension name or id (a String or Long respectively).SeoNavStateFormatter.setUseDimensionNameAsKey(boolean),
SeoERecFormatter.setUseDimensionNameAsKey(boolean)public boolean getAppendRoot()
DimVal
name to the URL.
public void setAppendRoot(boolean pAppendRoot)
DimVal
name to the URL.
If true for the "Wine Type" dimension, then the following URL would be output:
http://wines.endeca.com/browse/New-Zealand/Wine-Type-White-Sauvignon-Blanc/Cloudy-Bay/_/N-1z141hbZ66sZ1z1413q
If false, the URL would be output as follows (with "Wine-Type" omitted):
http://wines.endeca.com/browse/New-Zealand/White-Sauvignon-Blanc/Cloudy-Bay/_/N-1z141hbZ66sZ1z1413q
pAppendRoot - flag specifying whether the root DimVal
name should be appended to the URL.public boolean getAppendAncestors()
DimVal
names to the URL.
public void setAppendAncestors(boolean pAppendAncestors)
DimVal
names to the URL.
If true for the "Wine Type" dimension, then the following URL would be output:
http://wines.endeca.com/browse/New-Zealand/Wine-Type-White-Sauvignon-Blanc/Cloudy-Bay/_/N-1z141hbZ66sZ1z1413q
If false, the URL would be output as follows (with "White" omitted):
http://wines.endeca.com/browse/New-Zealand/Wine-Type-Sauvignon-Blanc/Cloudy-Bay/_/N-1z141hbZ66sZ1z1413q
pAppendAncestors - flag specifying whether the ancestor DimVal
names should be appended to the URL.public boolean getAppendDescriptor()
DimVal
name to the URL.
public void setAppendDescriptor(boolean pAppendDescriptor)
DimVal
name to the URL.
If true for the "Wine Type" dimension, then the following URL would be output:
http://wines.endeca.com/browse/New-Zealand/Wine-Type-White-Sauvignon-Blanc/Cloudy-Bay/_/N-1z141hbZ66sZ1z1413q
If false, the URL would be output as follows (with "Sauvignon-Blanc" omitted):
http://wines.endeca.com/browse/New-Zealand/Wine-Type-White/Cloudy-Bay/_/N-1z141hbZ66sZ1z1413q
pAppendDescriptor - flag specifying whether the descriptor DimVal
name should be appended to the URL.public char getSeparator()
DimVal names.
public void setSeparator(char pSeparator)
DimVal names.
In the following example, '/' is the separator character associated with the "Wine Type" dimension:
http://wines.endeca.com/browse/New-Zealand/Wine-Type/White/Sauvignon-Blanc/Cloudy-Bay/_/N-1z141hbZ66sZ1z1413q
pSeparator - the separator character to use.public StringFormatter getRootStringFormatter()
StringFormatter that is used to process the
root DimVal name.
public void setRootStringFormatter(StringFormatter pRootStringFormatter)
StringFormatter that is used to process the
root DimVal name.
The following example shows the resulting URL if a RegexStringFormatter
with a match pattern of "Wine-Type" and a replacement string of "Wine" were used
for the "Wine Type" dimension:
Before: http://wines.endeca.com/browse/New-Zealand/Wine-Type-White-Sauvignon-Blanc/Cloudy-Bay/_/N-1z141hbZ66sZ1z1413q After: http://wines.endeca.com/browse/New-Zealand/Wine-White-Sauvignon-Blanc/Cloudy-Bay/_/N-1z141hbZ66sZ1z1413q
pRootStringFormatter - the StringFormatter that is used to
process the roo DimVal name.StringFormatterChain,
RegexStringFormatter,
UpperCaseStringFormatter,
LowerCaseStringFormatter,
UrlEncodedStringFormatterpublic StringFormatter getDimValStringFormatter()
StringFormatter that is used to process the
ancestor and descriptor DimVal names.
public void setDimValStringFormatter(StringFormatter pDimValStringFormatter)
StringFormatter that is used to process the
ancestor and descriptor DimVal names.
The following example shows the resulting URL if an UpperCaseStringFormatter
were used for the "Wine Type" dimension:
before http://wines.endeca.com/browse/New-Zealand/Wine-Type-White-Sauvignon-Blanc/Cloudy-Bay/_/N-1z141hbZ66sZ1z1413q after http://wines.endeca.com/browse/New-Zealand/Wine-Type-WHITE-SAUVIGNON-BLANC/Cloudy-Bay/_/N-1z141hbZ66sZ1z1413q
Note that only the ancestor and descriptor DimVal names
have been converted to uppercase. Specifically, the "Wine-Type" root
dimension name is left untouched.
pDimValStringFormatter - the StringFormatter that is used to
process DimVal names.StringFormatterChain,
RegexStringFormatter,
UpperCaseStringFormatter,
LowerCaseStringFormatter,
UrlEncodedStringFormatter
public java.lang.String formatDimLocation(com.endeca.soleng.urlformatter.UrlState pUrlState,
com.endeca.navigation.DimLocation pDimLocation)
throws com.endeca.soleng.urlformatter.UrlFormatException
DimLocationFormatterDimLocation for the specified
UrlState.
formatDimLocation in interface DimLocationFormatterpUrlState - the UrlState that contains the
specified DimLocationpDimLocation - the DimLocation to be formatted
com.endeca.soleng.urlformatter.UrlFormatException - if the DimLocation cannot
be properly formatted
|
Java URL Optimization API (SEO API) 2.1.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
@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