<?xml version="1.0" encoding="UTF-8" ?>

<container xmlns="http://symfony.com/schema/dic/services"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">

    <services>
        <service id="sonata.admin.pool" class="Sonata\AdminBundle\Admin\Pool">
            <argument type="service" id="service_container" />
            <argument />
            <argument />
            <argument type="collection" />
            <argument type="collection" />

            <call method="setTemplates">
                <argument>%sonata.admin.configuration.templates%</argument>
            </call>
        </service>

        <service id="sonata.admin.route_loader" class="Sonata\AdminBundle\Route\AdminPoolLoader">
            <argument type="service" id="sonata.admin.pool" />
            <argument />
            <argument type="service" id="service_container" />
            <tag name="routing.loader" />
        </service>

        <service id="sonata.admin.helper" class="Sonata\AdminBundle\Admin\AdminHelper">
            <argument type="service" id="sonata.admin.pool" />
        </service>

        <service id="sonata.admin.builder.filter.factory" class="Sonata\AdminBundle\Filter\FilterFactory">
            <argument type="service" id="service_container" />
            <argument />
        </service>

        <!-- Services used to format the label, default is sonata.admin.label.strategy.noop -->
        <service id="sonata.admin.label.strategy.bc" class="Sonata\AdminBundle\Translator\BCLabelTranslatorStrategy" />
        <service id="sonata.admin.label.strategy.native" class="Sonata\AdminBundle\Translator\NativeLabelTranslatorStrategy" />
        <service id="sonata.admin.label.strategy.noop" class="Sonata\AdminBundle\Translator\NoopLabelTranslatorStrategy" />
        <service id="sonata.admin.label.strategy.underscore" class="Sonata\AdminBundle\Translator\UnderscoreLabelTranslatorStrategy" />
        <service id="sonata.admin.label.strategy.form_component" class="Sonata\AdminBundle\Translator\FormLabelTranslatorStrategy" />

        <!-- Translation extractor -->
        <service id="sonata.admin.translator.extractor.jms_translator_bundle" class="Sonata\AdminBundle\Translator\Extractor\JMSTranslatorBundle\AdminExtractor" >
            <tag name="jms_translation.extractor" alias="sonata_admin"/>
            <argument type="service" id="sonata.admin.pool" />
            <argument type="service" id="logger" on-invalid="ignore" />
        </service>

        <!-- controller as services -->
        <service id="sonata.admin.controller.admin" class="Sonata\AdminBundle\Controller\HelperController">
            <argument type="service" id="twig" />
            <argument type="service" id="sonata.admin.pool" />
            <argument type="service" id="sonata.admin.helper" />
            <argument type="service" id="validator" />
        </service>

        <!-- audit manager -->
        <service id="sonata.admin.audit.manager" class="Sonata\AdminBundle\Model\AuditManager">
            <argument type="service" id="service_container" />
        </service>

        <service id="sonata.admin.exporter" class="Sonata\AdminBundle\Export\Exporter" />

        <service id="sonata.admin.search.handler" class="Sonata\AdminBundle\Search\SearchHandler">
            <argument type="service" id="sonata.admin.pool" />
        </service>

        <!-- event -->
        <service id="sonata.admin.event.extension" class="Sonata\AdminBundle\Event\AdminEventExtension">
            <argument type="service" id="event_dispatcher" />
        </service>
    </services>
</container>
