nuxeo javaone 2007

59
Building an Embeddable Enterprise Content Management Core With the Latest Java Technologies Florent Guillaume JavaOne 2007 (TS-4532)

Upload: stefane-fermigier

Post on 17-Jan-2015

6.332 views

Category:

Technology


1 download

DESCRIPTION

This session describes the architecture and implementation of an embeddable, extensible enterprise content management core for Java EE and simpler platforms. The presentation starts by describing the general architectural concepts used as building blocks: • A schema and document model, reusing XML schemas and making good use of XML namespaces, where document types are built with several facets • A repository model, using hierarchy and versioning, with the Content Repository API for Java (JSR 170) being one of the possible back ends • A query model, based on the Java Persistence query language (JSR 220) and reusing the path-based concepts from Java Content Repositories (JCR) • A fine-grained security model, compatible with WebDAV concepts and designed to provide flexible security policies • An event model using synchronous and asynchronous events, allowing bridging through Java Message Service (JMS) or other systems to other event-enabled frameworks • A directory model, representing access to external data sources using the same concepts as for documents but taking advantage of the specificities of the data back ends Suitable abstraction layers are put in place to provide the required level of flexibility. One of the main architectural tasks is to find commonalities in all the systems used (or whose use is planned in the future) so framework users need to learn and use a minimal number of concepts. The result is a set of concepts that are fundamental to enterprise document management and are usable through direct Java technology-based APIs, Java EE APIs, or SOA. The presentation shows, for each of the main components, which challenges have been met and overcome when building a framework in which all components are designed to be improved and replaced by different implementations without sacrificing backward compatibility with existing ones. The described implementation, Nuxeo Core, can be embedded in a basic Java technology-based framework based on OSGi (such as Eclipse) or in one based on Java EE, according to the needs of the application using it. This means that the core has to function without relying on Java EE services but also has to take advantage of them when they are available (providing clustering, messaging, caching, remoting, and advanced deployment).

TRANSCRIPT

Page 1: Nuxeo JavaOne 2007

Building an Embeddable Enterprise Content Management Core With the Latest Java Technologies

Florent GuillaumeJavaOne 2007 (TS-4532)

Page 2: Nuxeo JavaOne 2007

Goal Of This Talk

Learn about the design and use of Nuxeo™ 5,an embeddable, extensible

Enterprise Content Management frameworkfor Java™ EE and other platforms

Page 3: Nuxeo JavaOne 2007

Agenda

What is Enterprise Content Management

What do we want to achieve

Core Framework

Core and High-Level Services

UI Layers

Extensible and Pluggable

Using the Framework

Page 4: Nuxeo JavaOne 2007

What isEnterprise Content Management?

● Manufacturing● Supply Chain● HR● Accounting● Activity Management● Shipping

ERPUnification

1990–2000...

Page 5: Nuxeo JavaOne 2007

What isEnterprise Content Management?

2000–20...

● Documents (Records, E-Mail, Media)● Imaging● Search Engine● Archiving● Collaboration● Web Publishing● Access Control● Compliance

ECMUnification

Page 6: Nuxeo JavaOne 2007

What isEnterprise Content Management?

The technologies used to ● capture● create● manage● store● preserve● reuse● deliver

content within the enterprise

Page 7: Nuxeo JavaOne 2007

Agenda

What is Enterprise Content Management

What do we want to achieve

Core Framework

Core and High-Level Services

UI Layers

Extensible and Pluggable

Using the Framework

Page 8: Nuxeo JavaOne 2007

What do we want to achieve?

● Create a Framework● Make it Extensible● Make it Multi-Platform● Use the Latest Technologies● Open Source

Page 9: Nuxeo JavaOne 2007

What do we want to achieve?

● Create a Framework● Set of Services

● Software Bundles● Set of APIs

● Open to other systems● Configuration

● XML rather than code

Page 10: Nuxeo JavaOne 2007

What do we want to achieve?

● Create a Framework● Make it Extensible

● New services● New backends to existing services

Page 11: Nuxeo JavaOne 2007

What do we want to achieve?

● Create a Framework● Make it Extensible● Make it Multi-Platform

● POJOs● Java EE

● Clusterable, distributable● Eclipse

● Rich Client Platform (RCP)● Mix of those

● RCP client, Java EE server

Page 12: Nuxeo JavaOne 2007

