Package org.ametys.plugins.survey.dao
Class QuestionDAO
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.survey.dao.AbstractDAO
org.ametys.plugins.survey.dao.QuestionDAO
- All Implemented Interfaces:
LogEnabled
,Component
,Contextualizable
,Serviceable
DAO for manipulating survey questions.
-
Field Summary
Fields inherited from class org.ametys.plugins.survey.dao.AbstractDAO
_cocoonContext, _context, _currentUserProvider, _jsonUtils, _observationManager, _resolver, _siteManager, _uploadManager
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionAdds a new rule to a question.copyQuestion
(String pageId, String questionId) Copies and pastes a survey question.createQuestion
(Map<String, Object> values) Creates a survey question.deleteQuestion
(String id) Deletes a survey question.deleteRule
(String id, String option) Deletes a rule to a question.editQuestion
(Map<String, Object> values) Edits a survey question.getQuestion
(String id) Gets properties of a survey questiongetQuestion
(SurveyQuestion question) Gets properties of a survey questionGets the rules for a survey question.Methods inherited from class org.ametys.plugins.survey.dao.AbstractDAO
_getCurrentUser, contextualize, getPictureInfo, getSurveyRootNode, service, setPicture, updateReferencesAfterCopy, updateReferencesAfterCopy, updateReferencesAfterCopy
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
ROLE
The Avalon role
-
-
Constructor Details
-
QuestionDAO
public QuestionDAO()
-
-
Method Details
-
getQuestion
Gets properties of a survey question- Parameters:
id
- The id of the survey question- Returns:
- The properties
-
getQuestion
Gets properties of a survey question- Parameters:
question
- The survey question- Returns:
- The properties
-
createQuestion
Creates a survey question.- Parameters:
values
- The question's values- Returns:
- The id of the created survey question, the id of the page and the id of the survey
-
editQuestion
Edits a survey question.- Parameters:
values
- The question's values- Returns:
- The id of the edited survey question, the id of the page and the id of the survey
-
copyQuestion
Copies and pastes a survey question.- Parameters:
pageId
- The id of the page, target of the copyquestionId
- The id of the question to copy- Returns:
- The id of the created question, the id of the page and the id of the survey
-
deleteQuestion
Deletes a survey question.- Parameters:
id
- The id of the survey question to delete- Returns:
- The id of the deleted survey question, the id of the page and the id of the survey
-
addRule
Adds a new rule to a question.- Parameters:
id
- _resolver.resolveById(id);option
- The optionrule
- The rule typepage
- The page to jump or skip- Returns:
- An empty map, or an error
-
deleteRule
Deletes a rule to a question.- Parameters:
id
- _resolver.resolveById(id);option
- The option to delete- Returns:
- An empty map
-
getRules
Gets the rules for a survey question.- Parameters:
id
- The id of the survey question.number
- The question number- Returns:
- The rules
-