Package io.goobi.viewer.managedbeans
Class CollectionViewBean
java.lang.Object
io.goobi.viewer.managedbeans.CollectionViewBean
- All Implemented Interfaces:
Serializable
Creates and stored
CollectionViews for a session.- Author:
- Florian Alpers
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetCollection(CMSCollectionContent content) Gets theCollectionViewof the given content item in the given page.getCollection(CMSCollectionContent content, String topVisibleElement) getCollection.static StringgetCollectionId(CMSCollectionContent content) getCollectionId.getCollectionIfStored.getCollections(String field) Get a list of allCollectionViews with the given solr field which are already loaded viagetCollection(CMSCollectionContent).getColletionMap(CMSCollectionContent content) getColletionMap.getLoadedCollectionsForPage.Queries Solr for a list of all values of the set collectionField which my serve as a collection.getPossibleIgnoreCollectionList(CMSCollectionContent content, boolean includeSubcollections) Queries Solr for a list of all values of the set collectionField which my serve as a collection.initializeCollection(CMSCollectionContent content, String topVisibleElement) Creates a collection view object from the item's collection related properties.voidinvalidate.booleanremoveCollection(CMSCollectionContent content) removeCollection.voidremoveCollectionsForPage.
-
Constructor Details
-
CollectionViewBean
public CollectionViewBean()
-
-
Method Details
-
getCollection
public CollectionView getCollection(CMSCollectionContent content) throws PresentationException, IndexUnreachableException, de.unigoettingen.sub.commons.contentlib.exceptions.IllegalRequestException Gets theCollectionViewof 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- aCMSCollectionContentinstance providing the base data for this collection- 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, String topVisibleElement) throws PresentationException, IndexUnreachableException, de.unigoettingen.sub.commons.contentlib.exceptions.IllegalRequestException getCollection.- Parameters:
content- collection content item providing base configurationtopVisibleElement- collection name to use as the top visible element- Returns:
- the CollectionView for the given content, creating and caching it if not yet initialized
- Throws:
PresentationException- if any.IndexUnreachableException- if any.de.unigoettingen.sub.commons.contentlib.exceptions.IllegalRequestException- if any.
-
getCollectionId
getCollectionId.- Parameters:
content- collection content item to derive the ID from- Returns:
- a unique string ID derived from the owning page or template and the content item ID
-
getCollectionIfStored
getCollectionIfStored.- Parameters:
content- collection content item identifying the desired collection- Returns:
- an Optional containing the cached CollectionView, or empty if not yet initialized
-
removeCollection
removeCollection.- Parameters:
content- collection content item identifying the collection to remove- Returns:
- true if the collection was present and has been removed, false if it was not found
-
initializeCollection
public CollectionView initializeCollection(CMSCollectionContent content, 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- collection content item providing Solr field and filter configurationtopVisibleElement- collection name to display at the root level- Returns:
- the newly created and populated CollectionView for the given content configuration
- Throws:
PresentationException- if any.IndexUnreachableException- if any.de.unigoettingen.sub.commons.contentlib.exceptions.IllegalRequestException
-
getPossibleIgnoreCollectionList
public List<SelectItem> getPossibleIgnoreCollectionList(CMSCollectionContent content, boolean includeSubcollections) throws IndexUnreachableException Queries Solr for a list of all values of the set collectionField which my serve as a collection.- Parameters:
content- collection content item providing Solr field and filter configurationincludeSubcollections- if true, nested subcollections are included in the list- Returns:
- a list of select items representing collection names that can be excluded from the given collection content
- Throws:
IndexUnreachableException- if any.
-
getPossibleBaseCollectionList
public List<SelectItem> getPossibleBaseCollectionList(CMSCollectionContent content) throws IndexUnreachableException Queries Solr for a list of all values of the set collectionField which my serve as a collection.- Parameters:
content- collection content item providing Solr field and filter configuration- Returns:
- a list of select items representing all possible base collection names for the given collection content
- Throws:
IndexUnreachableException- if any.
-
getColletionMap
public Map<String,CollectionResult> getColletionMap(CMSCollectionContent content) throws IndexUnreachableException getColletionMap.- Parameters:
content- collection content item providing Solr field and filter configuration- Returns:
- Map<String, CollectionResult>
- Throws:
IndexUnreachableException
-
removeCollectionsForPage
removeCollectionsForPage.- Parameters:
page- CMS page whose associated collections should be removed
-
getLoadedCollectionsForPage
getLoadedCollectionsForPage.- Parameters:
page- CMS page whose loaded collections to retrieve- Returns:
- a list of CollectionView instances already loaded for the given CMS page
-
getCollections
Get a list of allCollectionViews with the given solr field which are already loaded viagetCollection(CMSCollectionContent).- Parameters:
field- The solr field the collection is based on- Returns:
- a list of already-loaded CollectionView instances for the given Solr field
-
invalidate
public void invalidate()invalidate.
-