Hi,
I have requirement to create an image component with some properties.
1) while authoring the image in dailog box, it should fetch from damadmin and should not exceed the size limit greater than 20kb.
NOTE: The size limit should not be defined in dam admin. we need to restrict only in aem dailog box
Solved! Go to Solution.
Views
Replies
Total Likes
This is possible, what I would do is:
1. Create a servlet (assetSizeServlet.class) that returns the size of any asset that lives in the DAM; servlet will only be used for the authoring environment.
2. Create new jQuery Validation Plugin, JVP, which will ping the servlet, passing in the path of the image; this will return the size of the asset, and your JVP's JavaScript business logic will display an error message from the toolbar as prompt.
This is an example of how a new JVP is created for a Touch UI experience, https://sourcedcode.com/blog/aem/touch-ui/aem-richtext-max-characters-length-validation. Take a read of this article, you can see, the JVP will validate form fields and display error messages.
This is possible, what I would do is:
1. Create a servlet (assetSizeServlet.class) that returns the size of any asset that lives in the DAM; servlet will only be used for the authoring environment.
2. Create new jQuery Validation Plugin, JVP, which will ping the servlet, passing in the path of the image; this will return the size of the asset, and your JVP's JavaScript business logic will display an error message from the toolbar as prompt.
This is an example of how a new JVP is created for a Touch UI experience, https://sourcedcode.com/blog/aem/touch-ui/aem-richtext-max-characters-length-validation. Take a read of this article, you can see, the JVP will validate form fields and display error messages.
Views
Likes
Replies