Read xml file and convert it to aem page | Adobe Higher Education
Skip to main content
rk39193348
Level 4
October 1, 2020
解決済み

Read xml file and convert it to aem page

  • October 1, 2020
  • 4 の返信
  • 7813 ビュー

Hi all,

 

I have a requirement where I need to read xml file and convert it to aem page. Is there a way to do it?

 

Regards,

このトピックへの返信は締め切られました。

4 の返信

santhosh_kumark
Level 6
October 1, 2020

Hi @rk39193348 ,

 

First we need to write OSGI service to read data and persist key value properties in CRX repo using JCR API's and once the XML data is available in JCR node properties, we can access and display it on any page.

 

Regards,

Santosh

 

 

rk39193348
rk39193348作成者
Level 4
October 1, 2020
Thanks for your reply. I want to convert xml to page, how can that be achieved?
Manjunath_K
Level 7
October 1, 2020

@rk39193348 

There are two options available.

 

1. Import XML data by scheduler, store it in UGC & use that data on the page based on your requirement.

2. Say storing it in UGC not required, then you can skip saving it in UGC & create page whenever scheduler runs using the xml data.

 

refer this blog to import & store xml data in UGC.

https://aem.redquark.org/2019/05/import-xml-data-into-aem.html

 

rk39193348
rk39193348作成者
Level 4
October 2, 2020
Thanks for your reply. The article mentioned by you stores xml in jcr, which I have achieved, how can I convert it to html page?
BrianKasingli
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
October 1, 2020

@rk39193348,

Here's how I would do it.

  1. Upload the XML into AEM. The XML should either be a section of your website (including with all it's children)
  2. Create an OSGI service or servlet, Java Backend, to execute the migration logic. (somehow referencing to the XML file)
  3. Implement the migration logic with the Uber Jar AEM libraries such as the PageManager API or the JCR API to clone/create page and edit pages... of course you will need to parse the XML.

 

Ravi_Pampana
Community Advisor
Community Advisor
October 1, 2020
rk39193348
rk39193348作成者
Level 4
October 2, 2020
Thanks for your reply. The article mentioned by you stores xml in JCR, which I have achieved, how can I convert it to html page?