Package io.goobi.viewer.managedbeans
Class CollectionViewBean
java.lang.Object
io.goobi.viewer.managedbeans.CollectionViewBean
- All Implemented Interfaces:
Serializable
Creates and stored
CollectionView
s for a session- Author:
- florian
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetCollection
(CMSCollectionContent content, int collectionBaseLevels, boolean openExpanded, boolean displayParents, boolean ignoreHierarchy) Get theCollectionView
of the given content item in the given page.getCollection
(CMSCollectionContent content, int collectionBaseLevels, boolean openExpanded, boolean displayParents, boolean ignoreHierarchy, String topVisibleElement) static String
getCollectionId
(CMSCollectionContent content) getCollections
(String field) get a list of allCollectionView
s with the given solr field which are already loaded via#getCollection(CMSPage)
or#getCollection(String, CMSPage)
getColletionMap
(CMSCollectionContent content) getPossibleIgnoreCollectionList
(CMSCollectionContent content, boolean ignoreHierarchy) Queries Solr for a list of all values of the set collectionField which my serve as a collectioninitializeCollection
(CMSCollectionContent content, int numBaseLevels, boolean openExpanded, boolean displayParents, boolean ignoreHierarchy, String topVisibleElement) Creates a collection view object from the item's collection related propertiesvoid
boolean
removeCollection
(CMSCollectionContent content) void
-
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 theCollectionView
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
- aCMSCollectionContent
instance providing the base data for this collectioncollectionBaseLevels
- The number of hierarchy levels for which collections of these levels should not expand but rather redirect to a view of the clicked collection aloneopenExpanded
- 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 collectionignoreHierarchy
-- 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
-
getCollectionIfStored
-
removeCollection
-
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
-
getLoadedCollectionsForPage
-
getCollections
get a list of allCollectionView
s 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()
-