Skip to content

Commit

Permalink
Merge pull request #27 from discoverygarden/DDST-457
Browse files Browse the repository at this point in the history
DDST-457: Migrate backup datastreams for orig_file migration
  • Loading branch information
nchiasson-dgi authored Sep 20, 2024
2 parents 3a6fd2f + 276da19 commit 18b9c16
Showing 1 changed file with 61 additions and 0 deletions.
61 changes: 61 additions & 0 deletions src/Plugin/dgi_migrate_alter/foxml/DgisOrigFileAlter.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,67 @@ public function alter(array &$migration) {
$process =& $migration['process'];

$process['_source_dsid'][0]['map']['info:fedora/ir:thesisCModel'] = 'PDF';
unset($process['_latest']);

$to_insert['_source_dsid_2'] = [
[
'plugin' => 'static_map',
'source' => '@_models',
'bypass' => FALSE,
'map' => [
'info:fedora/islandora:sp_large_image_cmodel' => 'JP2',
'info:fedora/islandora:pageCModel' => 'JP2',
'info:fedora/islandora:newspaperPageCModel' => 'JP2',
],
],
[
'plugin' => 'extract',
'index' => [0],
],
];

$to_insert['_latest_1'] = [
[
'plugin' => 'dgi_migrate.subindex',
'source' => '@_parsed',
'index_from_destination' => '_source_dsid',
'missing_behavior' => 'skip_process',
],
];

$to_insert['_latest_2'] = [
[
'plugin' => 'dgi_migrate.subindex',
'source' => '@_parsed',
'index_from_destination' => '_source_dsid_2',
'missing_behavior' => 'skip_process',
],
];

$to_insert['_latest'] = [
[
'plugin' => 'null_coalesce',
'source' => [
'@_latest_1',
'@_latest_2',
],
],
[
'plugin' => 'skip_on_empty',
'method' => 'row',
],
[
'plugin' => 'dgi_migrate.method',
'method' => 'latest',
],
];

$position = array_search('_source_dsid', array_keys($process), TRUE);
$process = array_merge(
array_slice($process, 0, $position + 1, TRUE),
$to_insert,
array_slice($process, $position + 1, NULL, TRUE)
);

$logger->info('Migration altered for dgis_orig_file.');
}
Expand Down

0 comments on commit 18b9c16

Please sign in to comment.