Class CollectionBrowseBean

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

@Named @SessionScoped public class CollectionBrowseBean extends Object implements Serializable
This bean provides the data for collection browsing (the collection hierarchy derived from a Solr field, plus database-defined dynamic collections). Term browsing is handled by TermBrowseBean.
See Also:
  • Constructor Details

    • CollectionBrowseBean

      public CollectionBrowseBean()
      Empty constructor.
  • Method Details

    • 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.
    • 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 if a certain collection 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
    • 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
    • getDynamicCollectionName

      public String getDynamicCollectionName()
      Getter for the field dynamicCollectionName.
      Returns:
      the name of the dynamic collection to browse
    • setDynamicCollectionName

      public void setDynamicCollectionName(String dynamicCollectionName)
      Setter for the field dynamicCollectionName. Called by the dynamic-collection browse pretty-URL route.
      Parameters:
      dynamicCollectionName - the name of the dynamic collection to browse
    • getDynamicCollectionView

      public CollectionView getDynamicCollectionView()
      Returns the CollectionView for the current dynamicCollectionName.
      Returns:
      the collection view for the current dynamic collection, or null if none is set
    • getDynamicCollectionView

      public CollectionView getDynamicCollectionView(String name)
      Returns (and lazily builds and caches) the CollectionView for the database-defined dynamic collection with the given name. The view is backed by the collection's stored Solr query used as a filter query over the configured collection field.
      Parameters:
      name - unique name of the dynamic collection
      Returns:
      the collection view, or null if no such collection exists or it could not be built
    • removeDynamicCollectionView

      public void removeDynamicCollectionView(String name)
      Removes the cached collection view for the dynamic collection with the given name, forcing a rebuild on next access.
      Parameters:
      name - unique name of the dynamic collection
    • 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)