Package org.ametys.cms.content
Class MetadataSetDefGenerator
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.MetadataSetDefGenerator
- All Implemented Interfaces:
Poolable
,Recyclable
,Disposable
,Component
,LogEnabled
,Serviceable
,Generator
,SitemapModelComponent
,XMLProducer
- Direct Known Subclasses:
MetadataSetDefByContentTypeGenerator
Generator
for rendering the structure of a metadata set-
Field Summary
Modifier and TypeFieldDescriptionprotected ContentHelper
The content helperprotected ContentTypeExtensionPoint
Content type extension point.protected ContentTypesHelper
Helper for content typesprotected CurrentUserProvider
The current user providerprotected MetadataManager
Metadata manager.protected RightManager
Rights managerFields 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 MetadataDefinition
_getMetadataDefinition
(String[] contentTypes, String[] mixinTypes, MetadataDefinition parentMetadataDefinition, String metadataName) Retrieves a sub metadata definition from a content type or a parent metadata definition.protected void
_saxMetadataDefinition
(Content content, AbstractMetadataSetElement metadataSetElement, MetadataDefinition metaDef) Sax the metadata definitionprotected void
_saxMetadataSet
(Content content, String viewName, String fallbackViewName, boolean isEdition) SAX metadata set structureprotected void
_saxMetadataSetElement
(Content content, String[] contentTypes, String[] mixinTypes, MetadataDefinition metadataDefinition, AbstractMetadataSetElement metadataSetElement) SAX metadata set element.void
generate()
void
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
-
_contentTypeExtensionPoint
Content type extension point. -
_metadataManager
Metadata manager. -
_contentTypesHelper
Helper for content types -
_rightManager
Rights manager -
_currentUserProvider
The current user provider -
_contentHelper
The content helper
-
-
Constructor Details
-
MetadataSetDefGenerator
public MetadataSetDefGenerator()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classServiceableGenerator
- Throws:
ServiceException
-
generate
-
_saxMetadataSet
protected void _saxMetadataSet(Content content, String viewName, String fallbackViewName, boolean isEdition) throws SAXException, ProcessingException, IOException SAX metadata set structure- Parameters:
content
- the content.viewName
- The name of the view to saxfallbackViewName
- The fallback view to use if the initial was not found.isEdition
- True to use the edit view- Throws:
SAXException
- if an error occurs while SAXing.IOException
- if an error occurs.ProcessingException
- if an error occurs.
-
_saxMetadataSetElement
protected void _saxMetadataSetElement(Content content, String[] contentTypes, String[] mixinTypes, MetadataDefinition metadataDefinition, AbstractMetadataSetElement metadataSetElement) throws SAXException SAX metadata set element.- Parameters:
content
- the content. Can be null then set content types and mixinscontentTypes
- Can be null then set contentmixinTypes
- Can be null then set contentmetadataDefinition
- the metadata definition.metadataSetElement
- the metadata set element.- Throws:
SAXException
- if an error occurs while SAXing.
-
_getMetadataDefinition
protected MetadataDefinition _getMetadataDefinition(String[] contentTypes, String[] mixinTypes, MetadataDefinition parentMetadataDefinition, String metadataName) Retrieves a sub metadata definition from a content type or a parent metadata definition.- Parameters:
contentTypes
- the content typesmixinTypes
- the mixin typesparentMetadataDefinition
- the parent metadata definition.metadataName
- the metadata name.- Returns:
- the metadata definition found or
null
otherwise.
-
_saxMetadataDefinition
protected void _saxMetadataDefinition(Content content, AbstractMetadataSetElement metadataSetElement, MetadataDefinition metaDef) throws SAXException Sax the metadata definition- Parameters:
content
- The contentmetadataSetElement
- The metadata set elementmetaDef
- The metadata definition- Throws:
SAXException
- if an error occurs while SAXing.
-