Expand my Community achievements bar.

SOLVED

Displaying warning message to authors when adding Asset to the page

Avatar

Level 1

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

1 Accepted Solution

Avatar

Correct answer by
Level 10

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. 

View solution in original post

5 Replies

Avatar

Level 10

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

Avatar

Level 1

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.

Avatar

Level 10

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

Avatar

Correct answer by
Level 10

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. 

Avatar

Level 1

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.