public class QuestionDAO extends AbstractDAO
| Modifier and Type | Field and Description | 
|---|---|
static String | 
ROLE
The Avalon role 
 | 
_cocoonContext, _context, _currentUserProvider, _jsonUtils, _observationManager, _resolver, _siteManager, _uploadManager| Constructor and Description | 
|---|
QuestionDAO()  | 
| Modifier and Type | Method and Description | 
|---|---|
private void | 
_setValues(SurveyQuestion question,
          Map<String,Object> values)  | 
Map<String,Object> | 
addRule(String id,
       String option,
       String rule,
       String page)
Adds a new rule to a question. 
 | 
Map<String,String> | 
copyQuestion(String pageId,
            String questionId)
Copies and pastes a survey question. 
 | 
Map<String,String> | 
createQuestion(Map<String,Object> values)
Creates a survey question. 
 | 
Map<String,String> | 
deleteQuestion(String id)
Deletes a survey question. 
 | 
Map<String,Object> | 
deleteRule(String id,
          String option)
Deletes a rule to a question. 
 | 
Map<String,String> | 
editQuestion(Map<String,Object> values)
Edits a survey question. 
 | 
Map<String,Object> | 
getQuestion(String id)
Gets properties of a survey question 
 | 
Map<String,Object> | 
getQuestion(SurveyQuestion question)
Gets properties of a survey question 
 | 
Map<String,Object> | 
getRules(String id,
        int number)
Gets the rules for a survey question. 
 | 
_getCurrentUser, contextualize, getPictureInfo, getSurveyRootNode, service, setPicture, updateReferencesAfterCopy, updateReferencesAfterCopy, updateReferencesAfterCopygetLogger, setLoggerpublic QuestionDAO()
public Map<String,Object> getQuestion(String id)
id - The id of the survey questionpublic Map<String,Object> getQuestion(SurveyQuestion question)
question - The survey questionpublic Map<String,String> createQuestion(Map<String,Object> values)
values - The question's valuespublic Map<String,String> editQuestion(Map<String,Object> values)
values - The question's valuesprivate void _setValues(SurveyQuestion question, Map<String,Object> values)
public Map<String,String> copyQuestion(String pageId, String questionId)
pageId - The id of the page, target of the copyquestionId - The id of the question to copypublic Map<String,String> deleteQuestion(String id)
id - The id of the survey question to deletepublic Map<String,Object> addRule(String id, String option, String rule, String page)
id - _resolver.resolveById(id);option - The optionrule - The rule typepage - The page to jump or skippublic Map<String,Object> deleteRule(String id, String option)
id - _resolver.resolveById(id);option - The option to delete