Package io.goobi.viewer.managedbeans
Class TermBrowseBean
java.lang.Object
io.goobi.viewer.managedbeans.TermBrowseBean
- All Implemented Interfaces:
Serializable
This bean provides the data for alphabetical term browsing (the browsing menu). Collection browsing is handled by
CollectionBrowseBean.- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGetter 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.intGetter for the fieldcurrentPage.Getter for the fieldcurrentStringFilter.Getter for the fieldfilterQuery.intgetLastPage.getNextTermUrl.getPrevTermUrl.booleanisBrowsingMenuEnabled.booleanvoidResets 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.voidsetCurrentPage(int currentPage) Setter for the fieldcurrentPage.voidsetCurrentStringFilter(String currentStringFilter) Setter for the fieldcurrentStringFilter.voidsetFilterQuery(String filterQuery) Setter for the fieldfilterQuery.
-
Constructor Details
-
TermBrowseBean
public TermBrowseBean()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. -
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
-