Class IgnoreMergerHelper
- java.lang.Object
-
- org.ametys.plugins.contentio.archive.IgnoreMergerHelper
-
public final class IgnoreMergerHelper extends Object
ForMergers.IGNORE, we need to use session.getImportContentHandler and filter the SAX events from the XML input stream
For all <sv:property sv:name="jcr:uuid" sv:type="String"> and get their <sv:value>, query the repository to check if it already exists and if it should be ignored
And for each sax event of sv:node- if exists in the repository => ignore the node import
- if does not exist in the repository => send SAX event
-
-
Field Summary
Fields Modifier and Type Field Description private static Logger__AVALON_LOGGERprivate static org.slf4j.Logger__LOGGERprivate static Map<Thread,Session>__SESSIONS_BY_REQUEST
-
Constructor Summary
Constructors Modifier Constructor Description privateIgnoreMergerHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static Source_getXsltStringReader(Mergers mergers)private static TransformerHandler_sendFilteredSaxEvents(ContentHandler receiverContentHandler, Mergers mergers)private static void_sendSaxEventsFromInputStream(InputStream in, ContentHandler wrappedContentHandler)(package private) static voidjcrImportXml(Session session, String parentAbsPath, InputStream in, int importUuidBehavior, Mergers mergers)static booleanuuidIsNotPresent(String nodeUuid)Tells if the given node UUID is not present in the reposiotry.
-
-
-
Field Detail
-
__LOGGER
private static final org.slf4j.Logger __LOGGER
-
__AVALON_LOGGER
private static final Logger __AVALON_LOGGER
-
__SESSIONS_BY_REQUEST
private static Map<Thread,Session> __SESSIONS_BY_REQUEST
-
-
Constructor Detail
-
IgnoreMergerHelper
private IgnoreMergerHelper()
-
-
Method Detail
-
uuidIsNotPresent
public static boolean uuidIsNotPresent(String nodeUuid)
Tells if the given node UUID is not present in the reposiotry.- Parameters:
nodeUuid- The node UUID to test- Returns:
trueif no node exists in the repository with this UUID.falseif a node exists in the repository with this UUID.
-
jcrImportXml
static void jcrImportXml(Session session, String parentAbsPath, InputStream in, int importUuidBehavior, Mergers mergers) throws RepositoryException, IOException
- Throws:
RepositoryExceptionIOException
-
_sendFilteredSaxEvents
private static TransformerHandler _sendFilteredSaxEvents(ContentHandler receiverContentHandler, Mergers mergers) throws IOException, TransformerConfigurationException
-
_getXsltStringReader
private static Source _getXsltStringReader(Mergers mergers) throws IOException
- Throws:
IOException
-
_sendSaxEventsFromInputStream
private static void _sendSaxEventsFromInputStream(InputStream in, ContentHandler wrappedContentHandler) throws SAXException, IOException
- Throws:
SAXExceptionIOException
-
-