Adobe Experience Manager (AEM) is a comprehensive content management solution for building websites, mobile applications, and forms. One of its core capabilities is the ability to create databases to manage and store content effectively. This article will guide you through the process of creating a database in AEM, explaining each step in detail.
Key Takeaways
- AEM uses a Java Content Repository (JCR) as a database to store content.
- The creation of a database in AEM involves creating a content structure in the JCR.
- Using the CRXDE Lite, an integrated development environment in AEM, you can interact with the JCR.
- The process involves creating a node, which acts as a container for the data, and properties, which are key-value pairs holding the data.
What is JCR
AEM uses the Java Content Repository (JCR), a type of hierarchical database, for storing content. The JCR uses a tree-like structure, similar to a file system, which allows the storage and retrieval of data in a highly structured way.
A JCR is a type of object database tailored to storing, searching, and retrieving hierarchical data. The JCR API grew out of the needs of content management systems, which require storing documents and other binary objects with associated metadata; however, the API is applicable to many additional types of applications. In addition to object storage, the JCR provides: APIs for versioning of data; transactions; observation of changes in data; and import or export of data to XML in a standard way.
Nodes and Properties
In the JCR, data is stored in nodes and properties. A node is a container for data, similar to a folder in a file system. Each node can have properties, which are key-value pairs, similar to the files in a folder. For example, a node might represent a user, with properties for the user’s name, email address, and password.
Accessing the JCR with CRXDE Lite
CRXDE Lite is an integrated development environment (IDE) included with AEM, which allows you to interact with the JCR directly. You can create, view, and edit nodes and properties using CRXDE Lite.
To access CRXDE Lite:
- Open AEM in your web browser.
- Append /crx/de to your AEM URL. For example, if your AEM URL is http://localhost:4502, the CRXDE Lite URL would be http://localhost:4502/crx/de.
Creating a Node
To create a database in AEM, you essentially create a structured arrangement of nodes and properties in the JCR. Let’s start by creating a node:
- In CRXDE Lite, navigate to the location where you want to create the node.
- Right-click and select Create -> Create Node.
- Enter a name for the node and select a node type. For a general-purpose node, you can use the
nt:unstructured
type. - Click
OK
to create the node.
Adding Properties
Once you’ve created a node, you can add properties to it:
- Select the node in CRXDE Lite.
- In the
Properties
tab, click the Add Property button. - Enter the name and value for the property. For the type, select the appropriate data type for the property value.
- Click
OK
to add the property.
Saving Changes
After you’ve made changes in CRXDE Lite, you need to save them:
- Click the Save All button in the toolbar. This saves all changes to the JCR.
Conclusion
Creating a database in AEM involves structuring content within the Java Content Repository, using nodes to represent data containers and properties for specific data points. By using AEM’s built-in tool, CRXDE Lite, you can easily interact with the JCR to create your database. Remember to save your changes after creating nodes and adding properties to ensure they are stored in the JCR.