What do we want to achieve?

● Create a Framework● Make it Extensible● Make it Multi-Platform● Use the Latest Technologies

● Java 5, Java EE 5● OSGi● JCR (JSR-170, JSR-283), W3C XML Schemas● JSF, Facelets● BPEL, WfMC● SOAP, WSDL

Page 13: Nuxeo JavaOne 2007

What do we want to achieve?

● Create a Framework● Make it Extensible● Make it Multi-Platform● Use the Latest Technologies● Open Source

● LGPL, EPL● http://www.nuxeo.org

Page 14: Nuxeo JavaOne 2007

Agenda

What is Enterprise Content Management

What do we want to achieve

Core Framework

Core and High-Level Services

UI Layers

Extensible and Pluggable

Using the Framework

Page 15: Nuxeo JavaOne 2007

Core Framework

● Schemas● Document Types● Life Cycle● Repository● Security

Page 16: Nuxeo JavaOne 2007

Core Framework

● Schemas● Structure the documents● XML Schemas● Complex Types● Attached Files

Page 17: Nuxeo JavaOne 2007

Core Framework: Schema DublinCore

<xs:schema> <xs:element name="title" type="xs:string"/> <xs:element name="description" type="xs:string"/> <xs:element name="rights" type="xs:string"/> <xs:element name="created" type="xs:date"/> <xs:element name="modified" type="xs:date"/> <xs:element name="issued" type="xs:date"/> <xs:element name="format" type="xs:string"/> <xs:element name="language" type="xs:string"/> ...</xs:schema>

Page 18: Nuxeo JavaOne 2007

<xs:schema> <xs:complexType name="baddie"> <xs:sequence> <xs:element name="surname" type="xs:string"/> <xs:element name="level" type="xs:positiveInteger"/> <xs:element name="birth" type="xs:date"/> </xs:sequence> </xs:complexType> <xs:complexType name="baddies"> <xs:sequence> <xs:element name="baddie" type="baddie" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> <xs:element name="baddies" type="baddies"/></xs:schema>

Core Framework: Schema Baddies

Page 19: Nuxeo JavaOne 2007

<baddies> <baddie> <surname>Sylar</surname> <level>38</level> <birth>1962-06-11</birth> </baddie></baddies>

Core Framework: XML Equivalent

Page 20: Nuxeo JavaOne 2007

Core Framework

● Schemas● Document Types

● High-level name● Aggregate schemas● Facets

Page 21: Nuxeo JavaOne 2007

Core Framework: Document Type

<doctype name="Note" extends="Document">

<schema name="dublincore"/> <schema name="note"/>

<facet name="Commentable"/> <facet name="Versionable"/> <facet name="Publishable"/>

</doctype>

Page 22: Nuxeo JavaOne 2007

Core Framework

● Schemas● Document Types● Life Cycle

● States● Transitions

Page 23: Nuxeo JavaOne 2007

Core Framework: Life Cycle States

<lifecycle name="default" initial="project"> <states> <state name="project"> <transitions> <transition>approve</transition> </transitions> </state> <state name="approved"> <transitions> <transition>obsolete</transition> </transitions> </state> <state name="obsolete"/> </states> ...

Page 24: Nuxeo JavaOne 2007

<lifecycle name="default" initial="project"> ... <transitions> <transition name="approve" destination="approved"> <description>Approve the document</description> </transition> <transition name="obsolete" destination="obsolete"> <description>Obsolete the document</description> </transition> </transitions>

</lifecycle>

Core Framework: Life Cycle Transitions

Page 25: Nuxeo JavaOne 2007

Core Framework

● Schemas● Document Types● Life Cycle● Repository

● Hierarchical● Versioning● Backend● API

Page 26: Nuxeo JavaOne 2007

Core Framework: Repository

● Hierarchical● Servers, Domains● Tree of documents

● Versioning● Save, View, Restore● Policy

● Backend● JCR, SQL

● API● Nuxeo 5, JCR 2 (JSR-283)

Page 27: Nuxeo JavaOne 2007

Core Framework

● Schemas● Document Types● Life Cycle● Repository● Security

● Users, Groups● Permissions● ACLs

Page 28: Nuxeo JavaOne 2007

Core Framework: Security ACLs

● Basic Access Control Entry (ACE)● DENY Read to Anonymous● GRANT Write to group:Developers

