parameters:
    oro_action.handler.delete.class: Oro\Bundle\ActionBundle\Handler\DeleteHandler
    oro_action.helper.context.class: Oro\Bundle\ActionBundle\Helper\ContextHelper
    oro_action.helper.applications.class: Oro\Bundle\ActionBundle\Helper\ApplicationsHelper
    oro_action.helper.restrict.class: Oro\Bundle\ActionBundle\Helper\RestrictHelper
    oro_action.helper.options.class: Oro\Bundle\ActionBundle\Helper\OptionsHelper
    oro_action.helper.applications_url.class: Oro\Bundle\ActionBundle\Helper\ApplicationsUrlHelper
    oro_action.operation_registry.class: Oro\Bundle\ActionBundle\Model\OperationRegistry
    oro_action.action_group_registry.class: Oro\Bundle\ActionBundle\Model\ActionGroupRegistry
    oro_action.operation_manager.class: Oro\Bundle\ActionBundle\Model\OperationManager
    oro_action.attribute_guesser.class: Oro\Bundle\ActionBundle\Model\AttributeGuesser
    oro_action.options_assembler.class: Oro\Bundle\ActionBundle\Model\OptionsAssembler
    oro_action.form_manager.class: Oro\Bundle\ActionBundle\Model\OperationFormManager
    oro_action.api_manager.class: Oro\Bundle\SoapBundle\Entity\Manager\ApiEntityManager
    oro_action.datagrid.action.action_widget_action.class: Oro\Bundle\ActionBundle\Datagrid\Action\ActionWidgetAction
    oro_action.datagrid.mass_action_provider.registry.class: Oro\Bundle\ActionBundle\Datagrid\Provider\MassActionProviderRegistry
    oro_action.layout.data_provider.actions_data_rpovider.class: Oro\Bundle\ActionBundle\Layout\DataProvider\ActionsProvider

