MarcusBarnes / mik

The Move to Islandora Kit is an extensible PHP command-line tool for converting source content and metadata into packages suitable for importing into Islandora (or other digital repository and preservations systems).
GNU General Public License v3.0
34 stars 11 forks source link

Postwritehook suggestion: reorganize output by filetype? #488

Open bondjimbond opened 5 years ago

bondjimbond commented 5 years ago

Use case: I'm running CONTENTdm migrations right now, and just ran into an issue where, of a 619-item image collection, 614 are JPGs and 5 are JP2s. I failed to notice the JP2s, and attempted to ingest the whole set as Basic Images, which of course meant that the five JP2s were not ingested.

In migrations where the source collection contains a mix of content models, it would be helpful to create subdirectories in the output directory, so that objects with different filetypes were appropriately grouped. Should be doable with a post-write hook, I think?

e.g. Right now, my images are all poured into the directory herbarium_output. With the proposed post-write hook, the JPGs would get written to herbarium_output/jpg and the JP2s would go to herbarium_output/jp2.

mjordan commented 5 years ago

This might do the trick: https://github.com/MarcusBarnes/mik/blob/master/extras/scripts/postwritehooks/move_packages_by_extension.php

I just used it in our Summit migration, it was very useful.

bondjimbond commented 5 years ago

Ah, so it already exists! Awesome, thanks. Will give it a try.

mjordan commented 5 years ago

@bondjimbond did this work for you? If so, can you close this issue?