Class CreateNewsletterFunction.NewsletterFilter
- java.lang.Object
-
- org.xml.sax.helpers.XMLFilterImpl
-
- org.ametys.plugins.newsletter.workflow.CreateNewsletterFunction.NewsletterFilter
-
- All Implemented Interfaces:
ContentHandler
,DTDHandler
,EntityResolver
,ErrorHandler
,XMLFilter
,XMLReader
- Enclosing class:
- CreateNewsletterFunction
protected class CreateNewsletterFunction.NewsletterFilter extends XMLFilterImpl
Automatic newsletter filter.
-
-
Field Summary
Fields Modifier and Type Field Description private String
_contentId
private Map<String,AutomaticNewsletterFilterResult>
_filterResults
private boolean
_ignore
private int
_ignoreDepth
private boolean
_ignoreNextLevel
private boolean
_processAutoSections
private SourceResolver
_srcResolver
-
Constructor Summary
Constructors Constructor Description NewsletterFilter(XMLReader xmlReader, SourceResolver sourceResolver, boolean processAutoSections, Map<String,AutomaticNewsletterFilterResult> filterResults, String contentId)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
_copyStartElementAttributes(Attributes atts, AttributesImpl newAtts)
private SaxBuffer
_getFilterContent(List<String> contentIds, String level, String viewName)
private void
_handleIgnoreIfEmpty(String ignoreIfEmpty)
private SaxBuffer
_handleInsertFilter(String insertFilter, String insertFilterLevel, SaxBuffer saxBuffer)
void
characters(char[] ch, int start, int length)
void
endElement(String uri, String localName, String qName)
void
startDocument()
void
startElement(String uri, String localName, String qName, Attributes atts)
-
Methods inherited from class org.xml.sax.helpers.XMLFilterImpl
endDocument, endPrefixMapping, error, fatalError, getContentHandler, getDTDHandler, getEntityResolver, getErrorHandler, getFeature, getParent, getProperty, ignorableWhitespace, notationDecl, parse, parse, processingInstruction, resolveEntity, setContentHandler, setDocumentLocator, setDTDHandler, setEntityResolver, setErrorHandler, setFeature, setParent, setProperty, skippedEntity, startPrefixMapping, unparsedEntityDecl, warning
-
-
-
-
Field Detail
-
_srcResolver
private SourceResolver _srcResolver
-
_contentId
private String _contentId
-
_processAutoSections
private boolean _processAutoSections
-
_filterResults
private Map<String,AutomaticNewsletterFilterResult> _filterResults
-
_ignore
private boolean _ignore
-
_ignoreNextLevel
private boolean _ignoreNextLevel
-
_ignoreDepth
private int _ignoreDepth
-
-
Constructor Detail
-
NewsletterFilter
public NewsletterFilter(XMLReader xmlReader, SourceResolver sourceResolver, boolean processAutoSections, Map<String,AutomaticNewsletterFilterResult> filterResults, String contentId)
Constructor.- Parameters:
xmlReader
- the parent XML reader.sourceResolver
- the source resolver.filterResults
- the filter results.processAutoSections
- true to process auto sections, false to ignore them.contentId
- the newsletter content ID.
-
-
Method Detail
-
startDocument
public void startDocument() throws SAXException
- Specified by:
startDocument
in interfaceContentHandler
- Overrides:
startDocument
in classXMLFilterImpl
- Throws:
SAXException
-
startElement
public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException
- Specified by:
startElement
in interfaceContentHandler
- Overrides:
startElement
in classXMLFilterImpl
- Throws:
SAXException
-
_handleIgnoreIfEmpty
private void _handleIgnoreIfEmpty(String ignoreIfEmpty)
-
_handleInsertFilter
private SaxBuffer _handleInsertFilter(String insertFilter, String insertFilterLevel, SaxBuffer saxBuffer) throws SAXException
- Throws:
SAXException
-
_copyStartElementAttributes
private void _copyStartElementAttributes(Attributes atts, AttributesImpl newAtts)
-
endElement
public void endElement(String uri, String localName, String qName) throws SAXException
- Specified by:
endElement
in interfaceContentHandler
- Overrides:
endElement
in classXMLFilterImpl
- Throws:
SAXException
-
characters
public void characters(char[] ch, int start, int length) throws SAXException
- Specified by:
characters
in interfaceContentHandler
- Overrides:
characters
in classXMLFilterImpl
- Throws:
SAXException
-
_getFilterContent
private SaxBuffer _getFilterContent(List<String> contentIds, String level, String viewName) throws SAXException
- Throws:
SAXException
-
-