imports:
    - { resource: services/mapping.yml }

services:
    # default configuration for services in *this* file
    _defaults:
        # automatically injects dependencies in your services
        autowire: true
        # automatically registers your services as commands, event subscribers, etc.
        autoconfigure: true
        # this means you cannot fetch services directly from the container via $container->get()
        # if you need to do this, you can override this setting on individual services
        public: false

    # controllers are imported separately to make sure they're public
    # and have a tag that allows actions to type-hint services
    Pimcore\Bundle\DataImporterBundle\Controller\:
        resource: '../../Controller'
        public: true
        tags: ['controller.service_arguments']

    Pimcore\Bundle\DataImporterBundle\Command\:
        resource: '../../Command'
        tags: ['console.command']


    Pimcore\Bundle\DataImporterBundle\Queue\QueueService: ~
    Pimcore\Bundle\DataImporterBundle\Processing\ExecutionService: ~
    Pimcore\Bundle\DataImporterBundle\Settings\ConfigurationPreparationService: ~
    Pimcore\Bundle\DataImporterBundle\Preview\PreviewService: ~
    Pimcore\Bundle\DataImporterBundle\EventListener\ConfigurationEventSubscriber: ~
    Pimcore\Bundle\DataImporterBundle\EventListener\DataImporterListener:
        tags:
            - { name: kernel.event_listener, event: 'Pimcore\Bundle\DataImporterBundle\Event\PostPreparationEvent', method: importPrepared }

    Pimcore\Bundle\DataImporterBundle\Maintenance\RestartQueueWorkersTask:
        tags:
            - { name: pimcore.maintenance.task, type: data_importer.restart_queue_workers }

    Pimcore\Bundle\DataImporterBundle\DataSource\Loader\DataLoaderFactory: ~

    Pimcore\Bundle\DataImporterBundle\DataSource\Loader\AssetLoader:
        tags:
            - { name: "pimcore.datahub.data_importer.loader", type: "asset" }

    Pimcore\Bundle\DataImporterBundle\DataSource\Loader\UploadLoader:
        tags:
            - { name: "pimcore.datahub.data_importer.loader", type: "upload" }

    Pimcore\Bundle\DataImporterBundle\DataSource\Loader\HttpLoader:
        tags:
            - { name: "pimcore.datahub.data_importer.loader", type: "http" }

    Pimcore\Bundle\DataImporterBundle\DataSource\Loader\SftpLoader:
        tags:
            - { name: "pimcore.datahub.data_importer.loader", type: "sftp" }

    Pimcore\Bundle\DataImporterBundle\DataSource\Loader\PushLoader:
        tags:
            - { name: "pimcore.datahub.data_importer.loader", type: "push" }

    Pimcore\Bundle\DataImporterBundle\DataSource\Loader\SqlLoader:
        tags:
            - { name: "pimcore.datahub.data_importer.loader", type: "sql" }

    Pimcore\Bundle\DataImporterBundle\DataSource\Interpreter\DeltaChecker\DeltaChecker: ~

    Pimcore\Bundle\DataImporterBundle\DataSource\Interpreter\InterpreterFactory: ~

    Pimcore\Bundle\DataImporterBundle\DataSource\Interpreter\CsvFileInterpreter:
        calls:
            - [ setLogger, [ '@logger' ] ]
        tags:
            - { name: monolog.logger, channel: 'DATA-IMPORTER' }
            - { name: "pimcore.datahub.data_importer.interpreter", type: "csv" }

    Pimcore\Bundle\DataImporterBundle\DataSource\Interpreter\XlsxFileInterpreter:
        calls:
            - [ setLogger, [ '@logger' ] ]
        tags:
            - { name: monolog.logger, channel: 'DATA-IMPORTER' }
            - { name: "pimcore.datahub.data_importer.interpreter", type: "xlsx" }

    Pimcore\Bundle\DataImporterBundle\DataSource\Interpreter\JsonFileInterpreter:
        calls:
            - [ setLogger, [ '@logger' ] ]
        tags:
            - { name: monolog.logger, channel: 'DATA-IMPORTER' }
            - { name: "pimcore.datahub.data_importer.interpreter", type: "json" }

    Pimcore\Bundle\DataImporterBundle\DataSource\Interpreter\XmlFileInterpreter:
        calls:
            - [ setLogger, [ '@logger' ] ]
        tags:
            - { name: monolog.logger, channel: 'DATA-IMPORTER' }
            - { name: "pimcore.datahub.data_importer.interpreter", type: "xml" }

    Pimcore\Bundle\DataImporterBundle\DataSource\Interpreter\SqlFileInterpreter:
        calls:
            - [ setLogger, [ '@logger' ] ]
        tags:
            - { name: monolog.logger, channel: 'DATA-IMPORTER' }
            - { name: "pimcore.datahub.data_importer.interpreter", type: "sql" }

    Pimcore\Bundle\DataImporterBundle\Cleanup\CleanupStrategyFactory: ~

    Pimcore\Bundle\DataImporterBundle\Cleanup\DeleteStrategy:
        tags:
            - { name: "pimcore.datahub.data_importer.cleanup", type: "delete" }

    Pimcore\Bundle\DataImporterBundle\Cleanup\UnpublishStrategy:
        tags:
            - { name: "pimcore.datahub.data_importer.cleanup", type: "unpublish" }

    Pimcore\Bundle\DataImporterBundle\Resolver\ResolverFactory: ~
    Pimcore\Bundle\DataImporterBundle\Resolver\Resolver: ~

    Pimcore\Bundle\DataImporterBundle\Resolver\Load\IdStrategy:
        tags:
            - { name: "pimcore.datahub.data_importer.resolver.load", type: "id" }

    Pimcore\Bundle\DataImporterBundle\Resolver\Load\PathStrategy:
        tags:
            - { name: "pimcore.datahub.data_importer.resolver.load", type: "path" }

    Pimcore\Bundle\DataImporterBundle\Resolver\Load\AttributeStrategy:
        tags:
            - { name: "pimcore.datahub.data_importer.resolver.load", type: "attribute" }

    Pimcore\Bundle\DataImporterBundle\Resolver\Load\NotLoadStrategy:
        tags:
            - { name: "pimcore.datahub.data_importer.resolver.load", type: "notLoad" }

    Pimcore\Bundle\DataImporterBundle\Resolver\Location\FindParentStrategy:
        tags:
            - { name: "pimcore.datahub.data_importer.resolver.location", type: "findParent" }

    Pimcore\Bundle\DataImporterBundle\Resolver\Location\FindOrCreateFolderStrategy:
        tags:
            - { name: "pimcore.datahub.data_importer.resolver.location", type: "findOrCreateFolder" }

    Pimcore\Bundle\DataImporterBundle\Resolver\Location\NoChangeStrategy:
        tags:
            - { name: "pimcore.datahub.data_importer.resolver.location", type: "noChange" }

    Pimcore\Bundle\DataImporterBundle\Resolver\Location\StaticPathStrategy:
        tags:
            - { name: "pimcore.datahub.data_importer.resolver.location", type: "staticPath" }

    Pimcore\Bundle\DataImporterBundle\Resolver\Location\DoNotCreateStrategy:
        tags:
            - { name: "pimcore.datahub.data_importer.resolver.location", type: "doNotCreate" }

    Pimcore\Bundle\DataImporterBundle\Resolver\Publish\AlwaysPublishStrategy:
        tags:
            - { name: "pimcore.datahub.data_importer.resolver.publish", type: "alwaysPublish" }

    Pimcore\Bundle\DataImporterBundle\Resolver\Publish\AttributeBasedStrategy:
        tags:
            - { name: "pimcore.datahub.data_importer.resolver.publish", type: "attributeBased" }

    Pimcore\Bundle\DataImporterBundle\Resolver\Publish\NoChangePublishNewStrategy:
        tags:
            - { name: "pimcore.datahub.data_importer.resolver.publish", type: "noChangePublishNew" }

    Pimcore\Bundle\DataImporterBundle\Resolver\Publish\NoChangeUnpublishNewStrategy:
        tags:
            - { name: "pimcore.datahub.data_importer.resolver.publish", type: "noChangeUnpublishNew" }

    Pimcore\Bundle\DataImporterBundle\Resolver\Factory\DataObjectFactory:
        tags:
            - { name: "pimcore.datahub.data_importer.resolver.factory", type: "dataObject" }


    Pimcore\Bundle\DataImporterBundle\Processing\ImportProcessingService:
        calls:
            - [ setLogger, [ '@logger' ] ]
        tags:
            - { name: monolog.logger, channel: 'DATA-IMPORTER' }

    Pimcore\Bundle\DataImporterBundle\Processing\ImportPreparationService:
        calls:
            - [ setLogger, [ '@logger' ] ]
        tags:
            - { name: monolog.logger, channel: 'DATA-IMPORTER' }

    Pimcore\Bundle\DataImporterBundle\Tool\DataObjectLoader: ~

    # The migration installer needs the bundle it is operating on upon construction to be able to build its migration configuration.
    # As bundles can't be directly used as service argument, we need to make use of the expression language to fetch the bundle
    # from the kernel upon construction.
    Pimcore\Bundle\DataImporterBundle\Installer:
        public: true
        arguments:
            # fetch the bundle via expression language
            $bundle: "@=service('kernel').getBundle('PimcoreDataImporterBundle')"


    Pimcore\Bundle\DataImporterBundle\Messenger\DataImporterHandler:
        tags:
            - { name: messenger.message_handler }