-
Bug
-
Resolution: Done
-
Major
-
3.7.2.Final, 3.7.3.Final, 3.7.4.Final, 3.8.0.Final, 4.0.0.Alpha4
After import existing node tree from xml all imported nodes lose backreferences.
We write workaround helper which store existing backreferences before import and restore them after import:
// Find in imported xml all nodes that exists in the store and memorize backreferences for them BackreferencesRestorerContentHandlerWrapper referrersHandler = new BackreferencesRestorerContentHandlerWrapper(nodeIdentifier, session); parser.setContentHandler(referrersHandler); parser.parse(new InputSource(new ByteArrayInputStream(buffer))); // Do import after that we lose backreferences session.importXML(path, new ByteArrayInputStream(buffer), ImportUUIDBehavior.IMPORT_UUID_COLLISION_REPLACE_EXISTING); // Now we restore backreferences... referrersHandler.restoreReferences();
But is bad workaround and not stable for production