decoupling content management

57
Au g 22nd 2012 Decoupling Content Management with Create.js and PHPCR

Upload: henri-bergius

Post on 14-May-2015

978 views

Category:

Technology


2 download

DESCRIPTION

Presentation from DrupalCon Munich 2012

TRANSCRIPT

Page 1: Decoupling Content Management

Aug 22nd 2012

Decoupling Content Managementwith Create.js and PHPCR

Page 2: Decoupling Content Management

Henri Bergius

Director of R&DNemein Berlin

@bergie

bergie.iki.fi

Page 3: Decoupling Content Management

"The Midgard Project is born."

Launching our first Open Source CMS effortbergie.iki.fi, April 25th 1998

Page 4: Decoupling Content Management

Your CMS is a monolith

Content Management

System

Database File System

Page 5: Decoupling Content Management

"We like the user interface, but our IT doesn't want to run PHP"

Page 6: Decoupling Content Management

"We wanted to have a .Net CMS, but our users hate the UI"

Page 7: Decoupling Content Management

"Marketing wants this CMS, but we can't develop our app on it"

Page 8: Decoupling Content Management

Decoupling Content Management

Content Management

System

Content RepositoryDatabase

Web Framework

Web Editing Tool

Monolithic approach Decoupled approach

File System

Page 9: Decoupling Content Management

Clean separation of concerns

Web Editing ToolTools that user needs to create, manipulate, and publish content

Web FrameworkRendering and serving content and handling business logic

Content RepositoryData storage and retrieval. Access controls, validations, full-text search

Page 10: Decoupling Content Management

Semantic CMS Communitywww.iks-project.eu

Page 11: Decoupling Content Management

decoupledcms.org

Page 12: Decoupling Content Management

Create.js

Create.js is a comprehensive web editing interface for Content Management Systems. It is designed to provide a modern, fully browser­

based HTML5 environment for managing content. Create can be adapted to work on almost any content management backend. 

Page 13: Decoupling Content Management

“Build a CMS, no forms allowed”

Page 14: Decoupling Content Management

http://hallojs.org & http://github.com/bergie/blogsiple

Page 15: Decoupling Content Management

http://aloha-editor.org

Page 16: Decoupling Content Management

Manage Collections

Content can be added to any collections

Page 17: Decoupling Content Management

Image handling

Page 18: Decoupling Content Management

Tagging and annotations

http://szabyg.github.com/annotate.js/

Page 19: Decoupling Content Management

Never lose content

Page 20: Decoupling Content Management

Symfony CMF

Page 21: Decoupling Content Management

OpenCms

Page 22: Decoupling Content Management

Drupal

Page 23: Decoupling Content Management

Drupal

Page 24: Decoupling Content Management

Drupal

Page 25: Decoupling Content Management

Create.js for Drupal

drupal.org/project/create

Page 26: Decoupling Content Management

Web Framework

Web Editing Tool

HTML+RDFa JSON-LD over REST

Interfacing with Create.js

Page 27: Decoupling Content Management

RDFa: Your Content, Explained

Page 28: Decoupling Content Management

RDFa: Your Content, Explained

Page 29: Decoupling Content Management

Suddenly JavaScript can understand

Page 30: Decoupling Content Management

Bonus: SEO

Page 31: Decoupling Content Management

JSON-LD

Page 32: Decoupling Content Management

"Our recommendation at this time is to make JSON­LD our primary supported web services 

data format. It is quite flexible, and supports the self­discovery capabilities that we want to 

support."

Drupal WSCCI Web Services Format Sprint Reporthttp://groups.drupal.org/node/237443

Page 33: Decoupling Content Management

Framework for Semantic Interaction - viejs.org

Page 34: Decoupling Content Management

Create.js and PHP● CreatePHP

Generate RDFa annotations from your content modelhttps://github.com/flack/createphp

● Drupal CreateDrupal 7 integration of Create.jshttp://drupal.org/project/create

● LiipVieBundleSymfony2 integration of Create.jshttps://github.com/liip/LiipVieBundle

Page 35: Decoupling Content Management

PHPCR

The PHP Content Repository is an adaption of the Java Content Repository (JCR) standard, an open API specification defined in JSR­283.

The API defines how to handle hierarchical semi­structured data in a consistent way. 

Page 36: Decoupling Content Management

PHPCR is a collection of interfaces

Page 37: Decoupling Content Management

PHPCR is a collection of tests

Page 38: Decoupling Content Management

Same API, multiple repositories

● Jackalope– Apache Jackrabbit:

Java-based repository server, accessible through WebDAV

– Doctrine DBAL: pure-PHP repository library

● jackalope.github.com

● Midgard2– GObject-oriented

repository library accessible through PHP extension

– Python, JavaScript, Java, ...

● midgard-project.org/phpcr

Page 39: Decoupling Content Management

"Developers write against a single API

Implementations can be chosen based on deployment needs"

Page 40: Decoupling Content Management

Repository capabilities

● Tree access● Access by UUID● Workspaces● Versioning● Multi-value properties● Queries: SQL2, QOM

● XML import and export

● Permissions● Capability discovery● Observation● Locking &

Transactions

Page 41: Decoupling Content Management

“Simple stuff should be easy, but complex stuff should still be possible”

Page 42: Decoupling Content Management

PHPCR

Page 43: Decoupling Content Management

In PHPCR, all content is stored in a tree of nodes

Nodes have a name, a type, and a set of properties

Nodes can also have child nodes

Page 44: Decoupling Content Management

Connecting to a repository: Jackrabbit

● Start Jackrabbit:$ java -jar jackrabbit-standalone-2.4.1.jar

● Connect to repository:

Page 45: Decoupling Content Management

This is the only repository-specific part

Page 46: Decoupling Content Management

Working with the tree

Page 47: Decoupling Content Management

About Node types● Node types determine what properties and what kind of

child nodes a node can have● Some built-in types: nt:file, nt:folder, nt:resource, nt:unstructured

● Node types can be amended with “mixin” types, like mix:lastModified, mix:language

● Most repositories allow you to define your own types● Recommendation:

Start with nt:unstructured, add more strict definitions when you know your data model

Page 48: Decoupling Content Management

Queries: SQL2

Page 49: Decoupling Content Management

Queries: Query Object Model

Page 50: Decoupling Content Management

Versioning: enable

Page 51: Decoupling Content Management

Versioning: commit

Page 52: Decoupling Content Management

Versioning: restore

Page 53: Decoupling Content Management

Export and import

Page 54: Decoupling Content Management

Export and import

Page 55: Decoupling Content Management

Your decoupled CMS

PHPCR

Drupal

Create.js

Page 56: Decoupling Content Management

Decoupling means collaboration

Page 57: Decoupling Content Management

Questions?

@bergie

createjs.orghallojs.orgviejs.org

phpcr.github.comiks-project.eu