Last active
August 18, 2019 19:23
-
-
Save dinarcon/ca7dd9ffc2f2d76ec42d021c5f96936f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
process: | |
psf_destination_filename: | |
plugin: callback | |
callable: basename | |
source: src_photo_url |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
process: | |
field_ud_image/target_id: | |
plugin: migration_lookup | |
migration: udm_json_source_image | |
source: src_photo_file | |
destination: | |
plugin: 'entity:node' | |
default_bundle: ud_paragraphs | |
migration_dependencies: | |
required: | |
- udm_json_source_image | |
- udm_json_source_paragraph | |
optional: [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
process: | |
field_ud_book_paragraph_title: src_book_title | |
field_ud_book_paragraph_author: src_book_author |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"data": { | |
"udm_book_paragraph": [ | |
{ | |
"book_id": "B10", | |
"book_details": { | |
"title": "The definite guide to Drupal 7", | |
"author": "Benjamin Melançon et al." | |
} | |
}, | |
{...}, | |
{...} | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"data": { | |
"udm_people": [ | |
{ | |
"unique_id": 1, | |
"name": "Michele Metts", | |
"photo_file": "P01", | |
"book_ref": "B10" | |
}, | |
{...}, | |
{...} | |
], | |
"udm_book_paragraph": [ | |
{ | |
"book_id": "B10", | |
"book_details": { | |
"title": "The definite guide to Drupal 7", | |
"author": "Benjamin Melançon et al." | |
} | |
}, | |
{...}, | |
{...} | |
], | |
"udm_photos": [ | |
{ | |
"photo_id": "P01", | |
"photo_url": "https://agaric.coop/sites/default/files/pictures/picture-15-1421176712.jpg", | |
"photo_dimensions": [240, 351] | |
}, | |
{...}, | |
{...} | |
] | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source: | |
plugin: url | |
data_fetcher_plugin: file | |
data_parser_plugin: json | |
urls: | |
- modules/custom/ud_migrations/ud_migrations_json_source/sources/udm_data.json | |
item_selector: /data/udm_photos | |
fields: | |
- name: src_photo_id | |
label: 'Photo ID' | |
selector: photo_id | |
- name: src_photo_url | |
label: 'Photo URL' | |
selector: photo_url | |
ids: | |
src_photo_id: | |
type: string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source: | |
plugin: url | |
data_fetcher_plugin: file | |
data_parser_plugin: json | |
urls: | |
- modules/custom/ud_migrations/ud_migrations_json_source/sources/udm_data.json | |
item_selector: /data/udm_people | |
fields: | |
- name: src_unique_id | |
label: 'Unique ID' | |
selector: unique_id | |
- name: src_name | |
label: 'Name' | |
selector: name | |
- name: src_photo_file | |
label: 'Photo ID' | |
selector: photo_file | |
- name: src_book_ref | |
label: 'Book paragraph ID' | |
selector: book_ref | |
ids: | |
src_unique_id: | |
type: integer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source: | |
plugin: url | |
data_fetcher_plugin: http | |
data_parser_plugin: json | |
urls: | |
- https://api.myjson.com/bins/110rcr | |
item_selector: /data/udm_people | |
fields: ... | |
ids: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source: | |
plugin: url | |
data_fetcher_plugin: file | |
data_parser_plugin: json | |
urls: | |
- modules/custom/ud_migrations/ud_migrations_json_source/sources/udm_data.json | |
item_selector: /data/udm_book_paragraph | |
fields: | |
- name: src_book_id | |
label: 'Book ID' | |
selector: book_id | |
- name: src_book_title | |
label: 'Title' | |
selector: book_details/title | |
- name: src_book_author | |
label: 'Author' | |
selector: book_details/author | |
ids: | |
src_book_id: | |
type: string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"data": { | |
"udm_people": [ | |
{ | |
"unique_id": 1, | |
"name": "Michele Metts", | |
"photo_file": "P01", | |
"book_ref": "B10" | |
}, | |
{...}, | |
{...} | |
] | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"data": { | |
"udm_photos": [ | |
{ | |
"photo_id": "P01", | |
"photo_url": "https://agaric.coop/sites/default/files/pictures/picture-15-1421176712.jpg", | |
"photo_dimensions": [240, 351] | |
}, | |
{...}, | |
{...} | |
] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment