public class PageDAO extends AbstractDAO
Modifier and Type | Field and Description |
---|---|
private QuestionDAO |
_questionDAO
The Question DAO
|
private Repository |
_repository
The repository
|
static String |
ROLE
The Avalon role
|
_cocoonContext, _context, _currentUserProvider, _jsonUtils, _observationManager, _resolver, _siteManager, _uploadManager
Constructor and Description |
---|
PageDAO() |
Modifier and Type | Method and Description |
---|---|
private void |
_removeReferencesFromPages(String pageId) |
private void |
_removeReferencesFromQuestions(String pageId) |
private void |
_setValues(SurveyPage page,
Map<String,Object> values) |
Map<String,Object> |
addRule(String id,
String rule,
String page)
Adds a a new rule to a page.
|
Map<String,String> |
copyPage(String surveyId,
String pageId)
Copies and pastes a survey page.
|
Map<String,String> |
createPage(Map<String,Object> values)
Creates a survey page.
|
Map<String,String> |
deletePage(String id)
Deletes a survey page.
|
Map<String,Object> |
deleteRule(String id)
Deletes a rule to a page
|
Map<String,String> |
editPage(Map<String,Object> values)
Edits a survey page.
|
Map<String,Object> |
getBranches(String id)
Gets the branches for a survey page.
|
Map<String,Object> |
getPage(String id)
Gets properties of a survey page
|
Map<String,Object> |
getPage(SurveyPage page)
Gets properties of a survey page
|
Map<String,Object> |
getRule(String id)
Gets the rule for a survey page.
|
boolean |
isLastPage(String id)
Determines if a page is the last of survey's pages.
|
void |
service(ServiceManager serviceManager) |
_getCurrentUser, contextualize, getPictureInfo, getSurveyRootNode, setPicture, updateReferencesAfterCopy, updateReferencesAfterCopy, updateReferencesAfterCopy
getLogger, setLogger
private Repository _repository
private QuestionDAO _questionDAO
public PageDAO()
public void service(ServiceManager serviceManager) throws ServiceException
service
in interface Serviceable
service
in class AbstractDAO
ServiceException
public Map<String,Object> getPage(String id)
id
- The id of the survey pagepublic Map<String,Object> getPage(SurveyPage page)
page
- The survey pagepublic boolean isLastPage(String id)
id
- The page idpublic Map<String,String> createPage(Map<String,Object> values) throws Exception
values
- The survey page's valuesException
- if an exception occurs during the page creation processpublic Map<String,String> editPage(Map<String,Object> values)
values
- The survey page's valuesprivate void _setValues(SurveyPage page, Map<String,Object> values)
public Map<String,String> copyPage(String surveyId, String pageId)
surveyId
- The id of the survey, target of the copypageId
- The id of the page to copypublic Map<String,String> deletePage(String id)
id
- The id of the survey page to deletepublic Map<String,Object> addRule(String id, String rule, String page)
id
- The id of the pagerule
- The rule typepage
- The page to jump or skippublic Map<String,Object> deleteRule(String id)
id
- The id of the pagepublic Map<String,Object> getRule(String id)
id
- The id of the survey page.public Map<String,Object> getBranches(String id)
id
- The id of the survey page.private void _removeReferencesFromPages(String pageId)
private void _removeReferencesFromQuestions(String pageId)