Class CollectionViewBean

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

@Named @SessionScoped public class CollectionViewBean extends Object implements Serializable
Creates and stored CollectionViews for a session
Author:
florian
See Also:
  • Constructor Details

    • CollectionViewBean

      public CollectionViewBean()
  • Method Details

    • getCollection

      public CollectionView getCollection(CMSCollectionContent content, int collectionBaseLevels, boolean openExpanded, boolean displayParents, boolean ignoreHierarchy) throws PresentationException, IndexUnreachableException, de.unigoettingen.sub.commons.contentlib.exceptions.IllegalRequestException
      Get the CollectionView of the given content item in the given page. If the view hasn't been initialized yet, do so and add it to the Bean's CollectionView map
      Parameters:
      content - a CMSCollectionContent instance providing the base data for this collection
      collectionBaseLevels - The number of hierarchy levels for which collections of these levels should not expand but rather redirect to a view of the clicked collection alone
      openExpanded - whether to open the page with all collections expanded.
      displayParents - Whether to display all parent collections of the base collection. Useful in combination with collectionBaseLevels > 0 to navigate back out of the current collection
      ignoreHierarchy -
      Returns:
      The CollectionView or null if no matching ContentItem was found
      Throws:
      PresentationException - if any.
      IndexUnreachableException - if any.
      de.unigoettingen.sub.commons.contentlib.exceptions.IllegalRequestException
    • getCollection

      public CollectionView getCollection(CMSCollectionContent content, int collectionBaseLevels, boolean openExpanded, boolean displayParents, boolean ignoreHierarchy, String topVisibleElement) throws PresentationException, IndexUnreachableException, de.unigoettingen.sub.commons.contentlib.exceptions.IllegalRequestException
      Throws:
      PresentationException
      IndexUnreachableException
      de.unigoettingen.sub.commons.contentlib.exceptions.IllegalRequestException
    • getCollectionId

      public static String getCollectionId(CMSCollectionContent content)
    • getCollectionIfStored

      public Optional<CollectionView> getCollectionIfStored(CMSCollectionContent content)
    • removeCollection

      public boolean removeCollection(CMSCollectionContent content)
    • initializeCollection

      public CollectionView initializeCollection(CMSCollectionContent content, int numBaseLevels, boolean openExpanded, boolean displayParents, boolean ignoreHierarchy, String topVisibleElement) throws PresentationException, de.unigoettingen.sub.commons.contentlib.exceptions.IllegalRequestException, IndexUnreachableException
      Creates a collection view object from the item's collection related properties
      Parameters:
      content -
      numBaseLevels -
      openExpanded -
      displayParents -
      ignoreHierarchy -
      topVisibleElement -
      Returns:
      a io.goobi.viewer.model.viewer.CollectionView object.
      Throws:
      PresentationException - if any.
      IndexUnreachableException - if any.
      de.unigoettingen.sub.commons.contentlib.exceptions.IllegalRequestException
    • getPossibleIgnoreCollectionList

      public List<String> getPossibleIgnoreCollectionList(CMSCollectionContent content, boolean ignoreHierarchy) throws IndexUnreachableException
      Queries Solr for a list of all values of the set collectionField which my serve as a collection
      Parameters:
      content -
      ignoreHierarchy - If true, sub-collections will be omitted
      Returns:
      a List object.
      Throws:
      IndexUnreachableException - if any.
    • getColletionMap

      public Map<String,CollectionResult> getColletionMap(CMSCollectionContent content) throws IndexUnreachableException
      Parameters:
      content -
      Returns:
      Map<String, CollectionResult>
      Throws:
      IndexUnreachableException
    • removeCollectionsForPage

      public void removeCollectionsForPage(CMSPage page)
    • getLoadedCollectionsForPage

      public List<CollectionView> getLoadedCollectionsForPage(CMSPage page)
    • getCollections

      public List<CollectionView> getCollections(String field)
      get a list of all CollectionViews with the given solr field which are already loaded via #getCollection(CMSPage) or #getCollection(String, CMSPage)
      Parameters:
      field - The solr field the colleciton is based on
      Returns:
      a List object.
    • invalidate

      public void invalidate()