content mirror
DESCRIPTION
TRANSCRIPT
![Page 1: Content Mirror](https://reader034.vdocuments.us/reader034/viewer/2022051400/54c20a274a795915208b459d/html5/thumbnails/1.jpg)
Content Mirror
Plone Content Serialization to a Structured/Relational Database
![Page 2: Content Mirror](https://reader034.vdocuments.us/reader034/viewer/2022051400/54c20a274a795915208b459d/html5/thumbnails/2.jpg)
Who am I
Kapil Thangavelu
Lives in Washington, DC
Works with Python Uses zope3, sqlalchemy, repoze, z3c
![Page 3: Content Mirror](https://reader034.vdocuments.us/reader034/viewer/2022051400/54c20a274a795915208b459d/html5/thumbnails/3.jpg)
What is this talk about
Rethinking How to Use PloneData Portability
Developer Productivity
![Page 4: Content Mirror](https://reader034.vdocuments.us/reader034/viewer/2022051400/54c20a274a795915208b459d/html5/thumbnails/4.jpg)
What its not about
Using relational database with Plone
![Page 5: Content Mirror](https://reader034.vdocuments.us/reader034/viewer/2022051400/54c20a274a795915208b459d/html5/thumbnails/5.jpg)
Product vs. Framework
2003, First Plone conference NOLA, paul everitt posed the question.
![Page 6: Content Mirror](https://reader034.vdocuments.us/reader034/viewer/2022051400/54c20a274a795915208b459d/html5/thumbnails/6.jpg)
The Product Won
Plone does alot of out the box, with alot of knobs and customization possible through the web.
![Page 7: Content Mirror](https://reader034.vdocuments.us/reader034/viewer/2022051400/54c20a274a795915208b459d/html5/thumbnails/7.jpg)
More Complexity
- Features are great if your using them.- Size Matters- Orthogonality Maters
![Page 8: Content Mirror](https://reader034.vdocuments.us/reader034/viewer/2022051400/54c20a274a795915208b459d/html5/thumbnails/8.jpg)
Complexity Measured
"I have measured out my life in coffee spoons", The Love song of J Alrefd Prufrock, TS. Eliot
(1m x 40r x 5d x 50w )/60 = 166h
The Plone Tax, aka time spent waiting on restarts
![Page 9: Content Mirror](https://reader034.vdocuments.us/reader034/viewer/2022051400/54c20a274a795915208b459d/html5/thumbnails/9.jpg)
Simplicity is Good
- Pay for What You Use
- We can build fast, interactive applications
- Developer Productivity and the Learning Curve Matters - Simple things have a better chance of being correct
![Page 10: Content Mirror](https://reader034.vdocuments.us/reader034/viewer/2022051400/54c20a274a795915208b459d/html5/thumbnails/10.jpg)
Separating Deployment
2am December 6th 2002, Amsterdam, infrae zope3 sprint
![Page 11: Content Mirror](https://reader034.vdocuments.us/reader034/viewer/2022051400/54c20a274a795915208b459d/html5/thumbnails/11.jpg)
Static Deployment
CMFDeployment - Flexible Static Deployment, Filtering, transforms, deployment skins, rendering, urlresolution.
http://plone.org/products/cmfdeployment
From Plone 1.0 - Plone 3.1
![Page 12: Content Mirror](https://reader034.vdocuments.us/reader034/viewer/2022051400/54c20a274a795915208b459d/html5/thumbnails/12.jpg)
Data Deployment
Entransit, provides data deployment, with features like rollback in a workspace based site structure.
.. requires particular site structure/layout according to workgroups, provides advanced features like rollback of a deployment.
![Page 13: Content Mirror](https://reader034.vdocuments.us/reader034/viewer/2022051400/54c20a274a795915208b459d/html5/thumbnails/13.jpg)
Too Complex
Still too complex, needs to work out of the box.
operation and setup need to be dirt simple regardless of the internal complexity (like a product ;-)
![Page 14: Content Mirror](https://reader034.vdocuments.us/reader034/viewer/2022051400/54c20a274a795915208b459d/html5/thumbnails/14.jpg)
ContentMirror
"A facility for mirroring the content of a Plone site into a structured external datastore." - automated, transparent, synchronous serialization. - default source, Archetypes Content - default target, Relational Databases
![Page 15: Content Mirror](https://reader034.vdocuments.us/reader034/viewer/2022051400/54c20a274a795915208b459d/html5/thumbnails/15.jpg)
ContentMirror
Supports Plone 2.5 - Plone 3.1 Support different Databases ( tested with Postgresql & Mysql )
Work out of the Box
Strong Test Coverage
Easy to Extend
![Page 16: Content Mirror](https://reader034.vdocuments.us/reader034/viewer/2022051400/54c20a274a795915208b459d/html5/thumbnails/16.jpg)
Bootstrapping
- Load the Archetypes - Transform to Database Schema - Create Peer Class
![Page 17: Content Mirror](https://reader034.vdocuments.us/reader034/viewer/2022051400/54c20a274a795915208b459d/html5/thumbnails/17.jpg)
Schema Transformationtransform archetypes schemas into relational tables Using SQLAlchemy Uses a default schema ( dublin core, relations, files, identity ) each type gets its own table with common fields factored out
![Page 18: Content Mirror](https://reader034.vdocuments.us/reader034/viewer/2022051400/54c20a274a795915208b459d/html5/thumbnails/18.jpg)
Peer BasedEach content type's class has a corresponding, database persisted class (orm mapped), with corresponding attributes. The peer/domain class can be specified or autogenerated (default).
![Page 19: Content Mirror](https://reader034.vdocuments.us/reader034/viewer/2022051400/54c20a274a795915208b459d/html5/thumbnails/19.jpg)
Event Based
In order to serialize content as changes are happening in the CMS, we integrate into the application server's event stream and subscribe to content events. The subscribers in turn create sync operations via an operation factory.
![Page 20: Content Mirror](https://reader034.vdocuments.us/reader034/viewer/2022051400/54c20a274a795915208b459d/html5/thumbnails/20.jpg)
Files
Don't copy files without need Stored in the database by default
![Page 21: Content Mirror](https://reader034.vdocuments.us/reader034/viewer/2022051400/54c20a274a795915208b459d/html5/thumbnails/21.jpg)
Containment
Adjacency List Model Modified Preorder Tree TraversalLightweight Mapper for Site Maps (use eager join option )
![Page 22: Content Mirror](https://reader034.vdocuments.us/reader034/viewer/2022051400/54c20a274a795915208b459d/html5/thumbnails/22.jpg)
Relations
Archetypes
Bidirectional
Generic Between Types
Custom Attributes
Content Mirror
Relations Table
Doesn't support custom attributes without customization.
![Page 23: Content Mirror](https://reader034.vdocuments.us/reader034/viewer/2022051400/54c20a274a795915208b459d/html5/thumbnails/23.jpg)
Installation <configure xmlns="http://namespaces.zope.org/zope" xmlns:db="http://namespaces.objectrealms.net/rdb" xmlns:ore="http://namespaces.objectrealms.net/mirror"> <!-- setup a database connection --> <db:engine url="postgres://localhost/contentmirror" name="mirror-db" echo="True"/> <!-- associate the connection to the db structures --> <db:bind engine="mirror-db" metadata="ore.contentmirror.schema.metadata" /></configure>
![Page 24: Content Mirror](https://reader034.vdocuments.us/reader034/viewer/2022051400/54c20a274a795915208b459d/html5/thumbnails/24.jpg)
Finishing Installation
# generate a schema ./bin/zopectl run Products/ContentMirror/ddl.py postgres # create the database./bin/createdb mirror-example # load up the schema./bin/psql mirror-example < db.sql # bulk load the existing content./bin/zopectl run Products/ContentMirror/bulk.py portal
![Page 25: Content Mirror](https://reader034.vdocuments.us/reader034/viewer/2022051400/54c20a274a795915208b459d/html5/thumbnails/25.jpg)
Playing with Content Demo
SQL Command Line
Django Admin Interface
![Page 26: Content Mirror](https://reader034.vdocuments.us/reader034/viewer/2022051400/54c20a274a795915208b459d/html5/thumbnails/26.jpg)
Resources
Source Code, Issue Tracker, Documentation http://code.google.com/p/contentmirror Mailing Listhttp://groups.google.com/group/contentmirror 99% unit test coverage / 48 tests / Doctests
![Page 27: Content Mirror](https://reader034.vdocuments.us/reader034/viewer/2022051400/54c20a274a795915208b459d/html5/thumbnails/27.jpg)
Questions
?