symfony-cmf/cmf-sandbox — pull request #159 by rmsint (2013-02-17 14:53:35+00:00)
Title: [WIP] sonata media example

This PR adds an example implementation for the SonataMediaBundle.

Related to https://github.com/sonata-project/SonataMediaBundle/pull/271

Questions:
* No frontend example is added, what do we add?
* a banner with sponsor logo's could be added or a slide show with a short intro etc.
* will there also be an example created for the [SlideshowBlock](https://github.com/symfony-cmf/BlockBundle/pull/32)? Then the examples should be in sync, maybe devided or of each example has several implementations.
* for media fixtures see the object sharing issue mentioned underneath
* "web/media/cache" dir for LiipImagineBundle is not automatically created + permissions have to be set for "web/uploads", document that this has to be done? see also ["Setting up Permissions"](http://symfony.com/doc/current/book/installation.html#configuration-and-setup)

The following subjects / issues I could not solve:
* fix bug with annotations - PrePersist/PreUpdate not being called, see:
[here] (https://github.com/beeldspraak/cmf-sandbox/blob/sonata_media/src/Sandbox/BannerBundle/Admin/ImageBlockAdmin.php#L61)
and [here](https://github.com/beeldspraak/cmf-sandbox/blob/sonata_media/src/Sandbox/BannerBundle/Document/ImageBlock.php#L91)
* jackrabbit (works with dbal) ReferenceOne to media: "ConstraintViolationException: HTTP 409: Unable to perform operation. Node is protected. ", see:
[here](https://github.com/beeldspraak/cmf-sandbox/blob/sonata_media/src/Sandbox/BannerBundle/Document/BannerImage.php#L47)
and [here](https://github.com/beeldspraak/cmf-sandbox/blob/sonata_media/src/Sandbox/MediaBundle/Resources/config/doctrine/GalleryHasMedia.phpcr.xml#L9)
* doctrine configuration referenceable="true" is not detected on mapped-superclass, has to be defined on the document extending the mapper superclass
* Doctrine PHPCR DataFixtures cannot share objects between fixtures, as described [here](http://symfony.com/doc/current/bundles/DoctrineFixturesBundle/index.html#sharing-objects-between-fixtures)
* Implement doctrine integration for PHPCR in JMSDIExtra to be able to inject base paths in Repository classes, see:
[here](https://github.com/beeldspraak/cmf-sandbox/blob/sonata_media/src/Sandbox/MediaBundle/Document/MediaRepository.php#L18)
, [here](https://github.com/beeldspraak/cmf-sandbox/blob/sonata_media/src/Sandbox/MediaBundle/Document/GalleryRepository.php#L18)
and [here](https://github.com/beeldspraak/cmf-sandbox/blob/sonata_media/app/config/config.yml#L351)