Get user details in touch ui dialog listener

AG19

06-07-2019

Hi,

I want to get the user details in aem touch ui dialog listener. I need to know the user when a particular filed is modified/updated in dialog.

Thanks,

AG

Accepted Solutions (1)

Accepted Solutions (1)

Answers (4)

Answers (4)

Nirmal_Jose

MVP

07-07-2019

If  you are looking for change visibility of dialog property  based on user permissions / user cred, you can use renderconditions.

Create rendercondition like /libs/granite/ui/components/coral/foundation/renderconditions/privilege and use it on the dialog field like /libs/dam/gui/content/assets/annotate/jcr:content/actions/moveasset/granite:rendercondition.

If you want to get the user details in the dialog field, you should use jackrabit Usermanager API

reference - https://stackoverflow.com/questions/34631873/how-to-get-user-list-of-given-group-in-aem6-1

Dialog widget reference - How can we select the user from Dialog widget

Nirmal_Jose

MVP

08-07-2019

I don't know any quick route for this one, but you can implement the below.

1. Create a servlet like /bin/getCurrentUser using logic in [1] (not to create user, but to get current user )

2. The servlet should send back the current user

3. Create a listener for the dialog fields you need and write a listener logic to invoke the servlet and update the response to the specific field.

[1] - Adobe Experience Manager Help | Using Jackrabbit UserManager APIs to create AEM Users and Groups

AG19

08-07-2019

Hi nirmaljosehere

Thanks for writing. I need to the the user who is updating the component in dialog listener (Touch UI). I want to store the user id/name of author who is updating the specific textarea(only) of a component. Assume a component has 5 fields in dialog, AEM stores the lastModifiedBy if any of those fields updated. I want to store the user name only when one(specific filed, say text area) of those five fields got updated.

Thanks.