parameters:
    oro_navigation.entity.navigation_item.class:               Oro\Bundle\NavigationBundle\Entity\NavigationItem
    oro_navigation.entity.navigation_history_item.class:       Oro\Bundle\NavigationBundle\Entity\NavigationHistoryItem
    oro_navigation.entity.pinbar_tab.class:                    Oro\Bundle\NavigationBundle\Entity\PinbarTab
    oro_navigation.entity.page_state.class:                    Oro\Bundle\NavigationBundle\Entity\PageState

    oro_menu.factory.acl_extension.class:                      Oro\Bundle\NavigationBundle\Menu\AclAwareMenuFactoryExtension
    oro_menu.factory.class:                                    Knp\Menu\MenuFactory
    oro_menu.configuration_resolver.class:                     Oro\Component\Config\Resolver\SystemAwareResolver
    oro_menu.builder_chain.class:                              Oro\Bundle\NavigationBundle\Provider\BuilderChainProvider
    oro_menu.configuration_builder.class:                      Oro\Bundle\NavigationBundle\Menu\ConfigurationBuilder
    oro_menu.twig.extension.class:                             Oro\Bundle\NavigationBundle\Twig\MenuExtension

    oro_navigation.navigation_item_menu.builder.class:         Oro\Bundle\NavigationBundle\Menu\NavigationItemBuilder
    oro_navigation.navigation_history_menu.builder.class:      Oro\Bundle\NavigationBundle\Menu\NavigationHistoryBuilder
    oro_navigation.navigation_mostviewed_menu.builder.class:   Oro\Bundle\NavigationBundle\Menu\NavigationMostviewedBuilder

    oro_navigation.item.builder.pinbar.class:                  Oro\Bundle\NavigationBundle\Entity\Builder\PinbarTabBuilder
    oro_navigation.item.builder.favorite.class:                Oro\Bundle\NavigationBundle\Entity\Builder\NavigationItemBuilder
    oro_navigation.item.builder.history.class:                 Oro\Bundle\NavigationBundle\Entity\Builder\HistoryItemBuilder
    oro_navigation.item.factory.class:                         Oro\Bundle\NavigationBundle\Entity\Builder\ItemFactory
    oro_navigation.item.pinbar.post_persist_listener.class:    Oro\Bundle\NavigationBundle\Entity\Listener\PinbarPostPersist

    oro_navigation.event.response_history.listener.class:      Oro\Bundle\NavigationBundle\Event\ResponseHistoryListener
    oro_navigation.event.response_hashnav.listener.class:      Oro\Bundle\NavigationBundle\Event\ResponseHashnavListener
    oro_navigation.event.doctrine_tag_listener.class:          Oro\Bundle\NavigationBundle\Event\DoctrineTagEventListener
    oro_navigation.event.master_request_route_listener.class:  Oro\Bundle\NavigationBundle\Event\AddMasterRequestRouteListener

    oro_navigation.menu.matcher.voter.request:                 Oro\Bundle\NavigationBundle\Menu\Matcher\Voter\RequestVoter
    oro_navigation.menu.matcher.voter.routepattern:            Oro\Bundle\NavigationBundle\Menu\Matcher\Voter\RoutePatternVoter

    oro_navigation.title_service.class:                        Oro\Bundle\NavigationBundle\Provider\TitleService
    oro_navigation.title_provider.class:                       Oro\Bundle\NavigationBundle\Provider\TitleProvider
    oro_navigation.title_translator.class:                     Oro\Bundle\NavigationBundle\Provider\TitleTranslator
    oro_navigation.title_service.twig.extension.class:         Oro\Bundle\NavigationBundle\Twig\TitleExtension
    oro_navigation.title_service.annotations_reader.class:     Oro\Bundle\NavigationBundle\Title\TitleReader\AnnotationsReader
    oro_navigation.title_service.config_reader.class:          Oro\Bundle\NavigationBundle\Title\TitleReader\ConfigReader
    oro_navigation.title_service.event.request.listener.class: Oro\Bundle\NavigationBundle\Event\RequestTitleListener

    oro_navigation.translation.extractor.class:                Oro\Bundle\NavigationBundle\Title\TranslationExtractor

    oro_navigation.twig_hash_nav_extension.class:              Oro\Bundle\NavigationBundle\Twig\HashNavExtension

    oro_navigation.form.type.pagestate.class:                  Oro\Bundle\NavigationBundle\Form\Type\PageStateType
    oro_navigation.form.handler.pagestate.class:               Oro\Bundle\NavigationBundle\Form\Handler\PageStateHandler

    oro_navigation.breadcrumbs_manager.class:                  Oro\Bundle\NavigationBundle\Menu\BreadcrumbManager
    oro_navigation.chain_breadcrumbs_manager.class:            Oro\Bundle\NavigationBundle\Menu\ChainBreadcrumbManager

    oro_navigation.twig.content_tags.class:                    Oro\Bundle\NavigationBundle\Twig\ContentTagsExtension
    oro_navigation.content.topic_sender.class:                 Oro\Bundle\NavigationBundle\Content\TopicSender
    oro_navigation.content.tag_generator_chain.class:          Oro\Bundle\NavigationBundle\Content\TagGeneratorChain
    oro_navigation.content.doctrine_tag_generator.class:       Oro\Bundle\NavigationBundle\Content\DoctrineTagGenerator
    oro_navigation.content.simple_tag_generator.class:         Oro\Bundle\NavigationBundle\Content\SimpleTagGenerator
    oro_navigation.content.datagrid_tag_listener.class:        Oro\Bundle\NavigationBundle\Content\DataGridTagListener

