Class ProgramContentGenerator
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.cms.content.ContentGenerator
org.ametys.odf.program.generators.ODFContentGenerator
org.ametys.odf.program.generators.ProgramContentGenerator
- All Implemented Interfaces:
Poolable,Recyclable,Disposable,Initializable,Component,LogEnabled,Serviceable,Generator,SitemapModelComponent,XMLProducer
- Direct Known Subclasses:
CourseContentGenerator,OrgUnitContentGenerator,ProgramPdfContentGenerator
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ContentHelperThe content helperprotected ODFHelperThe ODF helperprotected SourceResolverThe source resolverFields inherited from class org.ametys.odf.program.generators.ODFContentGenerator
_resolverFields inherited from class org.ametys.cms.content.ContentGenerator
_contentSaxer, _contentTypeExtensionPoint, _cTypesHelper, _DC_DATE_FORMATFields 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 void_saxOtherData(Content content, Locale defaultLocale) SAX any other data needed by the view.getLinkedContents(Content content, String linkedContentType) Get the linked contents of the defined content type.voidvoidrecycle()protected voidsaxChildProgramPart(AbstractProgram program, Locale defaultLocale) SAX the referencedProgramPartsprotected voidsaxContainer(Container container, String parentPath, Locale defaultLocale) SAX a containerprotected voidsaxContent(Content content, ContentHandler handler, String viewName) SAX the HTML content of aContentprotected voidsaxContent(Content content, ContentHandler handler, String viewName, String format, boolean withContentRoot, boolean ignoreChildren) SAX aContentto given formatprotected voidSAX a courseprotected voidsaxCourseList(CourseList courseList, String parentPath, Locale defaultLocale) SAX a course listprotected voidsaxCoursePart(CoursePart coursePart, Locale defaultLocale) SAX a course partprotected voidsaxLinkedContents(Content content, String tagName, String linkedContentType, String viewName) SAX the referenced content types.protected voidsaxOrgUnits(Content content) SAX the referencedOrgUnitsprotected voidsaxPersons(Content content) SAX the referencedPersonsprotected voidsaxSubProgram(SubProgram subProgram, String parentPath) SAX a sub programprotected voidsaxTranslation(Content content) SAX the existing translationvoidservice(ServiceManager serviceManager) voidsetup(SourceResolver res, Map objModel, String src, Parameters par) Methods inherited from class org.ametys.odf.program.generators.ODFContentGenerator
saxTranslationsMethods inherited from class org.ametys.cms.content.ContentGenerator
_generateContent, _getView, _saxAttributesComments, _saxContent, _saxOtherData, generate, getDefaultLocaleMethods 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
-
_srcResolver
The source resolver -
_odfHelper
The ODF helper -
_contentHelper
The content helper
-
-
Constructor Details
-
ProgramContentGenerator
public ProgramContentGenerator()
-
-
Method Details
-
service
- Specified by:
servicein interfaceServiceable- Overrides:
servicein classODFContentGenerator- Throws:
ServiceException
-
initialize
- Specified by:
initializein interfaceInitializable- Throws:
Exception
-
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
-
_saxOtherData
protected void _saxOtherData(Content content, Locale defaultLocale) throws SAXException, ProcessingException, IOException Description copied from class:ContentGeneratorSAX any other data needed by the view.Default implementation does nothing.
- Overrides:
_saxOtherDatain classContentGenerator- Parameters:
content- the content.defaultLocale- The default locale- Throws:
SAXException- if an error occurs while SAXing.ProcessingException- if an error occurs.IOException- if an error occurs.
-
saxPersons
SAX the referencedPersons- Parameters:
content- The content to analyze- Throws:
SAXException- if an error occurs while saxing
-
saxOrgUnits
SAX the referencedOrgUnits- Parameters:
content- The content to analyze- Throws:
SAXException- if an error occurs while saxing
-
saxChildProgramPart
protected void saxChildProgramPart(AbstractProgram program, Locale defaultLocale) throws SAXException, ProcessingException, IOException SAX the referencedProgramParts- Parameters:
program- The program or subprogramdefaultLocale- The default locale- Throws:
SAXException- if an error occurs while saxingIOException- if an error occursProcessingException- if an error occurs
-
saxTranslation
SAX the existing translation- Parameters:
content- The content- Throws:
SAXException- if an error occurs while saxing
-
saxLinkedContents
protected void saxLinkedContents(Content content, String tagName, String linkedContentType, String viewName) throws SAXException SAX the referenced content types.- Parameters:
content- The content to analyzetagName- The root tagNamelinkedContentType- The content type to searchviewName- The view to parse the found contents- Throws:
SAXException- if an error occurs while saxing
-
getLinkedContents
Get the linked contents of the defined content type.- Parameters:
content- The content to analyzelinkedContentType- The content type to search- Returns:
- A
Setof content ids
-
saxContainer
protected void saxContainer(Container container, String parentPath, Locale defaultLocale) throws SAXException, ProcessingException, IOException SAX a container- Parameters:
container- the container to SAXparentPath- the parent pathdefaultLocale- The default locale- Throws:
SAXException- if an error occursIOException- if an error occursProcessingException- if an error occurs
-
saxSubProgram
SAX a sub program- Parameters:
subProgram- the sub program to SAXparentPath- the parent path- Throws:
SAXException- if an error occurs
-
saxCourseList
protected void saxCourseList(CourseList courseList, String parentPath, Locale defaultLocale) throws SAXException, ProcessingException SAX a course list- Parameters:
courseList- The course list to SAXparentPath- the parent pathdefaultLocale- The default locale- Throws:
SAXException- if an error occursProcessingException- if an error occurs
-
saxCourse
protected void saxCourse(Course course, String parentPath, Locale defaultLocale) throws SAXException, ProcessingException SAX a course- Parameters:
course- the course to SAXparentPath- the parent pathdefaultLocale- The default locale- Throws:
SAXException- if an error occursProcessingException- if an error occurs
-
saxContent
protected void saxContent(Content content, ContentHandler handler, String viewName) throws SAXException, IOException SAX the HTML content of aContent- Parameters:
content- the contenthandler- theContentHandlerto send SAX events to.viewName- the view name- Throws:
SAXException- If an error occurred saxing the contentIOException- If an error occurred resolving the content
-
saxContent
protected void saxContent(Content content, ContentHandler handler, String viewName, String format, boolean withContentRoot, boolean ignoreChildren) throws SAXException, IOException SAX aContentto given format- Parameters:
content- the contenthandler- theContentHandlerto send SAX events to.viewName- the view nameformat- the output formatwithContentRoot- true to wrap content stream into a root content tagignoreChildren- true to not SAX sub contents- Throws:
SAXException- If an error occurred saxing the contentIOException- If an error occurred resolving the content
-
_addAttrIfNotEmpty
Add an attribute if its not null or empty.- Parameters:
attrs- The attributesattrName- The attribute nameattrValue- The attribute value
-
saxCoursePart
protected void saxCoursePart(CoursePart coursePart, Locale defaultLocale) throws SAXException, ProcessingException SAX a course part- Parameters:
coursePart- The course part to SAXdefaultLocale- The default locale- Throws:
SAXException- if an error occursProcessingException- if an error occurs
-