1 Preface

1.1 Documents Included

2 Introduction

2.1 Motivation
2.2 Goals

3 Use Cases

3.1 Swappability
3.2 Resource Crunch (Personalization)

4 The Repository Model

4.1 API Basics
4.1.1 Traversal Access
4.1.2 Direct Access
4.1.3 Writing to the Repository Removing Items Transient Storage in the Session Transactions
4.1.4 Nodes, Properties and Items
4.2 Compliance Levels
4.3 Same–Name Siblings
4.3.1 Index Notation
4.3.2 Support for Same Name Siblings is Optional
4.3.3 Properties Cannot Have Same Name Siblings
4.4 Orderable Child Nodes
4.4.1 Orderable Same Name Siblings
4.4.2 Non-orderable Child Nodes
4.4.3 Orderable Child Node Support is Optional
4.4.4 Properties are Never Orderable
4.5 Namespaces
4.6 Path Syntax
4.6.1 Names vs. Paths
4.7 Properties
4.7.1 Multi-Value Properties
4.7.2 Reference, Path and Name Property Types
4.7.3 No Null Values
4.8 Node Types
4.9 Referenceable Nodes When UUIDs are Assigned Reference Properties
4.10 Workspaces
4.10.1 Single Workspace Repositories
4.10.2 Multiple Workspaces and Corresponding Nodes Example
4.11 Versioning Relation Between Nodes and Version Histories Example
4.12 Metadata
4.13 Hierarchical versus Direct Access

5 Example Implementations

5.1 A File System-backed Content Repository
5.2 A WebDAV-backed Content Repository
5.3 Database-backed Content Repository
5.4 XML-backed Content Repository
5.5 Namespace Prefixes in the Examples

6 Level 1 Repository Features

6.1 Accessing the Repository
6.1.1 Repository Repository Descriptors Thread Safety of Repository Methods
6.1.2 Credentials
6.2 Reading Repository Content
6.2.1 Session Read Methods
6.2.2 Workspace Read Methods
6.2.3 Node Read Methods
6.2.4 Property Read Methods
6.2.5 Property Types Date Name Path Reference
6.2.6 Property Type Conversion
6.2.7 Value Creating New Value Instances Equality Conditions Value Length
6.2.8 Item Read Methods
6.2.9 Effect of Access Denial on Read
6.2.10 Example
6.3 Namespaces
6.3.1 Namespace Registry
6.3.2 Prefix Syntax
6.3.3 Session Namespace Remapping Using Session Namespace Remapping Scope of Session Namespace Remapping
6.3.4 Internal Storage of Names and Paths
6.4 XML Mappings
6.4.1 System View XML Mapping Example
6.4.2 Document View XML Mapping General Structure Workspace Root XML Text Invalid Item Names Multi-value Properties Example
6.4.3 Escaping of Names
6.4.4 Escaping of Values
6.5 Exporting Repository Content
6.5.1 Encoding
6.6 Searching Repository Content
6.6.1 XPath over Document View
6.6.2 XPath and SQL
6.6.3 Structure of a Query Column Specifier Type Constraint Property Constraint Path Constraint Ordering Specifier
6.6.4 Adapting XPath to the Content Repository Same-Name Siblings Document Order Context Node Mapping Property Types to XML Types Abbreviated Syntax Axes Predicates Boolean Functions Escaping Searching Multi-value Properties Comparison Operators text() Node Test element() Node Test
6.6.5 XPath Extensions jcr:like Function jcr:contains Function jcr:score function jcr:deref Function order by Clause
6.6.6 XPath Grammar Named Terminals Non-Terminals Notes on the Grammar
6.6.7 Search Scope
6.6.8 Query API
6.6.9 QueryManager
6.6.10 The Query Object
6.6.11 Persistent vs. Transient Queries
6.6.12 Query Results
6.6.13 Permissions
6.7 Node Types
6.7.1 Node Type Configuration
6.7.2 What Constitutes a Node Type
6.7.3 Node Type Discovery in Level 1
6.7.4 Primary and Mixin Node Types
6.7.5 Special Properties jcr:primaryType and jcr:mixinTypes
6.7.6 Property Definitions
6.7.7 Child Node Definitions
6.7.8 Inheritance Among Node Types
6.7.9 Discovering available Node Types
6.7.10 Discovering the Node Types of a Node
6.7.11 Discovering the Definition of a Node Type
6.7.12 ItemDefinition
6.7.13 PropertyDefinition
6.7.14 NodeDefinition
6.7.15 Residual Definitions
6.7.16 Value Constraints Choice Lists
6.7.17 Automatic Item Creation
6.7.18 Discovery of Constraints on Existing Items
6.7.19 Predefined Node Types Node Type Definition Notation
6.7.20 Node Type Definitions in Content
6.7.21 Predefined Mixin Node Types mix:lockable mix:referenceable mix:versionable
6.7.22 Predefined Primary Node Types Node Type Inheritance Hierarchy Additions to the Hierarchy nt:base nt:unstructured nt:hierarchyNode nt:file nt:linkedFile nt:folder nt:resource nt:nodeType nt:propertyDefinition nt:childNodeDefinition nt:versionHistory nt:versionLabels nt:version nt:frozenNode nt:versionedChild nt:query
6.8 System Node
6.9 Access Control
6.9.1 JAAS
6.9.2 Checking Permissions

