During migration site from CQ5.4 to AEM6 I've faced problem in importing XML data to JCR.
On CQ5.4 we used "Content Loader Tool"(http(s)://[host]:[port]/crx/loader/index.jsp ) to load xml to jcr. Starting from CQ5.6.1 that tool was deprecated and gone. AEM6 doesn't have it also, the same like several crx:Xml* primary node types(crx:XmlCharacterData, crx:XmlDocument, crx:XmlElement, crx:XmlNode).
I've tried to re-import data programmatically, below sample groovy script
importXML();
def importXML(){
FileInputStream inputStream = new FileInputStream("c:/data.xml "); // XML file
session.importXML("/content/xmlNode", // Destination JCR node
inputStream ,
javax.jcr.ImportUUIDBehavior.IMPORT_UUID_CREATE_NEW);
session.save();
}
But as import result, I lost all sibling data. Imported data has only one node on each layer in JCR. The reason is Oak doesn't support Same Name Siblings (SNS).
http://docs.adobe.com/docs/en/aem/6-0/deploy/upgrade/introduction-to-oak.html http://jackrabbit.apache.org/oak/docs/differences.html#Same_name_siblings
I don't need support SNS or crx:Xml* node types. I'm happy to have unique generated names for siblings(i.e. node_1, node_2) and primary node type "nt:unstructured". Or any other jcr structure, that keeps all imported data from XML.
How to import XML data to AEM6? Help me out, please.