com.endeca.infront.navigation.event
Class NavigationEventWrapper

java.lang.Object
  extended by com.endeca.infront.navigation.event.NavigationEventWrapper

public class NavigationEventWrapper
extends Object

Provides a navigation specific schema to a request event.

Usage Example

To use, create a new NavigationEventWrapper by passing in a RequestEvent:
...
NavigationEventWrapper navigationEvent = new NavigationEventWrapper(RequestEventFactory.getEvent());

navigationEvent.setNumRecords(100);
...


Constructor Summary
NavigationEventWrapper(RequestEvent assemblerRequestEvent)
          Create a new NavigationEventWrapper object based on the given RequestEvent
 
Method Summary
 void addDidYouMeanTo(String recordName)
          Convenience method to add a single "did-you-mean" suggestion
 void addDimension(String dimension)
          Convenience method to add a single dimension
 void addDimensionValue(String dimensionValue)
          Convenience method to add a single dimension value
protected  void addListItem(String key, Object listItem)
          Add a list item to this map.
 void addRecordName(String recordName)
          Convenience method to add a single record name
 void addSortKey(String sortKey)
          Convenience method to add a single sort key
 void addSpotlight(String spotlight)
          Convenience method to add a single spotlight
 String getAutocorrectTo()
           
 String getContentPath()
           
 List<String> getDidYouMeanTo()
           
 List<String> getDimensions()
           
 List<String> getDimensionValues()
           
 Long getEneTime()
           
 Long getNumRecords()
           
 Integer getNumRefinements()
           
 List<String> getRecordNames()
           
 String getRecordSpec()
           
 RequestType getRequestType()
           
 String getSearchKey()
           
 String getSearchMode()
           
 String getSearchTerms()
           
 String getSiteRootPath()
           
 List<String> getSortKeys()
           
 List<String> getSpotlights()
           
 void setAutocorrectTo(String autocorrectTo)
           
 void setContentPath(String contentPath)
           
 void setDidYouMeanTo(List<String> didYouMeanTo)
           
 void setDimensions(List<String> dimensions)
           
 void setDimensionValues(List<String> dimensionValues)
           
 void setEneTime(Long eneTime)
           
 void setNumRecords(Long numRecords)
           
 void setNumRefinements(Integer numRefinements)
           
 void setRecordNames(List<String> recordNames)
           
 void setRecordSpec(String recordSpec)
           
 void setRequestType(RequestType requestType)
           
 void setSearchKey(String searchKey)
           
 void setSearchMode(String searchMode)
           
 void setSearchTerms(String searchTerms)
           
 void setSiteRootPath(String siteRootPath)
           
 void setSortKeys(List<String> sortKeys)
           
 void setSpotlights(List<String> spotlights)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NavigationEventWrapper

public NavigationEventWrapper(RequestEvent assemblerRequestEvent)
Create a new NavigationEventWrapper object based on the given RequestEvent

Parameters:
assemblerRequestEvent - the RequestEvent to wrap
Method Detail

addListItem

protected void addListItem(String key,
                           Object listItem)
Add a list item to this map. If the list does not exist, it is created. Only adds the item if it is not already present in the list.

Parameters:
key - the key of the list in this map
listItem - the item to add to the list corresponding to the key

getRequestType

public RequestType getRequestType()
Returns:
the type of request made (e.g. Navigation only, Search, etc.)

setRequestType

public void setRequestType(RequestType requestType)
Parameters:
requestType - the type of request made (e.g. Navigation only, Search, etc.)

getNumRecords

public Long getNumRecords()
Returns:
the number of records returned by this request in a results list

setNumRecords

public void setNumRecords(Long numRecords)
Parameters:
numRecords - the number of records returned by this request in a results list

getNumRefinements

public Integer getNumRefinements()
Returns:
the number of refinements selected

setNumRefinements

public void setNumRefinements(Integer numRefinements)
Parameters:
numRefinements - the number of refinements selected

getSearchKey

public String getSearchKey()
Returns:
the key used to search on in the given navigation state

setSearchKey

public void setSearchKey(String searchKey)
Parameters:
searchKey - the key used to search on in the given navigation state