● Ordered List● Manipulated by different services

● User assignment● Workflow● Record management locks

● Placeful and Inherited

Page 29: Nuxeo JavaOne 2007

Agenda

What is Enterprise Content Management

What do we want to achieve

Core Framework

Core and High-Level Services

UI Layers

Extensible and Pluggable

Using the Framework

Page 30: Nuxeo JavaOne 2007

Core Services

● Event System● Directories● User Manager● Query

Page 31: Nuxeo JavaOne 2007

Core Services

● Event System● Synchronous Listeners● Low Level

● Creation, Modification, Deletion● Move, Copy● Security Changes

● Bridged to JMS● Asynchronous Handlers● Non-Core components can participate

Page 32: Nuxeo JavaOne 2007

Core Services

● Event System● Directories

● Tabular Data● Users and Groups● Vocabularies● Entries are placeless documents

Page 33: Nuxeo JavaOne 2007

Core Services: Directory

<directory name="country"> <schema>vocabulary</schema> <dataSource>java:/nxsqldirectory</dataSource> <table>country</table> <idField>id</idField> <sqlScript>country.sql</sqlScript></directory>

<xs:schema> <xs:element name="id" type="xs:string"/> <xs:element name="label" type="xs:string"/> <xs:element name="obsolete" type="xs:boolean"/></xs:schema>

Page 34: Nuxeo JavaOne 2007

Core Services

● Event System● Directories● User Manager

● Bridge directories and user authentication● Interfaces with the application server● Global defaults

Page 35: Nuxeo JavaOne 2007

Core Services

● Event System● Directories● User Manager● Query

● Multiple Backends● Intelligent Dispatcher● Query Language: NXQL

Page 36: Nuxeo JavaOne 2007

Core Services: Query

SELECT * FROM Documents WHERE dc:title LIKE 'JavaOne%'

SELECT * FROM Documents WHERE dc:modified >= TIMESTAMP '2007-01-01T00:00:00'

SELECT * FROM Documents WHERE ecm:path STARTSWITH '/customers/proposals'

Page 37: Nuxeo JavaOne 2007

High-Level Services

● Audit and Logging● Comments● Transformations● Relations● Workflow● Action Manager● Mime Types● Scheduler

Page 38: Nuxeo JavaOne 2007

Layered Framework: Functional View

Nuxeo Core Services

Storage

High Level Services

Schemas Versions Security ...

Transform Audit Relation Indexing ...

Jackrabbit

CompassJenaOOo JDBC

Nuxeo Runtim

e

Web App RCP App Flex App

Page 39: Nuxeo JavaOne 2007

org.nuxeo.ecm.platform.workflow.apiorg.nuxeo.ecm.platform.workflow.clientorg.nuxeo.ecm.platform.workflow.coreorg.nuxeo.ecm.platform.workflow.documentorg.nuxeo.ecm.platform.workflow.document-apiorg.nuxeo.ecm.platform.workflow.document-facadeorg.nuxeo.ecm.platform.workflow.facadeorg.nuxeo.ecm.platform.workflow.jbpm

Layered Framework: Workflow

Page 40: Nuxeo JavaOne 2007

WF Doc API

Doc Core

Workflow API

WF Core

jBPM

EJB

WF Facade

Seam WF Client

Doc Facade

Nuxeo Core API

Nuxeo Core

Layered Framework: Workflow

Page 41: Nuxeo JavaOne 2007

Agenda

What is Enterprise Content Management

What do we want to achieve

Core Framework

Core and High-Level Services

UI Layers

Extensible and Pluggable

Using the Framework

Page 42: Nuxeo JavaOne 2007

UI Layers

● Web● JSF, Ajax4jsf, Facelets● EJB Action Listeners● JBoss Seam● Theming Engine: NXThemes

● Eclipse RCP

Page 43: Nuxeo JavaOne 2007

Nuxeo 5 Screenshot

Page 44: Nuxeo JavaOne 2007

Eclipse Screenshot

Page 45: Nuxeo JavaOne 2007

Agenda

What is Enterprise Content Management

What do we want to achieve

Core Framework

Core and High-Level Services

UI Layers

Extensible and Pluggable

Using the Framework

Page 46: Nuxeo JavaOne 2007

Nuxeo Core

Comment Service

Type Service

Storage Service

Blog Module