7 Level 2 Repository Features

7.1 Writing Repository Content Writing to Transient Storage Writing Directly to the Workspace Effect of Transactions Invalid States Timing of Validation Session Item
7.1.2 Saving by UUID and Path
7.1.3 Reflecting Item State Re-using Item Objects Effect of Save and Refresh Invalid Items Seeing Changes Made by Other Sessions Resolving Conflicts with Persistent State Item Status
7.1.4 Adding Nodes Example
7.1.5 Adding and Writing Properties Example Setting Multi-value vs. Single-value Properties Creating Value Objects
7.1.6 Removing Nodes and Properties
7.1.7 Moving and Copying Example
7.1.8 Updating and Cloning Nodes across Workspaces Creating a Corresponding Node Update getCorrespondingNodePath
7.1.9 Referenceable Nodes
7.1.10 Treatment of UUIDs
7.1.11 Ordering Child Nodes
7.2 Adding and Deleting Namespaces
7.2.1 Visibility of Namespace Registry Changes
7.3 Importing Repository Content
7.3.1 Import from System View
7.3.2 Import from Document View Roundtripping Example
7.3.3 Respecting Property Semantics
7.3.4 Determining Node Types
7.3.5 Determining Property Types
7.3.6 Workspace Import Methods
7.3.7 Session Import Methods
7.3.8 Importing jcr:root
7.4 Assigning Node Types
7.4.1 The Special Properties jcr:primaryType and jcr:mixinTypes
7.4.2 Assigning a Primary Node Type
7.4.3 Assigning Mixin Node Types
7.4.4 Automatic Addition and Removal of Mixins
7.4.5 Serialization and Node Types
7.5 Thread-Safety Requirements

8 Optional Repository Features

8.1 Transactions
8.1.1 Container Managed Transactions: Sample Request Flow
8.1.2 User Managed Transactions: Sample Code
8.1.3 Save vs. Commit
8.1.4 Single Session Across Multiple Transactions
8.1.5 Mention of Transactions within this Specification
8.2 Versioning
8.2.1 Versionable Nodes
8.2.2 Version Storage jcr:versionStorage Searching and Traversing Version Storage nt:versionHistory nt:versionLabels nt:version nt:frozenNode nt:versionedChild Version Graph Reference Properties within a Version Removal of Versions
8.2.3 The Base Version
8.2.4 Initializing the Version History
8.2.5 Check In
8.2.6 Check Out
8.2.7 Restoring a Version
8.2.8 Restoring a Group of Versions
8.2.9 Update
8.2.10 Merge Merge Algorithm Merging Branches
8.2.12 The OnParentVersionAction Class
8.2.13 Removal of Versions
8.2.14 Versioning API Node Versioning Methods Workspace Versioning Methods VersionHistory Interface The Version Interface
8.2.15 Serialization of Version Storage
8.2.16 Versioning within a Transaction
8.3 Observation
8.3.1 Event Listeners
8.3.2 Listener Registration
8.3.3 Observation Manager
8.3.4 Event Production
8.3.5 Event Filtering
8.3.6 Event Bundles
8.3.7 Interpretation of Events Creating a new Node Creating a Property Changing a Property Removing a Child Node Removing a Property Copying a Subtree Moving a Subtree Re-ordering a set of Child Nodes Adding a Mixin Removing a Mixin Checking in a Node Restoring, Updating or Merging a Node Locking and Unlocking a Node
8.3.8 Deserializing Content
8.3.9 External Mechanisms
8.3.10 Location of Listeners
8.3.11 Persistence of Event Listeners
8.3.12 Vetoable Event Listeners
8.3.13 Exceptions
8.4 Locking
8.4.1 Discovery of Lock Capabilities
8.4.2 Lockable
8.4.3 Shallow and Deep Locks
8.4.4 Lock Owner
8.4.5 Placing and Removing a Lock
8.4.6 Lock Token
8.4.7 Session-scoped and Open-scoped Locks
8.4.8 Effect of a Lock
8.4.9 Timing Out
8.4.10 Locks and Transactions
8.4.11 Locking Methods
8.4.12 The Lock Object
8.4.13 Session Methods Related to the Lock Token
8.5 Searching Repository Content with SQL
8.5.1 The SQL Language
8.5.2 Database View Node Types as Tables Pseudo-property jcr:path Path Literals Pseudo-property jcr:score Namespace delimiting colons Joins Multi-value Properties Null Values Undefined Property Types Data Type Mapping Optional Features
8.5.3 SQL EBNF
8.5.5 Query Results