Package org.ametys.odf.content
Class ProgramItemStructureGenerator
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.odf.content.ProgramItemStructureGenerator
- All Implemented Interfaces:
Poolable
,Recyclable
,Disposable
,Component
,LogEnabled
,Serviceable
,Generator
,SitemapModelComponent
,XMLProducer
SAX the structure (ie. the child program items) of a
ProgramItem
-
Field Summary
Modifier and TypeFieldDescriptionprotected ContentTypesHelper
The content types helperprotected ODFHelper
The ODF helperprotected OdfReferenceTableHelper
Helper for ODF reference tableprotected ODFSkillsHelper
The ODF skills helperprotected AmetysObjectResolver
The Ametys object resolverFields 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
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
_addAttrIfNotEmpty
(AttributesImpl attrs, String attrName, String attrValue) Add an attribute if its not null or empty.protected List<ProgramItem>
_getInitialAncestorPath
(Request request, ProgramItem rootProgramItem) Get the initial ancestor path from request or from root program itemprotected void
_saxCommonAttributes
(ProgramItem programItem, List<ProgramItem> ancestorPath, AttributesImpl attrs) SAX the common attributes for program itemprotected void
_saxReferenceTableItem
(String itemId, String tagName, String lang) SAX the item of a reference tableprotected void
_saxStructureViewIfExists
(Content content) SAX the 'structure' view if existsvoid
generate()
protected void
saxChildProgramItems
(ProgramItem programItem, List<ProgramItem> ancestorPath) SAX the child program itemsprotected void
saxContainer
(Container container, List<ProgramItem> ancestorPath) SAX a containerprotected void
saxCourse
(Course course, List<ProgramItem> ancestorPath) SAX a courseprotected void
saxCourseList
(CourseList cl, List<ProgramItem> ancestorPath) SAX a course listprotected void
saxCoursePart
(CoursePart coursePart) SAX a course partprotected void
saxCourseParts
(Course course) SAX a course partprotected void
saxProgram
(Program program) SAX a programprotected void
saxProgramItem
(ProgramItem programItem, List<ProgramItem> ancestorPath) SAX a program item with its child program itemsprotected void
saxSubProgram
(SubProgram subProgram, List<ProgramItem> ancestorPath) SAX a subprogramvoid
service
(ServiceManager smanager) 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 Details
-
_odfHelper
The ODF helper -
_odfReferenceTableHelper
Helper for ODF reference table -
_cTypesHelper
The content types helper -
_odfSkillsHelper
The ODF skills helper -
_resolver
The Ametys object resolver
-
-
Constructor Details
-
ProgramItemStructureGenerator
public ProgramItemStructureGenerator()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classServiceableGenerator
- Throws:
ServiceException
-
generate
-
_getInitialAncestorPath
Get the initial ancestor path from request or from root program item- Parameters:
request
- the requestrootProgramItem
- the root program item in saxed structure- Returns:
- the initial ancestor path as a list of program items
-
saxProgramItem
protected void saxProgramItem(ProgramItem programItem, List<ProgramItem> ancestorPath) throws SAXException SAX a program item with its child program items- Parameters:
programItem
- the program itemancestorPath
- The path of this program item in the saxed structure (computed from the initial saxed program item). Can be a partial path.- Throws:
SAXException
- if an error occurs while saxing
-
saxChildProgramItems
protected void saxChildProgramItems(ProgramItem programItem, List<ProgramItem> ancestorPath) throws SAXException SAX the child program items- Parameters:
programItem
- the program itemancestorPath
- The path of parent program item in the structure (starting from the initial saxed program item)- Throws:
SAXException
- if an error occurs while saxing
-
saxProgram
SAX a program- Parameters:
program
- the subprogram to SAX- Throws:
SAXException
- if an error occurs
-
saxSubProgram
protected void saxSubProgram(SubProgram subProgram, List<ProgramItem> ancestorPath) throws SAXException SAX a subprogram- Parameters:
subProgram
- the subprogram to SAXancestorPath
- The path of this program item in the saxed structure (computed from the initial saxed program item). Can be a partial path.- Throws:
SAXException
- if an error occurs
-
saxContainer
protected void saxContainer(Container container, List<ProgramItem> ancestorPath) throws SAXException SAX a container- Parameters:
container
- the container to SAXancestorPath
- The path of this program item in the saxed structure (computed from the initial saxed program item). Can be a partial path.- Throws:
SAXException
- if an error occurs while saxing
-
saxCourseList
SAX a course list- Parameters:
cl
- the course list to SAXancestorPath
- The path of this program item in the saxed structure (computed from the initial saxed program item). Can be a partial path.- Throws:
SAXException
- if an error occurs while saxing
-
saxCourse
SAX a course- Parameters:
course
- the container to SAXancestorPath
- The path of this program item in the saxed structure (computed from the initial saxed program item). Can be a partial path.- Throws:
SAXException
- if an error occurs while saxing
-
saxCourseParts
SAX a course part- Parameters:
course
- The course- Throws:
SAXException
- if an error occurs
-
saxCoursePart
SAX a course part- Parameters:
coursePart
- The course part to SAX- Throws:
SAXException
- if an error occurs
-
_saxStructureViewIfExists
SAX the 'structure' view if exists- Parameters:
content
- the content- Throws:
SAXException
- if an error occurs
-
_saxCommonAttributes
protected void _saxCommonAttributes(ProgramItem programItem, List<ProgramItem> ancestorPath, AttributesImpl attrs) SAX the common attributes for program item- Parameters:
programItem
- the program itemancestorPath
- The path of this program item in the structure (starting from the initial saxed program item)attrs
- the attributes
-
_saxReferenceTableItem
protected void _saxReferenceTableItem(String itemId, String tagName, String lang) throws SAXException SAX the item of a reference table- Parameters:
itemId
- the item idtagName
- the tag namelang
- the language to use- Throws:
SAXException
- if an error occurs while saxing
-
_addAttrIfNotEmpty
Add an attribute if its not null or empty.- Parameters:
attrs
- The attributesattrName
- The attribute nameattrValue
- The attribute value
-