Package de.xima.fc.gui.bean.statistics
Class StatisticsHistoryBean
- java.lang.Object
-
- de.xima.fc.gui.bean.statistics.AStatisticsBean
-
- de.xima.fc.gui.bean.statistics.StatisticsHistoryBean
-
- All Implemented Interfaces:
Serializable
@Named @ViewScoped public class StatisticsHistoryBean extends AStatisticsBean
- Author:
- XIMA MEDIA GmbH
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class de.xima.fc.gui.bean.statistics.AStatisticsBean
localeBean, MIME_TYPE_EXCEL, SUFFIX_EXCEL, SUFFIX_IMAGE, viewContext
-
-
Constructor Summary
Constructors Constructor Description StatisticsHistoryBean()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidchangeChartStyle(EChartStyle chartStyle)Method to change the chart style.List<NamedEntityDto>completeMandant(String query)Completion handler for the Mandant autocomplete.org.primefaces.model.StreamedContentdownloadExcelFile()Method to download the chart as an Excel file.EChartStylegetChartStyle()StringgetChartWidgetVar()DateRangeEditModelgetDateRangeEditModel()StringgetImageFilename()List<NamedEntityDto>getMandants()org.primefaces.model.charts.ChartModelgetModel()lazily initializes the current chart model and returns itList<BasicProjectDto>getProjects()List<javax.faces.model.SelectItem>getProjectSelectItems()Lazy Getter for the options of the project selectbox.NamedEntityDtogetSelectedMandant()BasicProjectDtogetSelectedProject()ETimeScalegetTimeScale()booleanisNextDateRangeDisabled()booleanisPreviousDateRangeDisabled()voidonNextDateRange()shifts the current date range forward by onevoidonPreviousDateRange()shifts the current date range backward by onevoidonRefreshModel()reloads the related entities (Mandants or projects) and updates the frontend modelvoidonTimeScaleChanged()Called when the time interval has changed.voidsetChartStyle(EChartStyle chartStyle)voidsetModel(org.primefaces.model.charts.ChartModel model)voidsetSelectedMandant(NamedEntityDto selectedMandant)voidsetSelectedProject(BasicProjectDto selectedProject)voidsetTimeScale(ETimeScale timeScale)StringtimeScaleDetailsFor(ETimeScale scale)voidupdateModel()Update the model.-
Methods inherited from class de.xima.fc.gui.bean.statistics.AStatisticsBean
defaultActivityRange, insertImageFilename
-
-
-
-
Method Detail
-
timeScaleDetailsFor
public String timeScaleDetailsFor(ETimeScale scale)
- Returns:
- a string to be used as the label details for the provided time scale
-
onPreviousDateRange
public void onPreviousDateRange()
shifts the current date range backward by one
-
onNextDateRange
public void onNextDateRange()
shifts the current date range forward by one
-
onTimeScaleChanged
public void onTimeScaleChanged()
Called when the time interval has changed.
-
onRefreshModel
public void onRefreshModel()
reloads the related entities (Mandants or projects) and updates the frontend model
-
getProjectSelectItems
public List<javax.faces.model.SelectItem> getProjectSelectItems()
Lazy Getter for the options of the project selectbox.- Returns:
- the select items, grouped by 'online'/'offline' state
-
getModel
public org.primefaces.model.charts.ChartModel getModel()
lazily initializes the current chart model and returns it
-
setModel
public void setModel(org.primefaces.model.charts.ChartModel model)
-
isPreviousDateRangeDisabled
public boolean isPreviousDateRangeDisabled()
- Returns:
- true if the current date range is not shiftable backward, otherwise false
-
isNextDateRangeDisabled
public boolean isNextDateRangeDisabled()
- Returns:
- true if the current date range is not shiftable forward, otherwise false
-
completeMandant
public List<NamedEntityDto> completeMandant(String query)
Completion handler for the Mandant autocomplete.- Parameters:
query- the user input to match the Mandant names against- Returns:
- the list of matching Mandants
-
changeChartStyle
public void changeChartStyle(EChartStyle chartStyle)
Method to change the chart style. Updates the model afterward.- Parameters:
chartStyle- Chart style to change to
-
downloadExcelFile
public org.primefaces.model.StreamedContent downloadExcelFile()
Method to download the chart as an Excel file.- Returns:
- StreamedContent with the Excel data
-
getImageFilename
public String getImageFilename()
- Specified by:
getImageFilenamein classAStatisticsBean- Returns:
- The file name for the image file.
-
getChartWidgetVar
public String getChartWidgetVar()
- Specified by:
getChartWidgetVarin classAStatisticsBean- Returns:
- The chart widget var.
-
updateModel
public void updateModel()
Update the model. First get the start and end time point. Then fetch and process the data. Lastly construct the chart data.
-
getMandants
public List<NamedEntityDto> getMandants()
-
getDateRangeEditModel
public DateRangeEditModel getDateRangeEditModel()
-
getSelectedMandant
public NamedEntityDto getSelectedMandant()
-
setSelectedMandant
public void setSelectedMandant(NamedEntityDto selectedMandant)
-
getProjects
public List<BasicProjectDto> getProjects()
-
getSelectedProject
public BasicProjectDto getSelectedProject()
-
setSelectedProject
public void setSelectedProject(BasicProjectDto selectedProject)
-
getTimeScale
public ETimeScale getTimeScale()
-
setTimeScale
public void setTimeScale(ETimeScale timeScale)
-
getChartStyle
public EChartStyle getChartStyle()
-
setChartStyle
public void setChartStyle(EChartStyle chartStyle)
-
-