Class CmsXMLSearchConfigurationParser
- java.lang.Object
-
- org.opencms.jsp.search.config.parser.CmsXMLSearchConfigurationParser
-
- All Implemented Interfaces:
I_CmsSearchConfigurationParser
public class CmsXMLSearchConfigurationParser extends java.lang.Object implements I_CmsSearchConfigurationParser
Search configuration parser reading XML.
-
-
Field Summary
Fields Modifier and Type Field Description protected static org.apache.commons.logging.Log
LOG
Logger for the class.
-
Constructor Summary
Constructors Constructor Description CmsXMLSearchConfigurationParser(CmsXmlContent xml, java.util.Locale locale)
Constructor taking the XML content that should be read and the locale in which it should be read.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected int
getMaxReturnedResults(java.lang.String indexName)
Returns the number of maximally returned results, ornull
if the indexes default should be used.I_CmsSearchConfigurationCommon
parseCommon(CmsObject cms)
Returns the common search configuration.I_CmsSearchConfigurationDidYouMean
parseDidYouMean()
Returns the configuration for the "Did you mean ...?" feature.protected java.util.List<I_CmsSearchConfigurationFacetQuery.I_CmsFacetQueryItem>
parseFacetQueryItems(java.lang.String path)
Helper to read a mandatory String value list.protected I_CmsSearchConfigurationFacetField
parseFieldFacet(java.lang.String pathPrefix)
Reads the configuration of a field facet.java.util.Map<java.lang.String,I_CmsSearchConfigurationFacetField>
parseFieldFacets()
Returns the configuration for the field facets.I_CmsSearchConfigurationGeoFilter
parseGeoFilter()
Returns the configuration for the Geo filter.I_CmsSearchConfigurationHighlighting
parseHighlighter()
Returns the configuration for the highlighting.protected java.lang.Boolean
parseOptionalBooleanValue(java.lang.String path)
Helper to read an optional Boolean value.protected java.lang.Integer
parseOptionalIntValue(java.lang.String path)
Helper to read an optional Integer value.protected java.lang.String
parseOptionalStringValue(java.lang.String path)
Helper to read an optional String value.protected java.util.List<java.lang.String>
parseOptionalStringValues(java.lang.String path)
Helper to read an optional String value list.I_CmsSearchConfigurationPagination
parsePagination()
Returns the configuration for the pagination.I_CmsSearchConfigurationFacetQuery
parseQueryFacet()
Returns the configuration for the query facet.protected I_CmsSearchConfigurationFacetRange
parseRangeFacet(java.lang.String pathPrefix)
Reads the configuration of a range facet.java.util.Map<java.lang.String,I_CmsSearchConfigurationFacetRange>
parseRangeFacets()
Returns the configuration for the range facets.I_CmsSearchConfigurationSorting
parseSorting()
Returns the configuration for sorting.
-
-
-
Field Detail
-
LOG
protected static final org.apache.commons.logging.Log LOG
Logger for the class.
-
-
Constructor Detail
-
CmsXMLSearchConfigurationParser
public CmsXMLSearchConfigurationParser(CmsXmlContent xml, java.util.Locale locale)
Constructor taking the XML content that should be read and the locale in which it should be read.- Parameters:
xml
- The XML content that should be read for the configuration.locale
- The locale in which the content should be read.
-
-
Method Detail
-
parseCommon
public I_CmsSearchConfigurationCommon parseCommon(CmsObject cms)
Description copied from interface:I_CmsSearchConfigurationParser
Returns the common search configuration.- Specified by:
parseCommon
in interfaceI_CmsSearchConfigurationParser
- Parameters:
cms
- the current context- Returns:
- The common search configuration.
- See Also:
I_CmsSearchConfigurationParser.parseCommon(CmsObject)
-
parseDidYouMean
public I_CmsSearchConfigurationDidYouMean parseDidYouMean()
Description copied from interface:I_CmsSearchConfigurationParser
Returns the configuration for the "Did you mean ...?" feature.- Specified by:
parseDidYouMean
in interfaceI_CmsSearchConfigurationParser
- Returns:
- The configuration for the "Did you mean ...?" feature.
- See Also:
I_CmsSearchConfigurationParser.parseDidYouMean()
-
parseFieldFacets
public java.util.Map<java.lang.String,I_CmsSearchConfigurationFacetField> parseFieldFacets()
Description copied from interface:I_CmsSearchConfigurationParser
Returns the configuration for the field facets.- Specified by:
parseFieldFacets
in interfaceI_CmsSearchConfigurationParser
- Returns:
- The configuration for the field facets.
- See Also:
I_CmsSearchConfigurationParser.parseFieldFacets()
-
parseGeoFilter
public I_CmsSearchConfigurationGeoFilter parseGeoFilter()
Description copied from interface:I_CmsSearchConfigurationParser
Returns the configuration for the Geo filter.- Specified by:
parseGeoFilter
in interfaceI_CmsSearchConfigurationParser
- Returns:
- The configuration for the Geo filter.
- See Also:
I_CmsSearchConfigurationParser.parseGeoFilter()
-
parseHighlighter
public I_CmsSearchConfigurationHighlighting parseHighlighter()
Description copied from interface:I_CmsSearchConfigurationParser
Returns the configuration for the highlighting.- Specified by:
parseHighlighter
in interfaceI_CmsSearchConfigurationParser
- Returns:
- The configuration for the highlighting.
- See Also:
I_CmsSearchConfigurationParser.parseHighlighter()
-
parsePagination
public I_CmsSearchConfigurationPagination parsePagination()
Description copied from interface:I_CmsSearchConfigurationParser
Returns the configuration for the pagination.- Specified by:
parsePagination
in interfaceI_CmsSearchConfigurationParser
- Returns:
- The configuration for the pagination.
- See Also:
I_CmsSearchConfigurationParser.parsePagination()
-
parseQueryFacet
public I_CmsSearchConfigurationFacetQuery parseQueryFacet()
Description copied from interface:I_CmsSearchConfigurationParser
Returns the configuration for the query facet.- Specified by:
parseQueryFacet
in interfaceI_CmsSearchConfigurationParser
- Returns:
- The configuration for the query facet.
- See Also:
I_CmsSearchConfigurationParser.parseQueryFacet()
-
parseRangeFacets
public java.util.Map<java.lang.String,I_CmsSearchConfigurationFacetRange> parseRangeFacets()
Description copied from interface:I_CmsSearchConfigurationParser
Returns the configuration for the range facets.- Specified by:
parseRangeFacets
in interfaceI_CmsSearchConfigurationParser
- Returns:
- The configuration for the range facets.
- See Also:
I_CmsSearchConfigurationParser.parseRangeFacets()
-
parseSorting
public I_CmsSearchConfigurationSorting parseSorting()
Description copied from interface:I_CmsSearchConfigurationParser
Returns the configuration for sorting.- Specified by:
parseSorting
in interfaceI_CmsSearchConfigurationParser
- Returns:
- The configuration for sorting.
- See Also:
I_CmsSearchConfigurationParser.parseSorting()
-
getMaxReturnedResults
protected int getMaxReturnedResults(java.lang.String indexName)
Returns the number of maximally returned results, ornull
if the indexes default should be used.- Parameters:
indexName
- the name of the index to search in.- Returns:
- The number of maximally returned results, or
null
if the indexes default should be used.
-
parseFacetQueryItems
protected java.util.List<I_CmsSearchConfigurationFacetQuery.I_CmsFacetQueryItem> parseFacetQueryItems(java.lang.String path) throws java.lang.Exception
Helper to read a mandatory String value list.- Parameters:
path
- The XML path of the element to read.- Returns:
- The String list stored in the XML, or
null
if the value could not be read. - Throws:
java.lang.Exception
- thrown if the list of String values can not be read.
-
parseFieldFacet
protected I_CmsSearchConfigurationFacetField parseFieldFacet(java.lang.String pathPrefix)
Reads the configuration of a field facet.- Parameters:
pathPrefix
- The XML Path that leads to the field facet configuration, ornull
if the XML was not correctly structured.- Returns:
- The read configuration, or
null
if the XML was not correctly structured.
-
parseOptionalBooleanValue
protected java.lang.Boolean parseOptionalBooleanValue(java.lang.String path)
Helper to read an optional Boolean value.- Parameters:
path
- The XML path of the element to read.- Returns:
- The Boolean value stored in the XML, or
null
if the value could not be read.
-
parseOptionalIntValue
protected java.lang.Integer parseOptionalIntValue(java.lang.String path)
Helper to read an optional Integer value.- Parameters:
path
- The XML path of the element to read.- Returns:
- The Integer value stored in the XML, or
null
if the value could not be read.
-
parseOptionalStringValue
protected java.lang.String parseOptionalStringValue(java.lang.String path)
Helper to read an optional String value.- Parameters:
path
- The XML path of the element to read.- Returns:
- The String value stored in the XML, or
null
if the value could not be read.
-
parseOptionalStringValues
protected java.util.List<java.lang.String> parseOptionalStringValues(java.lang.String path)
Helper to read an optional String value list.- Parameters:
path
- The XML path of the element to read.- Returns:
- The String list stored in the XML, or
null
if the value could not be read.
-
parseRangeFacet
protected I_CmsSearchConfigurationFacetRange parseRangeFacet(java.lang.String pathPrefix)
Reads the configuration of a range facet.- Parameters:
pathPrefix
- The XML Path that leads to the range facet configuration, ornull
if the XML was not correctly structured.- Returns:
- The read configuration, or
null
if the XML was not correctly structured.
-
-