← Back to list

JCR Structure — Nodes, Properties, Hierarchy & Advanced Concepts in AEM

What is JCR? and its concepts

Swathi Krishnamoorthi · 2026-05-05 12:39 · 0 claps · 2.1 min read
#java #aem-developer #adobe-experience-manager #web-development #sling
Open on Medium ↗
Wiki topics: 🌐 · Web Development

JCR Structure — Nodes, Properties, Hierarchy & Advanced Concepts in AEM

What is JCR?

The Java Content Repository (JCR) is the backbone of Adobe Experience Manager.

It stores all content in a hierarchical structure, similar to a file system.

Think of it like this:

Node — File

Content — PropertyFolder

Structure — Hierarchy

Core Building Blocks

1️⃣ Nodes (Structure)

Nodes are containers that organize content.

Example:

/content/my-site/home

content → root node

my-site → child node

home → page node

2️⃣ Properties (Data)

Properties store actual content as key-value pairs.

Example:

jcr:title = "Home Page" jcr:description = "Welcome to our website"

3️⃣ Hierarchy (Tree Structure)

JCR follows a parent-child model.

/content └── my-site └── home ├── jcr:content │ ├── title │ └── text └── image

Diagram — JCR Tree

/content │ ┌─────┴─────┐ /site1 /site2 │ /home │ jcr:content │ ┌─────┴─────────┐ text image

This is exactly how AEM stores and renders pages.

Real AEM Page Structure

/content/site-name/page-name └── jcr:content ├── root │ ├── responsivegrid │ │ ├── text │ │ └── image

Key Points:

jcr:content → actual content

Components → stored as nodes

Layout → managed via containers

4. Node Types

Define structure rules for nodes.

Types:

Primary Type

Mixin Type

Example:

jcr:primaryType = "cq:Page" jcr:mixinTypes = ["mix:versionable"]

  1. Namespaces

Avoid naming conflicts using prefixes.

jcr: → core

cq: → AEM

sling: → Sling

6. References

Link nodes using UUID.

myReference = "UUID-value"

Useful for linking assets or content reuse.

7. Versioning

  • Track and restore content changes.
  • Version history
  • Restore previous state

Used in AEM page versions.

  1. Access Control (ACL)

Controls permissions.

  • Read
  • Write
  • Modify

Ensures content security.

9. Querying (JCR SQL2)

Fetch content dynamically.

SELECT * FROM [cq:Page]

WHERE ISDESCENDANTNODE('/content')

10. Observation

Listen to repository changes.

Triggers events when:

  • Node added
  • Property updated
  • Used in workflows.

11. Workspaces

Logical separation of repository.

Default:

crx.default

12. Path vs UUID

Type Description

Path /content/site/home

UUID Unique identifier

UUID never changes.

13. Transient vs Persistent State

Changes are temporary until saved.

session.save(); 

Visual Diagram — Full JCR Concept Map

JCR │ ├── Nodes │ ├── Node Types │ └── Mixins │ ├── Properties │ ├── Hierarchy │ ├── Namespaces │ ├── References │ ├── Versioning │ ├── Access Control │ ├── Query Engine │ ├── Observation │ ├── Workspaces │ └── Transient State

Why JCR Matters in AEM

✔ Helps in debugging ✔ Improves component design ✔ Enables efficient querying ✔ Supports versioning & security

Common Mistakes

Treating JCR like a relational DB Hardcoding paths Ignoring hierarchy Deep nesting

Interview Questions

🔹 Basic

  1. What is JCR in AEM?
  2. Difference between node and property?
  3. What is jcr:content?

🔹 Intermediate

  1. What are node types?
  2. Difference between cq:Page and cq:PageContent?
  3. What is sling:resourceType?
  4. How does JCR hierarchy work?

🔹 Advanced

  1. What is JCR SQL2?
  2. Explain versioning in JCR
  3. What are mixin types?
  4. Difference between path and UUID?
  5. What is observation in JCR?
  6. Explain transient state
  7. How do you debug missing content in AEM?
  8. How do you fetch pages under /content?
  9. How do you link two nodes?

Pro Tips

✔ Keep node structure clean ✔ Avoid unnecessary nesting ✔ Use meaningful naming ✔ Follow AEM conventions ✔ Always validate queries

Final Thoughts

JCR is not just storage—it’s a complete content engine that powers:

  • Content structure
  • Security
  • Version control

Follow me for more AEM insights and interview-focused content. Let’s learn and grow together in AEM


메타데이터
post_id
f351f85a6cc4
slug
jcr-structure-nodes-properties-hierarchy-advanced-concepts-in-aem-f351f85a6cc4
url
https://medium.com/@swathikrishnamoorthi2001/jcr-structure-nodes-properties-hierarchy-advanced-concepts-in-aem-f351f85a6cc4
canonical_url
https://medium.com/@swathikrishnamoorthi2001/jcr-structure-nodes-properties-hierarchy-advanced-concepts-in-aem-f351f85a6cc4
author_url
https://medium.com/@swathikrishnamoorthi2001
status
ok
fetched_at
2026-07-10 20:20:52