[ 
https://issues.apache.org/jira/browse/JCRVLT-307?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16529287#comment-16529287
 ] 

Tobias Bocanegra commented on JCRVLT-307:
-----------------------------------------

so if I understand the mechanics correctly, filevault has to invoke

{{session.getWorkspace().getObservationManager().setUserDate("package-import")}}

so that the listeners can detect this. 

this would indeed be possible, but would overwrite whatever user data was set 
from the calling application. filevault does not own the session, so it should 
not change it. 

IMO this should be added to the application instead, i.e. the AEM package 
manager or Sling JCR Installer.

btw: I think the JCR observation API is flawed in this respect, as it only 
allows to set 1 user data string, and even worse, it has no getter. 





> UserData should be set to identify node/property changes in EventListeners 
> done through the PackageManager
> ----------------------------------------------------------------------------------------------------------
>
>                 Key: JCRVLT-307
>                 URL: https://issues.apache.org/jira/browse/JCRVLT-307
>             Project: Jackrabbit FileVault
>          Issue Type: Improvement
>          Components: vlt
>    Affects Versions: 3.1.44
>            Reporter: Konrad Windszus
>            Priority: Major
>
> There is the method {{ObservationManager.setUserData(String)}} 
> (https://docs.adobe.com/docs/en/spec/jsr170/javadocs/jcr-2.0/javax/jcr/observation/ObservationManager.html#setUserData(java.lang.String))
>  which allows to bind some arbitrary string with the session, so that for 
> each event, which is being emitted due to Session.save() from this session 
> this user data is available.
> This would allow to determine in an arbitrary 
> {{javax.jcr.observation.EventListener}} whether a particular event was caused 
> by a package manager installation or not.
> A related change has been implemented in 
> https://github.com/Adobe-Consulting-Services/acs-aem-tools/issues/149.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to