Class ContentExtractor
java.lang.Object
org.ametys.cms.content.ContentExtractor
org.ametys.web.content.ContentExtractor
org.ametys.plugins.newsletter.content.ContentExtractor
- All Implemented Interfaces:
Component
,Serviceable
Generates SAX events for Content, including category, automatic and sent for Newsletters.
TODO NEWATTRIBUTEAPI_CONTENT: do not use type implementation but the ModelAwareDataHolder#getInternalValue when this API exist
-
Field Summary
Fields inherited from class org.ametys.web.content.ContentExtractor
WEB_CONTENT_EXTACTOR_ROLE
Fields inherited from class org.ametys.cms.content.ContentExtractor
CMS_CONTENT_EXTACTOR_ROLE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
fillAutomatic
(ModifiableContent content, Element contentElement) Fills the given newsletter with the automatic status from the providedElement
protected void
fillCategory
(ModifiableContent content, Element contentElement) Fills the given newsletter with the category from the providedElement
void
fillContent
(ModifiableContent content, Node node, XMLValuesExtractorAdditionalDataGetter additionalDataGetter) Fills the given content with the values from the providedNode
.protected void
fillSent
(ModifiableContent content, Element contentElement) Fills the given newsletter with the sent status from the providedElement
void
service
(ServiceManager manager) Methods inherited from class org.ametys.web.content.ContentExtractor
fillSiteName, fillTags
Methods inherited from class org.ametys.cms.content.ContentExtractor
booleanValue, dateValue, fillAttributes, fillComment, fillContentComments, fillDublinCore, fillReactions, fillReports, setIfNotNull, values
-
Field Details
-
NEWSLETTER_CONTENT_EXTACTOR_ROLE
Avalon role.
-
-
Constructor Details
-
ContentExtractor
public ContentExtractor()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classContentExtractor
- Throws:
ServiceException
-
fillContent
public void fillContent(ModifiableContent content, Node node, XMLValuesExtractorAdditionalDataGetter additionalDataGetter) throws Exception Description copied from class:ContentExtractor
Fills the given content with the values from the providedNode
.
This is the anti-operation ofContentSaxer.saxContent(org.ametys.cms.repository.Content, org.xml.sax.ContentHandler, java.util.Locale, org.ametys.runtime.model.View, java.lang.String, boolean, boolean, boolean, java.lang.String)
, as the org.w3c.dom.Node should be a Node previously generated with SAX events from this method.- Overrides:
fillContent
in classContentExtractor
- Parameters:
content
- The content to fillnode
- The node to read for retrieving values to filladditionalDataGetter
- The object that will retrieve potential additional data for the content's attributes- Throws:
Exception
- if an exception occurs
-
fillCategory
protected void fillCategory(ModifiableContent content, Element contentElement) throws TransformerException, IOException Fills the given newsletter with the category from the providedElement
- Parameters:
content
- The newsletter to fillcontentElement
- the element to read to get the category- Throws:
TransformerException
- if an error occursIOException
- if an error occurs while reading the XML value
-
fillAutomatic
protected void fillAutomatic(ModifiableContent content, Element contentElement) throws TransformerException, IOException Fills the given newsletter with the automatic status from the providedElement
- Parameters:
content
- The newsletter to fillcontentElement
- the element to read to get the automatic status- Throws:
TransformerException
- if an error occursIOException
- if an error occurs while reading the XML value
-
fillSent
protected void fillSent(ModifiableContent content, Element contentElement) throws TransformerException, IOException Fills the given newsletter with the sent status from the providedElement
- Parameters:
content
- The newsletter to fillcontentElement
- the element to read to get the sent status- Throws:
TransformerException
- if an error occursIOException
- if an error occurs while reading the XML value
-