Java Content Repository API as well as other Java language related standards is created within the Java Community Process (http://jcp.org/) as a result of collaboration of an expert group and the Java community. It is known as JSR-170 (Java Specification Request). This chapter is for people new to eXo JCR that walks you through an overview of outstanding advantages of JCR. Especially, you will also learn about the following core topics:

  • JCR architecture

    Introduction to 2 core factors of the JCR architecture: eXo Repository Service and Workspace Data Model.

  • Compatibility levels

    Details of 2 compliance levels and a set of optional features.

Why Use JCR?

Do you know how your website data are stored? Images can be stored in a file system, and metadata are in some dedicated files, for example, in XML files, and text documents and PDFs are stored in different folders with metadata in another repositories and in a proprietary structure. How do you manage updating these data and access rights? Where and how do you start if your leader asks you to manage different versions of each document? The larger your website is, the more Content Management Systems (CMSs) you need that allows tackling all these issues.

These CMS solutions are provided by different vendors and each vendor provides its own API for interfacing the proprietary content repository. The developers MUST deal with this and need to learn about the vendor-specific API. If you intend to switch to a different vendor in future, everything will be different, for example, you need a new implementation or a new interface.

JCR provides a unique Java interface that allows you to interact with both text and binary data, and to deal with any kind and amount of metadata of your documents. JCR supplies methods for storing, updating, deleting and retrieving your data without being dependent on the fact that the data is stored in an RDBMS, in a file system or as an XML document. The JCR interface is also defined as classes and methods for searching, versioning, access control, locking and observation.

Furthermore, the export and import functionality is specified so that a switch to a different vendor is always possible.

What does eXo JCR do?

eXo JCR fully complies with JSR 170; therefore with eXo JCR you can use a vendor-independent API. It means that you could switch to a different vendor whenever. By using the standard, you can reduce your lifecycle cost and long-term risk.

Note

eXo Platform offers not only JCR but also the complete solution for both Enterprise Content Management and Web Content Management.

eXo Repository Service

eXo Repository Service is a standard service and is a registered IoC component that can be deployed in some eXo Containers (see Repository configuration for more details). The relationships between components are shown in the picture below:

eXo Container: Some subclasses of org.exoplatform.container.ExoContainer (usually org.exoplatform.container.StandaloneContainer or org.exoplatform.container.PortalContainer) that holds a reference to Repository Service.

  • Repository Service: Contain information about repositories. eXo JCR is able to manage many Repositories.

  • Repository: Implementation of javax.jcr.Repository. It holds references to one or more Workspace(s).

  • Workspace: Container of a single rooted tree of Items. (Note that here it is not exactly the same as javax.jcr.Workspace as it is not a Session object).

The JCR application usecase typically includes two initial steps:

  • Obtaining Repository object by getting Repository Service from the current eXo Container (eXo "native" way) or via JNDI lookup if eXo repository is bound to the naming context using (see Repository configuration for more details).

  • Creating javax.jcr.Session object that calls Repository.login(..).

Workspace Data Model

The following diagram explains which components of eXo JCR implementation are used in a data flow to perform operations specified in JCR API.

The Workspace Data Model can be split into 4 levels by data isolation and value from the JCR model point of view.

The Java Content Repository specification JSR-170 has been split into two compliance levels and a set of optional features.

  • Level 1 defines a read-only repository.

  • Level 2 defines methods for writing content and bidirectional interaction with the repository.

Note

eXo JCR supports JSR-170 level 1 and level 2 and all optional features. The recent JSR-283 is not yet supported.

Level 1

Level 1 includes the read-only functionality for very simple repositories. It is useful to port an existing data repository and convert it to a more advanced form step by step. JCR uses a well-known Session abstraction to access the repository data (similar to the sessions you have in OS, web, and more).

The features of level 1:

Level 2

JCR level 2 includes reading/writing content functionality, importing other sources and managing content definition and structuring using extensible node types.

In addition to the features of the Level 1, it also supports the following major features:

Optional features

On the top of Level 1 or Level 2, a number of optional features are defined for a more advanced repository functionality. This includes functions such as Versioning, (JTA) Transactions, Query using SQL, Explicit Locking and Content Observation. eXo JCR supports all optional features.

Copyright © 2009-2012. All rights reserved. eXo Platform SAS