public class SurveySessionGenerator extends ServiceableGenerator
| Modifier and Type | Field and Description |
|---|---|
protected org.ametys.plugins.repository.AmetysObjectResolver |
_resolver
The ametys object resolver.
|
protected SurveyAnswerDao |
_surveyDao
The survey data DAO.
|
managerobjectModel, parameters, resolver, sourcecontentHandler, EMPTY_CONTENT_HANDLER, lexicalHandler, xmlConsumer| Constructor and Description |
|---|
SurveySessionGenerator() |
| Modifier and Type | Method and Description |
|---|---|
void |
generate() |
protected java.util.Map<java.lang.String,SurveyAnswer> |
getAnswerMap(SurveySession surveySession)
Get the answers of a survey session as a Map, indexed by question ID.
|
protected java.util.Map<java.lang.String,java.util.Set<java.lang.String>> |
getValueMap(SurveyQuestion question,
java.lang.String value)
Get the user-input value as a Map from the database value, which is a single serialized string.
|
protected void |
saxAnswers(SurveySession surveySession,
Survey survey)
Generate the answers of a given session.
|
protected void |
saxSession(SurveySession surveySession,
Survey survey,
boolean withAnswers)
Generate the data of a survey user session.
|
void |
service(ServiceManager serviceManager) |
disposerecycle, setupsetConsumer, setContentHandler, setLexicalHandlerenableLogging, getLogger, setupLogger, setupLogger, setupLoggerclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitsetConsumerprotected org.ametys.plugins.repository.AmetysObjectResolver _resolver
protected SurveyAnswerDao _surveyDao
public void service(ServiceManager serviceManager) throws ServiceException
service in interface Serviceableservice in class ServiceableGeneratorServiceExceptionpublic void generate()
throws java.io.IOException,
org.xml.sax.SAXException,
ProcessingException
java.io.IOExceptionorg.xml.sax.SAXExceptionProcessingExceptionprotected void saxSession(SurveySession surveySession, Survey survey, boolean withAnswers) throws org.xml.sax.SAXException
surveySession - the survey session.survey - the survey.withAnswers - true to generate answers along, false otherwise.org.xml.sax.SAXExceptionprotected void saxAnswers(SurveySession surveySession, Survey survey) throws org.xml.sax.SAXException
surveySession - the survey session.survey - the survey.org.xml.sax.SAXExceptionprotected java.util.Map<java.lang.String,SurveyAnswer> getAnswerMap(SurveySession surveySession)
surveySession - the survey session.protected java.util.Map<java.lang.String,java.util.Set<java.lang.String>> getValueMap(SurveyQuestion question, java.lang.String value)
question - the question.value - the value from the database.Copyright © 2010 Anyware Services. All Rights Reserved.