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
public class ContentExtractor extends ContentExtractor
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 Modifier and Type Field Description private static String
__AUTOMATIC_METADATA_NAME
private static String
__AUTOMATIC_TAG_NAME
private static String
__CATEGORY_METADATA_NAME
private static String
__CATEGORY_TAG_NAME
private static String
__SENT_METADATA_NAME
private static String
__SENT_TAG_NAME
private ContentAttributeTypeExtensionPoint
_contentAttributeTypeExtensionPoint
static String
NEWSLETTER_CONTENT_EXTACTOR_ROLE
Avalon role.-
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
Constructors Constructor Description ContentExtractor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected 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 Detail
-
NEWSLETTER_CONTENT_EXTACTOR_ROLE
public static final String NEWSLETTER_CONTENT_EXTACTOR_ROLE
Avalon role.
-
__CATEGORY_METADATA_NAME
private static final String __CATEGORY_METADATA_NAME
- See Also:
- Constant Field Values
-
__CATEGORY_TAG_NAME
private static final String __CATEGORY_TAG_NAME
- See Also:
- Constant Field Values
-
__AUTOMATIC_METADATA_NAME
private static final String __AUTOMATIC_METADATA_NAME
- See Also:
- Constant Field Values
-
__AUTOMATIC_TAG_NAME
private static final String __AUTOMATIC_TAG_NAME
- See Also:
- Constant Field Values
-
__SENT_METADATA_NAME
private static final String __SENT_METADATA_NAME
- See Also:
- Constant Field Values
-
__SENT_TAG_NAME
private static final String __SENT_TAG_NAME
- See Also:
- Constant Field Values
-
_contentAttributeTypeExtensionPoint
private ContentAttributeTypeExtensionPoint _contentAttributeTypeExtensionPoint
-
-
Constructor Detail
-
ContentExtractor
public ContentExtractor()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- 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
-
-