Content Repository API for Java (JCR) is a specification for a
Java
Java is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea (a part of Pacific Ocean) to the north. With a population of 156.9 million people (including Madura) in mid 2024, proje ...
platform
application programming interface
An application programming interface (API) is a connection between computers or between computer programs. It is a type of software Interface (computing), interface, offering a service to other pieces of software. A document or standard that des ...
(API) to access
content repositories in a uniform manner. The content repositories are used in content management systems to keep the content data and also the
metadata
Metadata (or metainformation) is "data that provides information about other data", but not the content of the data itself, such as the text of a message or the image itself. There are many distinct types of metadata, including:
* Descriptive ...
used in
content management system
A content management system (CMS) is computer software used to manage the creation and modification of digital content ( content management).''Managing Enterprise Content: A Unified Content Strategy''. Ann Rockley, Pamela Kostur, Steve Manning. New ...
s (CMS) such as versioning metadata. The specification was developed under the
Java Community Process
The Java Community Process (JCP), established in 1998, is a formal mechanism that enables interested parties to develop standard technical specifications for Java technology. Becoming a member of the JCP requires solid knowledge of the Java program ...
as JSR-170 (Version 1), and as JSR-283 (version 2). The main
Java package
A Java package organizes Java classes into namespaces,
providing a unique namespace for each type it contains.
Classes in the same package can access each other's package-private and protected members.
In general, a package can contain the fo ...
is
javax.jcr
.
Overview
A JCR is a type of
object database
An object database or object-oriented database is a database management system in which information is represented in the form of objects as used in object-oriented programming. Object databases are different from relational databases which are ...
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
Extensible Markup Language (XML) is a markup language and file format for storing, transmitting, and reconstructing data. It defines a set of rules for encoding electronic document, documents in a format that is both human-readable and Machine-r ...
in a standard way.
Data structure
The data in a JCR consists of a tree of nodes with associated properties. Data is stored in the properties, which may hold simple values such as numbers and strings or binary data of arbitrary length. Nodes may optionally have one or more types associated with them which dictate the kinds of properties, number and type of child nodes, and certain behavioral characteristics of the nodes. Nodes may point to other nodes via a special reference type property. In this way nodes in a JCR offer both
referential integrity
Referential integrity is a property of data stating that all its references are valid. In the context of relational databases, it requires that if a value of one attribute (column) of a relation (table) references a value of another attribute (e ...
and object-oriented concept of
inheritance
Inheritance is the practice of receiving private property, titles, debts, entitlements, privileges, rights, and obligations upon the death of an individual. The rules of inheritance differ among societies and have changed over time. Offi ...
. Additional node types include the referenceable node type which allows the user to reference said node through use of a universally unique identifier. Another popular type is the versionable type. This makes the repository track a document's history and store copies of each version of the document.
Queries
A JCR can export portions of its tree to XML in two standard formats and can import hierarchies directly from XML. JSR 283 compliant implementations must support a standardized form of
SQL
Structured Query Language (SQL) (pronounced ''S-Q-L''; or alternatively as "sequel")
is a domain-specific language used to manage data, especially in a relational database management system (RDBMS). It is particularly useful in handling s ...
for queries and a query object model QOM. JSR 283 deprecates the
XPath
XPath (XML Path Language) is an expression language designed to support the query or transformation of XML documents. It was defined by the World Wide Web Consortium (W3C) in 1999, and can be used to compute values (e.g., strings, numbers, or ...
query language defined in JSR 170.
The
Apache Jackrabbit reference implementation of JCR also supports the integration of the
Apache Lucene
Apache Lucene is a free and open-source search engine software library, originally written in Java by Doug Cutting. It is supported by the Apache Software Foundation and is released under the Apache Software License. Lucene is widely used as a ...
search engine to give full text searches of data in the repository.
Available implementations
Both JSRs are led by
David Nüscheler
David (; , "beloved one") was a king of ancient Israel and Judah and the Kings of Israel and Judah, third king of the Kingdom of Israel (united monarchy), United Monarchy, according to the Hebrew Bible and Old Testament.
The Tel Dan stel ...
of
Adobe Systems
Adobe Inc. ( ), formerly Adobe Systems Incorporated, is an American software, computer software company based in San Jose, California. It offers a wide range of programs from web design tools, photo manipulation and vector creation, through to ...
(formerly of
Day Software). Day had both a commercial JCR implementation called Content Repository Extreme (CRX) and was involved in the open source
Apache Jackrabbit JCR, which had its 2.0 release in January 2010. ModeShape is another open source JCR implementation that supports JSR-283.
Adobe Experience Manager (AEM),
Jahia
Jahia is a software company offering enterprise products, services, and technical support for its open-source digital experience platform. Jahia’s platform provides content and customer data management. The company’s head optional content ...
,
Hippo CMS and
Magnolia
''Magnolia'' is a large genus of about 210 to 340The number of species in the genus ''Magnolia'' depends on the taxonomic view that one takes up. Recent molecular and morphological research shows that former genera ''Talauma'', ''Dugandiodendr ...
are Enterprise Content Management systems built on the JCR API, using Jackrabbit as its repository by default, but able to plug in any other JSR-170 certified repository implementation. JSR-170 is also supported by
Oracle Beehive, Oracle's enterprise collaboration software. The eXo JCR by eXo Platform is an open source repository with paid commercial support and documentation. Many other commercial vendors are working on JCR compatibility and products.
Alfresco is an open source content management system which provides a JCR API onto their repository. GX released the new
community version of its Web
enterprise content management
Enterprise content management (ECM) extends the concept of content management by adding a timeline for each content item and, possibly, enforcing processes for its creation, approval, and distribution. Systems using ECM generally provide a secur ...
(ECM) platform based natively on
Apache Jackrabbit and JSR.
PHP adaptions have been started by
TYPO3, translating the Java API to PHP. The
PHPCR interfaces are also implemented by Jackalope, a PHP frontend talking to the Jackrabbit backend through the WebDAV interface, and
Midgard
In Germanic cosmology, Midgard (an anglicised form of Old Norse ; Old English , Old Saxon , Old High German , and Gothic ''Midjun-gards''; "middle yard", "middle enclosure") is the name for Earth (equivalent in meaning to the Greek term : oikou ...
,
a cross-language content repository.
See also
*
Content Management Interoperability Services
Content Management Interoperability Services (CMIS) is an open standard that allows different content management systems to inter-operate over the Internet. Specifically, CMIS defines an abstraction layer for controlling diverse document manageme ...
(CMIS), another content repository API
References
{{Reflist, 30em
Java enterprise platform
Java specification requests
Content management systems
Database management systems