atg.repository.search.refinement
Class FacetTrail

java.lang.Object
  extended by atg.repository.search.refinement.FacetTrail

public class FacetTrail
extends java.lang.Object

This is a bean class that holds details about the current facet trail. It provides methods to retrieve the facet trail in different ways: - In the order that the facet values were navigated - Facet values are grouped by facet, each facet ordered according to when the first of its values was navigated


Field Summary
static java.lang.String CLASS_VERSION
          Class version string
protected  java.lang.String mAddFacetParameterName
           
protected  RepositoryItem mCurrentSortOption
           
protected  FacetHolder[] mFacetTrailGroupedByFacet
           
protected  FacetValue[] mFacetValues
           
protected  RefinementConfiguration mRefineConfig
           
protected  java.lang.String mRemoveAllFacetsParameterName
           
protected  java.lang.String mRemoveFacetParameterName
           
protected  java.lang.String mRemoveFacetTypeParameterName
           
protected  java.lang.String mSeparator
           
protected  java.lang.String mSortByParameterName
           
protected  java.lang.String mTrailParameterName
           
 
Constructor Summary
FacetTrail(RefinementConfiguration pRefineConfig, FacetValue[] pFacetValues, RepositoryItem pCurrentSortOptionItem)
          Constructor method.
 
Method Summary
 boolean facetExistsInTrail(Facet pFacet)
          Checks whether a facet exists in the facet trail
 java.lang.String getAddFacetParameterName()
           
 RepositoryItem getCurrentSortOption()
          Gets the currently selected sort option
 FacetHolder[] getFacetTrailGroupedByFacet()
           
 FacetValue[] getFacetValues()
          Getter for the facet trail by navigation order
 RefinementConfiguration getRefineConfig()
           
 java.lang.String getRemoveAllFacetsParameterName()
           
 java.lang.String getRemoveFacetParameterName()
           
 java.lang.String getRemoveFacetTypeParameterName()
           
 java.lang.String getSeparator()
           
 java.lang.String getSortByParameterName()
           
 java.lang.String getTrailParameterName()
           
 java.lang.String getTrailString()
          Generates a String representation of the facet trail that can be used in a URL parameter
protected  FacetHolder[] groupFacetTrailByFacet()
          Gets the facet trail grouped by facet
 boolean hasSearchFacets()
          Utility method to check whether the facet trail has any search facets.
 void setAddFacetParameterName(java.lang.String pAddFacetParameterName)
           
 void setCurrentSortOption(RepositoryItem pCurrentSortOption)
          Set the currently selected sort option
 void setFacetTrailGroupedByFacet(FacetHolder[] pFacetTrailGroupedByFacet)
           
 void setFacetValues(FacetValue[] pFacetValues)
          Setter for the facet trail by navigation order
 void setRefineConfig(RefinementConfiguration pRefineConfig)
           
 void setRemoveAllFacetsParameterName(java.lang.String pRemoveAllFacetsParameterName)
           
 void setRemoveFacetParameterName(java.lang.String pRemoveFacetParameterName)
           
 void setRemoveFacetTypeParameterName(java.lang.String pRemoveFacetTypeParameterName)
           
 void setSeparator(java.lang.String pSeparator)
           
 void setSortByParameterName(java.lang.String pSortByParameterName)
           
 void setTrailParameterName(java.lang.String pTrailParameterName)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string


mRefineConfig

protected RefinementConfiguration mRefineConfig

mFacetValues

protected FacetValue[] mFacetValues

mCurrentSortOption

protected RepositoryItem mCurrentSortOption

mSeparator

protected java.lang.String mSeparator

mTrailParameterName

protected java.lang.String mTrailParameterName

mSortByParameterName

protected java.lang.String mSortByParameterName

mAddFacetParameterName

protected java.lang.String mAddFacetParameterName

mRemoveFacetParameterName

protected java.lang.String mRemoveFacetParameterName

mRemoveAllFacetsParameterName

protected java.lang.String mRemoveAllFacetsParameterName

mRemoveFacetTypeParameterName

protected java.lang.String mRemoveFacetTypeParameterName

mFacetTrailGroupedByFacet

