Hello guys,
I want to create the following tree structure with the builder api from AEM Mocks.
The problem is the it does not create the parsys.
This my actual code:
context.pageManager().create("/", "content", "cq:Page", "content");
context.pageManager().create("/content", "de", "cq:Page", "de");
context.pageManager().create("/content/de", "ueber-uns", "cq:Page", "ueber-uns");
context.pageManager().create("/content/de/ueber-uns", "presse", "cq:Page", "presse");
context.pageManager().create("/content/de/ueber-uns/presse", "press-releases", "cq:Page", "press-releases");
context.pageManager().create("/content/de/ueber-uns/presse/press-releases", "2017", "cq:Page", "2017");
context.pageManager().create("/content/de/ueber-uns/presse/press-releases/2017", "release1", "/apps/test/foundation/templates/basepage", "release1");
context.pageManager().create("/content/de/ueber-uns/presse/press-releases/2017/release1", "par", "foundation/components/parsys", "par");
context.pageManager().create("/content/de/ueber-uns/presse/press-releases/2017/release1", "jcr:content", "test/test-com/components/common/basepage", "jcr:content");
context.pageManager().create("/content/de/ueber-uns/presse/press-releases/2017/release1/par", "gridcontrol", "test/test-com/components/content/gridcontrol", "gridcontrol");
context.pageManager().create("/content/de/ueber-uns/presse/press-releases/2017/release1/par/gridcontrol", "col-6-6-1", "foundation/components/parsys", "col-6-6-1");
context.pageManager().create("/content/de/ueber-uns/presse/press-releases/2017/release1/par/gridcontrol/col-6-6-1", "headline", "test/test-com/components/content/headline", "headline");
context.build().resource("/content/de/ueber-uns/presse/press-releases/jcr:content", "jcr:created", date);
context.build().
resource("/content/de/ueber-uns/presse/press-releases/2017/release1/jcr:content", "jcr:created", date).
resource("/content/de/ueber-uns/presse/press-releases/2017/release1/jcr:content", "pageTitle", "release1-title").
resource("/content/de/ueber-uns/presse/press-releases/2017/release1/jcr:content/par/gridcontrol/col-6-6-1/headline", "headlinetext", "Technik bringt mehr Stress in Europas Haushalte");
In the servlet I want to test calling subPage.getContentResource().getChild("par").adaptTo(Node.class); returns just null. So I think I am initializing the pages the wrong way.
Best regards,
Tim