활동이 없어 이 대화는 잠겼습니다. 새 게시물을 작성해 주세요.
활동이 없어 이 대화는 잠겼습니다. 새 게시물을 작성해 주세요.
I am having a event handler. It gets trigger when ever there is any change in node property.
Inside that event handler, how can I get which user changed the property. I want to get username / user id. Is there any way apart from lastmodified date of node
Thanks alot in advance
해결되었습니다! 솔루션으로 이동.
Hi,
I don't think, that the jcr:lastModified and jcr:lastModifiedBy properties are updated on every change on a node. Otherwise every node should have these properties, and this isn't the case.
A sling resource event (which indicates a change to a resource) always logs the user, which has executed the changed. But with Oak this is true only for local changes, changes performed on a different cluster node have the user "oak:unknown". For this reason you should run this event listener on every cluster node and only check local changes.
kind regards,
Jörg
조회 수
답글
좋아요 수
If you are tracking on the Node property changed, the user who changed would be captured under jcr:content with the property cq:lastModifiedBy
Let me know if you are looking at something else
Hi,
I don't think, that the jcr:lastModified and jcr:lastModifiedBy properties are updated on every change on a node. Otherwise every node should have these properties, and this isn't the case.
A sling resource event (which indicates a change to a resource) always logs the user, which has executed the changed. But with Oak this is true only for local changes, changes performed on a different cluster node have the user "oak:unknown". For this reason you should run this event listener on every cluster node and only check local changes.
kind regards,
Jörg
조회 수
답글
좋아요 수
Thanks for reponse @bsloki,
let say the node property name is 'mydata'.
Now when this property gets changes, two things will happen.
Task 1. cq:lastModifiedBy will get updated. ( Default AEM Behavior)
Task 2. My Event listener will get fired ( My Code)
Is there any possiblity that task 2 occur before task 1, which will give me old value not updated one in event listener. Whats your views in this case......
조회 수
답글
좋아요 수
In Oak the user id in events is not guaranteed to be the actual user, events from other cluster nodes is just one scenario where that is true. The other known scenario is when too many events are being generated too fast, in which case multiple events get coalesced without respect for which user generated which event. AFAIK...
-Rob Ryan
조회 수
답글
좋아요 수
In an JCR node event handler - the nodes are updated before the event handler is invoked. That is, the handler listens for the node events. See:
http://blogs.adobe.com/experiencedelivers/experience-management/event_handling_incq/
As @Scott mentioned, it shouldnt be the case as the actual action happens ie. update of a property along with which the lastModifiedBy will also be updated. Once that is saved successfully Event handler get triggered.
Thanks for answer and views guys, @scott, @bsloki
조회 수
답글
좋아요 수