Class TermBrowseBean

java.lang.Object
io.goobi.viewer.managedbeans.TermBrowseBean
All Implemented Interfaces:
Serializable

@Named @SessionScoped public class TermBrowseBean extends Object implements Serializable
This bean provides the data for alphabetical term browsing (the browsing menu). Collection browsing is handled by CollectionBrowseBean.
See Also:
  • Constructor Details

    • TermBrowseBean

      public TermBrowseBean()
      Empty constructor.
  • Method Details

    • setBreadcrumbBean

      public void setBreadcrumbBean(BreadcrumbBean breadcrumbBean)
      Required setter for ManagedProperty injection.
      Parameters:
      breadcrumbBean - the BreadcrumbBean instance to inject for testing
    • resetTerms

      public void resetTerms()
      Resets all lists for term browsing.
    • searchTermsAction

      public String searchTermsAction() throws PresentationException, IndexUnreachableException
      Action method for JSF.
      Returns:
      Navigation outcome
      Throws:
      PresentationException
      IndexUnreachableException
    • searchTerms

      searchTerms.
      Returns:
      the navigation outcome after executing the term browse search
      Throws:
      PresentationException - if any.
      IndexUnreachableException - if any.
      RedirectException
    • selectRedirectFilter

      public String selectRedirectFilter()
      Selects a filter string for automatic redirecting, prioritizing letters, followed by numbers and finally by the first available filter.
      Returns:
      Selected filter string
    • getBrowsingMenuFieldForLanguage

      public String getBrowsingMenuFieldForLanguage(String language)
      Parameters:
      language - Requested language
      Returns:
      browsingMenuField (modified for given language if placeholder found)
    • getBrowsingMenuField

      public String getBrowsingMenuField()
      Getter for the field browsingMenuField.
      Returns:
      the Solr field name used for term browsing, or "-" if none is set
    • setBrowsingMenuField

      public void setBrowsingMenuField(String browsingMenuField)
      Setter for the field browsingMenuField.
      Parameters:
      browsingMenuField - Solr field name to use for term browsing, or "-" / null for none
    • isBrowsingMenuFieldTranslated

      public boolean isBrowsingMenuFieldTranslated()
      Returns:
      true if browsingMenuField is set and configured to be translated; false otherwise
    • getBrowseTermList

      public List<String> getBrowseTermList()
      Getter for the field browseTermList.
      Returns:
      list of browse terms for the current page and field, or null if not yet loaded
    • getBrowseTermListEscaped

      public List<String> getBrowseTermListEscaped()
      Getter for the field browseTermListEscaped.
      Returns:
      list of URL-escaped browse terms for the current page and field, or null if not yet loaded
    • getBrowseTermHitCountList

      public List<Long> getBrowseTermHitCountList()
      Getter for the field browseTermHitCountList.
      Returns:
      list of hit counts corresponding to each browse term in the current browse term list
    • getPrevTermUrl

      public String getPrevTermUrl()
      getPrevTermUrl.
      Returns:
      the relative URL to the previous page of the current term browse listing
    • getNextTermUrl

      public String getNextTermUrl()
      getNextTermUrl.
      Returns:
      the relative URL to the next page of the current term browse listing
    • getAvailableStringFilters

      public List<String> getAvailableStringFilters()
      Getter for the field availableStringFilters.
      Returns:
      list of available alphabetical filter characters for the current browse field, or null if not yet loaded
    • getCurrentStringFilter

      public String getCurrentStringFilter()
      Getter for the field currentStringFilter.
      Returns:
      the active alphabetical filter character(s) for the browse term list, or "-" if none is set
    • setCurrentStringFilter

      public void setCurrentStringFilter(String currentStringFilter)
      Setter for the field currentStringFilter.
      Parameters:
      currentStringFilter - the alphabetical filter character(s) to apply to the browse term list
    • getFilterQuery

      public String getFilterQuery()
      Getter for the field filterQuery.
      Returns:
      the Solr filter query restricting the browse results, or "-" if none is set
    • setFilterQuery

      public void setFilterQuery(String filterQuery)
      Setter for the field filterQuery.
      Parameters:
      filterQuery - Solr filter query to restrict the browse results, or "-" for none
    • getCurrentPage

      public int getCurrentPage()
      Getter for the field currentPage.
      Returns:
      the 1-based current page number in the browse term list
    • setCurrentPage

      public void setCurrentPage(int currentPage)
      Setter for the field currentPage.
      Parameters:
      currentPage - the 1-based page number to display in the browse term list
    • getLastPage

      public int getLastPage()
      getLastPage.
      Returns:
      a int.
    • isBrowsingMenuEnabled

      public boolean isBrowsingMenuEnabled()
      isBrowsingMenuEnabled.
      Returns:
      true if the browsing menu is enabled in the configuration, false otherwise
    • getBrowsingMenuItems

      public List<String> getBrowsingMenuItems(String language)
      Returns the list of fields configured for term browsing to be listed in term browsing widgets.
      Parameters:
      language - BCP-47 language code to filter language-specific fields
      Returns:
      List of browsing menu items
    • getConfiguredBrowsingMenuFields

      public List<String> getConfiguredBrowsingMenuFields()
      Returns:
      List of configured browsing menu fields