Package io.goobi.viewer.managedbeans
Class CalendarBean
java.lang.Object
io.goobi.viewer.managedbeans.CalendarBean
- All Implemented Interfaces:
Serializable
This bean provides data for the calendar and time based search entries.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static voidaddEmptyDays(CalendarItemWeek currentWeek, LocalDate date) Add as manyCalendarItemDays to 'currentWeek' as there are days between the start of the month and the previous mondaygetActualYear.This method returns a list of all active centuries.getCentury(Integer year) getCenturyLabel(Integer century, Locale locale) Getter for the fieldcollection.intThis method returns the count of all data without a value in YEARMONTHDAY for the selected year.getCurrentDate.Getter for the fieldcurrentDay.Getter for the fieldcurrentMonth.Getter for the fieldcurrentYear.Getter for the fielddayRow.org.apache.solr.client.solrj.response.QueryResponsegetFacetCounts(String... fields) Getter for the fieldmonthList.Getter for the fieldmonthRow.intGetter for the fieldrowIndex.Getter for the fieldselectYear.intGetter for the fieldyearEnd.intGetter for the fieldyearStart.static List<CalendarItemMonth> populateMonthsWithDays(String selectYear, String collection, String filterQuery) This method generates the data for each month of the selected year.voidvoidThis method resets the current selection for year, month and day; also selectYear and collection.voidresetYears.This method generates the search string for the calendar search tab.searchCalendar(CalendarItemMonth month, CalendarItemDay day) searchCalendar.This method generates the search string for incomplete data.This method generates the search string for the time line based search tab.voidsetCollection(String collection) Setter for the fieldcollection.voidsetCurrentDay(CalendarItemDay currentDay) Setter for the fieldcurrentDay.voidsetCurrentMonth(CalendarItemMonth currentMonth) Set a new value for month.voidsetCurrentYear(CalendarItemYear currentYear) Set a new value for year.voidsetDayRow(CalendarRow dayRow) Setter for the fielddayRow.voidsetMonthRow(CalendarRow monthRow) Setter for the fieldmonthRow.voidsetRowIndex(int rowIndex) Setter for the fieldrowIndex.voidsetSearchBean(SearchBean searchBean) Required setter for ManagedProperty injectionvoidsetSelectYear(String selectYear) Select a year.voidsetYearEnd(int yearEnd) Setter for the fieldyearEnd.voidsetYearStart(int yearStart) Setter for the fieldyearStart.
-
Constructor Details
-
CalendarBean
public CalendarBean()Constructor for CalendarBean.
-
-
Method Details
-
setSearchBean
Required setter for ManagedProperty injection- Parameters:
searchBean- the searchBean to set
-
getCurrentYear
Getter for the field
currentYear.- Returns:
- selected year
-
setCurrentYear
public void setCurrentYear(CalendarItemYear currentYear) throws PresentationException, IndexUnreachableException Set a new value for year. If the selected year is the same as the old selection, the data will be unselected. Otherwise the new data will be generated.- Parameters:
currentYear- aCalendarItemYearobject.- Throws:
PresentationException- if any.IndexUnreachableException- if any.
-
getRowIndex
public int getRowIndex()Getter for the field
rowIndex.- Returns:
- a int.
-
setRowIndex
public void setRowIndex(int rowIndex) Setter for the field
rowIndex.- Parameters:
rowIndex- a int.
-
getMonthRow
Getter for the field
monthRow.- Returns:
- a
CalendarRowobject.
-
setMonthRow
Setter for the field
monthRow.- Parameters:
monthRow- aCalendarRowobject.
-
getCurrentMonth
Getter for the field
currentMonth.- Returns:
- a
CalendarItemMonthobject.
-
setCurrentMonth
public void setCurrentMonth(CalendarItemMonth currentMonth) throws PresentationException, IndexUnreachableException Set a new value for month. If the selected month is the same as the old selection, the month and day will be unselected. Otherwise the data for the month gets generated.- Parameters:
currentMonth- aCalendarItemMonthobject.- Throws:
PresentationException- if any.IndexUnreachableException- if any.
-
getCurrentDay
Getter for the field
currentDay.- Returns:
- a
CalendarItemDayobject.
-
setCurrentDay
Setter for the field
currentDay.- Parameters:
currentDay- aCalendarItemDayobject.
-
getCurrentDate
getCurrentDate.
- Returns:
- a
LocalDateTimeobject.
-
getCurrentDateAsString
-
getDayRow
Getter for the field
dayRow.- Returns:
- the dayRow
-
setDayRow
Setter for the field
dayRow.- Parameters:
dayRow- the dayRow to set
-
searchTimeline
public String searchTimeline() throws PresentationException, IndexUnreachableException, DAOException, ViewerConfigurationExceptionThis method generates the search string for the time line based search tab. The search string will be handed over to the search bean to execute the search.- Returns:
- a
Stringobject. - Throws:
PresentationException- if any.IndexUnreachableException- if any.DAOException- if any.ViewerConfigurationException- if any.
-
resetCurrentSelection
public void resetCurrentSelection()This method resets the current selection for year, month and day; also selectYear and collection. -
resetAllActiveYears
public void resetAllActiveYears() -
getAllActiveCenturies
public List<CalendarItemCentury> getAllActiveCenturies() throws PresentationException, IndexUnreachableExceptionThis method returns a list of all active centuries.
The method searches for the facet of the field 'CENTURY'. If the count of a facet is greater than 0, the century is active.- Returns:
- a
Listobject. - Throws:
PresentationException- if any.IndexUnreachableException- if any.
-
getCentury
-
getFacetCounts
public org.apache.solr.client.solrj.response.QueryResponse getFacetCounts(String... fields) throws PresentationException, IndexUnreachableException -
resetYears
resetYears.
- Throws:
PresentationException- if any.IndexUnreachableException- if any.
-
setSelectYear
public void setSelectYear(String selectYear) throws PresentationException, IndexUnreachableException Select a year. If the new value differs from the old one, the data for the new value gets generated.- Parameters:
selectYear- the selectYear to set- Throws:
PresentationException- if any.IndexUnreachableException- if any.
-
getSelectYear
Getter for the field
selectYear.- Returns:
- the selectYear
-
populateMonthsWithDays
public static List<CalendarItemMonth> populateMonthsWithDays(String selectYear, String collection, String filterQuery) throws PresentationException, IndexUnreachableException This method generates the data for each month of the selected year.
It runs a facet search for YEARMONTH and YEARMONTHDAY for the current year. For each day of the year, the method checks if the count of the field YEARMONTHDAY is greater than 0. If this is the case, the day is an active element, otherwise it has no hits.- Parameters:
selectYear- aStringobject.collection- aStringobject.filterQuery- aStringobject.- Returns:
- a
Listobject. - Throws:
PresentationException- if any.IndexUnreachableException- if any.
-
addEmptyDays
Add as manyCalendarItemDays to 'currentWeek' as there are days between the start of the month and the previous monday- Parameters:
currentWeek-date-
-
getMonthList
Getter for the field
monthList.- Returns:
- the monthList
-
getYearEnd
public int getYearEnd()Getter for the field
yearEnd.- Returns:
- the yearEnd
-
getYearStart
public int getYearStart()Getter for the field
yearStart.- Returns:
- the yearStart
-
setYearEnd
public void setYearEnd(int yearEnd) Setter for the field
yearEnd.- Parameters:
yearEnd- the yearEnd to set
-
setYearStart
public void setYearStart(int yearStart) Setter for the field
yearStart.- Parameters:
yearStart- the yearStart to set
-
setCollection
public void setCollection(String collection) throws PresentationException, IndexUnreachableException Setter for the field
collection.- Parameters:
collection- the collection to set- Throws:
PresentationException- if any.IndexUnreachableException- if any.
-
getCollection
Getter for the field
collection.- Returns:
- the collection
-
searchCalendar
public String searchCalendar(CalendarItemMonth month, CalendarItemDay day) throws PresentationException, IndexUnreachableException, DAOException, ViewerConfigurationException searchCalendar.
- Parameters:
month- aCalendarItemMonthobject.day- aCalendarItemDayobject.- Returns:
- a
Stringobject. - Throws:
PresentationException- if any.IndexUnreachableException- if any.DAOException- if any.ViewerConfigurationException- if any.
-
searchCalendar
public String searchCalendar() throws PresentationException, IndexUnreachableException, DAOException, ViewerConfigurationExceptionThis method generates the search string for the calendar search tab. The search string will be handed over to the search bean to execute the search.- Returns:
- a
Stringobject. - Throws:
PresentationException- if any.IndexUnreachableException- if any.DAOException- if any.ViewerConfigurationException- if any.
-
getCountOfIncompleteData
This method returns the count of all data without a value in YEARMONTHDAY for the selected year.- Returns:
- a int.
- Throws:
PresentationException- if any.IndexUnreachableException- if any.
-
getActualYear
getActualYear.
- Returns:
- a
Stringobject.
-
searchForIncompleteData
public String searchForIncompleteData() throws PresentationException, IndexUnreachableException, DAOException, ViewerConfigurationExceptionThis method generates the search string for incomplete data. The search string will be handed over to the search bean to execute the search.- Returns:
- a
Stringobject. - Throws:
PresentationException- if any.IndexUnreachableException- if any.DAOException- if any.ViewerConfigurationException- if any.
-
getCenturyLabel
-