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
_resolver
The Ametys object resolverprotected SiteManager
_siteManager
The site managerprotected SurveyDAO
_surveyDAO
The 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 void
generate()
protected ModifiableTraversableAmetysObject
getSurveyRootNode(String siteName, String lang)
Get the root node for surveysprotected void
saxBranches(SurveyPage page)
SAX branch logicvoid
service(ServiceManager serviceManager)
protected void
toSAX(SurveyPage page, boolean saxChildren, boolean saxBranches)
SAX a survey pageprotected void
toSAX(Survey survey, boolean saxChildren)
SAX a surveyprotected void
toSAX(SurveyQuestion question)
SAX a survey questionprotected void
toSAXPicture(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:
service
in interfaceServiceable
- Overrides:
service
in 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
-
-