id: d7_node_ressource
label: Node Ressource
migration_group: popsu
audit: true
migration_tags:
  - Drupal 7
  - Content
  - Popsu

source:
  plugin: d7_node_ressource
  batch_size: 500
  # high_water_property:
  #   name: changed
  #   alias: n

destination:
  plugin: entity:node

process:
  # nid: nid
  type:
    plugin: default_value
    default_value: ressource
  created: created
  changed: changed

  uid:
    plugin: default_value
    default_value: 34

  title: title

  field_programme:
    plugin: sub_process
    source: field_programme
    process:
      target_id:
        plugin: migration_lookup
        migration: d7_node_programme
        source: nid
        no_stub: true

  field_theme:
    plugin: migration_lookup
    migration: d7_node_theme
    source: field_theme
    no_stub: true

  field_projet:
    plugin: migration_lookup
    migration: d7_node_projet
    source: field_projet
    no_stub: true

  field_poid: field_poids

  field_type_de_ressource:
    plugin: migration_lookup
    migration: d7_taxonomy_term_type_doc
    source: field_popsu_doc_type
    no_stub: true

  field_sous_titre:
    plugin: sub_process
    source: field_popsu_publication_soustitr
    process:
      value: value
      # summary: summary
      # format:
      #   plugin: default_value
      #   default_value: wysiwyg

  field_edition:
    plugin: sub_process
    source: field_popsu_doc_source
    process:
      value: value
      summary: summary
      format:
        plugin: default_value
        default_value: wysiwyg

  body:
    plugin: sub_process
    source: body
    process:
      value: value
      summary: summary
      format:
        plugin: default_value
        default_value: wysiwyg


  field_image:
    plugin: sub_process
    source: field_popsu_publication_cover
    process:
      target_id:
        plugin: migration_lookup
        migration: d7_allpublicfiles
        source: fid
        no_stub: true
      alt: alt
      title: title

  field_fichier:
    plugin: sub_process
    source: field_popsu_doc_files
    process:
      target_id:
        plugin: migration_lookup
        migration: d7_allpublicfiles
        source: fid
        no_stub: true
      display: display
      description: description

  field_ressources_liees:
    plugin: migration_lookup
    migration: d7_node_ressource
    source: field_ressources_liees
    no_stub: true

  field_memo: field_memo

migration_dependencies:
  required:
    - d7_allpublicfiles
    - d7_users
    - d7_taxonomy_term_type_doc
