Package org.ametys.plugins.forms.helper
Class FormStatisticsHelper
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.forms.helper.FormStatisticsHelper
- All Implemented Interfaces:
 LogEnabled,Component,Serviceable
The helper to handle admin emails
- 
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordRecord representing a choice list option - 
Field Summary
FieldsModifier and TypeFieldDescriptionprotected FormEntryDAOThe form entry DAOprotected I18nUtilsThe I18n utilsprotected AmetysObjectResolverThe Ametys Object resolverprotected RightManagerThe right managerstatic final StringAvalon ROLE. - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionprotected void_dispatchBooleanStats(Form form, List<FormEntry> entries, FormQuestion question, Map<String, Map<String, Object>> questionValues) Dispatch boolean statsprotected void_dispatchChoicesStats(Form form, FormQuestion question, Map<String, Map<String, Object>> questionValues) Dispatch choices list statsprotected void_dispatchChoicesWithRemoteDataStats(Form form, FormQuestion question, Map<String, Map<String, Object>> questionValues) Dispatch choices list with remote data statsprotected void_dispatchMatrixStats(List<FormEntry> entries, FormQuestion question, Map<String, Map<String, Object>> questionValues) Dispatch matrix statsprotected void_dispatchStats(Form form, List<FormEntry> entries, FormQuestion question, Map<String, Map<String, Object>> questionValues) Dispatch default stats_getStatistics(Form form) Compute the statistics for each questions of the formGenerate statistics of a mini-survey No rights will be checked.getStatistics(String id) Generates statistics on each question of a form.getStatsMap(Form form) Create a map with count of all answers per questiongetStatsToArray(Form form) Transforms the statistics map into an array with some info.voidservice(ServiceManager manager) Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger 
- 
Field Details
- 
ROLE
Avalon ROLE. - 
_resolver
The Ametys Object resolver - 
_rightManager
The right manager - 
_formEntryDAO
The form entry DAO - 
_i18nUtils
The I18n utils 
 - 
 - 
Constructor Details
- 
FormStatisticsHelper
public FormStatisticsHelper() 
 - 
 - 
Method Details
- 
service
- Specified by:
 servicein interfaceServiceable- Throws:
 ServiceException
 - 
getStatistics
Generates statistics on each question of a form.- Parameters:
 id- The form id- Returns:
 - A map containing the statistics
 
 - 
getMiniSurveyStatistics
Generate statistics of a mini-survey No rights will be checked. Only a check that it is indeed a mini-survey will be done.- Parameters:
 id- the form id- Returns:
 - a JSON map of the statistics
 
 - 
_getStatistics
Compute the statistics for each questions of the form- Parameters:
 form- the form- Returns:
 - A JSON map representing the statistics
 
 - 
getStatsMap
Create a map with count of all answers per question- Parameters:
 form- current form- Returns:
 - the statsMap
 
 - 
getStatsToArray
Transforms the statistics map into an array with some info.- Parameters:
 form- The form- Returns:
 - A list of statistics.
 
 - 
_dispatchMatrixStats
protected void _dispatchMatrixStats(List<FormEntry> entries, FormQuestion question, Map<String, Map<String, Object>> questionValues) Dispatch matrix stats- Parameters:
 entries- the entriesquestion- the questionquestionValues- the values to fill
 - 
_dispatchChoicesStats
protected void _dispatchChoicesStats(Form form, FormQuestion question, Map<String, Map<String, Object>> questionValues) Dispatch choices list stats- Parameters:
 form- the formquestion- the questionquestionValues- the values to fill
 - 
_dispatchChoicesWithRemoteDataStats
protected void _dispatchChoicesWithRemoteDataStats(Form form, FormQuestion question, Map<String, Map<String, Object>> questionValues) Dispatch choices list with remote data stats- Parameters:
 form- the formquestion- the questionquestionValues- the values to fill
 - 
_dispatchBooleanStats
protected void _dispatchBooleanStats(Form form, List<FormEntry> entries, FormQuestion question, Map<String, Map<String, Object>> questionValues) Dispatch boolean stats- Parameters:
 form- the formentries- the entriesquestion- the questionquestionValues- the values to fill
 - 
_dispatchStats
protected void _dispatchStats(Form form, List<FormEntry> entries, FormQuestion question, Map<String, Map<String, Object>> questionValues) Dispatch default stats- Parameters:
 form- the formentries- the entriesquestion- the questionquestionValues- the values to fill
 
 -