Skip to content

Commit

Permalink
Merge pull request #86 from fivejars/shared-content
Browse files Browse the repository at this point in the history
Shared content
  • Loading branch information
hamrant authored Aug 21, 2020
2 parents c959176 + 94d3c97 commit 14f1c3f
Show file tree
Hide file tree
Showing 12 changed files with 1,044 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
langcode: en
status: true
dependencies: { }
id: virtual_y_shared
label: 'Virtual Y Shared Content Server sync'
description: 'Imports shared items from Virtual Y sources to the main Demo Server.'
module: openy_gc_shared_content_server
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
dependencies:
enforced:
module:
- openy_gc_shared_content_server
id: virtual_y_shared_file_blog
deriver: Drupal\openy_gc_shared_content_server\SourceMigrationDeriver
label: 'Import Shared VirtualY files'
migration_group: virtual_y_shared
source:
entity_type: vy_blog_post
json_includes:
- field_vy_blog_image.field_media_image
plugin: url
data_fetcher_plugin: http
# Specifies the JSON parser plugin.
data_parser_plugin: json
track_changes: true
headers:
Accept: 'application/json; charset=utf-8'
Content-Type: 'application/json'
urls: replace_me
item_selector: included/
fields:
- name: id
label: 'id'
selector: /id
- name: type
label: 'Include type'
selector: /type
- name: created
label: 'Created'
selector: /attributes/created
- name: changed
label: 'Changed'
selector: /attributes/changed
- name: status
label: 'Status'
selector: /attributes/status
- name: filename
label: 'FileName'
selector: /attributes/filename
- name: filemime
label: 'FileMIME'
selector: /attributes/filemime
- name: url
label: 'File url'
selector: /attributes/uri/url
ids:
id:
type: string
constants:
DOMAIN: replace_me
DRUPAL_FILE_DIRECTORY: 'public://virtual-y-shared-images/'
process:
type:
plugin: skip_on_value
method: row
source: type
value: media--image
langcode:
plugin: default_value
source: language
default_value: en
created:
plugin: callback
source: created
callable: strtotime
changed:
plugin: callback
source: changed
callable: strtotime
pseudo_source_full_path:
-
plugin: concat
delimiter: /
source:
- constants/DOMAIN
- url
-
plugin: urlencode
pseudo_destination_path:
plugin: concat
source:
- constants/DRUPAL_FILE_DIRECTORY
- filename
uri_file:
-
plugin: concat
delimiter: /
source:
- constants/uri_file
- name
-
plugin: urlencode
filename: filename
uri:
plugin: file_copy
source:
- '@pseudo_source_full_path'
- '@pseudo_destination_path'
file_exists: rename
move: false
status:
-
plugin: default_value
default_value: 1
uid:
-
plugin: default_value
default_value: 1
destination:
plugin: 'entity:file'
migration_dependencies:
required: { }
optional: { }
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
dependencies:
enforced:
module:
- openy_gc_shared_content_server
id: virtual_y_shared_file_video
deriver: Drupal\openy_gc_shared_content_server\SourceMigrationDeriver
label: 'Import Shared VirtualY files'
migration_group: virtual_y_shared
source:
entity_type: gc_video
json_includes:
- field_gc_video_image.field_media_image
plugin: url
data_fetcher_plugin: http
# Specifies the JSON parser plugin.
data_parser_plugin: json
track_changes: true
headers:
Accept: 'application/json; charset=utf-8'
Content-Type: 'application/json'
urls: replace_me
item_selector: included/
fields:
- name: id
label: 'id'
selector: /id
- name: type
label: 'Include type'
selector: /type
- name: created
label: 'Created'
selector: /attributes/created
- name: changed
label: 'Changed'
selector: /attributes/changed
- name: status
label: 'Status'
selector: /attributes/status
- name: filename
label: 'FileName'
selector: /attributes/filename
- name: filemime
label: 'FileMIME'
selector: /attributes/filemime
- name: url
label: 'File url'
selector: /attributes/uri/url
ids:
id:
type: string
constants:
DOMAIN: replace_me
DRUPAL_FILE_DIRECTORY: 'public://virtual-y-shared-images/'
process:
type:
plugin: skip_on_value
method: row
source: type
value: media--image
langcode:
plugin: default_value
source: language
default_value: en
created:
plugin: callback
source: created
callable: strtotime
changed:
plugin: callback
source: changed
callable: strtotime
pseudo_source_full_path:
-
plugin: concat
delimiter: /
source:
- constants/DOMAIN
- url
-
plugin: urlencode
pseudo_destination_path:
- plugin: concat
source:
- constants/DRUPAL_FILE_DIRECTORY
- filename
uri_file:
-
plugin: concat
delimiter: /
source:
- constants/uri_file
- name
-
plugin: urlencode
filename: filename
uri:
plugin: file_copy
source:
- '@pseudo_source_full_path'
- '@pseudo_destination_path'
file_exists: rename
move: false
status:
-
plugin: default_value
default_value: 1
uid:
-
plugin: default_value
default_value: 1
destination:
plugin: 'entity:file'
migration_dependencies:
required: { }
optional: { }
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
langcode: en
status: true
dependencies:
enforced:
module:
- openy_gc_shared_content_server
id: virtual_y_shared_gc_category
migration_group: virtual_y_shared
deriver: Drupal\openy_gc_shared_content_server\SourceMigrationDeriver
label: 'GC Category'
source:
entity_type: gc_video
json_includes:
- field_gc_video_category
plugin: url
data_fetcher_plugin: http
# Specifies the JSON parser plugin.
data_parser_plugin: json
track_changes: true
headers:
Accept: 'application/json; charset=utf-8'
Content-Type: 'application/json'
urls: replace_me
constants:
DOMAIN: replace_me
item_selector: included/
fields:
- name: id
label: 'id'
selector: /id
- name: title
label: 'title'
selector: /attributes/name
ids:
id:
type: string
process:
langcode:
plugin: default_value
source: language
default_value: en
status:
plugin: default_value
default_value: 1
name: title
destination:
plugin: entity:taxonomy_term
default_bundle: gc_category

