Read a xml file from file system and store as jcr:data in crx | Community
Skip to main content
Level 3
Feb 26, 2018 5:17 PM UTC
Solved

Read a xml file from file system and store as jcr:data in crx

Hi,

In AEM, how to read a xml file from file system and store the content as jcr:data into sling:folder node using Java?

Any sample or tutorial available, kindly help.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
smacdonald2008
smacdonald2008Accepted solution
Level 10
Mar 1, 2018 7:20 PM UTC

Here is the HELPX article that was created based on this thread -- Scott's Digital Community: Creating a Custom Watched Folder Service for Adobe Experience Manager 6.3

22 replies

smacdonald2008
Level 10
Feb 26, 2018 6:44 PM UTC

I will write sample JCR Java code that shows this. I will post back.

Translate
smacdonald2008
Level 10
Feb 26, 2018 6:04 PM UTC

This would be done via a custom service. You can read a file on the desktop using File API. THen you can use the JCR API to create a node under a folder - which is just a JCR location- and then write the content to the node prop using JCR API logic.

To learn how to use JCR API to write data to a node prop - see this -- Scott's Digital Community: Programmatically Accessing Adobe CQ Content using the JCR API

Translate