Class GetSurveysAction
java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.apache.cocoon.acting.AbstractAction
org.apache.cocoon.acting.ServiceableAction
org.ametys.plugins.survey.actions.GetSurveysAction
- All Implemented Interfaces:
Component
,LogEnabled
,Serviceable
,Action
SAX events for surveys, survey pages and survey questions
-
Field Summary
Modifier and TypeFieldDescriptionprotected AmetysObjectResolver
The Ametys object resolverprotected SiteManager
The site managerprotected SurveyDAO
The survey DAOprotected static final String
The String representing the type of a survey page nodeprotected static final String
The String representing the type of a survey question nodeprotected static final String
The String representing the type of a survey nodeFields inherited from class org.apache.cocoon.acting.ServiceableAction
manager
Fields inherited from class org.apache.cocoon.acting.AbstractAction
EMPTY_MAP
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionact
(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters) protected ModifiableTraversableAmetysObject
getSurveyRootNode
(String siteName, String lang) Get the root node for surveysvoid
service
(ServiceManager serviceManager) surveyPageToJSON
(SurveyPage page) Gets survey page's properties to JSON format.surveyQuestionToJSON
(SurveyQuestion question) Gets survey question's properties to JSON format.surveyToJSON
(Survey survey, boolean surveyOnly) Gets survey's properties to JSON format.Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
Field Details
-
SURVEY_TYPE
The String representing the type of a survey node- See Also:
-
SURVEY_PAGE_TYPE
The String representing the type of a survey page node- See Also:
-
SURVEY_QUESTION_TYPE
The String representing the type of a survey question node- See Also:
-
_resolver
The Ametys object resolver -
_siteManager
The site manager -
_surveyDAO
The survey DAO
-
-
Constructor Details
-
GetSurveysAction
public GetSurveysAction()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classServiceableAction
- Throws:
ServiceException
-
act
public Map act(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters) throws Exception - Throws:
Exception
-
surveyToJSON
Gets survey's properties to JSON format.- Parameters:
survey
- The survey.surveyOnly
- true to display survey only- Returns:
- The survey's properties
-
surveyPageToJSON
Gets survey page's properties to JSON format.- Parameters:
page
- The survey page- Returns:
- The page's properties
-
surveyQuestionToJSON
Gets survey question's properties to JSON format.- Parameters:
question
- The survey question- Returns:
- The question's properties
-
getSurveyRootNode
protected ModifiableTraversableAmetysObject getSurveyRootNode(String siteName, String lang) throws javax.jcr.RepositoryException Get the root node for surveys- Parameters:
siteName
- the site namelang
- the language- Returns:
- the root node
- Throws:
javax.jcr.RepositoryException
- if an error occurs when manipulating the repository
-