Skip to content

Commit

Permalink
WIP - initial content model overhaul migration update
Browse files Browse the repository at this point in the history
  • Loading branch information
seth-shaw-unlv committed May 3, 2018
1 parent 0cb7227 commit 033db02
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 20 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
**Content Model Overhaul in Process**

I've updated unlv_image to work in parallel to the new islandora_object.
Updating migrate_cdm is next.
Migrate is almost ready, but migrations need to be done in Web interface for the files to work in claw-playbook. (Is the vagrant ssh user a member of www-data?)

This repository consists of two modules:

Expand Down
16 changes: 11 additions & 5 deletions migrate_apollo/config/install/migrate_plus.migration.claw_file.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,12 @@ source:
source_base_dir: 'data/images'
collection_alias: 'apollo'
dest_base_dir: 'public://masters'
extension: 'tiff'
column_names:
0:
digital_id: 'Digital ID' # identifier key
digital_id: 'Digital ID' # identifier key and basename of the file
1:
title: 'Title' # Used for title and alt-text
6:
file: 'File'


process:
Expand All @@ -31,20 +30,27 @@ process:
plugin: default_value
default_value: image

filename:
plugin: concat
delimiter: '.'
source:
- digital_id
- constants/extension

source_file_path:
plugin: concat
delimiter: /
source:
- constants/source_base_dir
- file
- '@filename'

destination_file_path:
plugin: concat
delimiter: /
source:
- constants/dest_base_dir
- constants/collection_alias
- file
- '@filename'

uri:
plugin: file_copy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ migration_group: test_digital

migration_dependencies:
required:
- claw_media
# Loading authorities first allows us to look them up
- auth_person
- auth_complex
Expand All @@ -20,6 +19,7 @@ source:
- digital_id
constants:
collection_alias: 'apollo'
image: 'Image'
column_names:
0:
digital_id: 'Digital ID'
Expand Down Expand Up @@ -57,6 +57,14 @@ process:
- constants/collection_alias
- digital_id

# Type Tags
field_tags:
plugin: entity_lookup
source: constants/image
value_key: name
entity_type: taxonomy_term
ignore_case: true

# SUBJECTS
# For subjects we can't find in the system, we can't determine by their value
# if they should be persons, corporate, families, or topics. This defaults to
Expand All @@ -75,11 +83,3 @@ process:
plugin: entity_generate # Create a subject entity if it doesn't already exist
default_values:
type: subject

# Now the TIFF entity references
field_tiff/target_id:
plugin: migration_lookup
migration: claw_media
source: digital_id
no_stub: true
field_tiff/alt: title
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ migration_group: test_digital
migration_dependencies:
required:
- claw_file
- claw_image # so we can lookup the value for field_media_of

source:
plugin: csv
Expand All @@ -13,6 +14,8 @@ source:
header_row_count: 1 # headers, 0 if there are no headers
keys:
- digital_id
constants:
preservation_master: 'Preservation Master'
column_names:
0:
digital_id: 'Digital ID' # identifier key
Expand All @@ -24,19 +27,34 @@ process:
source: digital_id
no_stub: true

field_file/target_id:
# Lookup the Tiff we just migrated
field_media_file/target_id:
plugin: migration_lookup
migration: claw_file
source: digital_id
no_stub: true

field_file/display:
field_media_file/display:
plugin: default_value
default_value: 1
field_file/description:
field_media_file/description:
plugin: default_value
default_value: ''

# Lookup the UNLV_Image we just created
field_media_of:
plugin: migration_lookup
migration: claw_image
source: digital_id
no_stub: true

# Set as Preservation Master
field_tags:
plugin: entity_lookup
source: constants/preservation_master
value_key: name
entity_type: taxonomy_term
ignore_case: true

destination:
plugin: 'entity:media'
default_bundle: image_tiff
default_bundle: file

0 comments on commit 033db02

Please sign in to comment.