Class PublishRelationsListener
- java.lang.Object
-
- org.nuxeo.ecm.platform.relations.core.listener.PublishRelationsListener
-
- All Implemented Interfaces:
EventListener
public class PublishRelationsListener extends Object implements EventListener
Core Event listener to copy relations affecting the source document to the proxy upon publication events and the relations that were present on the replaced proxies if any. If this core event listener is used in combination with another core event listener that cleans relation on deleted documents, it should be executed before the cleaning listener so as to be able to copy relations from the deleted proxies. This core event listener cannot work in asynchronous or post commit mode.- Author:
- ogrisel
-
-
Field Summary
Fields Modifier and Type Field Description protected List<String>
graphNamesForCopyFromReplacedProxy
protected List<String>
graphNamesForCopyFromWork
static String
RENDITION_PROXY_PUBLISHED
protected RelationManager
rmanager
-
Constructor Summary
Constructors Constructor Description PublishRelationsListener()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
copyRelationsFromReplacedProxy(RelationManager rmanager, Resource replacedResource, Resource publishedResource, Resource sourceResource)
protected void
copyRelationsFromWorkingCopy(RelationManager rmanager, Resource sourceResource, Resource publishedResource)
List<String>
getGraphNamesForCopyFromReplacedProxy()
List<String>
getGraphNamesForCopyFromWork()
RelationManager
getRelationManager()
void
handleEvent(Event event)
Handle the given event.protected boolean
isCopyFromSource(Statement stmt, Resource sourceResource)
-
-
-
Field Detail
-
RENDITION_PROXY_PUBLISHED
public static final String RENDITION_PROXY_PUBLISHED
- See Also:
- Constant Field Values
-
rmanager
protected RelationManager rmanager
-
graphNamesForCopyFromWork
protected List<String> graphNamesForCopyFromWork
-
graphNamesForCopyFromReplacedProxy
protected List<String> graphNamesForCopyFromReplacedProxy
-
-
Constructor Detail
-
PublishRelationsListener
public PublishRelationsListener()
-
-
Method Detail
-
getRelationManager
public RelationManager getRelationManager()
-
getGraphNamesForCopyFromWork
public List<String> getGraphNamesForCopyFromWork()
-
getGraphNamesForCopyFromReplacedProxy
public List<String> getGraphNamesForCopyFromReplacedProxy()
-
handleEvent
public void handleEvent(Event event)
Description copied from interface:EventListener
Handle the given event. The listener can cancel the event by callingEvent.cancel()
- Specified by:
handleEvent
in interfaceEventListener
- Parameters:
event
- the event
-
copyRelationsFromReplacedProxy
protected void copyRelationsFromReplacedProxy(RelationManager rmanager, Resource replacedResource, Resource publishedResource, Resource sourceResource)
-
isCopyFromSource
protected boolean isCopyFromSource(Statement stmt, Resource sourceResource)
-
copyRelationsFromWorkingCopy
protected void copyRelationsFromWorkingCopy(RelationManager rmanager, Resource sourceResource, Resource publishedResource)
-
-