Skip to content

Commit

Permalink
Merge pull request #5 from dannylamb/issue-906
Browse files Browse the repository at this point in the history
Wrapping up yml as a feature
  • Loading branch information
whikloj authored Aug 28, 2018
2 parents b08ed69 + 003ccad commit 565d5aa
Show file tree
Hide file tree
Showing 8 changed files with 215 additions and 300 deletions.
144 changes: 0 additions & 144 deletions config/install/migrate_plus.migration.islandora_basic_image_files.yml

This file was deleted.

10 changes: 0 additions & 10 deletions config/install/migrate_plus.migration_group.islandora_migrate.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,43 +1,38 @@
langcode: en
status: true
dependencies:
enforced:
module:
- migrate_7x_claw
- migrate_plus
- islandora
id: islandora_basic_image
label: Basic Image Objects
class: null
field_plugin_method: null
cck_plugin_method: null
migration_tags: null
migration_group: islandora_7x

label: 'Basic Image Objects'
source:
# Islandora plugin
plugin: islandora
# Base url of your Solr instance
solr_base_url: http://10.0.2.2:9080/solr
# Base url of your Fedora 3 instance
fedora_base_url: &fedora_base_url http://10.0.2.2:9080/fedora

# define a http data fetcher to access the remote sites
solr_base_url: 'http://10.0.2.2:18080/solr'
fedora_base_url: 'http://10.0.2.2:18080/fedora'
data_fetcher_plugin: http
# Add authentication information to access Fedora
authentication: &fedora_auth
authentication:
plugin: basic
username: fedoraAdmin
password: fedoraAdmin

# We search Solr for PIDs, this is your Solr field for content models
content_model_field: RELS_EXT_hasModel_uri_ms
# This is the content model to search for (with or without "info:fedora/")
content_model: islandora:sp_basic_image

# Fedora requires the authentication you defined above to access the objectXML, so use this plugin instead of xml
content_model: 'islandora:sp_basic_image'
data_parser_plugin: authenticated_xml
# This grabs the root of an object as we only get one object for each XML.
item_selector: /foxml:digitalObject

item_selector: '/foxml:digitalObject'
constants:
# UID of the author.
creator_uid: 1
# Tag for this node.
image: 'Image'

image: Image
fields:
-
name: PID
label: 'PID'
label: PID
selector: '@PID'
-
name: created
Expand All @@ -53,80 +48,57 @@ source:
selector: 'foxml:objectProperties/foxml:property[@NAME="info:fedora/fedora-system:def/model#label"]/@VALUE'
-
name: member_of_collection
label: "Member of Collections"
label: 'Member of Collections'
selector: 'foxml:datastream[@ID = "RELS-EXT" and @CONTROL_GROUP = "X" ]/foxml:datastreamVersion[position() = last()]/foxml:xmlContent/rdf:RDF/rdf:Description/fedora:isMemberOfCollection/@rdf:resource'
-
name: member_of
label: "Member Of"
label: 'Member Of'
selector: 'foxml:datastream[@ID = "RELS-EXT" and @CONTROL_GROUP = "X" ]/foxml:datastreamVersion[position() = last()]/foxml:xmlContent/rdf:RDF/rdf:Description/fedora:isMemberOf/@rdf:resource'
-
name: mods_dsid
label: "MODS ds"
label: 'MODS ds'
selector: 'foxml:datastream[@ID = "MODS" and @CONTROL_GROUP = "M"]/foxml:datastreamVersion[position() = last()]'

ids:
PID:
type: string

destination:
plugin: entity:node
default_bundle: islandora_object

process:
# Set node title.
title: label

# Set node bundle
type:
plugin: default_value
default_value: islandora_object

# Set author
uid: constants/creator_uid

# Set created datetime
created:
plugin: format_date
from_format: Y-m-d\TH:i:s.u\Z
from_format: 'Y-m-d\TH:i:s.u\Z'
to_format: U
source: created
settings:
validate_format: false # don't validate as the incoming date has 3 digit MS and the generated has 5.

# Set updated datetime
validate_format: false
updated:
plugin: format_date
from_format: Y-m-d\TH:i:s.u\Z
from_format: 'Y-m-d\TH:i:s.u\Z'
to_format: U
source: lastmodified
settings:
validate_format: false # don't validate as the incoming date has 3 digit MS and the generated has 5.

# Set member of (THIS FIELD DOES NOT EXIST IN A DEFAULT ISLANDORA_OBJECT)
validate_format: false
field_member_of:
-
plugin: skip_on_empty
method: process
source: member_of
# We only want the PID so strip off the "info:fedora/" from the beginning.
-
plugin: substr
source: member_of
start: 11

# Set member of collection.
field_member_of_collection:
-
plugin: skip_on_empty
method: process
source: member_of_collection
# We only want the PID so strip off the "info:fedora/" from the beginning.
-
plugin: substr
source: member_of_collection
start: 11

# Set mods text (THIS FIELD DOES NOT EXIST IN A DEFAULT ISLANDORA_OBJECT).
field_mods_text:
-
plugin: skip_on_empty
Expand All @@ -136,10 +108,11 @@ process:
plugin: fedora_datastream
source: mods_dsid
settings:
fedora_base_url: *fedora_base_url
authentication: *fedora_auth

# Give this the Image tag.
fedora_base_url: 'http://10.0.2.2:18080/fedora'
authentication:
plugin: basic
username: fedoraAdmin
password: fedoraAdmin
field_tags:
plugin: entity_lookup
source: constants/image
Expand All @@ -148,11 +121,7 @@ process:
bundle: tags
entity_type: taxonomy_term
ignore_case: true

# Enforced dependencies means this migration is removed if any of these modules are uninstalled.
dependencies:
enforced:
module:
- migrate_7x_claw
- migrate_plus
- islandora
destination:
plugin: 'entity:node'
default_bundle: islandora_object
migration_dependencies: null
Loading

0 comments on commit 565d5aa

Please sign in to comment.