services:
    oro_action.handler.delete:
        class: %oro_action.handler.delete.class%
        arguments:
            - '@oro_soap.handler.delete'
            - '@oro_action.api_manager'
            - '@oro_entity.doctrine_helper'

    oro_action.helper.context:
        class: %oro_action.helper.context.class%
        arguments:
            - '@oro_entity.doctrine_helper'
            - '@property_accessor'
            - '@request_stack'

    oro_action.helper.default_operation_request:
        class: 'Oro\Bundle\ActionBundle\Helper\DefaultOperationRequestHelper'
        public: true
        arguments:
            - '@request_stack'
            - '@oro_action.helper.applications'

    oro_action.helper.applications:
        class: %oro_action.helper.applications.class%
        arguments:
            - '@security.token_storage'

    oro_action.helper.restrict:
        class: %oro_action.helper.restrict.class%

    oro_action.helper.options:
        class: %oro_action.helper.options.class%
        arguments:
            - '@oro_action.helper.context'
            - '@oro_action.options_assembler'
            - '@oro_action.context_accessor'
            - '@oro_action.helper.applications_url'
            - '@translator'

    oro_action.helper.applications_url:
        class: %oro_action.helper.applications_url.class%
        arguments:
            - '@oro_action.helper.applications'
            - '@router'

    oro_action.operation_registry:
        class: %oro_action.operation_registry.class%
        arguments:
            - '@oro_action.configuration.provider.operations'
            - '@oro_action.assembler.operation'
            - '@oro_action.helper.applications'
            - '@oro_entity.doctrine_helper'

    oro_action.action_group_registry:
        class: %oro_action.action_group_registry.class%
        arguments:
            - '@oro_action.configuration.provider.action_groups'
            - '@oro_action.assembler.action_group'

    oro_action.operation_manager:
        class: %oro_action.operation_manager.class%
        arguments:
            - '@oro_action.operation_registry'
            - '@oro_action.action_group_registry'
            - '@oro_action.helper.context'

    oro_action.attribute_guesser:
        class: %oro_action.attribute_guesser.class%
        arguments:
            - '@form.registry'
            - '@doctrine'
            - '@oro_entity_config.provider.entity'
            - '@oro_entity_config.provider.form'
        calls:
            # mapping from doctrine type to attribute parameters
            - [addDoctrineTypeMapping, ["string", "string"]]
            - [addDoctrineTypeMapping, ["integer", "integer"]]
            - [addDoctrineTypeMapping, ["smallint", "integer"]]
            - [addDoctrineTypeMapping, ["bigint", "integer"]]
            - [addDoctrineTypeMapping, ["boolean", "boolean"]]
            - [addDoctrineTypeMapping, ["decimal", "float"]]
            - [addDoctrineTypeMapping, ["date", "object", { class: "DateTime" }]]
            - [addDoctrineTypeMapping, ["time", "object", { class: "DateTime" }]]
            - [addDoctrineTypeMapping, ["datetime", "object", { class: "DateTime" }]]
            - [addDoctrineTypeMapping, ["datetimetz", "object", { class: "DateTime" }]]
            - [addDoctrineTypeMapping, ["text", "string"]]
            - [addDoctrineTypeMapping, ["array", "array"]]
            - [addDoctrineTypeMapping, ["simple_array", "array"]]
            - [addDoctrineTypeMapping, ["json_array", "array"]]
            - [addDoctrineTypeMapping, ["float", "float"]]
            - [addDoctrineTypeMapping, ["guid", "string"]]
            # custom types
            - [addDoctrineTypeMapping, ["percent", "float"]]
            - [addDoctrineTypeMapping, ["money", "float"]]
            # mapping from attribute type to form parameters
            - [addFormTypeMapping, ["string", "text"]]
            - [addFormTypeMapping, ["int", "integer", { precision: 0 }]]
            - [addFormTypeMapping, ["integer", "integer", { precision: 0 }]]
            - [addFormTypeMapping, ["bool", "checkbox"]]
            - [addFormTypeMapping, ["boolean", "checkbox"]]
            - [addFormTypeMapping, ["float", "number"]]

    oro_action.options_assembler:
        class: %oro_action.options_assembler.class%
        calls:
            - [addConfigurationPass, ['@oro_action.configuration_pass.replace_property_path']]

    oro_action.form_manager:
        class: %oro_action.form_manager.class%
        arguments:
            - '@form.factory'
            - '@oro_action.operation_manager'
            - '@oro_action.helper.context'

    oro_action.api_manager:
        class: %oro_action.api_manager.class%
        parent: oro_soap.manager.entity_manager.abstract
        arguments:
            - ''
            - '@doctrine.orm.entity_manager'

    oro_action.datagrid.event_listener.operation:
        class: 'Oro\Bundle\ActionBundle\Datagrid\EventListener\OperationListener'
        arguments:
            - '@oro_action.operation_manager'
            - '@oro_action.helper.context'
            - '@oro_action.datagrid.mass_action_provider.registry'
            - '@oro_action.helper.options'
            - '@oro_datagrid.grid_configuration.helper'
        calls:
            - [setGroups, [['', 'datagridRowAction']]]
        tags:
            - { name: kernel.event_listener, event: oro_datagrid.datagrid.extension.action.configure-actions.before, method: onConfigureActions }

    oro_action.datagrid.extension.delete_mass_action:
        class: Oro\Bundle\ActionBundle\Datagrid\Extension\DeleteMassActionExtension
        arguments:
            - '@oro_entity.doctrine_helper'
            - '@oro_datagrid.grid_configuration.helper'
            - '@oro_action.operation_manager'
        calls:
            - [setGroups, [['', 'datagridRowAction']]]
        tags:
            - { name: oro_datagrid.extension }

    oro_action.datagrid.action.action_widget_action:
        class: %oro_action.datagrid.action.action_widget_action.class%
        arguments:
            - '@translator'
        scope: prototype
        tags:
            - { name: oro_datagrid.extension.action.type, type: action-widget }

    oro_action.datagrid.mass_action_provider.registry:
        class: %oro_action.datagrid.mass_action_provider.registry.class%

    oro_action.layout.data_provider.actions_data_rpovider:
        class: %oro_action.layout.data_provider.actions_data_rpovider.class%
        arguments:
            - '@oro_action.operation_manager'
            - '@oro_action.helper.context'
            - '@oro_action.helper.restrict'
            - '@translator'
        tags:
            - { name: layout.data_provider, alias: actions }

    oro_action.layout.data_provider.action_buttons:
        class: 'Oro\Bundle\ActionBundle\Layout\DataProvider\ActionButtonsProvider'
        arguments:
            - '@oro_action.helper.applications'
            - '@oro_entity.doctrine_helper'
        tags:
            - { name: layout.data_provider, alias: action_buttons }

    oro_action.condition.route_exists:
        class: 'Oro\Bundle\ActionBundle\Condition\RouteExists'
        arguments:
            - '@router'
        tags:
            - { name: oro_action.condition, alias: 'route_exists' }

    oro_action.condition.service_exists:
        class: 'Oro\Bundle\ActionBundle\Condition\ServiceExists'
        arguments:
            - '@service_container'
        tags:
            - { name: oro_action.condition, alias: 'service_exists' }
