wxt-8.x-3.011/modules/custom/wxt_ext/wxt_ext_migration/config/install/migrate_plus.migration.gcweb_ext_group_translation.yml
modules/custom/wxt_ext/wxt_ext_migration/config/install/migrate_plus.migration.gcweb_ext_group_translation.yml
id: gcweb_ext_group_translation
migration_group: gcweb_translation
migration_tags:
- Group
dependencies:
enforced:
module:
- wxt_ext_migration
label: 'Json data for Groups'
source:
# We use the JSON source plugin.
plugin: url
data_fetcher_plugin: http
data_parser_plugin: json
headers:
Accept: application/json
translations: true
urls: http://open.canada.ca/data/api/action/organization_list?all_fields=true
item_selector: result
fields:
-
name: machine_name
label: 'Machine Name'
selector: id
-
name: shortcode
label: 'Shortcode'
selector: name
-
name: title
label: 'Label'
selector: title
# Under 'ids', we identify source fields populated above which will uniquely
# identify each imported item. The 'type' makes sure the migration map table
# uses the proper schema type for stored the IDs.
ids:
machine_name:
type: string
process:
id:
plugin: migration_lookup
migration: wxt_ext_group
source: machine_name
label:
-
plugin: explode
source: title
delimiter: '|'
-
plugin: extract
index:
- 1
-
plugin: callback
callable: trim
type:
plugin: default_value
default_value: department
uid:
plugin: default_value
default_value: 1
field_shortcode/value: shortcode
langcode:
plugin: default_value
default_value: "fr"
content_translation_source:
plugin: default_value
default_value: "en"
destination:
plugin: 'entity:group'
translations: true
migration_dependencies:
required:
- gcweb_ext_group
