Hi There.
I've written a component that stores data in the following location. /content/applicationName/jcr:content/data/forms/ . When my component saves information here I want to automatically push this out to the publish instance. I can do this manually by clicking the replicate button against the node.
Could anyone please let me know how to do this automatically?
Thanks in advance,
Tom
Solved! Go to Solution.
Views
Replies
Total Likes
Another option that you can do that is from an event handler - invoke a custom Java Servlet on Publish. Send the data (to store at /content/applicationName/jcr:content/data/forms/ ) using the Servlet. Then use the JCR API on the Servlet to persist the data. Use Java APIs located in the org.apache.http.client.methods.* package to invoke the Servlet.
Also - look at this:
http://www.slideshare.net/teofili/data-replication-in-sling
talks about data replication using sling.
Views
Replies
Total Likes
One way to perform this use case is to use the JCR API to do it programmatically. You can write an event handler that responds to that JCR path. When a new node is added on Author, call a service that opens up a session to the Pub instance and then add a new node there with the data.
Views
Replies
Total Likes
Hi,
Thanks for your answer. I'll give this a go.
Cheers,
Tom
Views
Replies
Total Likes
Another option that you can do that is from an event handler - invoke a custom Java Servlet on Publish. Send the data (to store at /content/applicationName/jcr:content/data/forms/ ) using the Servlet. Then use the JCR API on the Servlet to persist the data. Use Java APIs located in the org.apache.http.client.methods.* package to invoke the Servlet.
Also - look at this:
http://www.slideshare.net/teofili/data-replication-in-sling
talks about data replication using sling.
Views
Replies
Total Likes