fr.opensagres.xdocreport.document.docx.preprocessor.sax.rels
Class DocxDocumentXMLRelsDocumentContentHandler
java.lang.Object
org.xml.sax.helpers.DefaultHandler
fr.opensagres.xdocreport.document.preprocessor.sax.BufferedDocumentContentHandler
fr.opensagres.xdocreport.document.docx.preprocessor.sax.rels.DocxDocumentXMLRelsDocumentContentHandler
- All Implemented Interfaces:
- ContentHandler, DTDHandler, EntityResolver, ErrorHandler
public class DocxDocumentXMLRelsDocumentContentHandler
- extends BufferedDocumentContentHandler
This handler modify the XML entry word/_rels/document.xml.rels to add Relationship for dynamic image and hyperlink :
to add template engine script like this for Freemarker :
[#if imageRegistry??]
[#list imageRegistry.imageProviderInfos as ___info]
[/#list]
[/#if]
* to add template engine script like this for Velocity :
#if( $imageRegistry)
#foreach( $___info in $imageRegistry.ImageProviderInfos)
#end
#end
Methods inherited from class fr.opensagres.xdocreport.document.preprocessor.sax.BufferedDocumentContentHandler |
characters, createDocument, endElement, findParentElementInfo, findParentElementInfo, flushCharacters, getBufferedDocument, getCurrentElement, getElementIndex, mustEncodeCharachers, printEscaped, resetCharacters, startDocument, startElement, startPrefixMapping, toAttributesImpl |
Methods inherited from class org.xml.sax.helpers.DefaultHandler |
endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, unparsedEntityDecl, warning |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
entryName
protected final String entryName
formatter
protected final IDocumentFormatter formatter
fieldsMetadata
protected final FieldsMetadata fieldsMetadata
DocxDocumentXMLRelsDocumentContentHandler
public DocxDocumentXMLRelsDocumentContentHandler(String entryName,
FieldsMetadata fieldsMetadata,
IDocumentFormatter formatter,
Map<String,Object> sharedContext)
doStartElement
public boolean doStartElement(String uri,
String localName,
String name,
Attributes attributes)
throws SAXException
- Overrides:
doStartElement
in class BufferedDocumentContentHandler
- Throws:
SAXException
doEndElement
public void doEndElement(String uri,
String localName,
String name)
throws SAXException
- Overrides:
doEndElement
in class BufferedDocumentContentHandler
- Throws:
SAXException
generateRelationship
protected void generateRelationship(StringBuilder script,
String relationId,
String type,
String target,
String targetMode)
- Generate Relationship XML element.
- Parameters:
script
- relationId
- type
- target
- targetMode
-
Copyright © 2013. All rights reserved.