Displaying warning message to authors when adding Asset to the page | Community
Skip to main content
October 16, 2015
Solved

Displaying warning message to authors when adding Asset to the page

  • October 16, 2015
  • 5 replies
  • 1292 views

Please tell me If there is a way to provide a warning message to the authors if an author tries to add an asset to a page

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by smacdonald2008

Here is another way to implement your use case. You can use the PageEvent class to write app logic that is fired when someone modifies a page. See:

http://dev.day.com/docs/en/cq/current/javadoc/com/day/cq/wcm/api/PageEvent.html

To see an example of this Java class -- see this example that comes with CQ:

/apps/geometrixx/src/impl/src/main/java/com/day/cq/wcm/apps/geometrixx/impl/PageEventListener.java

Good luck. 

5 replies

smacdonald2008
Level 10
October 16, 2015

Are you looking for something like adding a warning message in an event handler when an asset is added to a CQ page? 

Omi4Author
October 16, 2015

Thank you very much for the reply.Basically Displaying warning message to authors if an author tries to add an asset to a page and the CUG of the Asset will not allow to access that asset when the page is published with the Asset.

smacdonald2008
Level 10
October 16, 2015

You may want to read this blog that talks about different ways you can use event handing in CQ:

http://experiencedelivers.adobe.com/cemblog/en/experiencedelivers/2012/04/event_handling_incq.html

Hope this helps

smacdonald2008
smacdonald2008Accepted solution
Level 10
October 16, 2015

Here is another way to implement your use case. You can use the PageEvent class to write app logic that is fired when someone modifies a page. See:

http://dev.day.com/docs/en/cq/current/javadoc/com/day/cq/wcm/api/PageEvent.html

To see an example of this Java class -- see this example that comes with CQ:

/apps/geometrixx/src/impl/src/main/java/com/day/cq/wcm/apps/geometrixx/impl/PageEventListener.java

Good luck. 

Omi4Author
October 16, 2015

If we see the /libs/wcm/extensions/contentfinder/images.js and while we are drag and drop that image i just need to veryfy that asset has CUG  in the CQ.wcm.ContentFinderTab.getResultsBoxConfig.Asset is selected by the "itemSelector": CQ.wcm.ContentFinderTab.DETAILS_ITEMSELECTOR.I think we can verify that the selected asset has CUG.Please let me know if we can do the same.