Hello,
I have been trying to create some content in the jcr on a publish instance of CQ5.4 and have it be reverse replicated back to the author instance. The node is being created by the following bit of test code in a custom servlet in a bundle:
// session is an admin session Node rootNode = session.getRootNode(); if (rootNode != null) { baseNode = rootNode.getNode("content/usergenerated/content"); if (baseNode != null) { Date now = new Date(); String name = "test-" + String.valueOf(now.getTime()); Node pageNode = baseNode.addNode(name, "cq:Page"); if (pageNode != null) { Node contentNode = pageNode.addNode("jcr:content", "nt:unstructured"); // If I leave the following 3 lines out and add manually (via CRXDE Lite), // the node gets replicated. contentNode.setProperty("cq:distribute", true); contentNode.setProperty("cq:lastModified", Calendar.getInstance()); contentNode.setProperty("cq:lastModifiedBy", session.getUserID()); } } } session.save()
I see the node being created in the proper location (/content/usergenerated/content/test-1234567890) and the properties being added.
The funny thing is that if I don't add the 3 properties (cq:distribute, cq:lastModified, and cq:lastModifiedBy) with code, but through CRXDE Lite, the node is replicated just fine.
What am I missing? Any help is greatly appreciated.
I am running this code with both the author instance and publish instance on my local machine.