Symfony CMF resource-bundle

203 views
Skip to first unread message

Masotti Marco

unread,
Aug 18, 2015, 5:35:48 AM8/18/15
to symfony-...@googlegroups.com
Hello, I'm using the resource-bundle of Symfony CMF.
How can I configure the service "cmf_resource.registry.container" to pass serviceMap in constructor?

I'm using:
        "sonata-project/admin-bundle": "dev-master"
        "sonata-project/doctrine-orm-admin-bundle": "dev-master"
        "symfony-cmf/resource-rest-bundle": "dev-master"

I have imported in app/routing.yml:
_cmf_resource_rest:
    Resource: @CmfResourceRestBundle/Resources/config/routing.yml

that imports the following route:
_cmf_resource:
    pattern: /api/RepositoryName{}/{path}
    requirements:
        path:. *
    defaults:
        _controller: cmf_resource_rest.controller.resource: resourceAction
        _format: json

that is invoked in the template of tree.html.twig SonataDoctrinePHPCRAdminBundle.

But I get an exception:
"Repository with alias \" default \ "has not Been registered, registered aliases: \" \ "

the method getRepositoryServiceId() class ContainerRepositoryRegistry.

How can I set the serviceMap? Where am I wrong?

Thank you in advance,

Marco

Daniel Leech

unread,
Aug 18, 2015, 3:43:21 PM8/18/15
to symfony-...@googlegroups.com
Hi Marco,

The bundles dependency injection configuration takes care of injecting
the service map:

https://github.com/symfony-cmf/ResourceBundle/blob/master/DependencyInjection/Compiler/RegistryPass.php

But I am not sure this is related to your problem. You need to define a
repository with the alias "default" (I am not sure if the bundle should
somehow take care of this automatically).

See the functional tests for an example configuration:

https://github.com/symfony-cmf/ResourceBundle/blob/master/Tests/Resources/app/config/resource.yml

Note that the ResourceBundle is still under development :)

Thanks,

Dan
> --
> You received this message because you are subscribed to the Google Groups
> "symfony-cmf-devs" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [1]symfony-cmf-de...@googlegroups.com.
> For more options, visit [2]https://groups.google.com/d/optout.
>
> References
>
> Visible links
> 1. mailto:symfony-cmf-de...@googlegroups.com
> 2. https://groups.google.com/d/optout

neo...@gmail.com

unread,
Aug 20, 2015, 6:44:53 AM8/20/15
to symfony-cmf-devs
Thanks Dan, it works now.
As you suggested I looked at the configuration of functional tests.

I
defined the repository:

cmf_resource:
repositories:
default:
type: doctrine_phpcr_odm
basepath: ~

Marco
>    For more options, visit [2]https://groups.google.com/d/optout.
>
> References
>
>    Visible links
Reply all
Reply to author
Forward
0 new messages