migration_dependencies:
optional: { }
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
langcode: en
status: true
dependencies:
enforced:
module:
- openy_gc_shared_content_server
id: virtual_y_shared_gc_equipment
migration_tags:
- openy_complete_installation
migration_group: virtual_y_shared
deriver: Drupal\openy_gc_shared_content_server\SourceMigrationDeriver
label: 'GC Equipment'
source:
entity_type: gc_video
json_includes:
- field_gc_video_equipment
plugin: url
data_fetcher_plugin: http
# Specifies the JSON parser plugin.
data_parser_plugin: json
track_changes: true
headers:
Accept: 'application/json; charset=utf-8'
Content-Type: 'application/json'
urls: replace_me
constants:
DOMAIN: replace_me
item_selector: included/
fields:
- name: id
label: 'id'
selector: /id
- name: title
label: 'title'
selector: /attributes/name
ids:
id:
type: string
process:
langcode:
plugin: default_value
source: language
default_value: en
status:
plugin: default_value
default_value: 1
name: title
destination:
plugin: entity:taxonomy_term
default_bundle: gc_equipment
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
langcode: en
status: true
dependencies:
enforced:
module:
- openy_gc_shared_content_server
id: virtual_y_shared_gc_level
migration_tags:
- openy_complete_installation
migration_group: virtual_y_shared
deriver: Drupal\openy_gc_shared_content_server\SourceMigrationDeriver
label: 'GC Level'
source:
entity_type: gc_video
json_includes:
- field_gc_video_level
plugin: url
data_fetcher_plugin: http
# Specifies the JSON parser plugin.
data_parser_plugin: json
track_changes: true
headers:
Accept: 'application/json; charset=utf-8'
Content-Type: 'application/json'
urls: replace_me
constants:
DOMAIN: replace_me
item_selector: included/
fields:
- name: id
label: 'id'
selector: /id
- name: title
label: 'title'
selector: /attributes/name
ids:
id:
type: string
process:
langcode:
plugin: default_value
source: language
default_value: en
status:
plugin: default_value
default_value: 1
name: title
destination:
plugin: entity:taxonomy_term
default_bundle: gc_level
Loading

0 comments on commit 14f1c3f

Please sign in to comment.