Reputation: 126
I see cq:lastModified in the page property which gives me the User who modified the page at the latest. Is there any way to get the list of latest 10 users who modified the page ? Does AEM stores that kind of information at all?
Thanks!
Upvotes: 0
Views: 2326
Reputation: 279
Use AuditLog Interface from com.day.cq.audit package and you can use AuditLog object to invoke getLatestEvents(String[] categories, String path, int max) here specify the max as 10 . you will receive an array of AuditLogEntry objects and from this array you can get all user id's.
Upvotes: 0
Reputation: 6764
When on the page in CQ, if you open the Information tab in the Sidekick you can view the Audit log — this will show you modification actions on the page, including page activation, e.g.:
I think this stores 15 entries by default (I'm not sure if that number is editable).
Alternatively, you can view the History log under $CQ_HOME/crx-quickstart/logs/history.log
— this will show entries for View/Edit/Delete on individual nodes (so for example, you can see that a component was edited rather than just a page).
It can be rotated by date or size as per other CQ logs, & will show:
For example:
28.07.2014 15:59:05 VIEW admin [/content/dam/geometrixx/travel/train_platform_boarding.jpg] [dam:Asset,mix:versionable]
Upvotes: 1
Reputation: 10241
There is no OOTB way to do this.
But here is how you can try to achieve it :
1) Create Custom workflow with a custom process step.
In this workflow process step copy the cq:lastModifiedBy property value to a new custom property(lets call this lastModifiedUsers, which will be an array)
2) Now create a launcher which runs on modified for cq:PageContent node type. Use this launcher to trigger workflow created in step 1.
Now everytime you modify this page, the launcher will trigger the workflow which will copy the cq:lastModifiedBy property value to this custom property which is an array and save it in the path-path/jcr:content node.
Upvotes: 0