parameters:
    oro_attachment.manager.attachment_manager.class:      Oro\Bundle\AttachmentBundle\Manager\AttachmentManager
    oro_attachment.listener.file_listener.class:          Oro\Bundle\AttachmentBundle\EventListener\FileListener

    oro_attachment.entity.class:                          Oro\Bundle\AttachmentBundle\Entity\Attachment
    oro_attachment.manager.api.class:                     Oro\Bundle\SoapBundle\Entity\Manager\ApiEntityManager

    oro_attachment.twig.file_extension.class:             Oro\Bundle\AttachmentBundle\Twig\FileExtension

    oro_attachment.entity_config_dumper.extension.file.class:  Oro\Bundle\AttachmentBundle\Tools\FileEntityConfigDumperExtension
    oro_attachment.entity_config_dumper.extension.class:  Oro\Bundle\AttachmentBundle\Tools\AttachmentConfigDumperExtension
    oro_attachment.entity_generator.extension.class:      Oro\Bundle\AttachmentBundle\Tools\AttachmentEntityGeneratorExtension
    oro_attachment.migration.extension.attachment.class:  Oro\Bundle\AttachmentBundle\Migration\Extension\AttachmentExtension

    oro_attachment.serializer.file_normalizer.class:      Oro\Bundle\AttachmentBundle\ImportExport\FileNormalizer

    oro_attachment.placeholder.filter.class:              Oro\Bundle\AttachmentBundle\Placeholder\PlaceholderFilter
    oro_attachment.attachment_grid_listener:              Oro\Bundle\AttachmentBundle\EventListener\AttachmentGridListener

    oro_attachment.datagrid.action.dialog.class:          Oro\Bundle\AttachmentBundle\DataGrid\Action\DialogAction

services:
    oro_attachment.manager:
        class: %oro_attachment.manager.attachment_manager.class%
        arguments: [@knp_gaufrette.filesystem_map, @router, @oro_security.security_facade.link, %oro_attachment.files%]

    oro_attachment.manager.api:
        class: %oro_attachment.manager.api.class%
        parent: oro_soap.manager.entity_manager.abstract
        arguments:
            - %oro_attachment.entity.class%
            - @doctrine.orm.entity_manager

    oro_attachment.listener.file_listener:
        class: %oro_attachment.listener.file_listener.class%
        arguments: [@oro_attachment.manager]
        tags:
            - { name: doctrine.event_listener, event: prePersist }
            - { name: doctrine.event_listener, event: preUpdate }
            - { name: doctrine.event_listener, event: postPersist }
            - { name: doctrine.event_listener, event: postUpdate }

    oro_attachment.twig.file_extension:
        class: %oro_attachment.twig.file_extension.class%
        arguments: [@oro_attachment.manager, @oro_entity_config.config_manager, @doctrine]
        tags:
            - { name: twig.extension }

    oro_attachment.entity_config_dumper.extension.file:
        class: %oro_attachment.entity_config_dumper.extension.file.class%
        arguments:
            - @oro_entity_config.config_manager
            - @oro_entity_extend.relation_builder
        tags:
            - { name: oro_entity_extend.entity_config_dumper_extension }

    oro_attachment.entity_config_dumper.extension:
        class: %oro_attachment.entity_config_dumper.extension.class%
        parent: oro_entity_extend.entity_config_dumper.extension.association
        tags:
            - { name: oro_entity_extend.entity_config_dumper_extension }

    oro_attachment.entity_generator.extension:
        class: %oro_attachment.entity_generator.extension.class%
        tags:
            - { name: oro_entity_extend.entity_generator_extension }


    oro_attachment.migration.extension.attachment:
        class: %oro_attachment.migration.extension.attachment.class%
        tags:
            - { name: oro_migration.extension, extension_name: attachment }

    oro_attachment.serializer.file_normalizer:
        class: %oro_attachment.serializer.file_normalizer.class%
        calls:
            - [setAttachmentManager, [@oro_attachment.manager]]
            - [setValidator, [@oro_attachment.validator.file_config_validator]]
        tags:
            - { name: oro_importexport.normalizer}

    oro_attachment.placeholder.filter:
        class: %oro_attachment.placeholder.filter.class%
        arguments:
            - @oro_entity_config.provider.attachment
            - @oro_entity_config.provider.entity

    oro_attachment.event_listener.attachment_grid_listener:
        class: %oro_attachment.attachment_grid_listener%
        arguments:
            - [entityId]
        tags:
            - { name: kernel.event_listener, event: oro_datagrid.datagrid.build.after.attachment-grid, method: onBuildAfter }
            - { name: kernel.event_listener, event: oro_datagrid.datagrid.build.before.attachment-grid, method: onBuildBefore }

    #
    #Datagrid
    #
    oro_attachment.datagrid.action.dialog:
        class: %oro_attachment.datagrid.action.dialog.class%
        scope: prototype
        tags:
            - { name: oro_datagrid.extension.action.type, type: dialog }
