Package org.ametys.cms.data
Class RichTextImportMetadataHandlerFactory.RichTextImportMetadataHandler
- java.lang.Object
-
- org.xml.sax.helpers.DefaultHandler
-
- org.ametys.cms.data.RichTextImportMetadataHandlerFactory.RichTextImportMetadataHandler
-
- All Implemented Interfaces:
ContentHandler
,DTDHandler
,EntityResolver
,ErrorHandler
- Enclosing class:
- RichTextImportMetadataHandlerFactory
public class RichTextImportMetadataHandlerFactory.RichTextImportMetadataHandler extends DefaultHandler
This transformer imports the rich text metadata (attachments, semantic annotations, ...) from docbook.
-
-
Field Summary
Fields Modifier and Type Field Description private static String
__ANNOTATION_CLASS_ATTRIBUTE_NAME
private static String
__ANNOTATION_CLASS_ATTRIBUTE_VALUE
private static String
__ANNOTATION_NAME_ATTRIBUTE_NAME
private static String
__ANNOTATION_TAG_NAME
private static String
__ATTACHMENT_TAG_NAME
private static String
__ATTACHMENT_TYPE_ATTRIBUTE_LOCAL_VALUE
private static String
__ATTACHMENT_TYPE_ATTRIBUTE_NAME
private int
_cptrElementsInsideCurrentAnnotation
private String
_currentAnnotationName
private StringBuilder
_currentAnnotationValue
private Map<String,InputStream>
_files
private boolean
_isCurrentlyInAnnotation
private RichText
_richText
-
Constructor Summary
Constructors Constructor Description RichTextImportMetadataHandler(RichText richText, Map<String,InputStream> files)
Creates a handler to import the rich text's metadata
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
_processAnnotation(Attributes attrs)
private void
_processAttachment(Attributes attrs)
void
characters(char[] ch, int start, int length)
void
endElement(String uri, String loc, String raw)
void
startDocument()
void
startElement(String uri, String loc, String raw, Attributes attrs)
-
Methods inherited from class org.xml.sax.helpers.DefaultHandler
endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startPrefixMapping, unparsedEntityDecl, warning
-
-
-
-
Field Detail
-
__ATTACHMENT_TAG_NAME
private static final String __ATTACHMENT_TAG_NAME
- See Also:
- Constant Field Values
-
__ATTACHMENT_TYPE_ATTRIBUTE_NAME
private static final String __ATTACHMENT_TYPE_ATTRIBUTE_NAME
- See Also:
- Constant Field Values
-
__ATTACHMENT_TYPE_ATTRIBUTE_LOCAL_VALUE
private static final String __ATTACHMENT_TYPE_ATTRIBUTE_LOCAL_VALUE
- See Also:
- Constant Field Values
-
__ANNOTATION_TAG_NAME
private static final String __ANNOTATION_TAG_NAME
- See Also:
- Constant Field Values
-
__ANNOTATION_NAME_ATTRIBUTE_NAME
private static final String __ANNOTATION_NAME_ATTRIBUTE_NAME
- See Also:
- Constant Field Values
-
__ANNOTATION_CLASS_ATTRIBUTE_NAME
private static final String __ANNOTATION_CLASS_ATTRIBUTE_NAME
- See Also:
- Constant Field Values
-
__ANNOTATION_CLASS_ATTRIBUTE_VALUE
private static final String __ANNOTATION_CLASS_ATTRIBUTE_VALUE
- See Also:
- Constant Field Values
-
_files
private Map<String,InputStream> _files
-
_isCurrentlyInAnnotation
private boolean _isCurrentlyInAnnotation
-
_currentAnnotationName
private String _currentAnnotationName
-
_currentAnnotationValue
private StringBuilder _currentAnnotationValue
-
_cptrElementsInsideCurrentAnnotation
private int _cptrElementsInsideCurrentAnnotation
-
-
Constructor Detail
-
RichTextImportMetadataHandler
public RichTextImportMetadataHandler(RichText richText, Map<String,InputStream> files)
Creates a handler to import the rich text's metadata- Parameters:
richText
- the rich textfiles
- the attachments of this rich text
-
-
Method Detail
-
startDocument
public void startDocument() throws SAXException
- Specified by:
startDocument
in interfaceContentHandler
- Overrides:
startDocument
in classDefaultHandler
- Throws:
SAXException
-
startElement
public void startElement(String uri, String loc, String raw, Attributes attrs) throws SAXException
- Specified by:
startElement
in interfaceContentHandler
- Overrides:
startElement
in classDefaultHandler
- Throws:
SAXException
-
_processAttachment
private void _processAttachment(Attributes attrs) throws SAXException
- Throws:
SAXException
-
_processAnnotation
private void _processAnnotation(Attributes attrs)
-
characters
public void characters(char[] ch, int start, int length) throws SAXException
- Specified by:
characters
in interfaceContentHandler
- Overrides:
characters
in classDefaultHandler
- Throws:
SAXException
-
endElement
public void endElement(String uri, String loc, String raw) throws SAXException
- Specified by:
endElement
in interfaceContentHandler
- Overrides:
endElement
in classDefaultHandler
- Throws:
SAXException
-
-