public class ContentGenerator extends ServiceableGenerator
Generator
for rendering raw content data.Modifier and Type | Field and Description |
---|---|
protected ContentTypeExtensionPoint |
_contentTypeExtensionPoint
Content type extension point.
|
protected ContentTypesHelper |
_cTypesHelper
Helper for content types
|
protected static DateFormat |
_DC_DATE_FORMAT
The display date format.
|
protected LanguagesManager |
_languageManager
The language manager
|
protected MetadataManager |
_metadataManager
Metadata manager.
|
protected WorkflowProvider |
_workflowProvider
The workflow provider
|
protected WorkflowHelper |
_worklflowHelper
The workflow helper
|
manager
objectModel, parameters, resolver, source
contentHandler, EMPTY_CONTENT_HANDLER, lexicalHandler, xmlConsumer
Constructor and Description |
---|
ContentGenerator() |
Modifier and Type | Method and Description |
---|---|
protected void |
_addAttributeIfNotNull(AttributesImpl attrs,
String name,
String value)
Add attribute if value is not null
|
protected void |
_generateContent()
Generate the content (with the start/end document)
|
protected com.opensymphony.workflow.spi.Step |
_getCurrentStep(WorkflowAwareContent content,
WorkflowProvider.AmetysObjectWorkflow workflow)
Get a content's step, wherever it works on the base version or not.
|
protected MetadataSet |
_getMetadataSet(Content content)
Retrieves the metadata set to be used when SAX'ing metadata and metadata comments.
|
protected void |
_saxContent(Content content)
SAX the content
|
protected void |
_saxContentComments(Content content)
SAX the comments of the content
|
protected void |
_saxDublinCoreMetadata(DublinCoreAwareAmetysObject dcObject)
SAX content Dublin Core metadata.
|
protected void |
_saxIfNotNull(String name,
Date value)
SAX date Dublin Core metadata.
|
protected void |
_saxIfNotNull(String name,
String value)
SAX string Dublin Core metadata.
|
protected void |
_saxIfNotNull(String name,
String[] values)
SAX string Dublin Core metadata.
|
protected void |
_saxLanguage(Content content)
SAX the content language
|
protected void |
_saxMetadata(Content content,
MetadataSet metadataSet)
SAX content metadata.
|
protected void |
_saxMetadataComments(Content content,
MetadataSet metadataSet)
SAX metadata comments.
|
protected void |
_saxOtherData(Content content)
SAX any other data needed by the view.
|
protected void |
_saxWorkflowStep(Content content)
SAX the workflow step if the content is a
WorkflowAwareContent |
void |
generate() |
void |
service(ServiceManager serviceManager) |
dispose
recycle, setup
setConsumer, setContentHandler, setLexicalHandler
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
setConsumer
protected static final DateFormat _DC_DATE_FORMAT
protected ContentTypeExtensionPoint _contentTypeExtensionPoint
protected MetadataManager _metadataManager
protected LanguagesManager _languageManager
protected WorkflowProvider _workflowProvider
protected WorkflowHelper _worklflowHelper
protected ContentTypesHelper _cTypesHelper
public ContentGenerator()
public void service(ServiceManager serviceManager) throws ServiceException
service
in interface Serviceable
service
in class ServiceableGenerator
ServiceException
public void generate() throws IOException, SAXException, ProcessingException
protected void _generateContent() throws SAXException, IOException, ProcessingException
SAXException
- if an error occurs while SAXingIOException
- if an error occursProcessingException
- if an error occursprotected void _saxContent(Content content) throws SAXException, IOException, ProcessingException
content
- The content to SAXSAXException
- if an error occurs while SAXingIOException
- if an error occursProcessingException
- if an error occursprotected void _addAttributeIfNotNull(AttributesImpl attrs, String name, String value)
attrs
- The attributesname
- The name of attributevalue
- The valueprotected void _saxContentComments(Content content) throws SAXException
content
- The content to consider. Cannot be null.SAXException
- if an error occurs while SAXing.protected void _saxLanguage(Content content) throws SAXException
content
- The contentSAXException
- if an error occurs while SAXing.protected void _saxWorkflowStep(Content content) throws SAXException
WorkflowAwareContent
content
- The contentSAXException
- if an error occurs while SAXing.protected void _saxMetadata(Content content, MetadataSet metadataSet) throws SAXException, ProcessingException, IOException
content
- the content.metadataSet
- the metadata set.SAXException
- if an error occurs while SAXing.IOException
- if an error occurs.ProcessingException
- if an error occurs.protected void _saxMetadataComments(Content content, MetadataSet metadataSet) throws SAXException, ProcessingException, IOException
content
- the content.metadataSet
- the metadata set.SAXException
- if an error occurs while SAXing.IOException
- if an error occurs.ProcessingException
- if an error occurs.protected void _saxDublinCoreMetadata(DublinCoreAwareAmetysObject dcObject) throws SAXException
dcObject
- the Dublin Core object.SAXException
- if an error occurs while SAXing.protected void _saxIfNotNull(String name, String value) throws SAXException
name
- the metadata name.value
- the metadata value.SAXException
- if an error occurs while SAXing.protected void _saxIfNotNull(String name, String[] values) throws SAXException
name
- the metadata name.values
- the metadata values.SAXException
- if an error occurs while SAXing.protected void _saxIfNotNull(String name, Date value) throws SAXException
name
- the metadata name.value
- the metadata value.SAXException
- if an error occurs while SAXing.protected void _saxOtherData(Content content) throws SAXException, ProcessingException
Default implementation does nothing.
content
- the content.SAXException
- if an error occurs while SAXing.ProcessingException
- if an error occurs.protected MetadataSet _getMetadataSet(Content content) throws ProcessingException
content
- The content to consider. Cannot be null.ProcessingException
- If the metadata set could not be retrievedprotected com.opensymphony.workflow.spi.Step _getCurrentStep(WorkflowAwareContent content, WorkflowProvider.AmetysObjectWorkflow workflow) throws com.opensymphony.workflow.WorkflowException
content
- the content.workflow
- The workflow impl to usecom.opensymphony.workflow.WorkflowException
- if an error occurs.