decoupling content management with create.js and phpcr

50
Decoupling Content Management with Create.js and PHPCR

Upload: henri-bergius

Post on 28-May-2015

2.772 views

Category:

Technology


5 download

DESCRIPTION

Talk from Symfony Live 2012

TRANSCRIPT

Page 1: Decoupling Content Management with Create.js and PHPCR

Decoupling Content Managementwith Create.js and PHPCR

Page 2: Decoupling Content Management with Create.js and PHPCR

Henri Bergius

Director of R&DNemein Berlin

@bergie

bergie.iki.fi

Page 3: Decoupling Content Management with Create.js and PHPCR

github.com/bergie/noflogithub.com/bergie/phpflo

Page 4: Decoupling Content Management with Create.js and PHPCR

Your CMS is a monolith

Content Management

System

DatabaseDatabase

Page 5: Decoupling Content Management with Create.js and PHPCR

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

Page 6: Decoupling Content Management with Create.js and PHPCR

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

Page 7: Decoupling Content Management with Create.js and PHPCR

Decoupling Content Management

Content Management

System

Content RepositoryDatabase

Web Framework

Web Editing Tool

Monolithic approach Decoupled approach

File system

Page 8: Decoupling Content Management with Create.js and PHPCR

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 9: Decoupling Content Management with Create.js and PHPCR

Symfony2 is a reusable set of standalone, decoupled, and cohesive PHP components that solve common 

web development problems.

http://fabien.potencier.org/article/49/what-is-symfony2

Page 10: Decoupling Content Management with Create.js and PHPCR

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 11: Decoupling Content Management with Create.js and PHPCR

“Build a CMS, no forms allowed”

Page 12: Decoupling Content Management with Create.js and PHPCR

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

Page 13: Decoupling Content Management with Create.js and PHPCR

http://aloha-editor.org

Page 14: Decoupling Content Management with Create.js and PHPCR

Manage Collections

Content can be added to any collections

Page 15: Decoupling Content Management with Create.js and PHPCR

Image handling

Page 16: Decoupling Content Management with Create.js and PHPCR

Tagging and annotations

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

Page 17: Decoupling Content Management with Create.js and PHPCR

Never lose content

Page 18: Decoupling Content Management with Create.js and PHPCR

CMF Front-end Editor

Page 19: Decoupling Content Management with Create.js and PHPCR

OpenCms

Page 20: Decoupling Content Management with Create.js and PHPCR

Web Framework

Web Editing Tool

HTML+RDFa JSON-LD over REST

Interfacing with Create.js

Page 21: Decoupling Content Management with Create.js and PHPCR

RDFa: Your Content, Explained

Page 22: Decoupling Content Management with Create.js and PHPCR

RDFa: Your Content, Explained

Page 23: Decoupling Content Management with Create.js and PHPCR

Suddenly JavaScript can understand

Page 24: Decoupling Content Management with Create.js and PHPCR

Bonus: SEO

Page 25: Decoupling Content Management with Create.js and PHPCR

Framework for Semantic Interaction - viejs.org

Page 26: Decoupling Content Management with Create.js and PHPCR

Create.js and PHP

● LiipVieBundleHandle Create's RESTful JSON-LD communications with Doctrine ODMhttps://github.com/liip/LiipVieBundle

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

Page 27: Decoupling Content Management with Create.js and PHPCR

Symfony CMF

The Symfony CMF project makes it easier for developers to add CMS functionality to 

applications built with the Symfony2 PHP framework. Key development principles for the 

provided set of bundles are scalability, usability, documentation and testing. 

Page 28: Decoupling Content Management with Create.js and PHPCR

Symfony CMF

Friday 15:00, Track ALukas Kahwe Smith

Build your decoupled CMS with Symfony2

Page 29: Decoupling Content Management with Create.js and PHPCR

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 30: Decoupling Content Management with Create.js and PHPCR

PHPCR is a collection of interfaces

Page 31: Decoupling Content Management with Create.js and PHPCR

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 32: Decoupling Content Management with Create.js and PHPCR

"Developers write against a single API

Implementations can be chosen based on deployment needs"

Page 33: Decoupling Content Management with Create.js and PHPCR

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 34: Decoupling Content Management with Create.js and PHPCR

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

Page 35: Decoupling Content Management with Create.js and PHPCR

PHPCR

Page 36: Decoupling Content Management with Create.js and PHPCR

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 37: Decoupling Content Management with Create.js and PHPCR

Connecting to a repository: Jackrabbit

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

● Connect to repository:

Page 38: Decoupling Content Management with Create.js and PHPCR

This is the only repository-specific part

Page 39: Decoupling Content Management with Create.js and PHPCR

Working with the tree

Page 40: Decoupling Content Management with Create.js and PHPCR

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 41: Decoupling Content Management with Create.js and PHPCR

Queries: SQL2

Page 42: Decoupling Content Management with Create.js and PHPCR

Queries: Query Object Model

Page 43: Decoupling Content Management with Create.js and PHPCR

Versioning: enable

Page 44: Decoupling Content Management with Create.js and PHPCR

Versioning: commit

Page 45: Decoupling Content Management with Create.js and PHPCR

Versioning: restore

Page 46: Decoupling Content Management with Create.js and PHPCR

Export and import

Page 47: Decoupling Content Management with Create.js and PHPCR

Export and import

Page 48: Decoupling Content Management with Create.js and PHPCR

Your decoupled CMS

PHPCR

Symfony CMF

Create.js

Page 49: Decoupling Content Management with Create.js and PHPCR

Decoupling means collaboration

Page 50: Decoupling Content Management with Create.js and PHPCR

Questions?

@bergie

createjs.orghallojs.orgviejs.org

phpcr.github.comcmf.symfony.com