Class SurveysGenerator
- java.lang.Object
-
- org.apache.avalon.framework.logger.AbstractLogEnabled
-
- org.apache.cocoon.xml.AbstractXMLProducer
-
- org.apache.cocoon.generation.AbstractGenerator
-
- org.apache.cocoon.generation.ServiceableGenerator
-
- org.ametys.plugins.survey.generators.SurveysGenerator
-
- All Implemented Interfaces:
Poolable,Recyclable,Disposable,Component,LogEnabled,Serviceable,Generator,SitemapModelComponent,XMLProducer
- Direct Known Subclasses:
SurveyGenerator
public class SurveysGenerator extends ServiceableGenerator
SAX surveys
-
-
Field Summary
Fields Modifier and Type Field Description protected AmetysObjectResolver_resolverThe Ametys object resolverprotected SiteManager_siteManagerThe site managerprotected SurveyDAO_surveyDAOThe DAO for surveys-
Fields inherited from class org.apache.cocoon.generation.ServiceableGenerator
manager
-
Fields inherited from class org.apache.cocoon.generation.AbstractGenerator
objectModel, parameters, resolver, source
-
Fields inherited from class org.apache.cocoon.xml.AbstractXMLProducer
contentHandler, EMPTY_CONTENT_HANDLER, lexicalHandler, xmlConsumer
-
-
Constructor Summary
Constructors Constructor Description SurveysGenerator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidgenerate()protected ModifiableTraversableAmetysObjectgetSurveyRootNode(String siteName, String lang)Get the root node for surveysprotected voidsaxBranches(SurveyPage page)SAX branch logicvoidservice(ServiceManager serviceManager)protected voidtoSAX(SurveyPage page, boolean saxChildren, boolean saxBranches)SAX a survey pageprotected voidtoSAX(Survey survey, boolean saxChildren)SAX a surveyprotected voidtoSAX(SurveyQuestion question)SAX a survey questionprotected voidtoSAXPicture(AbstractSurveyElement elmt)SAX the picture of the element of a survey-
Methods inherited from class org.apache.cocoon.generation.ServiceableGenerator
dispose
-
Methods inherited from class org.apache.cocoon.generation.AbstractGenerator
recycle, setup
-
Methods inherited from class org.apache.cocoon.xml.AbstractXMLProducer
setConsumer, setContentHandler, setLexicalHandler
-
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.cocoon.xml.XMLProducer
setConsumer
-
-
-
-
Field Detail
-
_resolver
protected AmetysObjectResolver _resolver
The Ametys object resolver
-
_siteManager
protected SiteManager _siteManager
The site manager
-
_surveyDAO
protected SurveyDAO _surveyDAO
The DAO for surveys
-
-
Constructor Detail
-
SurveysGenerator
public SurveysGenerator()
-
-
Method Detail
-
service
public void service(ServiceManager serviceManager) throws ServiceException
- Specified by:
servicein interfaceServiceable- Overrides:
servicein classServiceableGenerator- Throws:
ServiceException
-
generate
public void generate() throws IOException, SAXException, ProcessingException
-
toSAX
protected void toSAX(Survey survey, boolean saxChildren) throws SAXException
SAX a survey- Parameters:
survey- the survey to SAXsaxChildren- true to SAX children- Throws:
SAXException- if error occurs while SAXing
-
toSAX
protected void toSAX(SurveyPage page, boolean saxChildren, boolean saxBranches) throws SAXException
SAX a survey page- Parameters:
page- the page to SAXsaxChildren- true to SAX childrensaxBranches- true to SAX branch logic- Throws:
SAXException- if error occurs while SAXing
-
saxBranches
protected void saxBranches(SurveyPage page) throws SAXException
SAX branch logic- Parameters:
page- the page- Throws:
SAXException- if error occurs while SAXing
-
toSAX
protected void toSAX(SurveyQuestion question) throws SAXException
SAX a survey question- Parameters:
question- the question to SAX- Throws:
SAXException- if error occurs while SAXing
-
toSAXPicture
protected void toSAXPicture(AbstractSurveyElement elmt) throws SAXException
SAX the picture of the element of a survey- Parameters:
elmt- The survey element- Throws:
SAXException- If an error occurred
-
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 retrieving the survey's root node
-
-