April 13, 2020
Estimated Post Reading Time ~

Programmatically Accessing Adobe CQ Content using the JCR API

You can programmatically modify nodes and properties located within the Adobe CQ repository, which is part of the Adobe Digital Marketing Suite. To access the CQ repository, you use the Java Content Repository (JCR) API. You can use the Java JCR API to perform create, replace, update, and delete (CRUD) operations on content located within the Adobe CQ repository. For more information about the Java JCR API, see http://jackrabbit.apache.org/jcr-api.html.

This development article creates a Java class that modifies nodes and properties within Adobe CQ. The Java class connects to a local instance of Adobe CQ and creates nodes and stores data values to node properties. You can store data by manipulating node properties.

Note: This development article modifies the Adobe CQ JCR from an external Java application. In contrast, you can modify the JCR from within an OSGi bundle using the JCR API. For details, see https://aem4beginner.blogspot.com/2020/04/persisting-cq-data-in-java-content.html.

Note: To learn how to query the Adobe CQ JCR using the JCR Query API, click this link: https://aem4beginner.blogspot.com/2020/04/querying-adobe-experience-manager-data.html.

To read this development article, click this link:
https://helpx.adobe.com/experience-manager/using/programmatically-accessing-cq-content-using.html

See Also
To learn how to write this Java Swing application that queries the Adobe Experience Manager JCR by using the JCR API:


Developing a Java Swing Application that displays Adobe Experience Manager Data
When working with Adobe Experience Manager (AEM), sometimes you need to query data that is located in the AEM JCR and view results. Typically you write an AEM component to display the results within a web application. However, sometimes you want to be able to view the data without writing an AEM component or viewing the data from within an AEM web application. Even our team at Adobe has these requirements. That is, we want to be able to quickly get at data without having to write an AEM web application. For example, consider AEM community members which of course is data stored in the AEM JCR. We want the ability to quickly view community members, scores, and even activity based on date values.

In this situation, a Java Swing application is a good choice to use to build a custom tool that enables you to quickly get at the JCR data and view the result set. You can display the result set in a Swing data type that extends javax.swing.JTable, as shown in this illustration.

A Java Swing application that displays data retrieved from the AEM JCR

For information about javax.swing.JTable, see http://docs.oracle.com/javase/7/docs/api/javax/swing/JTable.html.

AEM 5.5-6.1
This development article walks you through how to build a Java Swing application that queries the AEM JCR and displays the result set. To read this development article, click http://helpx.adobe.com/experience-manager/using/java-swing-applications.html.

AEM 6.3
To read this development article for AEM 6.3 (which uses JCR SQL2 API), click https://helpx.adobe.com/experience-manager/using/java-swing-applications-aem63.html.


By aem4beginner

No comments:

Post a Comment

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