id: d7_node_article
label: Node Article
migration_group: d7_materio
audit: true
migration_tags:
  - Drupal 7
  - Content
  - Materio

source:
  plugin: d7_node_breve
  node_type: breve
  high_water_property:
    name: changed
    alias: n

destination:
  plugin: entity:node


process:
  # nid: nid
  type:
    plugin: default_value
    default_value: article
  title: title
  created: created
  changed: changed

  uid:
    plugin: migration_lookup
    migration: d7_users
    source: uid

  field_migration:
    plugin: default_value
    default_value: 'migration_imported'
  body:
    plugin: iterator
    source: body
    process:
      value: value
      format:
        plugin: default_value
        default_value: wysiwyg
  langcode: language
  field_memo: field_memo
  field_workflow:
    -
      plugin: default_value
      source: workflow
      default_value: 2
    -
      plugin: static_map
      default_value: 2
      map:
        1: "workflow_creation"
        2: "workflow_hidden"
        3: "workflow_visible"
        4: "workflow_imported"
        5: "workflow_edited"
  field_thesaurus:
    plugin: migration_lookup
    migration: d7_taxonomy_term_thesaurus
    source: field_onthologie
  field_tags:
    plugin: migration_lookup
    migration: d7_taxonomy_term_tags
    source: field_tags_libres
  field_video:
    plugin: iterator
    source: field_video_filter
    process:
      value: url
  field_linked_materials:
    -
      plugin: skip_on_empty
      method: process
      source: linked_materials
    -
      plugin: migration_lookup
      migration: d7_node_materiau
      no_stub: true
  field_visuel:
      plugin: iterator
      source: field_visuel
      process:
        target_id:
          plugin: migration_lookup
          migration: d7_allpublicfiles
          source: fid
          no_stub: true
        alt: alt
        title: title
        height: height
        width: width
  field_source:
    plugin: iterator
    source: field_source
    process:
      uri: url
      title: title
      options: attributes

migration_dependencies:
  required:
    - d7_allpublicfiles
    - d7_users
    - d7_taxonomy_term_thesaurus
    - d7_taxonomy_term_tags
    - d7_taxonomy_term_company
    - d7_taxonomy_term_showroom
    - d7_node_materiau
  # optional:
