Presentation from phpday2011. La modellazione e gestione dei contenuti costituisce un dominio complesso. Soluzioni standard come Drupal, Joomla o Wordpress si adattano con difficoltà sul dominio di uno specifico cliente; d'altro canto soluzioni fatte in casa costano in termini di tempi di sviluppo e riusabilità. Non esiste allora ""one cms to rule them all""?
Nel talk verrà introdotto il progetto Symfony CMF discutendo tra l'altro di:
- standard per la modellazione dei contenuti
- modellazione ed organizzazione dei contenuti
- scelte architetturali
- linee guida per l'utlizzo del cmf
6. No REALLY!
CMSes are awesome!
http://phpday.it #phpday
7. CMSes are awesome if
you are an end user!
Click click
http://phpday.it #phpday
8. CMSes are awesome if
you are a sales guy!
Brand
http://phpday.it #phpday
9. CMSes sucks if you are a
developer!
CMS first, framework second
http://phpday.it #phpday
10. CMSes nightmares
• no clean separation of configuration, logic and content
• no clean deployment and staging concept
• inconsistent cache layers
• lots of legacy baggage
• NIH (not invented here) syndrom
http://phpday.it #phpday
11. Do we also suffer from
NIH?
• Based ourselves as much on standard tools and specs
• Deliver value within a reasonable time
http://phpday.it #phpday
12. CMF = Content
Management Framework
• In other words: its a toolbox to create your
own custom CMS
• Not a one size fits all, but increase code
sharing
• Imagine Diem, Sympal, Apostrophe all build
on the same content foundation
http://phpday.it #phpday
13. Mission
• 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
http://phpday.it #phpday
20. Content Repository
• A content repository is a generic
application data “super store.”
• Can handle both small and large-scale data
interactions
• Is expected to manipulate and store
structured and unstructured content that
vary dynamically
http://phpday.it #phpday
21. JSR170 aka JCR1
JSR283 aka JCR2
• how data are stored within the repository
is identified and structured from the point
of view of the client
http://phpday.it #phpday
22. Workspaces
• Multiple workspaces, each with its own
name and root node
• Is similar to a Unix file system structure
• Each workspace is independent
http://phpday.it #phpday
23. Nodes
• Are identified by the path where are stored
• ex. id: “/my/path/under/water/fish”
• Can be created, deleted, modified, copied...
http://phpday.it #phpday
30. PHPCR
• Aims to provide a standard API that can be
used by any PHP content management system
to interface with any content repository.
• Several Implementations
• Jackalope on Jackrabbit
• Jackalope on Doctrine DBAL
• Midgard2 PHPCR
http://phpday.it #phpday
31. PHPCR
• PHPCR has been submitted to JCR
• http://phpcr.github.com/
http://phpday.it #phpday
34. PHPCR-ODM
• Sits on top of jackalope
• Works like MongoDB or CouchDB ODM,
but also includes a tree/graph, versioning
and ACL API
http://phpday.it #phpday
41. Not all data fits well in
PHPCR/JCR
• For example aggregation is better done in an
RDBMS
• Store web store product description in PHPCR/
JCR
• Store web store inventory and orders in RDBMS
http://phpday.it #phpday
Chi sa cos’è Sf2/Doctrine2?\nChi ha usato Sf2/Doctrine2?\nChi ha “visto” SfCMF?\n
\n
\n
\n
\n
\n
9999 conf per rendere il prodotto a misura di 10000 casi\ndeploy upgrade, conf su db difficili da replicare (velocemente) o esportare\ncache oggetti, viste, conf, diversi layer difficili da trattare quando qualcosa non va\nstrumenti vecchi codice vecchio\nlibrerie esterne ex. layer db, templating\n
non stiamo ricadendo nella sindrome poichè invece di concentrarci su sviluppare un prodotto, cerchiamo di guardare agli standard e specifiche consolidate per assemblare una cassetta degli attrezzi necessari per creare valore in tempo ragionevole\n
non un unico prodotto che va bene per tutti ma strumenti che permettano di “creare” un cms adhoc per ogni situazione. Strumenti piccoli che posso assemblare assieme per le esigenze specifiche.\n
\n
I contenuti su web sono rappresentabili come un grafo.\nNella maggior parte dei casi posso semplificare con un albero.\n
Uno dei problemi che si hanno nella progettazione è che i contenuti sono organizzati in un albero, DB relazionali sono stretti\n
\n
Tutte queste richieste non sono facilmente realizzabili con DB relazionali, non sono nati per fare questo. Per questo si è pensato ad un database documentale a grafo\n
Tutte queste richieste non sono facilmente realizzabili con DB relazionali, non sono nati per fare questo. Per questo si è pensato ad un database documentale a grafo\n
\n
Managing users and access control lists\n
Content Repository API for Java Technology\nE’ una specifica Java per cercare di standardizzare l’interfaccia del content repository e come questo permetta di indentificare le informazioni e la loro struttura\nL1 read-only: inizializzazione sessione, lettura dei nodi e proprietà, esportazione xml, query xpath\nL2: scrittura dei contenuti, importazione da altre fonti, modifica dei datatipi\nJava Specification Requests\n\n
Il cuore della specifica è l’organizzazione e il trattamento dei dati che viene chiamato Content Model\n
\n
single value, multivalue\n
tipi di nodo: definiscono una struttura di base\ni nodi tipizzati definiscono vincoli sulla struttura dell’albero\n
I mixin sono dei behaviour\n
\n
esistono diverse implementazioni CR noi utilizzato questo, ci sono diverse versioni tra cui versioni embedded (es in Tomcat) oppure versioni stand-alone che noi utilizziamo\n\n
\n
porting in PHP delle API definite nelle specifiche\ninsieme di interfacce e non l’implementazione\ndefinisce quali interfacce deve soddisfare un client per poter colloquiare con generico CR\n