public class GetSurveysAction extends ServiceableAction
| Modifier and Type | Field and Description |
|---|---|
protected AmetysObjectResolver |
_resolver
The Ametys object resolver
|
protected SiteManager |
_siteManager
The site manager
|
protected SurveyDAO |
_surveyDAO
The survey DAO
|
protected static String |
SURVEY_PAGE_TYPE
The String representing the type of a survey page node
|
protected static String |
SURVEY_QUESTION_TYPE
The String representing the type of a survey question node
|
protected static String |
SURVEY_TYPE
The String representing the type of a survey node
|
managerEMPTY_MAP| Constructor and Description |
|---|
GetSurveysAction() |
| Modifier and Type | Method and Description |
|---|---|
Map |
act(Redirector redirector,
SourceResolver resolver,
Map objectModel,
String source,
Parameters parameters) |
protected ModifiableTraversableAmetysObject |
getSurveyRootNode(String siteName,
String lang)
Get the root node for surveys
|
void |
service(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.
|
enableLogging, getLogger, setupLogger, setupLogger, setupLoggerprotected static final String SURVEY_TYPE
protected static final String SURVEY_PAGE_TYPE
protected static final String SURVEY_QUESTION_TYPE
protected AmetysObjectResolver _resolver
protected SiteManager _siteManager
protected SurveyDAO _surveyDAO
public GetSurveysAction()
public void service(ServiceManager serviceManager) throws ServiceException
service in interface Serviceableservice in class ServiceableActionServiceExceptionpublic Map act(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters) throws Exception
Exceptionprotected Map<String,Object> surveyToJSON(Survey survey, boolean surveyOnly)
survey - The survey.surveyOnly - true to display survey onlyprotected Map<String,Object> surveyPageToJSON(SurveyPage page)
page - The survey pageprotected Map<String,Object> surveyQuestionToJSON(SurveyQuestion question)
question - The survey questionprotected ModifiableTraversableAmetysObject getSurveyRootNode(String siteName, String lang) throws RepositoryException
siteName - the site namelang - the languageRepositoryException - if an error occurs when manipulating the repository