If you have to customize any default behavior in AEM, you can overlay
the library component responsible for that function.
You have to start off by finding the library component responsible for the behavior - in your case, the component responsible for rendering the http://<host>:<port>/assets.html/content/dam
page. Few ways to find out the component is by analysing the DOM for any unique attributes, analyzing the network logs, etc and tracing it all back to one of the components in /libs
.
Components responsible for DAM are located in /libs/dam/gui/components/
.
/libs/dam/gui/components/admin/page/contentchecker/contentchecker.jsp
for example gets invoked when you open DAM console. You overlay this node to create a node tree inside /apps
and you can then write your custom alert code in the overlayed file.
This is just one of the components which gets called when you open DAM. If you dig deeper you'll be able to find a lot more components you can use to overlay and write custom code.
Read more about overlay
here.
Note: Ensure you version control the overlayed node and make entries in filter.xml
- to ensure this gets deployed to all the environments along with the rest of the source code.
Screenshot of Overlayed file and node tree in /apps
-