Expand my Community achievements bar.

SOLVED

Modifying Assign To* dropdown in Create Review Task Workflow

Avatar

Level 1

Can anyone help with modifying the OOTB dropdown Assign To* , I need to exclude certain users from the dropdown? Thanks.

 

amahato_0-1643291886517.png

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

@amahato, just to be clear userlist is a selector that is added to the request - so it can be handled by specific servlet. You can observe in your browser that when you click on drop down request similar to this is sent

/mnt/overlay/dam/gui/content/projects/addtask/jcr:content/body/items/form/items/wizard/items/tabs/items/basic/items/singlecontainer/items/assign.userlist.html?impersonatesOnly=true&query=&start=0&end=25&_charset_=UTF-8&projectPath=

Above request is handled by/libs/cq/gui/components/projects/admin/userpicker/userlist.jsp - so I think this is what you are looking for.

View solution in original post

3 Replies

Avatar

Community Advisor

Hi @amahato, wizard implementation can be found under /libs/dam/gui/content/projects/addtask and drop-down can be found here /libs/cq/gui/components/projects/admin/userpicker.

Unfortunately both those areas are marked as granite:InternalArea. Base on AEM documentation

Internal (granite:InternalArea) - Defines a node as internal. Nodes classified as internal cannot be overlaid, inherited, or used directly. These nodes are meant only for internal functionality of AEM

This complicates the operation you are trying to do. I would leave it as it is, and maybe write some guidelines for users.

But if you do not have a choice and need to apply some code changes, I would suggest to create Sling Filter that will handle userlist.html request that provides list of options in the drop-down. So in that filter you will need to remove entries that you do not want to expose to the users. However please be aware that /libs/cq/gui/components/projects/admin/userpicker is used in any other places, so your filter should modify data only for this specific scenario. In other case it will affect other functionalists. You can find more information about filters under https://sling.apache.org/documentation/the-sling-engine/filters.html.

The other option could be to write some JavaScript that will remove specific items on client side.

Avatar

Level 1

I found userlist.jsp which is in the userpicker folder but cannot locate userlist.html, can you please help?

Avatar

Correct answer by
Community Advisor

@amahato, just to be clear userlist is a selector that is added to the request - so it can be handled by specific servlet. You can observe in your browser that when you click on drop down request similar to this is sent

/mnt/overlay/dam/gui/content/projects/addtask/jcr:content/body/items/form/items/wizard/items/tabs/items/basic/items/singlecontainer/items/assign.userlist.html?impersonatesOnly=true&query=&start=0&end=25&_charset_=UTF-8&projectPath=

Above request is handled by/libs/cq/gui/components/projects/admin/userpicker/userlist.jsp - so I think this is what you are looking for.