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
public class GetSurveysAction extends ServiceableAction
SAX events for surveys, survey pages and survey questions 
- 
- 
Field Summary
Fields Modifier and Type Field Description protected AmetysObjectResolver_resolverThe Ametys object resolverprotected SiteManager_siteManagerThe site managerprotected SurveyDAO_surveyDAOThe survey DAOprotected static StringSURVEY_PAGE_TYPEThe String representing the type of a survey page nodeprotected static StringSURVEY_QUESTION_TYPEThe String representing the type of a survey question nodeprotected static StringSURVEY_TYPEThe String representing the type of a survey node- 
Fields inherited from class org.apache.cocoon.acting.ServiceableAction
manager 
- 
Fields inherited from class org.apache.cocoon.acting.AbstractAction
EMPTY_MAP 
 - 
 
- 
Constructor Summary
Constructors Constructor Description GetSurveysAction() 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Mapact(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters)protected ModifiableTraversableAmetysObjectgetSurveyRootNode(String siteName, String lang)Get the root node for surveysvoidservice(ServiceManager serviceManager)protected Map<String,Object>surveyPageToJSON(SurveyPage page)Gets survey page's properties to JSON format.protected Map<String,Object>surveyQuestionToJSON(SurveyQuestion question)Gets survey question's properties to JSON format.protected Map<String,Object>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 Detail
- 
SURVEY_TYPE
protected static final String SURVEY_TYPE
The String representing the type of a survey node- See Also:
 - Constant Field Values
 
 
- 
SURVEY_PAGE_TYPE
protected static final String SURVEY_PAGE_TYPE
The String representing the type of a survey page node- See Also:
 - Constant Field Values
 
 
- 
SURVEY_QUESTION_TYPE
protected static final String SURVEY_QUESTION_TYPE
The String representing the type of a survey question node- See Also:
 - Constant Field Values
 
 
- 
_resolver
protected AmetysObjectResolver _resolver
The Ametys object resolver 
- 
_siteManager
protected SiteManager _siteManager
The site manager 
- 
_surveyDAO
protected SurveyDAO _surveyDAO
The survey DAO 
 - 
 
- 
Constructor Detail
- 
GetSurveysAction
public GetSurveysAction()
 
 - 
 
- 
Method Detail
- 
service
public void service(ServiceManager serviceManager) throws ServiceException
- Specified by:
 servicein interfaceServiceable- Overrides:
 servicein classServiceableAction- Throws:
 ServiceException
 
- 
act
public Map act(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters) throws Exception
- Throws:
 Exception
 
- 
surveyToJSON
protected Map<String,Object> surveyToJSON(Survey survey, boolean surveyOnly)
Gets survey's properties to JSON format.- Parameters:
 survey- The survey.surveyOnly- true to display survey only- Returns:
 - The survey's properties
 
 
- 
surveyPageToJSON
protected Map<String,Object> surveyPageToJSON(SurveyPage page)
Gets survey page's properties to JSON format.- Parameters:
 page- The survey page- Returns:
 - The page's properties
 
 
- 
surveyQuestionToJSON
protected Map<String,Object> surveyQuestionToJSON(SurveyQuestion question)
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 RepositoryException
Get the root node for surveys- Parameters:
 siteName- the site namelang- the language- Returns:
 - the root node
 - Throws:
 RepositoryException- if an error occurs when manipulating the repository
 
 - 
 
 -