Package io.goobi.viewer.managedbeans
Class BrowseBean
java.lang.Object
io.goobi.viewer.managedbeans.BrowseBean
- All Implemented Interfaces:
Serializable
This bean provides the data for collection and term browsing.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidUse this method of a certain collections needs to be expanded via URL.voidexpandCollection(String collectionField, String facetField) expandCollection.Getter for the fieldavailableStringFilters.Getter for the fieldbrowseTermHitCountList.Getter for the fieldbrowseTermList.Getter for the fieldbrowseTermListEscaped.Getter for the fieldbrowsingMenuField.getBrowsingMenuFieldForLanguage(String language) getBrowsingMenuItems(String language) Returns the list of fields configured for term browsing to be listed in term browsing widgets.getCollection(String field) getCollection.Getter for the fieldcollectionField.getCollectionHierarchy(String collectionField, String collectionValue) TODO translation from DB.Getter for the fieldcollectionToExpand.intGetter for the fieldcurrentPage.Getter for the fieldcurrentStringFilter.getDcCollection.getDcList.Getter for the fieldfilterQuery.intgetLastPage.getList.getList.getNextTermUrl.getOrCreateCollection(String field) getPrevTermUrl.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.booleanisBrowsingMenuEnabled.booleanopenWorkInTargetCollection.voidpopulateCollection(String field) populateCollection.voidresetAllLists.voidresetDcList.voidresetList.voidResets all lists for term browsing.searchTerms.Action method for JSF.Selects a filter string for automatic redirecting, prioritizing letters, followed by numbers and finally by the first available filter.voidsetBreadcrumbBean(BreadcrumbBean breadcrumbBean) Required setter for ManagedProperty injection.voidsetBrowsingMenuField(String browsingMenuField) Setter for the fieldbrowsingMenuField.voidsetCollectionField(String collectionField) Setter for the fieldcollectionField.voidsetCollectionToExpand(String collectionToExpand) Setter for the fieldcollectionToExpand.voidsetCurrentPage(int currentPage) Setter for the fieldcurrentPage.voidsetCurrentStringFilter(String currentStringFilter) Setter for the fieldcurrentStringFilter.voidsetFilterQuery(String filterQuery) Setter for the fieldfilterQuery.voidsetTargetCollection(String targetCollection) Setter for the fieldtargetCollection.voidsetTopVisibleCollection(String topVisibleCollecion) Setter for the fieldtopVisibleCollection.
-
Constructor Details
-
BrowseBean
public BrowseBean()Empty constructor.
-
-
Method Details
-
setBreadcrumbBean
Required setter for ManagedProperty injection.- Parameters:
breadcrumbBean- the BreadcrumbBean instance to inject for testing
-
resetTerms
public void resetTerms()Resets all lists for term browsing. -
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.de.unigoettingen.sub.commons.contentlib.exceptions.IllegalRequestException
-
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 of a certain collections 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
-
searchTermsAction
Action method for JSF.- Returns:
- Navigation outcome
- Throws:
PresentationExceptionIndexUnreachableException
-
searchTerms
public String searchTerms() throws PresentationException, IndexUnreachableException, RedirectExceptionsearchTerms.- Returns:
- the navigation outcome after executing the term browse search
- Throws:
PresentationException- if any.IndexUnreachableException- if any.RedirectException
-
selectRedirectFilter
Selects a filter string for automatic redirecting, prioritizing letters, followed by numbers and finally by the first available filter.- Returns:
- Selected filter string
-
getBrowsingMenuFieldForLanguage
- Parameters:
language- Requested language- Returns:
- browsingMenuField (modified for given language if placeholder found)
-
getBrowsingMenuField
Getter for the fieldbrowsingMenuField.- Returns:
- the Solr field name used for term browsing, or "-" if none is set
-
setBrowsingMenuField
Setter for the fieldbrowsingMenuField.- Parameters:
browsingMenuField- Solr field name to use for term browsing, or "-" / null for none
-
isBrowsingMenuFieldTranslated
public boolean isBrowsingMenuFieldTranslated()- Returns:
- true if
browsingMenuFieldis set and configured to be translated; false otherwise
-
getBrowseTermList
Getter for the fieldbrowseTermList.- Returns:
- list of browse terms for the current page and field, or null if not yet loaded
-
getBrowseTermListEscaped
Getter for the fieldbrowseTermListEscaped.- Returns:
- list of URL-escaped browse terms for the current page and field, or null if not yet loaded
-
getBrowseTermHitCountList
Getter for the fieldbrowseTermHitCountList.- Returns:
- list of hit counts corresponding to each browse term in the current browse term list
-
getPrevTermUrl
getPrevTermUrl.- Returns:
- the relative URL to the previous page of the current term browse listing
-
getNextTermUrl
getNextTermUrl.- Returns:
- the relative URL to the next page of the current term browse listing
-
getAvailableStringFilters
Getter for the fieldavailableStringFilters.- Returns:
- list of available alphabetical filter characters for the current browse field, or null if not yet loaded
-
getCurrentStringFilter
Getter for the fieldcurrentStringFilter.- Returns:
- the active alphabetical filter character(s) for the browse term list, or "-" if none is set
-
setCurrentStringFilter
Setter for the fieldcurrentStringFilter.- Parameters:
currentStringFilter- the alphabetical filter character(s) to apply to the browse term list
-
getFilterQuery
Getter for the fieldfilterQuery.- Returns:
- the Solr filter query restricting the browse results, or "-" if none is set
-
setFilterQuery
Setter for the fieldfilterQuery.- Parameters:
filterQuery- Solr filter query to restrict the browse results, or "-" for none
-
getCurrentPage
public int getCurrentPage()Getter for the fieldcurrentPage.- Returns:
- the 1-based current page number in the browse term list
-
setCurrentPage
public void setCurrentPage(int currentPage) Setter for the fieldcurrentPage.- Parameters:
currentPage- the 1-based page number to display in the browse term list
-
getLastPage
public int getLastPage()getLastPage.- Returns:
- a int.
-
isBrowsingMenuEnabled
public boolean isBrowsingMenuEnabled()isBrowsingMenuEnabled.- Returns:
- true if the browsing menu is enabled in the configuration, false otherwise
-
getBrowsingMenuItems
Returns the list of fields configured for term browsing to be listed in term browsing widgets.- Parameters:
language- BCP-47 language code to filter language-specific fields- Returns:
- List of browsing menu items
-
getConfiguredBrowsingMenuFields
- Returns:
- List of configured browsing menu fields
-
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
-
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
-