Package org.docx4j.model.datastorage
Class OpenDoPEHandler
java.lang.Object
org.docx4j.model.datastorage.OpenDoPEHandler
public class OpenDoPEHandler
extends java.lang.Object
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringBINDING_CONTENTTYPEstatic java.lang.StringBINDING_HANDLERstatic java.lang.StringBINDING_PROGIDstatic java.lang.StringBINDING_RESULT_CONDITION_FALSEstatic java.lang.StringBINDING_RESULT_RPTDstatic java.lang.StringBINDING_RESULT_RPTD_ZEROstatic java.lang.StringBINDING_RESULT_RPTD_ZERO_W15static java.lang.StringBINDING_ROLE_COMPONENTstatic java.lang.StringBINDING_ROLE_COMPONENT_AFTERstatic java.lang.StringBINDING_ROLE_COMPONENT_BEFOREstatic java.lang.StringBINDING_ROLE_COMPONENT_CONTEXTstatic java.lang.StringBINDING_ROLE_CONDITIONALstatic java.lang.StringBINDING_ROLE_FINISHERstatic java.lang.StringBINDING_ROLE_NARRATIVEstatic java.lang.StringBINDING_ROLE_REPEATstatic java.lang.StringBINDING_ROLE_RPT_POS_CONstatic java.lang.StringBINDING_ROLE_XPATHlongcloneTimestatic booleanENABLE_XPATH_CACHElongfixBTime -
Constructor Summary
Constructors Constructor Description OpenDoPEHandler(WordprocessingMLPackage wordMLPackage) -
Method Summary
Modifier and Type Method Description DomToXPathMapgetDomToXPathMap()java.util.concurrent.atomic.AtomicIntegergetNextBookmarkId()Provide a way to for user to fetch the starting bookmark ID number for use in the next stage (ie Binding Traverse).protected static java.util.Set<ContentAccessor>getParts(WordprocessingMLPackage srcPackage)protected static java.lang.StringgetRepeatXpathBase(java.lang.String xpath)Massage the xpath into an expected format, by dropping any trailing '/' or [1]static SdtPrgetSdtPr(java.lang.Object o)WordprocessingMLPackagepreprocess()Preprocess content controls which have tag "od:condition|od:repeat|od:component".
-
Field Details
-
ENABLE_XPATH_CACHE
public static boolean ENABLE_XPATH_CACHE -
BINDING_ROLE_XPATH
public static final java.lang.String BINDING_ROLE_XPATH- See Also:
- Constant Field Values
-
BINDING_ROLE_CONDITIONAL
public static final java.lang.String BINDING_ROLE_CONDITIONAL- See Also:
- Constant Field Values
-
BINDING_RESULT_CONDITION_FALSE
public static final java.lang.String BINDING_RESULT_CONDITION_FALSE- See Also:
- Constant Field Values
-
BINDING_ROLE_REPEAT
public static final java.lang.String BINDING_ROLE_REPEAT- See Also:
- Constant Field Values
-
BINDING_RESULT_RPTD_ZERO
public static final java.lang.String BINDING_RESULT_RPTD_ZERO- See Also:
- Constant Field Values
-
BINDING_RESULT_RPTD_ZERO_W15
public static final java.lang.String BINDING_RESULT_RPTD_ZERO_W15- See Also:
- Constant Field Values
-
BINDING_RESULT_RPTD
public static final java.lang.String BINDING_RESULT_RPTD- See Also:
- Constant Field Values
-
BINDING_ROLE_RPT_POS_CON
public static final java.lang.String BINDING_ROLE_RPT_POS_CON- See Also:
- Constant Field Values
-
BINDING_ROLE_NARRATIVE
public static final java.lang.String BINDING_ROLE_NARRATIVE- See Also:
- Constant Field Values
-
BINDING_ROLE_COMPONENT
public static final java.lang.String BINDING_ROLE_COMPONENT- See Also:
- Constant Field Values
-
BINDING_ROLE_COMPONENT_BEFORE
public static final java.lang.String BINDING_ROLE_COMPONENT_BEFORE- See Also:
- Constant Field Values
-
BINDING_ROLE_COMPONENT_AFTER
public static final java.lang.String BINDING_ROLE_COMPONENT_AFTER- See Also:
- Constant Field Values
-
BINDING_ROLE_COMPONENT_CONTEXT
public static final java.lang.String BINDING_ROLE_COMPONENT_CONTEXT- See Also:
- Constant Field Values
-
BINDING_ROLE_FINISHER
public static final java.lang.String BINDING_ROLE_FINISHER- See Also:
- Constant Field Values
-
BINDING_CONTENTTYPE
public static final java.lang.String BINDING_CONTENTTYPE- See Also:
- Constant Field Values
-
BINDING_HANDLER
public static final java.lang.String BINDING_HANDLER- See Also:
- Constant Field Values
-
BINDING_PROGID
public static final java.lang.String BINDING_PROGID- See Also:
- Constant Field Values
-
cloneTime
public long cloneTime -
fixBTime
public long fixBTime
-
-
Constructor Details
-
OpenDoPEHandler
- Throws:
Docx4JException
-
-
Method Details
-
getDomToXPathMap
-
getNextBookmarkId
public java.util.concurrent.atomic.AtomicInteger getNextBookmarkId()Provide a way to for user to fetch the starting bookmark ID number for use in the next stage (ie Binding Traverse). If it isn't fetched/set, the value will have to be recalculated (less efficient).- Since:
- 3.2.1
-
preprocess
Preprocess content controls which have tag "od:condition|od:repeat|od:component". It is "preprocess" in the sense that it is "pre" opening in Word The algorithm is as follows: Inject components first. Look at each top level SDT (ShallowTraversor). If it does not have a real data binding, it might have a bindingrole tag we need to process (processBindingRoleIfAny). Conditionals are easy. processRepeat method: - clones the sdt n times - invokes DeepTraversor which changes xpath binding on descendant sdts (both sdts with real bindings and sdts with bindingrole tags). It is not the job of DeepTraversor to expand out any other repeats it might encounter, or to resolve conditionals. Those things are done by ShallowTraversor, to which control returns, as it continues its traverse. The implementation of 13 Sept 2010 replaced the previous XPath based implementation, which did not support nested repeats. I've chosen to build this around TraversalUtil, instead of using XSLT, and this seems to have worked out nicely. The implementation of 10 October 2010 replaced the v1 conventions implementation with a v2 implementation. The main method in this class can convert v1 documents to v2. The v2 implementation is not yet complete. All v1 features are implemented, but not the new v2 stuff (eg complex conditions).- Parameters:
documentPart-- Throws:
java.lang.ExceptionDocx4JException
-
getParts
-
getRepeatXpathBase
protected static java.lang.String getRepeatXpathBase(java.lang.String xpath)Massage the xpath into an expected format, by dropping any trailing '/' or [1]- Parameters:
xpath-- Returns:
-
getSdtPr
-