Symfony CMF experiences

Post on 05-Jul-2015

578 views 2 download

description

Symfony Based Online Management System based on Symfony CMF

Transcript of Symfony CMF experiences

Een Open Source Online Management System op basis van het Symfony2 CMF

Wie ben ik

Voorliefde voor:● Architectuur● UML● Agile

Deze presentatie

● Hoe zijn we tot een nieuw CMS gekomen gebaseerd op het Symfony CMF

● Uitleg over wat Symfony CMF is● Implementatieproblemen● Roadmap

Hoe zijn we gekomen tot een nieuw CMS

Monolithische systemen

● One size fits all syndroom● Beoogt gebruiksklaar product te zijn● Uitzonderingen en maatwerk worden

standaard

Monolithische systemen

● One size fits all syndroom● Beoogt gebruiksklaar product te zijn● Uitzonderingen en maatwerk worden

standaard

Bugfixes in core

Plugin/module systemen

● Maatwerk loskoppelen van core● Nog steeds monolitisch● Simplistische plugin architectuur of veel

dependencies van core

Plugin/module systemen

● Maatwerk loskoppelen van core● Nog steeds monolitisch● Simplistische plugin architectuur of veel

dependencies van core

Making patches

Groeiende architectuur behoefte

Bron: Automatiseringsgids 22 (6-12-2012) – Gevraagd nieuwe Agile IT-principesBron: Automatiseringsgids 22 (6-12-2012) – Gevraagd nieuwe Agile IT-principes

Groeiende architectuur behoefte

Bron: Automatiseringsgids 22 (6-12-2012) – Gevraagd nieuwe Agile IT-principesBron: Automatiseringsgids 22 (6-12-2012) – Gevraagd nieuwe Agile IT-principes

Doelstelling van nieuw CMS

Schaalbare oplossing

+ Open source

+ Ruimte voor maatwerk

+ Archipel principes

+ Uitgebreide standaard voor module/plugin architectuur

Doelstelling van nieuw CMS

Schaalbare oplossing

+ Open source

+ Ruimte voor maatwerk

+ Archipel principes

+ Uitgebreide standaard voor module/plugin architectuur

= Symfony2

Een CMS op Symfony 2

● Functionele verantwoordelijkheden opdelen in zelfstandige functionerende “eilandjes van code”

● Aan elkaar koppelen dmv de Symfony2 DIC

Symfony CMF

Content management framework,

not content management system● Use what you can● Replace what you need● Ignore what you do not need● Collection of modular tools to do content

management● Not a ready-to-use application for end users

Symfony CMF

● PHPCR (gebaseerd op JCR 2)– NoSQL

– Graph DB (Tree structures)

– Versioning van content

– Full text search

– Rechtenbeheer * (not yet)

Symfony CMF - PHPCR

● Drie hiërarchise bomen die je terug kunt vinden in CMF

Content Menu Routing

Symfony CMF

● Symfony 2 control flow

Symfony CMF

● Symfony 2 control flow

Symfony CMF

Symfony CMF - Content● Class - controller mapping in config.yml● Class - template mapping in config.yml● Hiërarchische dependencies

– Selectie/verwijderen (bijv blogpost → comments)

– Houd rekening met rechten

– Voorkom te diepe nesting (user → blogposts → comments)

Content Menu Routing

Implementatie

Data models en bundles

● Interfaces gebruiken om functionaliteit toe te voegen aan models (beter PHP 5.4 traits)– Doctrine Listeners op deze interfaces zetten voor

CRUD acties

– Sonata Admin extensions om forms uit te breiden (compiler pass van sonata)

– Dmv traits properties toevoegen

Voorbeeld

class Page implements SeoInterface, CallToActionInterface{

   protected $metaTitle;

   protected $metaDescription;

   protected $callToActions; ...

PageBundle, SeoBundle en CallToActionBundle

Node path generator

/**

 * @PHPCRODM\Document(referenceable=true)

 * @OMS\NodeNameCompiler(    class="PropertyNodeNameCompiler",    options={"pattern"="[title]"},    basePath="pages/landingpage")

 */

class LandingPage extends Page {...

Route generator

/**

 * @PHPCRODM\Document(referenceable=true)

 * @ROUTING\Routing(      routeName="[title]",      basepath="product"   )

 */

class Product extends Page {...

Route collection per document

● Auto route ( meeveranderende route op basis van bijv titel )

● Primary route ( intial route, aka permalink)● Default route (welke route gebruikt moet

worden, bijv bij menu)● Redirect route(s) (alle andere routes dan

default route)

Referential integrity

Zelf bouwen

● Path generator (mkdir -p)● Path validation● Sonata phpcr admin uitbreidingen● Multi site router

Implementatieproblemen

Menu is geen menu

● Menu is geen menu– Menu,

– Kruimelpad

– Sitemap

Content Menu Routing

Routing concept => nok

http://candystore.com/chocolate/m-and-ms● Object conversions● Chocolate is node en chocolate moet een link

worden● Of hele link moet een redirect worden naar

http://m-and-ms.com

Object conversions tricky in PHPCR, en groot riscico bij verwijderen/wijzigen van tussenliggende nodes

PHPCR / Jackalope● Document caching gebeurt zowel in Doctrine

ODM als in Jackalope PHPCR● Validation van nodenames ontbreekt● Referential integrity ontbreekt

Innovatie risico

● Bugs en (deels) ongeteste code● Sonata niet “af” genoeg voor phpcr● Layout van Sonata● Zie mailinglist cmf-devs

● Jackrabbit explorer

http://blog.netvlies.nl/techniek-code/phpcr-repository-admin/

Screenshots

Screenshots

Roadmap

● PR's voor reeds gebouwde functionaliteit● SOMS sandbox release● Meer mensen inspireren tot gebruik van CMF

Waar te beginnen

● cmf.symfony.com● Join mailinglist● Download sandbox