Content repository API for Java
| Company type | Specification |
|---|---|
| Industry | Software, Content Management |
| Founder | David Nüscheler |
Key people | David Nüscheler |
| Products | JSR-170, JSR-283 |
Java Content Repository API (JCR) defines a standardized application programming interface (API) for the Java environment, facilitating consistent interaction with content repositories. These repositories underpin content management systems by housing content along with related metadata, such as version control details. Established through the Java Community Process as JSR-170 (first edition) and JSR-283 (second edition), its principal Java package is javax.jcr.
Overview
A JCR functions as a dedicated object database tailored for the storage, retrieval, and querying of hierarchical information. Initially conceived to meet the demands of content management systems, it handles documents and binary data enriched with metadata, while also accommodating wider use cases. The API encompasses capabilities like version control, transaction management, event observation, and standardized XML-based import/export mechanisms.
Data structure
Within a JCR, data is structured as a hierarchy of nodes containing properties that store either simple values or binary content. Each node can possess a specific type that dictates permissible properties, child nodes, and operational behavior. Nodes can reference other nodes through special properties, ensuring referential integrity and supporting object-oriented principles such as inheritance. Prominent node types include referenceable nodes, identifiable via globally unique identifiers, and versionable nodes that maintain historical versions of documents.
Queries
JCR supports exporting segments of its node hierarchy into XML using two standardized formats and importing structured data directly from XML files. Implementations compliant with JSR 283 are required to provide a unified SQL-like query language alongside a query object model (QOM), superseding the earlier XPath query approach from JSR 170. The reference implementation by Apache Jackrabbit integrates the Apache Lucene search engine to deliver comprehensive full-text search capabilities within repositories.
Available implementations
Leadership for both JSRs has been provided by David Nüscheler from Adobe Systems, previously affiliated with Day Software. Day Software developed Content Repository Extreme (CRX), a commercial JCR solution, and contributed to the open source project Apache Jackrabbit, which reached version 2.0 in January 2010. Another open source option is ModeShape, supporting JSR-283 compliance.
Enterprise Content Management platforms such as Adobe Experience Manager (AEM), Jahia, Hippo CMS, and Magnolia utilize the JCR API with Jackrabbit as their default repository but can incorporate any implementation certified under JSR-170. Oracle’s enterprise collaboration suite, Oracle Beehive, also implements support for JSR-170.
The eXo Platform offers eXo JCR—an open source repository complemented by commercial support and documentation. Multiple commercial vendors are actively developing products compatible with JCR standards. For example, Alfresco exposes a JCR API within its content management system. GX has launched a community edition of its Web enterprise content management (ECM) platform built on top of Apache Jackrabbit and compliant with JSR.
Efforts to port the Java API to PHP are ongoing through projects like TYPO3. PHPCR interfaces are realized by Jackalope, which acts as a PHP client communicating with Jackrabbit via WebDAV, and by Midgard, a multi-language content repository solution.
See also
- Content Management Interoperability Services (CMIS), an associated API for content repositories