April 13, 2020
Estimated Post Reading Time ~

Persisting CQ data in the Java Content Repository

You can create an Adobe CQ application that captures data from users and stores the data in the Java Content Repository (JCR). When storing data within the JCR, each record can be saved as a separate node. A node can contain properties that store data values.


Assume that you want to create a CQ application that tracks your customers.

When the end-user fills in the CQ web form and clicks the Add Customer button, customer information is persisted in the JCR. The customer identifier value is returned and displayed in the Customer Id field. In this example, each submitted customer record is stored within a JCR node. The values, such as first name and last name, are stored as node properties, as shown in the following illustration.



This development article guides you through creating a CQ web application that captures data and stores it in the JCR. The JCR application logic is implemented as an OSGi bundle that is built using Declarative Services (DS) and Maven. DS is used to inject a SlingRepository instance into the service. The OSGi bundle is a managed component, which means that the OSGi service container creates the SlingRepository instance.

To view this development article, click:
http://helpx.adobe.com/experience-manager/using/persisting-cq-data-java-content1.html.

Note: If you are interested in learning how to query the Adobe CQ JCR, click this link: http://scottsdigitalcommunity.blogspot.ca/2013/02/querying-adobe-experience-manager-data.html.

Note: When modeling data in the JCR, it is recommended that you read the following: http://dev.day.com/docs/en/cq/current/howto/model_data.html.


By aem4beginner

No comments:

Post a Comment

If you have any doubts or questions, please let us know.