Skip to content

Commit

Permalink
release(2.26.0): update to new syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
arturu committed May 7, 2024
1 parent 2cbdcdd commit 51aa455
Show file tree
Hide file tree
Showing 45 changed files with 2,406 additions and 2,780 deletions.
163 changes: 79 additions & 84 deletions config/install/migrate_plus.migration.demo_circolare.yml
Original file line number Diff line number Diff line change
@@ -1,111 +1,111 @@
langcode: it
status: true
dependencies:
enforced:
module:
- sunchronizo
id: demo_circolare
label: Tipo di contenuto Circolare
migration_group: scuola_demo
class: null
field_plugin_method: null
cck_plugin_method: null
migration_tags:
- json
- scuola
- demo
- demo_node
- demo_circolare

migration_group: scuola_demo
label: 'Tipo di contenuto Circolare'
source:
plugin: url
data_fetcher_plugin: http
data_parser_plugin: json

headers:
Accept: 'application/json; charset=utf-8'
Content-Type: 'application/json'

# The data_parser normally limits the fields passed on to the source plugin
# to fields configured to be used as part of the migration. To support more
# dynamic migrations, the JSON data parser supports including the original
# data for the current row. Simply include the 'include_raw_data' flag set
# to `true` to enable this. This option is disabled by default to minimize
# memory footprint for migrations that do not need this capability.
# include_raw_data: false

# Flags whether to track changes to incoming data. If TRUE, we will maintain
# hashed source rows to determine whether incoming data has changed.
# track_changes: false

Content-Type: application/json
urls:
- 'https://ouitoulia.github.io/krene/demo/circolare.json'

# An xpath-like selector corresponding to the items to be imported.
item_selector: data

fields:
- name: nid
-
name: nid
label: 'ID del nodo'
selector: id
- name: type
-
name: type
label: 'Il tipo di contenuto'
selector: type
- name: title
-
name: title
label: 'Il titolo del libro'
selector: attributes/titolo
- name: numero_circolare
-
name: numero_circolare
label: 'Il numero della circolare'
selector: attributes/numero_circolare
- name: anno_scolastico
-
name: anno_scolastico
label: 'Anno scolastico'
selector: relationships/anno_scolastico/data/id

# Scheda apertura
- name: abstract
-
name: abstract
label: 'Oggetto della circolare'
selector: attributes/abstract
- name: argomenti
label: 'Argomenti'
-
name: argomenti
label: Argomenti
selector: relationships/argomenti/data
- name: destinatari
-
name: destinatari
label: 'Destinatari circolare'
selector: relationships/destinatari/data

# Scheda allegati e riferimenti
- name: data_oblio
label: "Oblio documento"
-
name: data_oblio
label: 'Oblio documento'
selector: attributes/data_oblio
- name: document_url
label: "URL del documento"
-
name: document_url
label: 'URL del documento'
selector: relationships/document/data/url
- name: document
label: "I metadata del documento"
-
name: document
label: 'I metadata del documento'
selector: relationships/document
- name: link
label: "Riferimenti normativi"
-
name: link
label: 'Riferimenti normativi'
selector: attributes/link
- name: eventi
-
name: eventi
label: 'Eventi correlati'
selector: relationships/eventi/data


- name: testo_circolare
-
name: testo_circolare
label: 'Testo della circolare'
selector: attributes/testo_circolare
- name: persona_responsabile
label: 'Autori'
-
name: persona_responsabile
label: Autori
selector: relationships/persona_responsabile/data

# Footer
- name: language
-
name: language
label: 'La lingua del contenuto'
selector: attributes/language
- name: promote
-
name: promote
label: 'Se il contenuto è promosso alla prima pagina'
selector: attributes/promote
- name: sticky
-
name: sticky
label: 'Se il contenuto è in cima agli elenchi'
selector: attributes/sticky
- name: published
-
name: published
label: 'Se il contenuto è pubblicato o meno'
selector: attributes/published

ids:
nid:
type: integer

process:
nid: nid
uid:
Expand All @@ -118,27 +118,27 @@ process:
plugin: skip_on_empty
source: anno_scolastico
method: process

# Scheda apertura
field_abstract: abstract
field_argomenti:
- plugin: skip_on_empty
-
plugin: skip_on_empty
source: argomenti
method: process
- plugin: sub_process
-
plugin: sub_process
source: argomenti
process:
target_id: id
field_destinatari:
- plugin: skip_on_empty
-
plugin: skip_on_empty
source: destinatari
method: process
- plugin: sub_process
-
plugin: sub_process
source: destinatari
process:
target_id: id

# Scheda allegati e riferimenti
field_data_oblio:
plugin: skip_on_empty
source: data_oblio
Expand All @@ -148,7 +148,7 @@ process:
source: document_url
destination: constants/documents_media_path
uid: '@_file_uid'
file_exists: 'replace'
file_exists: replace
skip_on_missing_source: true
id_only: true
field_allegati/description:
Expand All @@ -160,35 +160,38 @@ process:
source: link
method: process
field_eventi:
- plugin: skip_on_empty
-
plugin: skip_on_empty
source: eventi
method: process
- plugin: sub_process
-
plugin: sub_process
source: eventi
process:
target_id: id

body/value:
- plugin: skip_on_empty
-
plugin: skip_on_empty
source: testo_circolare
method: process
body/format:
- plugin: default_value
-
plugin: default_value
default_value: bootstrap_italia_2
field_persona_responsabile:
- plugin: skip_on_empty
-
plugin: skip_on_empty
source: persona_responsabile
method: process
- plugin: sub_process
-
plugin: sub_process
source: persona_responsabile
process:
target_id: id

# Footer
langcode:
plugin: default_value
source: language
default_value: "und"
default_value: und
promote:
plugin: default_value
source: promote
Expand All @@ -201,20 +204,12 @@ process:
plugin: default_value
source: published
default_value: 0

destination:
plugin: entity:node
plugin: 'entity:node'
default_bundle: circolare
translations: true

migration_dependencies:
required:
- demo_taxonomy
- demo_persona
- demo_evento

dependencies:
enforced:
module:
- sunchronizo

Loading

0 comments on commit 51aa455

Please sign in to comment.