Class EventQuestionServiceImpl
java.lang.Object
ch.tocco.nice2.optional.event.impl.actions.EventQuestionServiceImpl
- All Implemented Interfaces:
EventQuestionService
-
Constructor Summary
ConstructorDescriptionEventQuestionServiceImpl
(QueryBuilderFactory queryBuilderFactory, Context context, SecurityManager securityManager, org.slf4j.Logger log) -
Method Summary
Modifier and TypeMethodDescriptiongetQuestionAnswer
(Entity registration, Entity eventQuestion) Returns anEvent_question_answer
for the passedregistration
andEvent_question
if existing.void
updateOrCreateChoiceQuestion
(Entity eventQuestion, Entity registration, EntityList answers) Updates or creates anEvent_question_answer
for the passedRegistration
andEvent_question
and adds the passedRegistration_answer_options
to it.void
updateOrCreateTextQuestion
(Entity eventQuestion, Entity registration, String answer) Updates or creates anEvent_question_answer
for the passedRegistration
andEvent_question
and sets the value of the fieldanswer
with the passedString
.
-
Constructor Details
-
EventQuestionServiceImpl
public EventQuestionServiceImpl(QueryBuilderFactory queryBuilderFactory, Context context, SecurityManager securityManager, org.slf4j.Logger log)
-
-
Method Details
-
getQuestionAnswer
Description copied from interface:EventQuestionService
Returns anEvent_question_answer
for the passedregistration
andEvent_question
if existing. Otherwise ancom.google.common.base.Absent<T>
will be returned.- Specified by:
getQuestionAnswer
in interfaceEventQuestionService
-
updateOrCreateTextQuestion
Description copied from interface:EventQuestionService
Updates or creates anEvent_question_answer
for the passedRegistration
andEvent_question
and sets the value of the fieldanswer
with the passedString
. The type of the question has either to betext_single_line
ortext_multi_line
. Otherwise this method won't do anything. If there is noEvent_question_answer
available for the passedRegistration
andEvent_question
a new one will be created.- Specified by:
updateOrCreateTextQuestion
in interfaceEventQuestionService
-
updateOrCreateChoiceQuestion
public void updateOrCreateChoiceQuestion(Entity eventQuestion, Entity registration, EntityList answers) Description copied from interface:EventQuestionService
Updates or creates anEvent_question_answer
for the passedRegistration
andEvent_question
and adds the passedRegistration_answer_options
to it. the type of the question has either to besingle_choice
ormultiple_choice
. Otherwise this method won't do anything. If there is noEvent_question_answer
available for the passedRegistration
andEvent_question
a new one will be created. If the type of the passedEvent_question
issingle_choice
and the passedEntityList
has more than one entries, only the first entry will be added.- Specified by:
updateOrCreateChoiceQuestion
in interfaceEventQuestionService
-