com.day.cq.searchpromote
Class Search

java.lang.Object
  extended by com.day.cq.searchpromote.Search

public final class Search
extends Object


Field Summary
static String PN_ACCOUNT_NUMBER
          Property name account number
static String PN_MEMBER_ID
          Property name member ID
static String PN_SEARCHFORMXML
          Property name search form XML
static String QUERY_PARAM_NAME
          Query parameter
static String VALID_QUERY_PATTERN
          Valid query pattern
 
Constructor Summary
Search(SlingHttpServletRequest request, Configuration configuration)
           
 
Method Summary
 Banner getBanner(String bannerArea)
          Returns the Banner for the specified bannerArea or null if it could not be found.
 List<Banner> getBanners()
          Returns a List of Banners.
 List<BreadCrumbItem> getBreadcrumbs()
          Returns a List of BreadCrumItem's.
 Long getExecutionTime()
          Returns query execution time.
 Facet getFacet(String name)
          Returns the Facet with the specified name or null if it could not be found.
 List<Facet> getFacets()
          Returns a List of Facet's.
 Menu getMenu(String menuName)
          Returns the Banner for the specified bannerArea or null if it could not be found.
 List<Menu> getMenus()
          Returns a List of Banners.
 Pagination getPagination()
          Returns the Pagination.
 Query getQuery()
          Returns the Query.
static String getQueryParameter(String queryString, String parameter)
          Returns a query parameter from the provided query string.
 String getQueryString()
          Returns current query string.
 String getRedirect()
          Returns a String containing the url to redirect to.
 List<Result> getResults()
          Returns a List of Result's.
 SearchForm getSearchForm()
          Returns the SearchForm.
 Suggestions getSuggestion()
          Returns a Suggestions object.
 List<Suggestion> getSuggestions()
          Returns a List of Suggestion's.
 void setQueryString(String query)
          Sets query string.
 boolean shouldRedirect()
          Returns a Boolean wether the request should be redirected
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VALID_QUERY_PATTERN

public static final String VALID_QUERY_PATTERN
Valid query pattern

See Also:
Constant Field Values

QUERY_PARAM_NAME

public static final String QUERY_PARAM_NAME
Query parameter

See Also:
Constant Field Values

PN_MEMBER_ID

public static final String PN_MEMBER_ID
Property name member ID

See Also:
Constant Field Values

PN_ACCOUNT_NUMBER

public static final String PN_ACCOUNT_NUMBER
Property name account number

See Also:
Constant Field Values

PN_SEARCHFORMXML

public static final String PN_SEARCHFORMXML
Property name search form XML

See Also:
Constant Field Values
Constructor Detail

Search

public Search(SlingHttpServletRequest request,
              Configuration configuration)
       throws SearchPromoteException
Parameters:
request -
analyticsConfiguration -
Throws:
SearchPromoteException
Method Detail

getQueryParameter

public static String getQueryParameter(String queryString,
                                       String parameter)
Returns a query parameter from the provided query string. Additional to the delimiter & the Search&Promote parameter delimiters ; and / are supported.

Parameters:
queryString -
parameter -
Returns:

getQueryString

public String getQueryString()
Returns current query string.

Returns:

setQueryString

public void setQueryString(String query)
Sets query string.

Parameters:
query -

getSearchForm

public SearchForm getSearchForm()
Returns the SearchForm.

Returns:

getQuery

public Query getQuery()
Returns the Query.

Returns:

getBreadcrumbs

public List<BreadCrumbItem> getBreadcrumbs()
Returns a List of BreadCrumItem's.

Returns:

getPagination

public Pagination getPagination()
Returns the Pagination.

Returns:

getResults

public List<Result> getResults()
Returns a List of Result's.

Returns:

getRedirect

public String getRedirect()
Returns a String containing the url to redirect to.

Returns:

shouldRedirect

public boolean shouldRedirect()
Returns a Boolean wether the request should be redirected

Returns:

getSuggestion

public Suggestions getSuggestion()
Returns a Suggestions object.

Returns:

getSuggestions

public List<Suggestion> getSuggestions()
Returns a List of Suggestion's.

Returns:

getFacets

public List<Facet> getFacets()
Returns a List of Facet's.

Returns:

getFacet

public Facet getFacet(String name)
Returns the Facet with the specified name or null if it could not be found.

Parameters:
name -
Returns:

getBanners

public List<Banner> getBanners()
Returns a List of Banners.

Returns:

getBanner

public Banner getBanner(String bannerArea)
Returns the Banner for the specified bannerArea or null if it could not be found.

Parameters:
name -
Returns:

getMenus

public List<Menu> getMenus()
Returns a List of Banners.

Returns:

getMenu

public Menu getMenu(String menuName)
Returns the Banner for the specified bannerArea or null if it could not be found.

Parameters:
name -
Returns:

getExecutionTime

public Long getExecutionTime()
Returns query execution time. The execution time is built on the sum of request time and parsing time.

Returns:
Execution time in milliseconds


Copyright © 2011-2013 Adobe Systems Incorporated. All Rights Reserved.