fr.opensagres.xdocreport.document.docx.preprocessor
Class DocxDocumentXMLRelsDocumentContentHandler
java.lang.Object
org.xml.sax.helpers.DefaultHandler
fr.opensagres.xdocreport.document.preprocessor.sax.BufferedDocumentContentHandler
fr.opensagres.xdocreport.document.docx.preprocessor.DocxDocumentXMLRelsDocumentContentHandler
- All Implemented Interfaces:
- EncodingConstants, DocXConstants, org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler
public class DocxDocumentXMLRelsDocumentContentHandler
- extends BufferedDocumentContentHandler
- implements DocXConstants
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
| Fields inherited from interface fr.opensagres.xdocreport.document.docx.DocXConstants |
A_NS, BLIP_ELT, BOOKMARK_END_ELT, BOOKMARK_START_ELT, CONTENT_TYPES_XML, CONTENT_TYPES_XML_ENTRY, DESCRIPTION_DISCOVERY, DOCX_EXTENSION, EMBED_ATTR, FLDCHAR_ELT, FLDCHARTYPE_ATTR, FLDSIMPLE_ELT, HYPERLINK_ELT, HYPERLINKS_SHARED_CONTEXT, ID_ATTR, ID_DISCOVERY, INSTR_ATTR, INSTR_TEXT_ELT, MIME_MAPPING, NAME_ATTR, P_ELT, R_ELT, R_NS, RELATIONSHIP_ELT, RELATIONSHIP_ID_ATTR, RELATIONSHIP_TARGET_ATTR, RELATIONSHIP_TARGET_MODE_ATTR, RELATIONSHIP_TYPE_ATTR, RELATIONSHIPS_ELT, RELATIONSHIPS_HYPERLINK_NS, RELATIONSHIPS_IMAGE_NS, T_ELT, TARGET_MODE_EXTERNAL, TBL_ELT, TR_ELT, W_NS, WORD_DOCUMENT_XML_ENTRY, WORD_FOOTER_XML_ENTRY, WORD_HEADER_XML_ENTRY, WORD_RELS_DOCUMENTXMLRELS_XML_ENTRY, WORD_STYLES_XML_ENTRY, WORDPROCESSINGML_DOCUMENT |
|
Method Summary |
void |
doEndElement(java.lang.String uri,
java.lang.String localName,
java.lang.String name)
|
boolean |
doStartElement(java.lang.String uri,
java.lang.String localName,
java.lang.String name,
org.xml.sax.Attributes attributes)
|
protected void |
generateRelationship(java.lang.StringBuilder script,
java.lang.String relationId,
java.lang.String type,
java.lang.String target,
java.lang.String targetMode)
Generate Relationship XML element. |
| Methods inherited from class fr.opensagres.xdocreport.document.preprocessor.sax.BufferedDocumentContentHandler |
characters, createDocument, endElement, findParentElementInfo, findParentElementInfo, flushCharacters, getBufferedDocument, getCurrentElement, 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 |
formatter
protected final IDocumentFormatter formatter
fieldsMetadata
protected final FieldsMetadata fieldsMetadata
DocxDocumentXMLRelsDocumentContentHandler
public DocxDocumentXMLRelsDocumentContentHandler(FieldsMetadata fieldsMetadata,
IDocumentFormatter formatter,
java.util.Map<java.lang.String,java.lang.Object> sharedContext)
doStartElement
public boolean doStartElement(java.lang.String uri,
java.lang.String localName,
java.lang.String name,
org.xml.sax.Attributes attributes)
throws org.xml.sax.SAXException
- Overrides:
doStartElement in class BufferedDocumentContentHandler
- Throws:
org.xml.sax.SAXException
doEndElement
public void doEndElement(java.lang.String uri,
java.lang.String localName,
java.lang.String name)
throws org.xml.sax.SAXException
- Overrides:
doEndElement in class BufferedDocumentContentHandler
- Throws:
org.xml.sax.SAXException
generateRelationship
protected void generateRelationship(java.lang.StringBuilder script,
java.lang.String relationId,
java.lang.String type,
java.lang.String target,
java.lang.String targetMode)
- Generate Relationship XML element.
- Parameters:
script - relationId - type - target - targetMode -
Copyright © 2011. All Rights Reserved.