the java content repository

35
The Java Content Repository Andreas Hartmann CTO, BeCompany GmbH

Upload: nobby

Post on 10-May-2015

2.007 views

Category:

Technology


3 download

TRANSCRIPT

Page 1: The Java Content Repository

The Java Content Repository

Andreas HartmannCTO, BeCompany GmbH

Page 2: The Java Content Repository

Agenda

Primer: Content- vs. behaviour-orientation

What is a content repository?

The Java Content Repository

Jackrabbit

Page 3: The Java Content Repository

Primer:Content- vs.

Behaviour-Orientation

Page 4: The Java Content Repository

Behaviour vs. ContentApplications

Complex

Proprietary

Fix set of functions

Fine-grained

Integration: O(n²)

WWW

Simple

Standards-based

Build your own

Coarse-grained

Integration: O(n)

Page 5: The Java Content Repository

Integration through Behaviour

Page 6: The Java Content Repository

Integration through Content

Page 7: The Java Content Repository

Server

feed.getPosts()

feed.add(post)

post.setTitle(…)

post.setAuthor(…)

feed.delete(…)

Posts

Dojo

Flex

Applet

Desktop

Page 8: The Java Content Repository

Server

Posts

Workflow Engine

States

setState()

getState()

feed.getPosts()

feed.add(post)

post.setTitle(…)

post.setAuthor(…)

feed.delete(…)

Dojo

Flex

Applet

Desktop

Page 9: The Java Content Repository

Server

Posts

Workflow Engine

States

Dojo

Flex

Applet

Desktop

Console

Page 10: The Java Content Repository

Server

get(uri) : doc

post(uri, doc)

put(uri, doc)

delete(uri)

AtomDojo

Flex

Google

Reader

Sage

Documents

Page 11: The Java Content Repository

Server

Atom

Documents

Dojo

Flex

Google

Reader

Sage

Workflow

Engine

Console

Page 12: The Java Content Repository

Content Orientation …

Enforces simplicity

Encourages standardization (think SOA)

Allows applications to involve independently from each other

Improves scalability and reuse of infrastructure

Page 13: The Java Content Repository

Content Orientation …

May be inappropriate for complex processes

Requires content processing facilities in each involved application (good availability for content formats based on open standards)

Can increase network traffic

Page 14: The Java Content Repository

What is aContent Repository?

Page 15: The Java Content Repository

Why a Repository Standard?

Portability → no vendor lock-in

Shared vocabulary for developers

Reuse of experience, code, tools, …:True content repository infrastructure

Increased independence, reduced risk

Page 16: The Java Content Repository

Customers

Now: „Vendor A had a nice GUI, but the back-end doesn‘t scale. Vendor B had a great back-end, but the front-end is unusable.“

With JCR: „We can choose the front-end vendor independently from the back-end vendor. And when we need a bigger back-end, we can exchange it without having to train the users again.“

Page 17: The Java Content Repository

Vendors

Now: „It‘s such a PITA to fix all those concurrency bugs in the back-end. I‘d rather work on this nifty AJAX stuff.“

With JCR: „Since we can just include whatever back-end the customer wants, we can concentrate on providing a magnificent user experience by continuously improving our front-end.“

Page 18: The Java Content Repository

What is a Content Repository?

Application data „super store“

Generic API for content storage:CRUD + locking, versioning, transactions, observation

Access control

Powerful search

Page 19: The Java Content Repository

API, not Product

Well-defined, closed set of features

Documentation about expected behaviour

Abstraction from implementation:Choose whatever storage facility is appropriate - file system, RDBMS, …or even mix them in your repository

Page 20: The Java Content Repository

Today: Separated Content Silos

WCMS

File System

CRM

Oracle

Project Mgmt

MySQL

Page 21: The Java Content Repository

Towards a JCR Infrastructure

WCMS

File System

CRM

Oracle

Project Mgmt

MySQL

JSR 170 API

JCR

Connectors

Page 22: The Java Content Repository

JCR Infrastructure

WCMS CRM

JCR Repository

Project Mgmt

JSR 170 API

Page 23: The Java Content Repository

Choosing a Back-End

How easily can I implement a connector?Versioning: FS easy, RDMBS difficultTransactions: FS difficult, RDMBS easy

Performance

Manageability

Page 24: The Java Content Repository

Repository Deployment Models (Jackrabbit)

A) Inside the application

B) As application inside the containerReferenced via JNDI, accessed via JCR

C) As standalone serverCommunication via SOAP, DAV, RMI, …Accessed via JCR stub

Page 25: The Java Content Repository

Content Model Features

Structured: Mandatory/optional elements

Unstructured: Store what you like

Content types (textual, binary, …)

Relationships with integrity control

Page 26: The Java Content Repository

The Java Content Repository

JSR-170 = JCR 1.0 (Final Release)JSR-283 = JCR 2.0 (Public Review)

Page 27: The Java Content Repository

Content Model

Repository

Workspaces (shared version store)a) working copies for usersb) authoring/staging/livec) …

Tree of nodes

Properties

Page 28: The Java Content Repository

Nodes

1 primary node typee.g., nt:file, nt:unstructured

0..* mixin node typese.g., mix:versionable, mix:referenceable

Properties (key-value pairs)string, binary, date, double, long, boolean, name, path, reference

Page 29: The Java Content Repository

Node Types

Hierarchical (inheritance)

Child node definitions:Default+required node types for childrensame name siblings allowed (true|false)

Property definitions:Required type, multiple (true|false),value constraints, default values

Page 30: The Java Content Repository

Level 1

Initiate a session with a workspace (login)

Retrieve and traverse nodes and properties

Read the values of properties

Export to XML

XPath queries

Page 31: The Java Content Repository

Level 2

Add and remove nodes and properties

Write the value of properties

Assign node types to nodes

Import from XML

Page 32: The Java Content Repository

Optional

Locking

Transactions (Java Transaction API)

Versioning (directed acyclic graph)

Observation

SQL queries

Page 33: The Java Content Repository

Implementations

Apache Jackrabbit (Reference Impl.)

Jeceira

eXo Platform

Alfresco

Day CRX (commercial)

Page 34: The Java Content Repository

JackrabbitPersistence managers (back-ends):In-memory: fast, but not persistentSerialized objects: good performanceXML: human-readable, good for testingRDBMS: good performance, scalable

Hibernate pers. mgr. from JBoss project: Clustering, transactions, better caching

Lucene for indexing

Page 35: The Java Content Repository

JSR-283: JCR 2.0

Management facilities for

Access permissions

Workspaces

Node Types

Meta data

I18n