Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

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

0 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

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.