Class CmsMacroSearchFieldMapping

  • All Implemented Interfaces:, I_CmsSearchFieldMapping

    public class CmsMacroSearchFieldMapping
    extends java.lang.Object
    implements I_CmsSearchFieldMapping
    Field mapping to resolve macros as for gallery names. The main purpose is to use stringtemplates for special mappings to Solr fields. For this use case, define a parameter (via xsd:annotation/xsd:appinfo/parameters/param and use a stringtemplate as value. In the solr mapping, you just place %(stringtemplate:paramName). Example (there is some element "Type" and in the parameters section of the schema, there's a param "eventKind"):
       <searchsetting element="Type">
         <solrfield targetfield="event-kind" sourcefield="*_s">
           <mapping type="dynamic" class="">%(stringtemplate:eventKind)</mapping>
    See Also:
    Serialized Form
    • Field Summary

      Modifier and Type Field Description
      protected static org.apache.commons.logging.Log LOG
      Logger for the class
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getDefaultValue()
      Returns the default value used for this field mapping in case no content is available.
      java.lang.String getParam()
      Returns the mapping parameter.
      java.lang.String getStringValue​(CmsObject cms, CmsResource res, I_CmsExtractionResult extractionResult, java.util.List<CmsProperty> properties, java.util.List<CmsProperty> propertiesSearched)
      Returns the String value extracted form the provided data according to the rules of this mapping type.
      CmsSearchFieldMappingType getType()
      Returns the mapping type.
      void setDefaultValue​(java.lang.String defaultValue)
      Sets the default value for this field mapping in case no content is available.
      void setLocale​(java.util.Locale locale)
      Sets the locale, the mapping can examine when extracting the content.
      void setParam​(java.lang.String param)
      Sets the mapping parameter.
      void setType​(java.lang.String type)
      Sets the mapping type as a String.
      void setType​(CmsSearchFieldMappingType type)
      Sets the mapping type.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait