how to update a json file in JCR repository by using sling servlet ? | Community
Skip to main content
keshava219
Level 3
July 8, 2022
Solved

how to update a json file in JCR repository by using sling servlet ?

  • July 8, 2022
  • 1 reply
  • 1190 views

I have a requirement like to update json file by using sling servlet waking up with ajax call .

 

like:

Path: apps/myproject/jsonfile/xyz.json

 

 

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 Manu_Mathew_

@keshava219  you may just need to call the servlet via form-submit/ajax,

call the 3rd party API from the servlet ,

get the resonpse ,

manupulate the data as required and use JCR APIs to manupulate JCR nodes etc.

and send it back via response object.

 

you can also ref these links.: https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/how-to-where-to-store-json-files-to-access-json-as-it-is-in-ui/m-p/272656

https://aemsimplifiedbynikhil.wordpress.com/2019/10/04/read-write-data-in-json-file-of-dam-in-aem-making-rest-api-call/

 

 

1 reply

Manu_Mathew_
Community Advisor
Community Advisor
July 8, 2022

@keshava219 Can you describe a bit more on this?

keshava219
Level 3
July 8, 2022

Hi @manu_mathew_ ,

 

                 i want to update  json values which coming from thirdparty api to store in jcr repository that will render in dialog dropdown .

 

to get this requirement i need to use ajax call to send some params  and then servlet will update json file 

 

 

Manu_Mathew_
Community Advisor
Manu_Mathew_Community AdvisorAccepted solution
Community Advisor
July 8, 2022

@keshava219  you may just need to call the servlet via form-submit/ajax,

call the 3rd party API from the servlet ,

get the resonpse ,

manupulate the data as required and use JCR APIs to manupulate JCR nodes etc.

and send it back via response object.

 

you can also ref these links.: https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/how-to-where-to-store-json-files-to-access-json-as-it-is-in-ui/m-p/272656

https://aemsimplifiedbynikhil.wordpress.com/2019/10/04/read-write-data-in-json-file-of-dam-in-aem-making-rest-api-call/