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
public class ContentGenerator extends ServiceableGenerator
Generatorfor rendering raw content data.
-
-
Field Summary
Fields Modifier and Type Field Description protected ContentSaxer_contentSaxerThe content saxerprotected ContentTypeExtensionPoint_contentTypeExtensionPointContent type extension point.protected ContentTypesHelper_cTypesHelperHelper for content typesprotected static DateFormat_DC_DATE_FORMATThe 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
Constructors Constructor Description ContentGenerator()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected void_generateContent()Generate the content (with the start/end document)protected View_getView(Content content, boolean isEdition)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.Use and/or override_saxOtherData(Content, Locale)insteadprotected 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
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 Detail
-
_DC_DATE_FORMAT
protected static final DateFormat _DC_DATE_FORMAT
The display date format.
-
_contentTypeExtensionPoint
protected ContentTypeExtensionPoint _contentTypeExtensionPoint
Content type extension point.
-
_cTypesHelper
protected ContentTypesHelper _cTypesHelper
Helper for content types
-
_contentSaxer
protected ContentSaxer _contentSaxer
The content saxer
-
-
Constructor Detail
-
ContentGenerator
public ContentGenerator()
-
-
Method Detail
-
service
public void service(ServiceManager serviceManager) throws ServiceException
- Specified by:
servicein interfaceServiceable- Overrides:
servicein classServiceableGenerator- Throws:
ServiceException
-
generate
public void generate() throws IOException, SAXException, ProcessingException
-
_generateContent
protected void _generateContent() throws SAXException, IOException, ProcessingException
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
protected Locale getDefaultLocale(Request request)
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
protected void _saxAttributesComments(Content content, View view) throws SAXException
SAX content attributes comments.- Parameters:
content- the content.view- the view containing the attributes.- Throws:
SAXException- if an error occurs while SAXing.
-
_saxOtherData
@Deprecated protected void _saxOtherData(Content content) throws SAXException, ProcessingException
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
protected View _getView(Content content, boolean isEdition) throws ProcessingException
Retrieves the view to be used when SAX'ing attributes and attribute comments.- 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
-
-