2 Replies Latest reply on Nov 29, 2012 10:50 AM by lsmith77

    support ModeShape as a PHPCR persistence layer

    lsmith77

      I am one of the lead authors of PHPCR and the PHPCR reference implementation Jackalope.

      http://phpcr.github.com

       

      The aim is to create an API that takes the concepts of JCR but follows the philosophie of PHP. This means that anyone experienced with JCR will quickly be familiar with code written for a PHPCR implementation. All the concepts like tree's, references, SQL2 search, workspaces etc are all also available in PHPCR.

       

      The reference implementation uses Jackrabbit as the persistence layer via their Davex HTTP API:

      https://github.com/jackalope/jackalope-jackrabbit

       

      This means it is possible to write PHP code that reads/creates nodes stored in Jackrabbit. We recently did a proof of concept where we interfaced with the Jackrabbit instance underneath the Magnolia CMS to exchange data. I even did a presentation at the annual Magnolia conference about the results:

      https://dl.dropbox.com/u/268634/PHPCR-and-Magnolia.html#1

       

      What this means in short:

      - its now possible to build sophisticated CMS solutions on top of PHPCR

      - it is possible to integrate PHP with Jackrabbit based CMS solutions

      - since there are multiple implementations its possible switch storage layer more easily

       

      There is of course an extensive test suite to test compliance (next to Jackalope there is also a C implementation) which we automatically test against on travis-ci.org:

      https://github.com/phpcr/phpcr-api-tests

       

      I recently learned that ModeShape also exposes some of its functionality via REST API. Furthermore ModeShape has some interesting features missing in Jackrabbit, like a much more powerful and performant SQL2 implementation. So it would be interesting to also have a PHPCR implementation based on ModeShape.

       

      While a full PHPCR implementation is quite a significant time investment, the good news is that Jackalope, the PHPCR reference implementation, separates all the in memory management and node validation etc from the actual persistance via a set of so called transport interfaces. The above link to jackalope-jackrabbit is only the code necessary for the implementation of the transport interfaces for Jackrabbit. The key classes can be found here:

      https://github.com/jackalope/jackalope-jackrabbit/tree/master/src/Jackalope/Transport/Jackrabbit/

       

      The transport interfaces are here:

      https://github.com/jackalope/jackalope/tree/master/src/Jackalope/Transport

       

      I must admit we still have our hands full with work on the current transport implementations (Jackrabbit, Doctrine DBAL, MongoDB) so we will likely not soon have the time to start on a ModeShape implementation. So I am writing this message mainly for two reasons:

      1) to validate the importance of working on exposing as many features as possible via an HTTP API

      2) to see if there is someone within the ModeShape community that sees a need for better integration with PHP and is willing to start the effort (we would certainly be willing to support this effort with advice)

       

      BTW: we also have a layer on top of PHPCR, called PHPCR ODM, which provides a hibernate like object persistence mapper but with native support for most of the PHPCR features. Additionally it covers an API to deal with i18n of class properties.

       

      BTW 2: Would also be interesting to have ModeShape run its own test suite on travis-ci.org. Jackrabbit OAK runs its test suite on travis:

      https://travis-ci.org/#!/apache/jackrabbit-oak

        • 1. Re: support ModeShape as a PHPCR persistence layer
          rhauch

          Lukas,

           

          I totally forgot to come back to this thread and give you an answer.

           

          The biggest challenge is going to be that ModeShape does not have a Davex API like Jackrabbit does. It's possible to consider reusing the Jackrabbit DavEx module, as long as that module supports using only the JCR API (e.g., obtaining the Repository instances via the RepositoryFactory) and the module doesn't expect Jackrabbit-specific behavior. That's the path with the least work, and while it may not be a high priority for existing contributors, we'd absolutely welcome anyone who might be interested in helping out.

           

          As for Travis, we use JBoss.org's Jenkins installation and were thinking of augmenting that with some jobs on Cloudbees.

          • 2. Re: support ModeShape as a PHPCR persistence layer
            lsmith77

            I suspect we could use the Jackrabbit implementation as a starting point but will need to make a ModeShape specific version. At any rate I am currently looking to organize some PHPCR summit:

            https://groups.google.com/forum/?hl=en&fromgroups#!topic/phpcr-users/d03nBz2ox4k

             

            Additionally (or as a fallback plan) there will likely be several people (including myself) at FOSDEM 2013 in Brussels. Not sure if anybody from the ModeShape community will be present there.