The main requirement is to identify all transitive dependencies on a page and disallow the authors of those dependencies from reviewing the page.
I have broken the requirement into smaller parts and trying to the do the following
1) Get a list of all the links on a page (can be links to assets/pages) - How to get this list? I tried using AssetReference API but it does not give list of associated pages on a page, also it does not give list of any asset that you might have set using a composite field
2) Determine who all have worked on all those related assets/pages - Using audit log I can determine the data for a page but not for an asset. For asset I am trying to use activity manager, but the activity manager is not providing the data for activities of user other than admin. For a user I can see activity folder created and see all the activities from CRXDE but I am unable to retrieve the data for that user.
3) Accordingly apply business rule to see if the same person can review the workflow payload or not - have created a process step in the workflow to do the same.
Appreciate help and direction anyone can provide.
Thanks and regards,
AJ
Solved! Go to Solution.
Views
Replies
Total Likes
Amit Jain wrote...
Hi Sham,
Thanks for the response.
1.
I am trying to get the links that are available on a page in a JAVA class.so not sure how will I use rewriter for the same. Can you provide more information around it?
2.
I have enabled DAM event recorder and I can see the activities getting generated under the users. However, using the granite activity stream APIs I am unable to get the activities of any user other than admin
ActivityManager mgr = sling.getService(ActivityManager.class);
String userId = request.getParameter("userId");
ActivityCollection coll = mgr.getActivities(resourceResolver, userId);
Above code is what i am using but the collection size is always 0 for user other than admin (I am using 5.6.1 CQ version)
I tried using ActivityService but it looks like it has been deprecated in favor of ActivityManager. The activity service is returning me the required activity. I would have expected ActivityManager to do the same as well, but it doesn't seem to be working.
Below is the activity service code that I am using:
ActivityService activityService = sling.getService(ActivityService.class);
Resource userResource = null;
final UserPropertiesManager upm = resourceResolver.adaptTo(UserPropertiesManager.class);
String authorizableId = resourceResolver.getUserID();
UserProperties userProperties = upm.getUserProperties(authorizableId, "profile");
userResource = resourceResolver.getResource(userProperties.getNode().getPath());
Collection<Activity> activities = java.util.Collections.EMPTY_LIST;
activities = activityService.readActivities(userResource, "dam", -1L);
Any clues regarding the same would be helpful.
Appreciate your help.
Thanks
AJ
1) Look example at [1]. when the request is placed to render a page in java class you get all the link, asset urls.
2) I have never tried personally from your description looks like a bug please file a daycare. As a workaround temporarily go with deprecated ActivityService. Alternatively you can use JCR observation and log the audit events accordingly.
[1] http://helpx.adobe.com/experience-manager/using/creating-link-rewrite.html
Views
Replies
Total Likes
Hi Amit Jain,
1) During page rendering at rewriter you will get all the links. http://sling.apache.org/site/rewriting-the-output-through-pipelines.html
2) USE Dam event recorder http://cq-ops.tumblr.com/post/32802188133/how-to-enable-audit-logging-for-cq-dam
Thanks,
Sham
Views
Replies
Total Likes
Hi Sham,
Thanks for the response.
1.
I am trying to get the links that are available on a page in a JAVA class.so not sure how will I use rewriter for the same. Can you provide more information around it?
2.
I have enabled DAM event recorder and I can see the activities getting generated under the users. However, using the granite activity stream APIs I am unable to get the activities of any user other than admin
ActivityManager mgr = sling.getService(ActivityManager.class); String userId = request.getParameter("userId"); ActivityCollection coll = mgr.getActivities(resourceResolver, userId);
Above code is what i am using but the collection size is always 0 for user other than admin (I am using 5.6.1 CQ version)
I tried using ActivityService but it looks like it has been deprecated in favor of ActivityManager. The activity service is returning me the required activity. I would have expected ActivityManager to do the same as well, but it doesn't seem to be working.
Below is the activity service code that I am using:
ActivityService activityService = sling.getService(ActivityService.class); Resource userResource = null; final UserPropertiesManager upm = resourceResolver.adaptTo(UserPropertiesManager.class); String authorizableId = resourceResolver.getUserID(); UserProperties userProperties = upm.getUserProperties(authorizableId, "profile"); userResource = resourceResolver.getResource(userProperties.getNode().getPath()); Collection<Activity> activities = java.util.Collections.EMPTY_LIST; activities = activityService.readActivities(userResource, "dam", -1L);
Any clues regarding the same would be helpful.
Appreciate your help.
Thanks
AJ
Views
Replies
Total Likes
Amit Jain wrote...
Hi Sham,
Thanks for the response.
1.
I am trying to get the links that are available on a page in a JAVA class.so not sure how will I use rewriter for the same. Can you provide more information around it?
2.
I have enabled DAM event recorder and I can see the activities getting generated under the users. However, using the granite activity stream APIs I am unable to get the activities of any user other than admin
ActivityManager mgr = sling.getService(ActivityManager.class);
String userId = request.getParameter("userId");
ActivityCollection coll = mgr.getActivities(resourceResolver, userId);
Above code is what i am using but the collection size is always 0 for user other than admin (I am using 5.6.1 CQ version)
I tried using ActivityService but it looks like it has been deprecated in favor of ActivityManager. The activity service is returning me the required activity. I would have expected ActivityManager to do the same as well, but it doesn't seem to be working.
Below is the activity service code that I am using:
ActivityService activityService = sling.getService(ActivityService.class);
Resource userResource = null;
final UserPropertiesManager upm = resourceResolver.adaptTo(UserPropertiesManager.class);
String authorizableId = resourceResolver.getUserID();
UserProperties userProperties = upm.getUserProperties(authorizableId, "profile");
userResource = resourceResolver.getResource(userProperties.getNode().getPath());
Collection<Activity> activities = java.util.Collections.EMPTY_LIST;
activities = activityService.readActivities(userResource, "dam", -1L);
Any clues regarding the same would be helpful.
Appreciate your help.
Thanks
AJ
1) Look example at [1]. when the request is placed to render a page in java class you get all the link, asset urls.
2) I have never tried personally from your description looks like a bug please file a daycare. As a workaround temporarily go with deprecated ActivityService. Alternatively you can use JCR observation and log the audit events accordingly.
[1] http://helpx.adobe.com/experience-manager/using/creating-link-rewrite.html
Views
Replies
Total Likes
Thanks a lot Sham for all the help.
Views
Replies
Total Likes
Views
Likes
Replies