Class FacetFieldSidebarWidget

java.lang.Object
io.goobi.viewer.model.cms.widgets.CustomSidebarWidget
io.goobi.viewer.model.cms.widgets.FacetFieldSidebarWidget
All Implemented Interfaces:
IPolyglott, Serializable

@Entity public class FacetFieldSidebarWidget extends CustomSidebarWidget
A subtype of CustomSidebarWidget to display a list of possible values of a given SOLR field and link to a search listing of items with a specific value.
Author:
Florian Alpers
See Also:
  • Constructor Details

    • FacetFieldSidebarWidget

      public FacetFieldSidebarWidget()
      Empty default constructor.
    • FacetFieldSidebarWidget

      public FacetFieldSidebarWidget(FacetFieldSidebarWidget o)
      Cloning constructor.
      Parameters:
      o - the widget to copy from
  • Method Details

    • getFacetField

      public String getFacetField()
      Contains the SOLR field holding the values to list.
      Returns:
      the name of the Solr field whose values are listed in this widget
    • setFacetField

      public void setFacetField(String facetField)
      Sets the SOLR field for which to list values.
      Parameters:
      facetField - the name of the Solr field to facet on
    • getFilterQuery

      public String getFilterQuery()
      An additional SOLR query. If this is not empty, only values of the getFacetField() are listed that are contained in documents meeting this query. This is also true for the linked result lists
      Returns:
      the additional Solr filter query, or an empty string if no filter is set
    • getCombinedFilterQuery

      public String getCombinedFilterQuery(CMSPage page)
    • setFilterQuery

      public void setFilterQuery(String filterQuery)
      Set the value of getFilterQuery().
      Parameters:
      filterQuery - an additional Solr query to restrict which field values are shown
    • getType

      public CustomWidgetType getType()
      Description copied from class: CustomSidebarWidget
      Return the type of this custom sidebar widget. Must be implemented by subclasses of CustomSidebarWidget
      Overrides:
      getType in class CustomSidebarWidget
      Returns:
      CustomWidgetType
    • getNumEntries

      public int getNumEntries()
      Returns:
      the number of field values displayed in the widget
    • setNumEntries

      public void setNumEntries(int numEntries)
      Sets the number of field values displayed in the widget.
      Parameters:
      numEntries - the number of field values to display
    • getTitle

      public TranslatedText getTitle()
      Override default title to always show the selected facetField.
      Overrides:
      getTitle in class CustomSidebarWidget
      Returns:
      a TranslatedText built from the translations of the configured facet field name