Progress on PHPCR with a hackday
12.5.2011I repost some of my blog posts made @ liip. Please see here for the original post and comments: http://blog.liip.ch/archive/2011/05/12/progress-on-phpcr-with-a-hackday.html
This weekend we had a hackday on PHPCR. The goal was to coordinate the efforts of Midgard to implement PHPCR with the Jackalope project. We ended up doing a few important cleanups to the PHPCR API definition (see below). We had Henri and Eero from the Midgard project, Benjamin from the Doctrine project and Jordi, Lukas, Chregu and myself (David) from Liip. On the second day, Uwe, Johannes and Dan join us to push the PHPCR doctrine layer further.
We had Henri and Eero from the Midgard project. They will write a separate PHPCR implementation for Midgard2 so that we will have to independant PHPCR implementations. This will ensure that the API specification is precise and the phpcr-api-tests do what they are supposed to do. It forces us to clean up the api tests and move all dependencies to Jackalope into Jackalope.
For the old version of the Midgard content repository, Henri and Eero will implement a transport for Jackalope.
Benjamin is implementing a transport for Jackalope that uses Doctrine DBAL and can thus directly use plain SQL databases. With now 3 different transports, we discussed the inner workings of Jackalope and adjusted the transport interfaces in a few places. I have a list of refactorings I have to do on jackalope to have really only the transport be depending on the backend.
Once the DBAL transport is ready, somebody could write a plain filesystem transport that dumps json files into the file system. Ids can be stored in files in a separate folder and just contain the current path of the node they reference and be updated whenever the node is moved. Who wants to do this? I am sure it would be fun!
On monday, we also had Uwe Jäger with us. He has been working on the doctrine phpcr odm layer and we finally got to clean up and import his changes to have a child annotation. Yes, thats right, you can now use an annotation in your documents to have a child document as a field. See the README of phpcr-odm for details. This opens the road to do a more general children annotation, as well as parent and references. I compiled a long roadmap for phpcr-odm. In the process of getting the child annotation working, we also enabled mapping your documents to other node types. This includes having mixin node types working in Jackalope. When updating to the latest phpcr-odm, you need to do a few changes to the jackrabbit setup. The document alias is no longer stored as property _doctrine_alias, but properly namespaced as as phpcr:alias and defined by the mixin type phpcr:managed.
Henri presented the VIE editor that can be plugged into any web site for frontend editing. The editor is stand alone and independant of the web presentation layer. By simply including the javascript and providing a REST API, you get frontend editing that can store the changes. This sounds like a good plan for the symfony cmf. We did not have time to investigate yet, so if somebody wants to pick this task up, please get in contact!
We also discussed possible reuse of symfony components in midgard mvc and the potential for cooperation between the midgard mvc and the symfony cmf project. There is nothing to announce at the moment, but we will continue investigating the possibilities.
If you update your projects, you might notice some of the following changes PHPCR:
- PropertyInterface::getNativeValue was simplified to PropertyInterface::getValue
- We finally dropped the BinaryInterface, as a PHP resource together with the property containing the binary to get the lenght have the same power
- PropertyInterface::getBoolean is now following php logic and not java logic (everything that is not null, 0 or boolean false is true)
- PropertyInterface::getDecimal must be string and not double, as we need arbitrary precision math. The string can be used with the BC math extension
- RepositoryFactoryInterface::getConfigurationKeys() to get list of config options
The next Symfony2 CMF event is the CMF day in Italy, end of July. See you there...