parameters:
  multilang_plugins:
    "multilingual-press-pro": false
    "polylang": false

  plugin.name: smartling-connector
  plugin.version: 1.1.0
  plugin.domain: smartling-connector
  wp.hooks:
    - 'wp.cron'
    - 'wp.i18n'
    - 'wp.checkStatus'
    - 'wp.submissions'
    - 'wp.bulkSubmit'
    - 'wp.settings'
    - 'wp.settings.edit'
    - 'wp.post'
    - 'wp.page'
    - 'wp.taxonomy'
    - 'wp.ext.policy'
    - 'wp.ext.partner'
    - 'wp.ext.testimonial'
    - 'smartling.helper.relative-image-path-support'


  # Property mapper general definitions
  # all not listed here should be sent for translation
  field.processor:
    ignore: # do not clone
      - '_edit_lock'
      - '_edit_last'
      - '_yoast_wpseo_canonical'
      - '_yoast_wpseo_redirect'
      - 'post_date'
      - 'post_date_gmt'
      - 'post_modified'
      - 'post_modified_gmt'
      - 'guid'
      - 'comment_count'
      - 'post_name'
      - 'post_parent'
      - 'hash'
      - 'ID'
      - 'id'
      - 'term_id'
      - 'slug'
      - 'term_group'
      - 'term_taxonomy_id'
      - 'parent'
      - '_menu_item_object_id'
      - 'smartlingId'
      - 'attachment_id'
      - 'testimonial_id'
      - 'testimonials'
    key: # add jey to XML
      seo: # key="seo"
        - '_yoast_wpseo_title'
        - '_yoast_wpseo_bctitle'
        - '_yoast_wpseo_metadesc'
        - '_yoast_wpseo_metakeywords'
        - '_yoast_wpseo_focuskw'
        - '_yoast_wpseo_opengraph-description'
        - '_yoast_wpseo_google-plus-description'
    copy: # do not trandlate, but clone
      name: # by full name
        - '_yoast_wpseo_meta-robots-noindex'
        - '_yoast_wpseo_meta-robots-nofollow'
        - '_yoast_wpseo_meta-robots-adv'
        - 'post_status'
        - 'comment_status'
        - 'ping_status'
        - 'post_password'
        - 'to_ping'
        - 'pinged'
        - 'post_content_filtered'
        - 'post_type'
        - 'post_mime_type'
        - 'post_author'
        - 'taxonomy'
        - 'background'
        - 'effective_date'
        - 'icon'
        - 'menu_order'
        - 'sm_body_class'
        - '_wp_page_template'
        - 'ccb_curated_page'
        - 'sm_left_sidebar'
        - 'sm_hide_sidebar'
        - 'header_template_meta_box'
        - 'header_nav_visibility_meta_box'
        - 'header_sign_in_visibility_meta_box'
        - 'header_help_visibility_meta_box'
        - 'footer_template_meta_box'
        - 'footer_main_menu_visibility_meta_box'
        - 'language_menu_visibility_meta_box'
        - 'short_menu_visibility_meta_box'
        - '_call_to_action'
        - 'call_to_action'
        - '_dh_display_featured_image'
        - 'sm_dh_sidebar_order'
        - 'sm_dh_text_cta_link'
        - 'sm_dh_footer_cta_link_yellow'
        - 'sm_dh_cta_type'
        - 'sm_dh_sidebar_cta_type'
        - 'sm_dh_footer_cta_link_gray'
        - 'sm_dh_sidebar_cta_sv_link_yellow'
        - 'sm_dh_sidebar_cta_sv_link_gray'
        - '_yoast_wpseo_opengraph-image'
        - 'sm_dh_sidebar_reach_link'
        - 'sm_dh_sidebar_audience_link'
        - '_marketo_sidebar'
        - '_post_restored_from'
        - 'sm_dh_button_cta_link'
        - 'sm_dh_sidebar_cta_au_link_yellow'
        - '_menu_item_object'
        - '_menu_item_classes'
        - '_menu_item_type'
        - '_wp_attached_file'
        - 'file'
        ### Widget fields
        - 'bar'
        - 'widgetType'
        - 'count'
        - 'dropdown'
        - 'hierarchical'
        - 'sortby'
        - 'exclude'
        - 'number'
        - 'filter'
        - 'taxonomy'
        - 'show_date'
        - 'url'
        - 'items'
        - 'show_summary'
        - 'show_author'
        - 'show_date'
      regexp: # by value match
       - '^\d+([,\.]\d+)?$'
       - '^(y|yes|n|no|on|off|default|in|out|html|cta\d+|cta|any|null|text|surveys|choose|button)$'
       - '^(http:|https:|field_)'
       - '^(callout|card-list|card-icon-list|cta|cta-hero|cta-sidebar|image-text-list|list-icon|list|nav|template-list|embeds|html|basic|select|gold|platinum)$' # SM CuratedPage markers
       - '^(taxonomy|category|\s+)$'
       - '^(true|false|enabled|disabled|background-image)$'


  logger.smartling_log_raw_sql: false
  logger.smartling_verbose_output_for_xml_coding: true
  logger.smartling_verbose_metadata_io: true

  logger.channel: default
  logger.filehandler.standard.filename: %plugin.dir%/logs/logfile
  logger.filehandler.standard.loglevel: DEBUG
  logger.filehandler.standard.maxfiles: 5

  logger.formatter.date: "Y-m-d H:i:s"
  logger.formatter.output.default: "[%%datetime%%] %%channel%%.%%level_name%%: %%message%% %%context%% %%extra%%\n"
  logger.formatter.output.short: "[%%datetime%%] %%level_name%%: %%message%%\n"
  logger.formatter.output.short_with_request_id: "[%%datetime%%] %%extra.request_id%% %%level_name%%: %%message%%\n"
  logger.formatter.allow_multiline: true

  submission.pagesize: 10

