Package io.goobi.viewer.managedbeans
Class CollectionBrowseBean
java.lang.Object
io.goobi.viewer.managedbeans.CollectionBrowseBean
- All Implemented Interfaces:
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidUse this method if a certain collection needs to be expanded via URL.voidexpandCollection(String collectionField, String facetField) expandCollection.getCollection(String field) getCollection.Getter for the fieldcollectionField.getCollectionHierarchy(String collectionField, String collectionValue) TODO translation from DB.Getter for the fieldcollectionToExpand.getDcCollection.getDcList.Getter for the fielddynamicCollectionName.Returns theCollectionViewfor the currentdynamicCollectionName.Returns (and lazily builds and caches) theCollectionViewfor the database-defined dynamic collection with the given name.getList.getList.getOrCreateCollection(String field) longgetRecordCount(String collectionField, String collectionName) Getter for the fieldtargetCollection.Getter for the fieldtopVisibleCollection.getTranslationForCollectionName(String field, String value) voidinitializeCollection(String collectionField) voidinitializeCollection(String collectionField, String groupingField) Adds a CollectionView object for the given field to the map and populates its values.voidinitializeDCCollection.openWorkInTargetCollection.voidpopulateCollection(String field) populateCollection.voidRemoves the cached collection view for the dynamic collection with the given name, forcing a rebuild on next access.voidresetAllLists.voidresetDcList.voidresetList.voidsetCollectionField(String collectionField) Setter for the fieldcollectionField.voidsetCollectionToExpand(String collectionToExpand) Setter for the fieldcollectionToExpand.voidsetDynamicCollectionName(String dynamicCollectionName) Setter for the fielddynamicCollectionName.voidsetTargetCollection(String targetCollection) Setter for the fieldtargetCollection.voidsetTopVisibleCollection(String topVisibleCollecion) Setter for the fieldtopVisibleCollection.
-
Constructor Details
-
CollectionBrowseBean
public CollectionBrowseBean()Empty constructor.
-
-
Method Details
-
resetAllLists
public void resetAllLists()resetAllLists. -
resetDcList
public void resetDcList()resetDcList. -
resetList
resetList.- Parameters:
field- Solr field name identifying the collection to reset
-
getDcList
getDcList.- Returns:
- the dcList (Collections)
- Throws:
IndexUnreachableException- if any.
-
getList
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
getList.- Parameters:
field- Solr field name identifying the collectiondepth- 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
Getter for the fieldcollectionToExpand.- Returns:
- the name of the collection currently marked for expansion in the view
-
setCollectionToExpand
Setter for the fieldcollectionToExpand.- Parameters:
collectionToExpand- name of the collection to expand in the view
-
getTopVisibleCollection
Getter for the fieldtopVisibleCollection.- Returns:
- the name of the top-level collection currently visible in the collection view, or the collection to expand if not yet set
-
setTopVisibleCollection
Setter for the fieldtopVisibleCollection.- 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.IllegalRequestExceptionUse 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 expandfacetField- Solr field used for grouping or faceting within the collection- Throws:
IndexUnreachableException- if any.de.unigoettingen.sub.commons.contentlib.exceptions.IllegalRequestException
-
getTargetCollection
Getter for the fieldtargetCollection.- Returns:
- the name of the target collection whose first record should be opened
-
setTargetCollection
Setter for the fieldtargetCollection.- Parameters:
targetCollection- collection name whose first record should be opened
-
openWorkInTargetCollection
public String openWorkInTargetCollection() throws IndexUnreachableException, PresentationException, RecordDeletedException, DAOException, ViewerConfigurationException, RecordLimitExceededExceptionopenWorkInTargetCollection.- Returns:
- the navigation URL to the first record in the target collection, or null if none found
- Throws:
IndexUnreachableException- if any.PresentationException- if any.ViewerConfigurationExceptionDAOExceptionRecordDeletedExceptionRecordLimitExceededException
-
getDcCollection
getDcCollection.- Returns:
- the CollectionView for the DC (Dublin Core) collection field
-
getCollection
getCollection.- Parameters:
field- Solr field name identifying the collection- Returns:
- the CollectionView for the given Solr field, or null if not initialized
-
getOrCreateCollection
- Parameters:
field- Solr field name identifying the collection- Returns:
CollectionView
-
initializeDCCollection
public void initializeDCCollection()initializeDCCollection. -
initializeCollection
-
initializeCollection
Adds a CollectionView object for the given field to the map and populates its values.- Parameters:
collectionField- Solr field name identifying the collectiongroupingField- Solr field used to group collection results; may be null
-
getCollectionField
Getter for the fieldcollectionField.- Returns:
- the Solr field name used to identify the collection hierarchy
-
setCollectionField
Setter for the fieldcollectionField.- Parameters:
collectionField- Solr field name used to identify the collection hierarchy
-
getDynamicCollectionName
Getter for the fielddynamicCollectionName.- Returns:
- the name of the dynamic collection to browse
-
setDynamicCollectionName
Setter for the fielddynamicCollectionName. Called by the dynamic-collection browse pretty-URL route.- Parameters:
dynamicCollectionName- the name of the dynamic collection to browse
-
getDynamicCollectionView
Returns theCollectionViewfor the currentdynamicCollectionName.- Returns:
- the collection view for the current dynamic collection, or null if none is set
-
getDynamicCollectionView
Returns (and lazily builds and caches) theCollectionViewfor 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
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
TODO translation from DB.- Parameters:
collectionField- Solr field name of the collectioncollectionValue- Raw collection value (may be hierarchical)- Returns:
String
-
getTranslationForCollectionName
- Parameters:
field- Collection field namevalue- Collection raw name- Returns:
- Translated collection name
-
getRecordCount
-