com.endeca.infront.cartridge
Class ResultsListRequestParamMarshaller

java.lang.Object
  extended by com.endeca.infront.cartridge.RequestParamMarshaller
      extended by com.endeca.infront.cartridge.ResultsListRequestParamMarshaller

public class ResultsListRequestParamMarshaller
extends RequestParamMarshaller

Creates ResultsListHandler configuration from the parameters present in a request URL. The following mapping is used:


Field Summary
static String OFFSET_PARAMETER
          Name of request parameter that sets the offset, in terms of number of records from the start of the results, of the first record of the ResultsList, "No".
static String RECORDS_PER_PAGE_PARAMETER
          Name of request parameter that sets the maximum number of records that the ResultsList may contain, "Nrpp".
static String RELRANK_KEY_PARAMETER
          Name of request parameter that sets the relevance ranking search key.
static String RELRANK_MATCHMODE_PARAMETER
          Name of request parameter that sets the relevance ranking match mode.
static String RELRANK_TERMS_PARAMETER
          Name of request parameter that sets the relevance ranking search terms.
static String SORT_PARAMETER
          Name of request parameter that sets the sort options, "Ns".
static String WHY_MATCH
          Query parameter name for turning on debug information about why a record is included in a text search result, "whymatch".
static String WHY_RANK
          Query parameter name for turning on debug information about why a record is ordered higher or lower than another in the result list, "whyrank".
 
Fields inherited from class com.endeca.infront.cartridge.RequestParamMarshaller
mRequest, mRequestMap
 
Constructor Summary
ResultsListRequestParamMarshaller()
          Creates the marshaller for reading request parameters related to ResultsListConfig.
 
Method Summary
 ContentItem marshall()
          Creates a new ContentItem and populates it with information from the HttpServletRequest.
 void setEnableRecordsPerPage(boolean enable)
          Controls whether or not records per page can be set via RECORDS_PER_PAGE_PARAMETER.
 void setMaxRecordsPerPage(int max)
          Sets the maximum number of records per page that will be returned.
 
Methods inherited from class com.endeca.infront.cartridge.RequestParamMarshaller
convertToBoolean, convertToInt, convertToList, convertToLong, override, setHttpServletRequest, setRequestMap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OFFSET_PARAMETER

public static final String OFFSET_PARAMETER
Name of request parameter that sets the offset, in terms of number of records from the start of the results, of the first record of the ResultsList, "No".

See Also:
ResultsListConfig.setOffset(long), Constant Field Values

RECORDS_PER_PAGE_PARAMETER

public static final String RECORDS_PER_PAGE_PARAMETER
Name of request parameter that sets the maximum number of records that the ResultsList may contain, "Nrpp".

See Also:
ResultsListConfig.setRecordsPerPage(int), Constant Field Values

SORT_PARAMETER

public static final String SORT_PARAMETER
Name of request parameter that sets the sort options, "Ns". Parameter value must be one or more sort keys (properties or dimensions), separated by "||". Optionally, each sort key may be followed by a suffix of "|1", indicating descending order, or "|0", indicating ascending order (the default).

If a value is present for this parameter, it is parsed to create the selected SortOption

See Also:
ResultsListConfig.setSortOption(com.endeca.infront.navigation.model.SortOption), Constant Field Values

WHY_RANK

public static final String WHY_RANK
Query parameter name for turning on debug information about why a record is ordered higher or lower than another in the result list, "whyrank". Any available debug information will appear in the Record output model's attribute with the key "DGraph.WhyRank". This parameter value overrides the default value that is set up by the application. e.g. /N-83092?whyrank=1

See Also:
ResultsListConfig.setWhyRankEnabled(boolean), Constant Field Values

WHY_MATCH

public static final String WHY_MATCH
Query parameter name for turning on debug information about why a record is included in a text search result, "whymatch". Any available debug information will appear in the Record output model's attribute with the key "DGraph.WhyMatch". on the output model. This parameter value overrides the default value that is set up by the application. e.g. /N-83092?whymatch=1&Ntt=cannon

See Also:
ResultsListConfig.setWhyMatchEnabled(boolean), Constant Field Values

RELRANK_KEY_PARAMETER

public static final String RELRANK_KEY_PARAMETER
Name of request parameter that sets the relevance ranking search key. The key may be a search interface defined in the Endeca MDEX or it may be a property or dimension in the Endeca MDEX, which is enabled for search. e.g. /N-83092?Nrk=product.id

See Also:
ResultsListConfig.setRelRankKey(String), Constant Field Values

RELRANK_MATCHMODE_PARAMETER

public static final String RELRANK_MATCHMODE_PARAMETER
Name of request parameter that sets the relevance ranking match mode. When specifying match mode, it should start with 'match'. See the list of match modes here. MatchMode e.g. /N-83092?Nrm=matchall

See Also:
ResultsListConfig.setRelRankMatchMode(MatchMode), Constant Field Values

RELRANK_TERMS_PARAMETER

public static final String RELRANK_TERMS_PARAMETER
Name of request parameter that sets the relevance ranking search terms. For multiple terms, each term is delimited by a plus (+) sign. Note that these relevance ranking terms can be different from the search terms in the search filter. e.g. /N-83092?Nrt=canon+bag

See Also:
ResultsListConfig.setRelRankTerms(String), Constant Field Values
Constructor Detail

ResultsListRequestParamMarshaller

public ResultsListRequestParamMarshaller()
Creates the marshaller for reading request parameters related to ResultsListConfig.

Method Detail

setMaxRecordsPerPage

public void setMaxRecordsPerPage(int max)
Sets the maximum number of records per page that will be returned. This is used to prevent denial-of-service attacks if a malicious user requests a page with a very large RECORDS_PER_PAGE_PARAMETER value. The default value is 1000.

Note that this value is ignored if records per page parsing is disabled.

Parameters:
max - a positive integer to limit the number of records that can be requested via RECORDS_PER_PAGE_PARAMETER.
Throws:
IllegalArgumentException - if max is negative or zero
See Also:
setEnableRecordsPerPage(boolean), ResultsListConfig.setRecordsPerPage(int)

setEnableRecordsPerPage

public void setEnableRecordsPerPage(boolean enable)
Controls whether or not records per page can be set via RECORDS_PER_PAGE_PARAMETER. The default value is true.

Parameters:
enable - true to enable use of RECORDS_PER_PAGE_PARAMETER, false to disable request parameter control of records per page.
See Also:
ResultsListConfig.setRecordsPerPage(int)

marshall

public ContentItem marshall()
Description copied from class: RequestParamMarshaller
Creates a new ContentItem and populates it with information from the HttpServletRequest. More specifically, this method iterates through the keys in the request map; for each key (URL parameter), if a corresponding value exists in the HttpServletRequest, then this method stores the value in the new ContentItem using the ContentItem key obtained from the request map.

Overrides:
marshall in class RequestParamMarshaller


Copyright © 2012, Oracle and/or its affiliates. All rights reserved.