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

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

Avatar

Level 3

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

 

keshava219_0-1657262899176.png

 

1 Accepted Solution

Avatar

Correct answer by
Level 7

@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...

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

 

 

View solution in original post

1 Reply

Avatar

Level 3

Hi @ManuMathew1994 ,

 

                 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 

 

 

Avatar

Correct answer by
Level 7

@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...

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