services:

  smartling.helper.relative-image-path-support:
    class: Smartling\Helpers\RelativeLinkedAttachmentCoreHelper
    arguments:
      - "@logger"
      - "@entrypoint"

  helper.customMenu:
    class: Smartling\Helpers\CustomMenuContentTypeHelper
    calls:
      - [ "setSiteHelper", [ "@site.helper" ] ]
      - [ "setContentIoFactory", [ "@factory.contentIO" ] ]

  wrapper.sdk.api.smartling:
    class: Smartling\ApiWrapper
    arguments:
      - "@manager.settings"
      - "@logger"
      - "%plugin.name%"
      - "%plugin.version%"

  entrypoint:
    class: Smartling\Base\SmartlingCore
    calls:
      - [ "setLogger", [ "@logger" ]]
      - [ "setSubmissionManager", [ "@manager.submission" ]]
      - [ "setSettings", [ "@manager.settings" ]]
      - [ "setSiteHelper", [ "@site.helper" ]]
      - [ "setApiWrapper", [ "@wrapper.sdk.api.smartling" ]]
      - [ "setMultilangProxy", [ "@multilang.proxy" ]]
      - [ "setContentIoFactory", [ "@factory.contentIO" ]]
      - [ "setCache", [ "@site.cache" ]]
      - [ "setCustomMenuHelper", [ "@helper.customMenu" ]]
      - [ "setSettingsManager", [ "@manager.settings" ]]

  wrapper.widget:
    class: Smartling\DbAl\WordpressContentEntities\WidgetEntity
    arguments:
      - "@logger"

  wrapper.entity.menu:
    class: Smartling\DbAl\WordpressContentEntities\MenuEntity
    arguments:
      - "@logger"

  wrapper.entity.menuitem:
      class: Smartling\DbAl\WordpressContentEntities\MenuItemEntity
      arguments:
        - "@logger"

  wrapper.entity.post:
    class: Smartling\DbAl\WordpressContentEntities\PostEntity
    arguments:
      - "@logger"

  wrapper.entity.ext.partner:
    class: Smartling\DbAl\WordpressContentEntities\PartnerEntity
    arguments:
      - "@logger"

  wrapper.entity.ext.testimonial:
    class: Smartling\DbAl\WordpressContentEntities\TestimonialEntity
    arguments:
      - "@logger"

  wrapper.entity.ext.policy:
    class: Smartling\DbAl\WordpressContentEntities\PolicyEntity
    arguments:
      - "@logger"

  wrapper.entity.page:
    class: Smartling\DbAl\WordpressContentEntities\PageEntity
    arguments:
      - "@logger"

  wrapper.entity.category:
    class: Smartling\DbAl\WordpressContentEntities\CategoryEntity
    arguments:
      - "@logger"

  wrapper.entity.tag:
    class: Smartling\DbAl\WordpressContentEntities\TagEntity
    arguments:
      - "@logger"

  wrapper.entity.attachment:
      class: Smartling\DbAl\WordpressContentEntities\AttachmentEntity
      arguments:
        - "@logger"

  factory.contentIO:
    class: Smartling\Processors\ContentEntitiesIOFactory
    arguments:
      - "@logger"
    calls:
      - [ "registerHandler", ["post", "@wrapper.entity.post"]]
      - [ "registerHandler", ["nav_menu", "@wrapper.entity.menu"]]
      - [ "registerHandler", ["nav_menu_item", "@wrapper.entity.menuitem"]]
      - [ "registerHandler", ["page", "@wrapper.entity.page"]]
      - [ "registerHandler", ["category", "@wrapper.entity.category"]]
      - [ "registerHandler", ["post_tag", "@wrapper.entity.tag"]]
      - [ "registerHandler", ["policy", "@wrapper.entity.ext.policy"]]
      - [ "registerHandler", ["partner", "@wrapper.entity.ext.partner"]]
      - [ "registerHandler", ["testimonial", "@wrapper.entity.ext.testimonial"]]
      - [ "registerHandler", ["theme_widget", "@wrapper.widget"]]
      - [ "registerHandler", ["attachment", "@wrapper.entity.attachment"]]

  fileLoggerLineFormatter:
    #class: Monolog\Formatter\LineFormatter
    class: Smartling\Base\CustomLogLineFormatter
    arguments:
      - "%logger.formatter.output.short_with_request_id%"
      - "%logger.formatter.date%"
      - "%logger.formatter.allow_multiline%"

  fileLoggerHandlerStandard:
    class: Monolog\Handler\StreamHandler
    arguments:
      - "%logger.filehandler.standard.filename%"
      - "%logger.filehandler.standard.loglevel%"
    calls:
      - [ "setFormatter", [ "@fileLoggerLineFormatter" ]]

  fileLoggerHandlerRotatable:
     class: Monolog\Handler\RotatingFileHandler
     arguments:
       - "%logger.filehandler.standard.filename%"
       - "%logger.filehandler.standard.maxfiles%"
       - "%logger.filehandler.standard.loglevel%"
     calls:
       - [ "setFormatter", [ "@fileLoggerLineFormatter" ]]

  logger:
    class: Monolog\Logger
    arguments:
      - "%logger.channel%"
    calls:
      - [pushHandler, ["@fileLoggerHandlerRotatable"]]

  manager.submission:
    class: Smartling\Submissions\SubmissionManager
    arguments:
     - "@logger"
     - "@site.db"
     - "%submission.pagesize%"
     - "@entity.helper"

  site.helper:
    class: Smartling\Helpers\SiteHelper
    arguments:
      - "@logger"

  site.db:
    class: Smartling\DbAl\DB
    arguments:
      - "@logger"
      - "%logger.smartling_log_raw_sql%"

  site.cache:
    class: Smartling\Helpers\Cache

  manager.settings:
    class: Smartling\Settings\SettingsManager
    arguments:
      - "@logger"
      - "@site.db"
      - "%submission.pagesize%"
      - "@site.helper"
      - "@multilang.proxy"

  plugin.info:
      class: Smartling\Helpers\PluginInfo
      arguments:
        - "%plugin.name%"
        - "%plugin.version%"
        - "%plugin.url%"
        - "%plugin.dir%"
        - "%plugin.domain%"
        - "@manager.settings"
        - "%plugin.upload%"

  multilang.proxy:
    class: Smartling\DbAl\MultiligualPressConnector
    arguments:
      - "@logger"
      - "@site.helper"
      - "%multilang_plugins%"

  entity.helper:
    class: Smartling\Helpers\EntityHelper
    calls:
      - [ "setLogger", [ "@logger" ]]
      - [ "setPluginInfo", [ "@plugin.info" ]]
      - [ "setConnector", [ "@multilang.proxy" ]]
      - [ "setSiteHelper", [ "@site.helper" ]]

  wp.cron:
    class: Smartling\WP\JobEngine
    arguments:
      - "@logger"
      - "@plugin.info"

  wp.i18n:
    class: Smartling\WP\i18n
    arguments:
      - "@plugin.info"

  wp.settings:
    class: Smartling\WP\Controller\ConfigurationProfilesController
    arguments:
      - "@logger"
      - "@multilang.proxy"
      - "@plugin.info"
      - "@entity.helper"
      - "@manager.submission"
      - "@site.cache"

  wp.settings.edit:
    class: Smartling\WP\Controller\ConfigurationProfileFormController
    arguments:
      - "@logger"
      - "@multilang.proxy"
      - "@plugin.info"
      - "@entity.helper"
      - "@manager.submission"
      - "@site.cache"

  wp.submissions:
    class: Smartling\WP\Controller\SubmissionsPageController
    arguments:
      - "@logger"
      - "@multilang.proxy"
      - "@plugin.info"
      - "@entity.helper"
      - "@manager.submission"
      - "@site.cache"

  wp.post:
    class: Smartling\WP\Controller\PostWidgetController
    arguments:
      - "@logger"
      - "@multilang.proxy"
      - "@plugin.info"
      - "@entity.helper"
      - "@manager.submission"
      - "@site.cache"

  wp.ext.partner:
    class: Smartling\WP\Controller\PartnerWidgetController
    arguments:
      - "@logger"
      - "@multilang.proxy"
      - "@plugin.info"
      - "@entity.helper"
      - "@manager.submission"
      - "@site.cache"

  wp.ext.testimonial:
    class: Smartling\WP\Controller\TestimonialWidgetController
    arguments:
      - "@logger"
      - "@multilang.proxy"
      - "@plugin.info"
      - "@entity.helper"
      - "@manager.submission"
      - "@site.cache"

  wp.ext.policy:
    class: Smartling\WP\Controller\PolicyWidgetController
    arguments:
      - "@logger"
      - "@multilang.proxy"
      - "@plugin.info"
      - "@entity.helper"
      - "@manager.submission"
      - "@site.cache"

  wp.page:
    class: Smartling\WP\Controller\PageWidgetController
    arguments:
      - "@logger"
      - "@multilang.proxy"
      - "@plugin.info"
      - "@entity.helper"
      - "@manager.submission"
      - "@site.cache"

  wp.taxonomy:
      class: Smartling\WP\Controller\TaxonomyWidgetController
      arguments:
        - "@logger"
        - "@multilang.proxy"
        - "@plugin.info"
        - "@entity.helper"
        - "@manager.submission"
        - "@site.cache"

  wp.checkStatus:
      class: Smartling\WP\Controller\CheckStatusController
      arguments:
        - "@logger"
        - "@multilang.proxy"
        - "@plugin.info"
        - "@entity.helper"
        - "@manager.submission"
        - "@site.cache"

  wp.bulkSubmit:
    class: Smartling\WP\Controller\BulkSubmitController
    arguments:
      - "@logger"
      - "@multilang.proxy"
      - "@plugin.info"
      - "@entity.helper"
      - "@manager.submission"
      - "@site.cache"


  extension.translation_lock:
    class: Smartling\Extensions\TranslateLock

  extension.loader:
    class: Smartling\Extensions\ExtensionLoader
    arguments:
      - "@logger"
    calls:
      - [ "registerExtension", [ "@extension.translation_lock" ]]

  migration.150512:
    class:	Smartling\DbAl\Migrations\Migration150512

  migration.150619:
    class:	Smartling\DbAl\Migrations\Migration150619

  migration.151222:
    class: Smartling\DbAl\Migrations\Migration151222

  manager.db.migrations:
    class: Smartling\DbAl\Migrations\DbMigrationManager
    arguments:
      - "@logger"
    calls:
      - [ "registerMigration", [ "@migration.150512" ]]
      - [ "registerMigration", [ "@migration.150619" ]]
      - [ "registerMigration", [ "@migration.151222" ]]
