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,Initializable,Component,LogEnabled,Serviceable,Generator,SitemapModelComponent,XMLProducer
SAX the structure (ie. the child program items) of a
ProgramItem-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AbstractCacheManagerThe cache managerprotected ContentTypesHelperThe content types helperprotected ODFHelperThe ODF helperprotected OdfReferenceTableHelperHelper for ODF reference tableprotected ODFSkillsHelperThe ODF skills helperprotected AmetysObjectResolverThe Ametys object resolverFields inherited from class org.apache.cocoon.generation.ServiceableGenerator
managerFields inherited from class org.apache.cocoon.generation.AbstractGenerator
objectModel, parameters, resolver, sourceFields inherited from class org.apache.cocoon.xml.AbstractXMLProducer
contentHandler, EMPTY_CONTENT_HANDLER, lexicalHandler, xmlConsumer -
Constructor Summary
Constructors -
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 existsvoidgenerate()voidvoidrecycle()protected voidsaxChildProgramItems(ProgramItem programItem, List<ProgramItem> ancestorPath) SAX the child program itemsprotected voidsaxContainer(Container container, List<ProgramItem> ancestorPath) SAX a containerprotected voidsaxCourse(Course course, List<ProgramItem> ancestorPath) SAX a courseprotected voidsaxCourseList(CourseList cl, List<ProgramItem> ancestorPath) SAX a course listprotected voidsaxCoursePart(CoursePart coursePart) SAX a course partprotected voidsaxCourseParts(Course course) SAX a course partprotected voidsaxProgram(Program program) SAX a programprotected voidsaxProgramItem(ProgramItem programItem, List<ProgramItem> ancestorPath) SAX a program item with its child program itemsprotected voidsaxSubProgram(SubProgram subProgram, List<ProgramItem> ancestorPath) SAX a subprogramvoidservice(ServiceManager smanager) voidsetup(SourceResolver res, Map objModel, String src, Parameters par) Methods inherited from class org.apache.cocoon.generation.ServiceableGenerator
disposeMethods inherited from class org.apache.cocoon.xml.AbstractXMLProducer
setConsumer, setContentHandler, setLexicalHandlerMethods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLoggerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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 -
_cacheManager
The cache manager
-
-
Constructor Details
-
ProgramItemStructureGenerator
public ProgramItemStructureGenerator()
-
-
Method Details
-
service
- Specified by:
servicein interfaceServiceable- Overrides:
servicein classServiceableGenerator- Throws:
ServiceException
-
setup
public void setup(SourceResolver res, Map objModel, String src, Parameters par) throws ProcessingException, SAXException, IOException - Specified by:
setupin interfaceSitemapModelComponent- Overrides:
setupin classAbstractGenerator- Throws:
ProcessingExceptionSAXExceptionIOException
-
recycle
- Specified by:
recyclein interfaceRecyclable- Overrides:
recyclein classAbstractGenerator
-
initialize
- Specified by:
initializein interfaceInitializable- Throws:
Exception
-
generate
- Specified by:
generatein interfaceGenerator- Throws:
IOExceptionSAXExceptionProcessingException
-
_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
-