throw new Docx4JException("Couldn't find CustomXmlDataStoragePart! exiting..");
}
if ((flags & FLAG_BIND_INSERT_XML) == FLAG_BIND_INSERT_XML) {
StartEvent startEvent = new StartEvent( WellKnownJobTypes.BIND, wmlPackage, WellKnownProcessSteps.BIND_INSERT_XML );
startEvent.publish();
insertXMLData(customXmlDataStoragePart, xmlDocument);
new EventFinished(startEvent).publish();
}
if ((flags & FLAG_BIND_BIND_XML) == FLAG_BIND_BIND_XML) {
StartEvent startEvent = new StartEvent( WellKnownJobTypes.BIND, wmlPackage, WellKnownProcessSteps.BIND_BIND_XML );
startEvent.publish();
if (wmlPackage.getMainDocumentPart().getXPathsPart()!=null) {
openDoPEHandler = new OpenDoPEHandler(wmlPackage);
openDoPEHandler.preprocess();
bookmarkId = openDoPEHandler.getNextBookmarkId();
}
BindingHandler bh = new BindingHandler(wmlPackage);
bh.setStartingIdForNewBookmarks(bookmarkId);
bh.applyBindings();
new EventFinished(startEvent).publish();
}
if ((flags & FLAG_BIND_REMOVE_SDT) == FLAG_BIND_REMOVE_SDT) {
StartEvent startEvent = new StartEvent( WellKnownJobTypes.BIND, wmlPackage, WellKnownProcessSteps.BIND_REMOVE_SDT );
startEvent.publish();
removeSDTs(wmlPackage);
new EventFinished(startEvent).publish();
}
if ((flags & FLAG_BIND_REMOVE_XML) == FLAG_BIND_REMOVE_XML) {
StartEvent startEvent = new StartEvent( WellKnownJobTypes.BIND, wmlPackage, WellKnownProcessSteps.BIND_REMOVE_XML );
startEvent.publish();
removeDefinedCustomXmlParts(wmlPackage, customXmlDataStoragePart);
new EventFinished(startEvent).publish();
}