Actually the ContentImporter method void importContent(Node parent, String name, String contentType, InputStream contentStream, ImportOptions importOptions, ContentImportListener importListener) is not helping because it treat the ZIP content without "reprocessing" it, meaning if the ZIP contains .json, it only write the .json file in the repository, worse it also remove existing nodes (like /content etc..).
So currently the only solution I see to solve the initial issue here is to implement what I have suggested in the SLING-5330. 2015-12-02 22:34 GMT+01:00 Stefan Seifert <[email protected]>: > > >> > ...check the very good work done by Stefan in the testing area. Maybe > >> > it's already possible to import content the way you want with the > tools > >> > developed by him.... > >> > >> Which tools do you mean? > > > >my co-workers used something from wcm.io to import content, not sure if > >that > >tools already live in the Sling repo and how capable they are - better ask > >Stefan himself. > > sling-mock (which is used by aem-mock from wcm.io as well) implements a > simple ContentLoader [1], which works quite similar to the JCR > contentloader to import a node structure from a JSON file. but it uses only > the sling resource API for this, thus supporting JCR-less resource resolver > like the resourceresolver-mock as well. > > sling-mock is indeed not designed to be deployed into a real sling or AEM > instance, so it is of no help for the teleporter rule. if the ContentLoader > implementation is useful we can of course reuse it. > > stefan > > [1] > https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock/src/main/java/org/apache/sling/testing/mock/sling/loader/ContentLoader.java > >
