Java URL Optimization API (SEO API) 2.1.1

com.endeca.soleng.urlformatter.seo
Class SeoERecFormatter

java.lang.Object
  extended by com.endeca.soleng.urlformatter.seo.SeoERecFormatter
All Implemented Interfaces:
ERecFormatter
Direct Known Subclasses:
SeoAggrERecFormatter

public class SeoERecFormatter
extends java.lang.Object
implements ERecFormatter

An ERecFormatter that formats the UrlState associated with an Endecan record in SEO Optimized format, taking into account record Dimension Values and Properties.

Property Summary
Property Type Default Value
useDimensionNameAsKey boolean false
dimLocationFormatters DimLocationFormatter[] null
propertyKeys String[] empty
propertyFormatter StringFormatter NOOP_STRING_FORMATTER = new StringFormatter()


Constructor Summary
SeoERecFormatter()
           
 
Method Summary
 java.lang.String formatERec(com.endeca.soleng.urlformatter.UrlState pUrlState, com.endeca.navigation.ERec pERec)
           
 DimLocationFormatter[] getDimLocationFormatters()
           
 StringFormatter getPropertyFormatter()
           
 java.lang.String[] getPropertyKeys()
           
 boolean getUseDimensionNameAsKey()
          Indicates whether DimLocationFormatter objects should be associated to this formatter by dimension name or id.
 void setDimLocationFormatters(DimLocationFormatter[] pDimLocationFormatters)
          Specifies a list of DimLocationFormatters that will be used to format the DimLocations in the UrlState.
 void setPropertyFormatter(StringFormatter pPropertyFormatter)
          Specifies a class that implements StringFormatter to format each of the properties included in the propertyKeys.
 void setPropertyKeys(java.lang.String[] pPropertyKeys)
          Specifies a list of Record Property keys that will be included in the formatted Url.
 void setUseDimensionNameAsKey(boolean pUseDimensionNameAsKey)
          Specifies whether DimLocationFormatter objects should be associated to this formatter by dimension name or id.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SeoERecFormatter

public SeoERecFormatter()
Method Detail

getUseDimensionNameAsKey

public boolean getUseDimensionNameAsKey()
Indicates whether DimLocationFormatter objects should be associated to this formatter by dimension name or id.


setUseDimensionNameAsKey

public void setUseDimensionNameAsKey(boolean pUseDimensionNameAsKey)
Specifies whether DimLocationFormatter objects should be associated to this formatter by dimension name or id.

Parameters:
pUseDimensionNameAsKey - flag indicating whether dimension name should be used.
See Also:
SeoDimLocationFormatter.getKey(), setDimLocationFormatters(DimLocationFormatter[])

getDimLocationFormatters

public DimLocationFormatter[] getDimLocationFormatters()

setDimLocationFormatters

public void setDimLocationFormatters(DimLocationFormatter[] pDimLocationFormatters)
Specifies a list of DimLocationFormatters that will be used to format the DimLocations in the UrlState. Each DimLocationFormatter will specify one particular DimLocation's formatting in the URL.

Parameters:
pDimLocationFormatters - Array of DimLocationFormatter objects used to format the UrlState.

See the SeoDimLocationFormatter for an example implementation of a DimLocation formatter.

getPropertyKeys

public java.lang.String[] getPropertyKeys()

setPropertyKeys

public void setPropertyKeys(java.lang.String[] pPropertyKeys)
Specifies a list of Record Property keys that will be included in the formatted Url.

Parameters:
pPropertyKeys - Array of Properties to include in the formatted Url.

The following Url could be produced from an empty pPropertyKeys array:
http://www.mysite.com/controller/Sonoma/Weinstock/Wine-Red/Vintage-1994/_/R-47417

If the pPropertyKeys included P_Name, the following Url would be produced instead:
http://www.mysite.com/controller/Sonoma/Weinstock/Wine-Red/Vintage-1994/Cabernet-Sauvignon-Sonoma-County/_/R-47417

getPropertyFormatter

public StringFormatter getPropertyFormatter()

setPropertyFormatter

public void setPropertyFormatter(StringFormatter pPropertyFormatter)
Specifies a class that implements StringFormatter to format each of the properties included in the propertyKeys.

Parameters:
pPropertyFormatter - StringFormatter class to format the propertyKeys.

The following Url might be output if the default (empty) StringFormatter were used: http://www.mysite.com/controller/Sonoma/Weinstock/Wine-Red/Vintage-1994/Cabernet Sauvignon Sonoma County/_/R-47417 The Url might be output as followed if it has an UpperCaseStringFormatter set as the propertyFormatter: http://www.mysite.com/controller/Sonoma/Weinstock/Wine-Red/Vintage-1994/CABERNET SAUVIGNON SONOMA COUNTY/_/R-47417

formatERec

public java.lang.String formatERec(com.endeca.soleng.urlformatter.UrlState pUrlState,
                                   com.endeca.navigation.ERec pERec)
                            throws com.endeca.soleng.urlformatter.UrlFormatException
Specified by:
formatERec in interface ERecFormatter
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