the java content repository
TRANSCRIPT
The Java Content Repository
Andreas HartmannCTO, BeCompany GmbH
Agenda
Primer: Content- vs. behaviour-orientation
What is a content repository?
The Java Content Repository
Jackrabbit
Primer:Content- vs.
Behaviour-Orientation
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)
Integration through Behaviour
Integration through Content
Server
feed.getPosts()
feed.add(post)
post.setTitle(…)
post.setAuthor(…)
feed.delete(…)
…
Posts
Dojo
Flex
Applet
Desktop
Server
Posts
Workflow Engine
States
setState()
getState()
feed.getPosts()
feed.add(post)
post.setTitle(…)
post.setAuthor(…)
feed.delete(…)
…
Dojo
Flex
Applet
Desktop
Server
Posts
Workflow Engine
States
Dojo
Flex
Applet
Desktop
Console
Server
get(uri) : doc
post(uri, doc)
put(uri, doc)
delete(uri)
AtomDojo
Flex
Reader
Sage
Documents
Server
Atom
Documents
Dojo
Flex
Reader
Sage
Workflow
Engine
Console
Content Orientation …
Enforces simplicity
Encourages standardization (think SOA)
Allows applications to involve independently from each other
Improves scalability and reuse of infrastructure
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
What is aContent 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
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.“
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.“
What is a Content Repository?
Application data „super store“
Generic API for content storage:CRUD + locking, versioning, transactions, observation
Access control
Powerful search
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
Today: Separated Content Silos
WCMS
File System
CRM
Oracle
Project Mgmt
MySQL
Towards a JCR Infrastructure
WCMS
File System
CRM
Oracle
Project Mgmt
MySQL
JSR 170 API
JCR
Connectors
JCR Infrastructure
WCMS CRM
JCR Repository
Project Mgmt
JSR 170 API
Choosing a Back-End
How easily can I implement a connector?Versioning: FS easy, RDMBS difficultTransactions: FS difficult, RDMBS easy
Performance
Manageability
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
Content Model Features
Structured: Mandatory/optional elements
Unstructured: Store what you like
Content types (textual, binary, …)
Relationships with integrity control
The Java Content Repository
JSR-170 = JCR 1.0 (Final Release)JSR-283 = JCR 2.0 (Public Review)
Content Model
Repository
Workspaces (shared version store)a) working copies for usersb) authoring/staging/livec) …
Tree of nodes
Properties
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
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
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
Level 2
Add and remove nodes and properties
Write the value of properties
Assign node types to nodes
Import from XML
Optional
Locking
Transactions (Java Transaction API)
Versioning (directed acyclic graph)
Observation
SQL queries
Implementations
Apache Jackrabbit (Reference Impl.)
Jeceira
eXo Platform
Alfresco
Day CRX (commercial)
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
JSR-283: JCR 2.0
Management facilities for
Access permissions
Workspaces
Node Types
Meta data
I18n