Package org.ametys.cms.content
Class ContentGenerator
- All Implemented Interfaces:
Poolable,Recyclable,Disposable,Component,LogEnabled,Serviceable,Generator,SitemapModelComponent,XMLProducer
- Direct Known Subclasses:
CommentsGenerator,ContentGenerator,ODFContentGenerator
Generator for rendering raw content data.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ContentSaxerThe content saxerprotected ContentTypeExtensionPointContent type extension point.protected ContentTypesHelperHelper for content typesprotected static final DateFormatThe display date format.Fields 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 voidGenerate the content (with the start/end document)protected ViewRetrieves the view to be used when SAX'ing attributes.protected void_saxContent(Content content, Locale defaultLocale) SAX the contentprotected void_saxOtherData(Content content) Deprecated.protected void_saxOtherData(Content content, Locale defaultLocale) SAX any other data needed by the view.voidgenerate()protected LocalegetDefaultLocale(Request request) Get the default locale to use to sax localized valuesvoidservice(ServiceManager serviceManager) Methods inherited from class org.apache.cocoon.generation.ServiceableGenerator
disposeMethods inherited from class org.apache.cocoon.generation.AbstractGenerator
recycle, setupMethods 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
-
_DC_DATE_FORMAT
The display date format. -
_contentTypeExtensionPoint
Content type extension point. -
_cTypesHelper
Helper for content types -
_contentSaxer
The content saxer
-
-
Constructor Details
-
ContentGenerator
public ContentGenerator()
-
-
Method Details
-
service
- Specified by:
servicein interfaceServiceable- Overrides:
servicein classServiceableGenerator- Throws:
ServiceException
-
generate
-
_generateContent
Generate the content (with the start/end document)- Throws:
SAXException- if an error occurs while SAXingIOException- if an error occursProcessingException- if an error occurs
-
getDefaultLocale
Get the default locale to use to sax localized values- Parameters:
request- the request- Returns:
- the default locale
-
_saxContent
protected void _saxContent(Content content, Locale defaultLocale) throws SAXException, IOException, ProcessingException SAX the content- Parameters:
content- The content to SAXdefaultLocale- The default locale to use to sax localized values if the content's language is null.- Throws:
SAXException- if an error occurs while SAXingIOException- if an error occursProcessingException- if an error occurs
-
_saxOtherData
Deprecated.Use and/or override_saxOtherData(Content, Locale)insteadSAX any other data needed by the view.Default implementation does nothing.
- Parameters:
content- the content.- Throws:
SAXException- if an error occurs while SAXing.ProcessingException- if an error occurs.
-
_saxOtherData
protected void _saxOtherData(Content content, Locale defaultLocale) throws SAXException, ProcessingException, IOException SAX any other data needed by the view.Default implementation does nothing.
- 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.
-
_getView
Retrieves the view to be used when SAX'ing attributes.- Parameters:
content- The content to consider. Cannot be null.isEdition-trueif the view is to use for edition,falseotherwise- Returns:
- The retrieved view
- Throws:
ProcessingException- If the view could not be retrieved
-
_saxOtherData(Content, Locale)instead