Since we started working on Jackalope, we always claimed it would also provide an integration point with other enterprise systems. Last week, we set out to proof this idea. Grégory Joseph of the Java based Magnolia CMS came to help us on the Magnolia side of things. Magnolia is using the JCR reference implementation Jackrabbit for storing its content. After an interesting exchange on their design decisions and our ideas, we started to hack.
Trying to import an XML export from Magnolia in the JCR standard format showed that the Jackalope importer is not yet perfect. In the end Greg was faster in building a Magnolia module that exposes the Jackrabbit Davex binding that Jackalope uses to communicate with the server.
After that, things really started flowing. We managed to not only read data, but also write using the frontend editing feature of the CMF. Additionally, we managed to configure PHPCR-ODM to determine document classes based on the MetaData child every Magnolia page node has. And all of that using several parallel connections to the repositories, so that the normal pages and navigation can still be loaded from our standalone jackrabbit backend (you could just as well use another PHPCR implementation like jackalope-doctrine).
All in all a very successful hackday. We integrated the demos into the cmf-sandbox (branch magnolia_integration). See the MagnoliaController in src/Sandbox/MagnoliaBundle/Controller.
If you want to try things out for yourself, you need to:
If you followed the above steps, you should be able to access Magnolia data with Jackalope-Jackrabbit at http://localhost:8888/magnoliaAuthor/.davex/ (Note that there is no web browser access, as the servlet does not issue a basic auth challenge but just expect the credentials to be set from the beginning).
Now try the urls /magnolia_edit, /magnolia/about/subsection-articles/article and /magnolia_odm and read the code to see what we do.
What was kind of cool is that as while we were showing Greg the PHP code, he immediately recognized the JCR API behind all of this.
is there a simple way to interact with magnolia using php and write/read from jcr? Some code? Thank you
Well it is as “simple” currently as described above.
1) enable davex support in Magnolia
2) setup PHPCR with Jackalope and the Jackrabbit transport
3) interact with Magnolia with read/write support from PHP in an API that is very similar to JCR (http://phpcr.github.com/)
Note we will give a presentation on this at the Magnolia Conference in early September.
your help is very appreciated, thank you :-)
I have updated the branch to match the latest versions of the sandbox as part of the presentation I held at the Magnolia Conference:
I have now unbundled the examples from Symfony2 CMF and created a dedicated repository to get started: