


I have a requirement of setting current logged in user's ID as value for a custom metadata field once I upload an asset in AEM DAM. eg. I logged in as admin,then "admin" need to be stored as value for a custom metadata field name "Owner'. How I can achieve it?
Thanks LM
Views
Replies
Sign in to like this content
Total Likes
Write a custom DAM handler that is called when an asset is uploaded:
https://helpx.adobe.com/experience-manager/using/damhandler.html
You need to read the user id using the User management API:
http://jackrabbit.apache.org/api/2.0/org/apache/jackrabbit/api/security/user/UserManager.html
You can get current user:
Session session = resourceResolver.adaptTo(Session.class);
UserManager userManager = resourceResolver.adaptTo(UserManager.class);
/* to get the current user */
Authorizable auth = userManager.getAuthorizable(session.getUserID());
Get the id and set the asset using AssetManger API.
Views
Replies
Sign in to like this content
Total Likes
Write a custom DAM handler that is called when an asset is uploaded:
https://helpx.adobe.com/experience-manager/using/damhandler.html
You need to read the user id using the User management API:
http://jackrabbit.apache.org/api/2.0/org/apache/jackrabbit/api/security/user/UserManager.html
You can get current user:
Session session = resourceResolver.adaptTo(Session.class);
UserManager userManager = resourceResolver.adaptTo(UserManager.class);
/* to get the current user */
Authorizable auth = userManager.getAuthorizable(session.getUserID());
Get the id and set the asset using AssetManger API.
Views
Replies
Sign in to like this content
Total Likes