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
Modifier and TypeFieldDescriptionprotected ContentSaxer
The content saxerprotected ContentTypeExtensionPoint
Content type extension point.protected ContentTypesHelper
Helper for content typesprotected static final DateFormat
The display date format.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
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
Generate the content (with the start/end document)protected View
Retrieves the view to be used when SAX'ing attributes and attribute comments.protected void
_saxAttributesComments
(Content content, View view) SAX content attributes comments.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.void
generate()
protected Locale
getDefaultLocale
(Request request) Get the default locale to use to sax localized valuesvoid
service
(ServiceManager serviceManager) 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
-
_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:
service
in interfaceServiceable
- Overrides:
service
in 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
-
_saxAttributesComments
SAX content attributes comments.- Parameters:
content
- the content.view
- the view containing the attributes.- Throws:
SAXException
- if an error occurs while SAXing.
-
_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 and attribute comments.- Parameters:
content
- The content to consider. Cannot be null.isEdition
-true
if the view is to use for edition,false
otherwise- Returns:
- The retrieved view
- Throws:
ProcessingException
- If the view could not be retrieved
-
_saxOtherData(Content, Locale)
instead