Class CmsXMLSearchConfigurationParser
java.lang.Object
org.opencms.jsp.search.config.parser.CmsXMLSearchConfigurationParser
- All Implemented Interfaces:
I_CmsSearchConfigurationParser
public class CmsXMLSearchConfigurationParser
extends Object
implements I_CmsSearchConfigurationParser
Search configuration parser reading XML.
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final org.apache.commons.logging.Log
Logger for the class. -
Constructor Summary
ConstructorDescriptionCmsXMLSearchConfigurationParser
(CmsXmlContent xml, Locale locale) Constructor taking the XML content that should be read and the locale in which it should be read. -
Method Summary
Modifier and TypeMethodDescriptionprotected int
getMaxReturnedResults
(String indexName) Returns the number of maximally returned results, ornull
if the indexes default should be used.parseCommon
(CmsObject cms) Returns the common search configuration.Returns the configuration for the "Did you mean ...?" feature.parseFacetQueryItems
(String path) Helper to read a mandatory String value list.protected I_CmsSearchConfigurationFacetField
parseFieldFacet
(String pathPrefix) Reads the configuration of a field facet.Returns the configuration for the field facets.Returns the configuration for the Geo filter.Returns the configuration for the highlighting.protected Boolean
Helper to read an optional Boolean value.protected Integer
parseOptionalIntValue
(String path) Helper to read an optional Integer value.protected String
Helper to read an optional String value.Helper to read an optional String value list.Returns the configuration for the pagination.Returns the configuration for the query facet.protected I_CmsSearchConfigurationFacetRange
parseRangeFacet
(String pathPrefix) Reads the configuration of a range facet.Returns the configuration for the range facets.Returns the configuration for sorting.
-
Field Details
-
LOG
Logger for the class.
-
-
Constructor Details
-
CmsXMLSearchConfigurationParser
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 Details
-
parseCommon
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:
-
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:
-
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:
-
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:
-
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:
-
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:
-
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:
-
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:
-
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:
-
getMaxReturnedResults
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 List<I_CmsSearchConfigurationFacetQuery.I_CmsFacetQueryItem> parseFacetQueryItems(String path) throws 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:
Exception
- thrown if the list of String values can not be read.
-
parseFieldFacet
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
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
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
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
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
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.
-