getSearchTerms

public String getSearchTerms()
Returns:
the terms searched on

setSearchTerms

public void setSearchTerms(String searchTerms)
Parameters:
searchTerms - the terms searched on

getSearchMode

public String getSearchMode()
Returns:
the mode used to search on

setSearchMode

public void setSearchMode(String searchMode)
Parameters:
searchMode - the mode used to search on

getDimensions

public List<String> getDimensions()
Returns:
the list of names of dimensions selected for navigation

setDimensions

public void setDimensions(List<String> dimensions)
Parameters:
dimensions - the list of names of dimensions selected for navigation

addDimension

public void addDimension(String dimension)
Convenience method to add a single dimension

Parameters:
dimension - the dimension to add

getDimensionValues

public List<String> getDimensionValues()
Returns:
the list of dimension value names selected for navigation

setDimensionValues

public void setDimensionValues(List<String> dimensionValues)
Parameters:
dimensionValues - the list of dimension value names selected for navigation

addDimensionValue

public void addDimensionValue(String dimensionValue)
Convenience method to add a single dimension value

Parameters:
dimensionValue - the dimension value to add

getAutocorrectTo

public String getAutocorrectTo()
Returns:
if auto-correct triggered, what was suggested

setAutocorrectTo

public void setAutocorrectTo(String autocorrectTo)
Parameters:
autocorrectTo - if auto-correct triggered, what was suggested

getDidYouMeanTo

public List<String> getDidYouMeanTo()
Returns:
if "did you mean" triggered, what was suggested

setDidYouMeanTo

public void setDidYouMeanTo(List<String> didYouMeanTo)
Parameters:
didYouMeanTo - if "did you mean" triggered, what was suggested

addDidYouMeanTo

public void addDidYouMeanTo(String recordName)
Convenience method to add a single "did-you-mean" suggestion

Parameters:
recordName - the suggestion to add

getRecordNames

public List<String> getRecordNames()
Returns:
the names of the records returned by the request

setRecordNames

public void setRecordNames(List<String> recordNames)
Parameters:
recordNames - the names of the records returned by the request

addRecordName

public void addRecordName(String recordName)
Convenience method to add a single record name

Parameters:
recordName - the record name to add

getSpotlights

public List<String> getSpotlights()
Returns:
what spotlights triggered

setSpotlights

public void setSpotlights(List<String> spotlights)
Parameters:
spotlights - what spotlights triggered

addSpotlight

public void addSpotlight(String spotlight)
Convenience method to add a single spotlight

Parameters:
spotlight - the spotlight to add

getSortKeys

public List<String> getSortKeys()
Returns:
the keys sorted on. The key are strings with the format:
fieldName|(Descending|Ascending)

setSortKeys

public void setSortKeys(List<String> sortKeys)
Parameters:
sortKeys - the keys sorted on. The key are strings with the format:
fieldName|(Descending|Ascending)

addSortKey

public void addSortKey(String sortKey)
Convenience method to add a single sort key

Parameters:
sortKey - the sort key to add. Sort keys are strings with the format:
fieldName|(Descending|Ascending)

getEneTime

public Long getEneTime()
Returns:
the time the MDEX engine spent running the query, in milliseconds

setEneTime

public void setEneTime(Long eneTime)
Parameters:
eneTime - the time the MDEX engine spent running the query, in milliseconds

getSiteRootPath

public String getSiteRootPath()
Returns:
the site root path of the page corresponding to this request

setSiteRootPath

public void setSiteRootPath(String siteRootPath)
Parameters:
siteRootPath - the site root path of the page corresponding to this request

getContentPath

public String getContentPath()
Returns:
the content path of the page corresponding to this request

setContentPath

public void setContentPath(String contentPath)
Parameters:
contentPath - the content path of the page corresponding to this request

getRecordSpec

public String getRecordSpec()
Returns:
the record specifier for a selected record

setRecordSpec

public void setRecordSpec(String recordSpec)
Parameters:
recordSpec - the record specifier for a selected record


Copyright © 2012. All Rights Reserved.