Class EventQuestionServiceImpl
java.lang.Object
ch.tocco.nice2.optional.event.impl.actions.EventQuestionServiceImpl
- All Implemented Interfaces:
EventQuestionService
-
Constructor Summary
ConstructorsConstructorDescriptionEventQuestionServiceImpl(QueryBuilderFactory queryBuilderFactory, Context context, SecurityManager securityManager, org.slf4j.Logger log) -
Method Summary
Modifier and TypeMethodDescriptiongetQuestionAnswer(Entity registration, Entity eventQuestion) Returns anEvent_question_answerfor the passedregistrationandEvent_questionif existing.voidupdateOrCreateChoiceQuestion(Entity eventQuestion, Entity registration, EntityList answers) Updates or creates anEvent_question_answerfor the passedRegistrationandEvent_questionand adds the passedRegistration_answer_optionsto it.voidupdateOrCreateTextQuestion(Entity eventQuestion, Entity registration, String answer) Updates or creates anEvent_question_answerfor the passedRegistrationandEvent_questionand sets the value of the fieldanswerwith the passedString.
-
Constructor Details
-
EventQuestionServiceImpl
public EventQuestionServiceImpl(QueryBuilderFactory queryBuilderFactory, Context context, SecurityManager securityManager, org.slf4j.Logger log)
-
-
Method Details
-
getQuestionAnswer
Description copied from interface:EventQuestionServiceReturns anEvent_question_answerfor the passedregistrationandEvent_questionif existing. Otherwise ancom.google.common.base.Absent<T>will be returned.- Specified by:
getQuestionAnswerin interfaceEventQuestionService
-
updateOrCreateTextQuestion
Description copied from interface:EventQuestionServiceUpdates or creates anEvent_question_answerfor the passedRegistrationandEvent_questionand sets the value of the fieldanswerwith the passedString. The type of the question has either to betext_single_lineortext_multi_line. Otherwise this method won't do anything. If there is noEvent_question_answeravailable for the passedRegistrationandEvent_questiona new one will be created.- Specified by:
updateOrCreateTextQuestionin interfaceEventQuestionService
-
updateOrCreateChoiceQuestion
public void updateOrCreateChoiceQuestion(Entity eventQuestion, Entity registration, EntityList answers) Description copied from interface:EventQuestionServiceUpdates or creates anEvent_question_answerfor the passedRegistrationandEvent_questionand adds the passedRegistration_answer_optionsto it. the type of the question has either to besingle_choiceormultiple_choice. Otherwise this method won't do anything. If there is noEvent_question_answeravailable for the passedRegistrationandEvent_questiona new one will be created. If the type of the passedEvent_questionissingle_choiceand the passedEntityListhas more than one entries, only the first entry will be added.- Specified by:
updateOrCreateChoiceQuestionin interfaceEventQuestionService
-