protected FacetHolder[] mFacetTrailGroupedByFacet
Constructor Detail

FacetTrail

public FacetTrail(RefinementConfiguration pRefineConfig,
                  FacetValue[] pFacetValues,
                  RepositoryItem pCurrentSortOptionItem)
           throws FacetException
Constructor method.

Parameters:
pRefineConfig - The refinement configuration to use for queries and to the set of sort options available.
pFacetValues - Array of facet values in the order that they were navigated.
pCurrentSortOption - The current sort option repository item
pSeparator - The separator sequence used to separate facet values in a facet trail URL parameter.
pSortString - String id to use to prefix the current sort option
Throws:
FacetException - for problems creating a RefinementSortOption
Method Detail

getRefineConfig

public RefinementConfiguration getRefineConfig()

setRefineConfig

public void setRefineConfig(RefinementConfiguration pRefineConfig)

getFacetValues

public FacetValue[] getFacetValues()
Getter for the facet trail by navigation order

Returns:
An array of FacetValue objects, each entry in the array representing a facet value that was navigated. Elements in the array are ordered according to the order they were navigated.

setFacetValues

public void setFacetValues(FacetValue[] pFacetValues)
Setter for the facet trail by navigation order

Parameters:
pFacetValues - An array of FacetValue objects, each entry in the array representing a facet value that was navigated. Elements in the array are ordered according to the order they were navigated.

getCurrentSortOption

public RepositoryItem getCurrentSortOption()
Gets the currently selected sort option

Returns:
A RepositoryItem for the current sort option. Will be null if no sort option has been selected.

setCurrentSortOption

public void setCurrentSortOption(RepositoryItem pCurrentSortOption)
Set the currently selected sort option

Parameters:
pSortOption - The RepositoryItem sort option to set.

getSeparator

public java.lang.String getSeparator()

setSeparator

public void setSeparator(java.lang.String pSeparator)

getTrailParameterName

public java.lang.String getTrailParameterName()

setTrailParameterName

public void setTrailParameterName(java.lang.String pTrailParameterName)

getSortByParameterName

public java.lang.String getSortByParameterName()

setSortByParameterName

public void setSortByParameterName(java.lang.String pSortByParameterName)

getAddFacetParameterName

public java.lang.String getAddFacetParameterName()

setAddFacetParameterName

public void setAddFacetParameterName(java.lang.String pAddFacetParameterName)

getRemoveFacetParameterName

public java.lang.String getRemoveFacetParameterName()

setRemoveFacetParameterName

public void setRemoveFacetParameterName(java.lang.String pRemoveFacetParameterName)

getRemoveAllFacetsParameterName

public java.lang.String getRemoveAllFacetsParameterName()

setRemoveAllFacetsParameterName

public void setRemoveAllFacetsParameterName(java.lang.String pRemoveAllFacetsParameterName)

getRemoveFacetTypeParameterName

public java.lang.String getRemoveFacetTypeParameterName()

setRemoveFacetTypeParameterName

public void setRemoveFacetTypeParameterName(java.lang.String pRemoveFacetTypeParameterName)

getFacetTrailGroupedByFacet

public FacetHolder[] getFacetTrailGroupedByFacet()

setFacetTrailGroupedByFacet

public void setFacetTrailGroupedByFacet(FacetHolder[] pFacetTrailGroupedByFacet)

groupFacetTrailByFacet

protected FacetHolder[] groupFacetTrailByFacet()
Gets the facet trail grouped by facet

Returns:
An array of FacetHolder objects, each entry in the array representing a particular facet that was navigated. Each of the values navigated for that facet are held within the FacetHolder object.

getTrailString

public java.lang.String getTrailString()
Generates a String representation of the facet trail that can be used in a URL parameter

Returns:
A String representation of this facet trail object.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

hasSearchFacets

public boolean hasSearchFacets()
Utility method to check whether the facet trail has any search facets.

Returns:
true if the facet trail contains one or more search facets, false otherwise.

facetExistsInTrail

public boolean facetExistsInTrail(Facet pFacet)
Checks whether a facet exists in the facet trail

Parameters:
pFacet - The facet to check
Returns:
true if the facet occurs in the facet trail, false otherwise.