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
FieldsModifier and TypeFieldDescriptionprotected static final org.apache.commons.logging.LogLogger for the class. -
Constructor Summary
ConstructorsConstructorDescriptionCmsXMLSearchConfigurationParser(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 intgetMaxReturnedResults(String indexName) Returns the number of maximally returned results, ornullif 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_CmsSearchConfigurationFacetFieldparseFieldFacet(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 BooleanHelper to read an optional Boolean value.protected IntegerparseOptionalIntValue(String path) Helper to read an optional Integer value.protected StringHelper 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_CmsSearchConfigurationFacetRangeparseRangeFacet(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_CmsSearchConfigurationParserReturns the common search configuration.- Specified by:
parseCommonin interfaceI_CmsSearchConfigurationParser- Parameters:
cms- the current context- Returns:
- The common search configuration.
- See Also:
-
parseDidYouMean
Description copied from interface:I_CmsSearchConfigurationParserReturns the configuration for the "Did you mean ...?" feature.- Specified by:
parseDidYouMeanin interfaceI_CmsSearchConfigurationParser- Returns:
- The configuration for the "Did you mean ...?" feature.
- See Also:
-
parseFieldFacets
Description copied from interface:I_CmsSearchConfigurationParserReturns the configuration for the field facets.- Specified by:
parseFieldFacetsin interfaceI_CmsSearchConfigurationParser- Returns:
- The configuration for the field facets.
- See Also:
-
parseGeoFilter
Description copied from interface:I_CmsSearchConfigurationParserReturns the configuration for the Geo filter.- Specified by:
parseGeoFilterin interfaceI_CmsSearchConfigurationParser- Returns:
- The configuration for the Geo filter.
- See Also:
-
parseHighlighter
Description copied from interface:I_CmsSearchConfigurationParserReturns the configuration for the highlighting.- Specified by:
parseHighlighterin interfaceI_CmsSearchConfigurationParser- Returns:
- The configuration for the highlighting.
- See Also:
-
parsePagination
Description copied from interface:I_CmsSearchConfigurationParserReturns the configuration for the pagination.- Specified by:
parsePaginationin interfaceI_CmsSearchConfigurationParser- Returns:
- The configuration for the pagination.
- See Also:
-
parseQueryFacet
Description copied from interface:I_CmsSearchConfigurationParserReturns the configuration for the query facet.- Specified by:
parseQueryFacetin interfaceI_CmsSearchConfigurationParser- Returns:
- The configuration for the query facet.
- See Also:
-
parseRangeFacets
Description copied from interface:I_CmsSearchConfigurationParserReturns the configuration for the range facets.- Specified by:
parseRangeFacetsin interfaceI_CmsSearchConfigurationParser- Returns:
- The configuration for the range facets.
- See Also:
-
parseSorting
Description copied from interface:I_CmsSearchConfigurationParserReturns the configuration for sorting.- Specified by:
parseSortingin interfaceI_CmsSearchConfigurationParser- Returns:
- The configuration for sorting.
- See Also:
-
getMaxReturnedResults
Returns the number of maximally returned results, ornullif the indexes default should be used.- Parameters:
indexName- the name of the index to search in.- Returns:
- The number of maximally returned results, or
nullif 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
nullif 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, ornullif the XML was not correctly structured.- Returns:
- The read configuration, or
nullif 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
nullif 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
nullif 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
nullif 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
nullif 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, ornullif the XML was not correctly structured.- Returns:
- The read configuration, or
nullif the XML was not correctly structured.
-