Class BrowseBean

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

@Named @SessionScoped public class BrowseBean extends Object implements Serializable
This bean provides the data for collection and term browsing.
See Also:
  • Constructor Details

    • BrowseBean

      public BrowseBean()
      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.
    • resetAllLists

      public void resetAllLists()
      resetAllLists.
    • resetDcList

      public void resetDcList()
      resetDcList.
    • resetList

      public void resetList(String field)
      resetList.
      Parameters:
      field - Solr field name identifying the collection to reset
    • getDcList

      public List<BrowseDcElement> getDcList() throws IndexUnreachableException
      getDcList.
      Returns:
      the dcList (Collections)
      Throws:
      IndexUnreachableException - if any.
    • getList

      public List<BrowseDcElement> getList(String field) throws IndexUnreachableException
      getList.
      Parameters:
      field - Solr field name identifying the collection
      Returns:
      a list of BrowseDcElement objects for all collections in the given Solr field, expanded to unlimited depth
      Throws:
      IndexUnreachableException - if any.
    • getList

      public List<BrowseDcElement> getList(String field, int depth) throws IndexUnreachableException
      getList.
      Parameters:
      field - Solr field name identifying the collection
      depth - maximum hierarchy depth to expand; -1 for unlimited
      Returns:
      a list of BrowseDcElement objects for all visible collections in the given Solr field up to the specified depth
      Throws:
      IndexUnreachableException - if any.
      de.unigoettingen.sub.commons.contentlib.exceptions.IllegalRequestException
    • populateCollection

      public void populateCollection(String field) throws IndexUnreachableException, de.unigoettingen.sub.commons.contentlib.exceptions.IllegalRequestException
      populateCollection.
      Parameters:
      field - Solr field name identifying the collection to populate
      Throws:
      IndexUnreachableException - if any.
      de.unigoettingen.sub.commons.contentlib.exceptions.IllegalRequestException
    • getCollectionToExpand

      public String getCollectionToExpand()
      Getter for the field collectionToExpand.
      Returns:
      the name of the collection currently marked for expansion in the view
    • setCollectionToExpand

      public void setCollectionToExpand(String collectionToExpand)
      Setter for the field collectionToExpand.
      Parameters:
      collectionToExpand - name of the collection to expand in the view
    • getTopVisibleCollection

      public String getTopVisibleCollection()
      Getter for the field topVisibleCollection.
      Returns:
      the name of the top-level collection currently visible in the collection view, or the collection to expand if not yet set
    • setTopVisibleCollection

      public void setTopVisibleCollection(String topVisibleCollecion)
      Setter for the field topVisibleCollection.
      Parameters:
      topVisibleCollecion - name of the top-level collection currently visible in the collection view
    • expandCollection

      public void expandCollection() throws IndexUnreachableException, de.unigoettingen.sub.commons.contentlib.exceptions.IllegalRequestException
      Use this method of a certain collections needs to be expanded via URL.
      Throws:
      IndexUnreachableException - if any.
      de.unigoettingen.sub.commons.contentlib.exceptions.IllegalRequestException
    • expandCollection

      public void expandCollection(String collectionField, String facetField) throws IndexUnreachableException, de.unigoettingen.sub.commons.contentlib.exceptions.IllegalRequestException
      expandCollection.
      Parameters:
      collectionField - Solr field name identifying the collection to expand
      facetField - Solr field used for grouping or faceting within the collection
      Throws:
      IndexUnreachableException - if any.
      de.unigoettingen.sub.commons.contentlib.exceptions.IllegalRequestException
    • 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
    • getTargetCollection

      public String getTargetCollection()
      Getter for the field targetCollection.
      Returns:
      the name of the target collection whose first record should be opened
    • setTargetCollection

      public void setTargetCollection(String targetCollection)
      Setter for the field targetCollection.
      Parameters:
      targetCollection - collection name whose first record should be opened
    • openWorkInTargetCollection

      openWorkInTargetCollection.
      Returns:
      the navigation URL to the first record in the target collection, or null if none found
      Throws:
      IndexUnreachableException - if any.
      PresentationException - if any.
      ViewerConfigurationException
      DAOException
      RecordDeletedException
      RecordLimitExceededException
    • getDcCollection

      public CollectionView getDcCollection()
      getDcCollection.
      Returns:
      the CollectionView for the DC (Dublin Core) collection field
    • getCollection

      public CollectionView getCollection(String field)
      getCollection.
      Parameters:
      field - Solr field name identifying the collection
      Returns:
      the CollectionView for the given Solr field, or null if not initialized
    • getOrCreateCollection

      public CollectionView getOrCreateCollection(String field)
      Parameters:
      field - Solr field name identifying the collection
      Returns:
      CollectionView
    • initializeDCCollection

      public void initializeDCCollection()
      initializeDCCollection.
    • initializeCollection

      public void initializeCollection(String collectionField)
    • initializeCollection

      public void initializeCollection(String collectionField, String groupingField)
      Adds a CollectionView object for the given field to the map and populates its values.
      Parameters:
      collectionField - Solr field name identifying the collection
      groupingField - Solr field used to group collection results; may be null
    • getCollectionField

      public String getCollectionField()
      Getter for the field collectionField.
      Returns:
      the Solr field name used to identify the collection hierarchy
    • setCollectionField

      public void setCollectionField(String collectionField)
      Setter for the field collectionField.
      Parameters:
      collectionField - Solr field name used to identify the collection hierarchy
    • getCollectionHierarchy

      public String getCollectionHierarchy(String collectionField, String collectionValue)
      TODO translation from DB.
      Parameters:
      collectionField - Solr field name of the collection
      collectionValue - Raw collection value (may be hierarchical)
      Returns:
      String
    • getTranslationForCollectionName

      public String getTranslationForCollectionName(String field, String value)
      Parameters:
      field - Collection field name
      value - Collection raw name
      Returns:
      Translated collection name
    • getRecordCount

      public long getRecordCount(String collectionField, String collectionName)