Blog Extensions

Storage Module

Jackrabbit Storage

NXRuntime: Extension Points

Page 47: Nuxeo JavaOne 2007

NXRuntime: Extension Points

<component name="core.TypeService" version="1.0">

<implementation class="org.nuxeo.ecm.core.schema.TypeService"/>

<extension-point name="schema"> <object class="org.nuxeo.ecm.core.schema.SchemaBinding- Descriptor"/> </extension-point>

<extension-point name="doctype"> <object class="org.nuxeo.ecm.core.schema.DocumentType- Descriptor"/> </extension-point>

</component>

Page 48: Nuxeo JavaOne 2007

<component name="MyTypes" version="1.0">

<extension target="core.TypeService" point="schema"> <schema name="common" src="common.xsd"/> <schema name="dublincore" src="dublincore.xsd" prefix="dc"/> </extension>

<extension target="core.TypeService" point="doctype"> <doctype name="Note" extends="Document"> <schema name="common"/> ... </doctype> </extension>

</component>

NXRuntime: Extension Points Contributions

Page 49: Nuxeo JavaOne 2007

Services are Pluggable

● Internal Service Provider Interfaces (SPI)● Repository Backend● Directory Backend● Workflow Service● Indexing Service● Relation Service● Transformation Service

Page 50: Nuxeo JavaOne 2007

Plug into Different Platforms

● POJO Bundles● OSGi Dependencies

● Extension Points ● Generic Lookup Service● Java EE Deployment

● JBoss● GlassFish● ...

Page 51: Nuxeo JavaOne 2007

Plug into OSGi

● OSGi as Basic Format● JAR● Meta-Information

● NXRuntime● Extension points

● Definition● Contributions

● Specialized Deployment

Page 52: Nuxeo JavaOne 2007

Plug into Java EE: Problems

● Modules hard to reuse on other platforms● XML module descriptors don't allow fragmentation● Hardcoded package names in code or XML● Cannot add functionality without redeploying the entire

application● No extension model (plugins)

Page 53: Nuxeo JavaOne 2007

Plug into Java EE: Deployment

● Deployment● Ordering● Dynamic Activation● Contributed XML descriptors

● EAR: application.xml, jboss-app.xml● WAR: web.xml, faces-config.xml, pages.xml● Other: persistence.xml, datasources

● L10n properties files● Services as MBeans● Lookup Service

Page 54: Nuxeo JavaOne 2007

Agenda

What is Enterprise Content Management

What do we want to achieve

Core Framework

Core and High-Level Services

UI Layers

Extensible and Pluggable

Using the Framework

Page 55: Nuxeo JavaOne 2007

Using the Framework

● Contribute to Extension Points● Schemas, Documents● Actions● Event Listeners● Directories

● XHTML UI● JSF

● EJB Action Listeners● Seam

● Deployment Rules

Page 56: Nuxeo JavaOne 2007

<h:outputText value="#{messages['label.edit']}" class=”top”/><h:form> <h:panelGrid columns="3" styleClass="dataInput" columnClasses="labelColumn,fieldColumn">

<h:outputText value="#{messages['label.title']}"/> <h:inputText value="#{currentDocument.dublincore.title}" class="dataInputText" id="title" required="true"> <f:validateLength minimum="5"/> </h:inputText> <h:message styleClass="errorMessage" for="title"/>

<h:outputText value=""/> <h:commandButton value="#{messages['label.save']}" styleClass="button" type="submit" action="#{documentActions.updateCurrentDocument}"/></h:form>

Using the Framework: JSF

Page 57: Nuxeo JavaOne 2007

@Stateless@Name("myActions")public class MyActionsBean implements MyActions {

@In(required = true) protected Document currentDocument;

public String doSubmit() throws ClientException { String title = currentDocument.getProperty("dc:title"); title += " (Captured)"; currentDocument.setProperty("dc:title", title); currentDocument.save(); return null; }}

Using the Framework: Action Listener

Page 58: Nuxeo JavaOne 2007

Summary

● Modular Framework● Flexible Backends● Platform Independent● Easy Extensions● Open Source● We Welcome Your Ideas and Contributions!

Page 59: Nuxeo JavaOne 2007

For More Information

http://www.nuxeo.org/

http://svn.nuxeo.org/

http://lists.nuxeo.com/mailman/listinfo/ecm