Validate json/yaml assets prior to loading in AEM 6.5 | Community
Skip to main content
Level 2
October 5, 2024
Solved

Validate json/yaml assets prior to loading in AEM 6.5

  • October 5, 2024
  • 3 replies
  • 791 views

  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?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by anupampat

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. 

3 replies

anupampat
Community Advisor
anupampatCommunity AdvisorAccepted solution
Community Advisor
October 7, 2024

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. 

narendragandhi
Community Advisor
Community Advisor
October 8, 2024

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

kautuk_sahni
Community Manager
Community Manager
October 9, 2024

@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