services:
    oro_menu.cache:
        parent: oro.cache.abstract
        calls:
            - [ setNamespace, [ 'oro_menu' ] ]

    oro_menu_acl_extension:
        class: %oro_menu.factory.acl_extension.class%
        arguments:
            - '@router'
            - '@oro_security.security_facade.link'
        calls:
            - [ setCache, [ '@oro_menu.cache' ] ]

    oro_menu_feature_extension:
        class: 'Oro\Bundle\NavigationBundle\Menu\FeatureAwareMenuFactoryExtension'
        arguments:
            - '@oro_featuretoggle.checker.feature_checker'

    oro_menu.factory:
        class: %oro_menu.factory.class%
        calls:
            - [ addExtension, [ '@oro_menu_feature_extension' ] ]
            - [ addExtension, [ '@oro_menu_acl_extension' ] ]

    oro_menu.builder_chain:
        class: %oro_menu.builder_chain.class%
        arguments:
            - '@oro_menu.factory'
            - '@event_dispatcher'
        tags:
            - { name: knp_menu.provider }

    oro_menu.configuration_resolver:
        class: %oro_menu.configuration_resolver.class%
        arguments:
            - '@service_container'

    oro_menu.configuration_builder:
        class: %oro_menu.configuration_builder.class%
        arguments:
            - '@oro_menu.configuration_resolver'
        tags:
            - { name: oro_menu.builder }

    oro_menu.twig.extension:
        class: %oro_menu.twig.extension.class%
        arguments:
            - '@knp_menu.helper'
            - '@oro_menu.builder_chain'
            - '@oro_navigation.breadcrumb_manager'
        calls:
          - [ setBreadcrumbManager, [ '@oro_navigation.chain_breadcrumb_manager' ]]
        tags:
            - { name: twig.extension }

    oro_navigation.item.builder.pinbar:
        class: %oro_navigation.item.builder.pinbar.class%
        arguments:
            - '@doctrine.orm.entity_manager'
        calls:
            - [ setClassName, [ %oro_navigation.entity.pinbar_tab.class% ]]
            - [ setNavigationItemClassName, [ %oro_navigation.entity.navigation_item.class% ]]
        tags:
            - { name: oro_navigation.item.builder, alias: pinbar }

    oro_navigation.item.builder.favorite:
        class: %oro_navigation.item.builder.favorite.class%
        arguments:
            - '@doctrine.orm.entity_manager'
        calls:
            - [ setClassName, [ %oro_navigation.entity.navigation_item.class% ]]
        tags:
            - { name: oro_navigation.item.builder, alias: favorite }

    oro_navigation.item.builder.history:
        class: %oro_navigation.item.builder.history.class%
        arguments:
            - '@doctrine.orm.entity_manager'
        calls:
            - [ setClassName, [ %oro_navigation.entity.navigation_history_item.class% ]]
        tags:
            - { name: oro_navigation.item.builder, alias: history }

    oro_navigation.item.builder.mostviewed:
        class: %oro_navigation.item.builder.history.class%
        arguments:
            - '@doctrine.orm.entity_manager'
        calls:
            - [ setClassName, [ %oro_navigation.entity.navigation_history_item.class% ]]
        tags:
            - { name: oro_navigation.item.builder, alias: mostviewed }

    oro_navigation.item.factory:
        class: %oro_navigation.item.factory.class%

    oro_navigation.item.pinbar.post_persist_listener:
        class: %oro_navigation.item.pinbar.post_persist_listener.class%
        calls:
            - [ setClassName, [ %oro_navigation.entity.pinbar_tab.class% ]]
        tags:
            - { name: doctrine.event_listener, event: postPersist }

    oro_navigation.pinbar_menu.builder:
        class: %oro_navigation.navigation_item_menu.builder.class%
        arguments:
            - '@security.context'
            - '@doctrine.orm.entity_manager'
            - '@oro_navigation.item.factory'
        tags:
            - { name: oro_menu.builder, alias: pinbar }

    oro_navigation.favorites_menu.builder:
        class: %oro_navigation.navigation_item_menu.builder.class%
        arguments:
            - '@security.context'
            - '@doctrine.orm.entity_manager'
            - '@oro_navigation.item.factory'
        tags:
            - { name: oro_menu.builder, alias: favorite }

    oro_navigation.history_menu.builder:
        class: %oro_navigation.navigation_history_menu.builder.class%
        arguments:
            - '@security.context'
            - '@doctrine.orm.entity_manager'
            - '@oro_navigation.item.factory'
        calls:
            - [ setMatcher, [ '@knp_menu.matcher' ]]
            - [ setOptions, [ '@oro_config.user' ]]
        tags:
            - { name: oro_menu.builder, alias: history }

    oro_navigation.mostviewed_menu.builder:
        class: %oro_navigation.navigation_mostviewed_menu.builder.class%
        arguments:
            - '@security.context'
            - '@doctrine.orm.entity_manager'
            - '@oro_navigation.item.factory'
        calls:
            - [ setOptions, [ '@oro_config.user' ]]
        tags:
            - { name: oro_menu.builder, alias: mostviewed }

    knp_voter_request:
        class: %oro_navigation.menu.matcher.voter.request%
        tags:
            - { name: knp_menu.voter, request: true }

    knp_menu.voter.router:
        class: %oro_navigation.menu.matcher.voter.routepattern%
        tags:
            - { name: knp_menu.voter, request: true }

    kernel.listener.nav_history_response:
        class: %oro_navigation.event.response_history.listener.class%
        tags:
            - { name: kernel.event_listener, event: kernel.response, method: onResponse }
        arguments:
            - '@oro_navigation.item.factory'
            - '@security.context'
            - '@doctrine'
            - '@oro_navigation.title_service'
        calls:
            - [ setHistoryItemEntityFQCN, [ %oro_navigation.entity.navigation_history_item.class% ]]
            - [ setUserEntityFQCN, [ %oro_user.entity.class% ]]
            - [ setNavigationHistoryItemType, ['history']]

    oro_navigation.event.doctrine_tag_listener:
        class: %oro_navigation.event.doctrine_tag_listener.class%
        arguments:
            - '@oro_navigation.content.topic_sender'
            - %installed%
        calls:
            - [ markSkipped, ['Oro\Bundle\DataAuditBundle\Entity\Audit']]
            - [ markSkipped, ['Oro\Bundle\DataAuditBundle\Entity\AuditData']]
            - [ markSkipped, ['Oro\Bundle\NavigationBundle\Entity\PageState']]
            - [ markSkipped, ['Oro\Bundle\NavigationBundle\Entity\NavigationHistoryItem']]
            - [ markSkipped, ['Oro\Bundle\SearchBundle\Entity\Item']]
            - [ markSkipped, ['Oro\Bundle\SearchBundle\Entity\IndexText']]
            - [ markSkipped, ['Oro\Bundle\SearchBundle\Entity\IndexInteger']]
            - [ markSkipped, ['Oro\Bundle\SearchBundle\Entity\IndexDecimal']]
            - [ markSkipped, ['Oro\Bundle\SearchBundle\Entity\IndexDatetime']]
            - [ markSkipped, ['Akeneo\Bundle\BatchBundle\Entity\JobExecution']]
            - [ markSkipped, ['Akeneo\Bundle\BatchBundle\Entity\StepExecution']]
            - [ markSkipped, ['Akeneo\Bundle\BatchBundle\Entity\JobInstance']]
            - [ markSkipped, ['JMS\JobQueueBundle\Entity\Job']]
        tags:
            - { name: doctrine.event_listener, event: onFlush, connection: default }
            - { name: doctrine.event_listener, event: postFlush, connection: default }

    oro_navigation.event.master_request_route_listener:
        class: %oro_navigation.event.master_request_route_listener.class%
        tags:
            - { name: kernel.event_listener, event: kernel.request, method: onKernelRequest }

    oro_navigation.event.js_routing_dump_listener:
        class: Oro\Bundle\NavigationBundle\Event\JsRoutingDumpListener
        arguments:
            - '@oro_ui.dynamic_asset_version_manager'
        tags:
            - { name: kernel.event_listener, event: console.command, method: onConsoleCommand }

    oro_navigation.content.topic_sender:
        class: %oro_navigation.content.topic_sender.class%
        arguments:
            - '@oro_wamp.publisher'
            - '@oro_navigation.content.tag_generator_chain.link'
            - '@oro_navigation.content.security.context.linksss'
            - '@logger'

    oro_navigation.content.tag_generator_chain.link:
        tags:
            - { name: oro_service_link,  service: oro_navigation.content.tag_generator_chain }

    oro_navigation.content.security.context.linksss:
        tags:
            - { name: oro_service_link,  service: security.context }

    oro_navigation.title_service:
        class: %oro_navigation.title_service.class%
        arguments:
          - '@oro_navigation.title_annotations_reader'
          - '@oro_navigation.title_config_reader'
          - '@oro_navigation.title_translator'
          - '@doctrine.orm.entity_manager'
          - '@serializer'
          - '@oro_config.user'
          - '@oro_navigation.chain_breadcrumb_manager.link'
          - '@oro_navigation.title_provider'

    oro_navigation.title_provider:
        class: %oro_navigation.title_provider.class%
        public: false
        arguments:
          - '@oro_entity.doctrine_helper'

    oro_navigation.title_translator:
        class: %oro_navigation.title_translator.class%
        public: false
        arguments:
          - '@translator.default'
          - '@oro_config.user'

    oro_navigation.title_annotations_reader:
        class:                        %oro_navigation.title_service.annotations_reader.class%
        arguments:                    ["@kernel", "@annotation_reader"]

    oro_navigation.title_config_reader:
        class:                        %oro_navigation.title_service.config_reader.class%

    oro_navigation.title_service.twig.extension:
        class: %oro_navigation.title_service.twig.extension.class%
        arguments:
            - '@oro_navigation.title_service'
        tags:
            - { name: twig.extension }

    kernel.listener.title_service.request_listener:
        class: %oro_navigation.title_service.event.request.listener.class%
        tags:
            - { name: kernel.event_listener, priority: -255, event: kernel.request, method: onKernelRequest }
        arguments:
            - '@oro_navigation.title_service'

    oro_navigation.translation.extractor:
        class: %oro_navigation.translation.extractor.class%
        arguments:
            - '@oro_navigation.title_service'
            - '@router'
        tags:
            - { name: translation.extractor, alias: navigation_translation_extractor }

    oro_navigation.form.pagestate:
        class:                        Symfony\Component\Form\Form
        factory_method:               createNamed
        factory_service:              form.factory
        arguments:                    ["pagestate", "pagestate", null]

    oro_navigation.form.type.pagestate:
        class:                        %oro_navigation.form.type.pagestate.class%
        tags:
            - { name: form.type, alias: pagestate }

    oro_navigation.form.handler.pagestate:
        class:                        %oro_navigation.form.handler.pagestate.class%
        scope:                        request
        arguments:                    ["@oro_navigation.form.pagestate", "@request", "@doctrine.orm.entity_manager", "@security.context"]

    kernel.listener.hashnav_response:
        class: %oro_navigation.event.response_hashnav.listener.class%
        arguments:
            - '@security.context'
            - '@templating'
            - %kernel.debug%
        tags:
            - { name: kernel.event_listener, event: kernel.response, method: onResponse }

    oro_navigation.twig.hash_nav_extension:
        class:        %oro_navigation.twig_hash_nav_extension.class%
        tags:
            - { name: twig.extension }
            - { name: kernel.event_listener, event: kernel.request, method: onKernelRequest }

    oro_navigation.breadcrumb_manager:
        class: %oro_navigation.breadcrumbs_manager.class%
        arguments:
            - '@oro_menu.builder_chain'
            - '@knp_menu.matcher'
            - '@router'

    oro_navigation.chain_breadcrumb_manager.link:
        tags:
            - { name: oro_service_link,  service: oro_navigation.chain_breadcrumb_manager }

    oro_navigation.chain_breadcrumb_manager:
        class: %oro_navigation.chain_breadcrumbs_manager.class%
        calls:
          - [ setDefaultManager, [ '@oro_navigation.breadcrumb_manager' ]]

    oro_navigation.twig.content_tags:
        class: %oro_navigation.twig.content_tags.class%
        arguments:
            - '@oro_navigation.content.tag_generator_chain'
        tags:
            - { name: twig.extension }

    oro_navigation.content.tag_generator_chain:
        class: %oro_navigation.content.tag_generator_chain.class%
        arguments:
            - []

    oro_navigation.content.doctrine_tag_generator:
        class: %oro_navigation.content.doctrine_tag_generator.class%
        arguments:
            - '@doctrine'
        tags:
            - { name: oro_navigation.tag_generator }

    oro_navigation.content.simple_tag_generator:
        class: %oro_navigation.content.simple_tag_generator.class%
        tags:
            - { name: oro_navigation.tag_generator }

    oro_navigation.content.datagrid_tag_listener:
        class: %oro_navigation.content.datagrid_tag_listener.class%
        arguments:
            - '@oro_navigation.content.tag_generator_chain'
        tags:
            - { name: kernel.event_listener, event: oro_datagrid.datagrid.build.after, method: buildAfter }

    oro_navigation.menu_update.builder:
        class: Oro\Bundle\NavigationBundle\Builder\MenuUpdateBuilder
        arguments:
            - '@oro_locale.helper.localization'
        tags:
            - { name: oro_menu.builder }

    oro_navigation.menu_update_provider.default:
        class: Oro\Bundle\NavigationBundle\Provider\DefaultMenuUpdateProvider
        arguments:
            - '@oro_security.security_facade'
            - '@oro_entity.doctrine_helper'
        tags:
            - { name: oro_navigation.menu_update_provider, area: default }
