Package org.ametys.web.content
Class ContentSaxer
- java.lang.Object
-
- org.ametys.cms.content.ContentSaxer
-
- org.ametys.web.content.ContentSaxer
-
- All Implemented Interfaces:
Component
,Serviceable
- Direct Known Subclasses:
ContentSaxer
public class ContentSaxer extends ContentSaxer
Generates SAX events for Content, including tags forWebContent
.
-
-
Field Summary
Fields Modifier and Type Field Description private TagProviderExtensionPoint
_tagProviderEP
-
Fields inherited from class org.ametys.cms.content.ContentSaxer
ROLE
-
-
Constructor Summary
Constructors Constructor Description ContentSaxer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
fillContent(ModifiableContent content, Node contentNode, XMLValuesExtractorAdditionalDataGetter additionalDataGetter)
Fills the given content with the values from the providedNode
.protected void
fillSiteName(ModifiableWebContent content, Node contentNode)
Fills the given content with the site name from the providedNode
protected void
fillTags(TaggableAmetysObject taggable, Node contentNode)
Fills the givenTaggableAmetysObject
with the tags from the providedNode
protected void
saxBody(Content content, ContentHandler contentHandler, Locale locale, View view, String tagName, boolean saxWorkflowStep, boolean saxWorkflowInfo, boolean saxLanguageInfo, String attributesTagName)
Generates SAX events for the content data.protected void
saxSiteName(WebContent content, ContentHandler contentHandler)
Generates SAX events for the site name.protected void
saxTags(WebContent content, ContentHandler contentHandler)
Generates SAX events for tags.void
service(ServiceManager manager)
-
Methods inherited from class org.ametys.cms.content.ContentSaxer
booleanValue, dateValue, fillAttributes, fillComment, fillContentComments, fillDublinCore, fillReactions, fillReports, getCurrentStep, saxAttributes, saxComment, saxComments, saxContent, saxContentComments, saxContentTypes, saxDublinCoreMetadata, saxIfNotNull, saxIfNotNull, saxIfNotNull, saxLanguage, saxReactions, saxReports, saxRootTag, saxWorkflowStep, setIfNotNull, values
-
-
-
-
Field Detail
-
_tagProviderEP
private TagProviderExtensionPoint _tagProviderEP
-
-
Constructor Detail
-
ContentSaxer
public ContentSaxer()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classContentSaxer
- Throws:
ServiceException
-
saxBody
protected void saxBody(Content content, ContentHandler contentHandler, Locale locale, View view, String tagName, boolean saxWorkflowStep, boolean saxWorkflowInfo, boolean saxLanguageInfo, String attributesTagName) throws SAXException
Description copied from class:ContentSaxer
Generates SAX events for the content data.- Overrides:
saxBody
in classContentSaxer
- Parameters:
content
- theContent
.contentHandler
- the ContentHandler receving SAX events.locale
- theLocale
to use for eg. multilingual attributes.view
- the View or null to select all attributes.tagName
- the surrounding tag name or null to SAX events without root tag.saxWorkflowStep
- if true, also produces SAX events for the current workflow step.saxWorkflowInfo
- if true, also produces SAX events for detailed information about the current workflow step.saxLanguageInfo
- if true, also produces SAX events for detailed information about the content language.attributesTagName
- the name of the tag surrounding attributes. Used for legacy purposes.- Throws:
SAXException
- if an error occurs during the SAX events generation.
-
saxSiteName
protected void saxSiteName(WebContent content, ContentHandler contentHandler) throws SAXException
Generates SAX events for the site name.- Parameters:
content
- theWebContent
.contentHandler
- the ContentHandler receving SAX events.- Throws:
SAXException
- if an error occurs during the SAX events generation.
-
saxTags
protected void saxTags(WebContent content, ContentHandler contentHandler) throws SAXException
Generates SAX events for tags.- Parameters:
content
- theWebContent
.contentHandler
- the ContentHandler receving SAX events.- Throws:
SAXException
- if an error occurs during the SAX events generation.
-
fillContent
public void fillContent(ModifiableContent content, Node contentNode, XMLValuesExtractorAdditionalDataGetter additionalDataGetter) throws Exception
Description copied from class:ContentSaxer
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 classContentSaxer
- Parameters:
content
- The content to fillcontentNode
- 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
-
fillSiteName
protected void fillSiteName(ModifiableWebContent content, Node contentNode) throws TransformerException
Fills the given content with the site name from the providedNode
- Parameters:
content
- The content to fillcontentNode
- the node to read to get the site name- Throws:
TransformerException
- if an error occurs
-
fillTags
protected void fillTags(TaggableAmetysObject taggable, Node contentNode) throws TransformerException
Fills the givenTaggableAmetysObject
with the tags from the providedNode
- Parameters:
taggable
- TheTaggableAmetysObject
to fillcontentNode
- the node to read to get the tags- Throws:
TransformerException
- if an error occurs
-
-