Skip to main content
Oct 16, 2015 2:28 AM UTC
Solved

Displaying warning message to authors when adding Asset to the page

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.
smacdonald2008
smacdonald2008Accepted solution
Level 10
Oct 16, 2015 2:28 AM UTC

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

Omi4Author
Oct 16, 2015 2:28 AM UTC

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.

Translate
smacdonald2008
smacdonald2008Accepted solution
Level 10
Oct 16, 2015 2:28 AM UTC

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. 

Translate
smacdonald2008
Level 10
Oct 16, 2015 2:28 AM UTC

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

Translate
Omi4Author
Oct 16, 2015 2:28 AM UTC

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.

Translate
smacdonald2008
Level 10
Oct 16, 2015 2:28 AM UTC

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

Translate