This is a workflow that can be solved by creating OSGi bundles. You can create an OSGi bundle that reads data from your backend database. For information, this development artilce talks about how to retrieve data from the backend. See .http://scottsdigitalcommunity.blogspot.ca/2012/04/creating-adobe-cq-web-application-that.h tml.
You can use JCR API to modify nodes and properties located within the Adobe CQ. See http://scottsdigitalcommunity.blogspot.ca/2012/03/programmatically-accessing-day-cq.html.
You can create a single OSGi bunlde that contains operations that retrieve data from the database and other operations that use the JCR API to update nodes with the data retrieved from the database.
Hope this helps!
Thanks alot. This approach sounds really good.
thanks for the help,
I needed some help with the part of accessing JCR repository.
This above article seems to be for accessing the JCR repository from an external application.
I needed to access the JCR repository from within an OSGI-Bundle.
Please suggest what would be the way to get the repository instance.
Also my bundle is spring-based and I am using spring-dm.
For anyone who is interested this is the way to access the repository in a spring bundle:
1) Update the manifest:
2) Update the spring xml to get the sling repository:
<osgi:reference id="SlingRepository.class" interface="org.apache.sling.jcr.api.SlingRepository"/>
3) Sample Code in the class:
session = slingRepository.loginAdministrative(null);
Node root = session.getRootNode();
Node test = root.addNode("test");
Thanks to smacdonald2008, Sarwar and Scott's blog.