Expand my Community achievements bar.

SOLVED

Validate json/yaml assets prior to loading in AEM 6.5

Avatar

Level 1

  Hello, I need to validate json/yaml files prior to loading it to the assets in AEM 6.5, if the file is not valid than show an error to the author, if it is valid than just upload it. Right now I am trying to overlay and customize the upload.js file which is meant for handle the "Upload" button, if the file is in the myproject folder and it is json/yaml, then send it to the servlet for validation. Is it ok? Is there a better approach?

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Level 5

Hi @agyrki ,

Yes overlaying upload.js and then making a call to your servlet for validation is the right approach, adding a check for only your required filetypes.

Thanks. 

View solution in original post

3 Replies

Avatar

Correct answer by
Level 5

Hi @agyrki ,

Yes overlaying upload.js and then making a call to your servlet for validation is the right approach, adding a check for only your required filetypes.

Thanks. 

Avatar

Community Advisor

Hi @agyrki 

 

The other option would be to customize the DAM Update Asset workflow to include a process step which can invoke the servlet to perform the file type validation and then terminate the workflow if the file is not valid or proceed with next steps incase of valid file scenario.

 

Hope this helps!

 

Thanks

Narendra

Avatar

Administrator

@agyrki Did you find the suggestions helpful? Please let us know if you require more information. Otherwise, please mark the answer as correct for posterity. If you've discovered a solution yourself, we would appreciate it if you could share it with the community. Thank you!



Kautuk Sahni