MarcusBarnes / islandora_compound_batch

Provides the basic ability to batch import compound objects into Islandora.
GNU General Public License v3.0
3 stars 12 forks source link

Allow assignment of content model for parent objects #26

Closed mjordan closed 6 years ago

mjordan commented 6 years ago

If you uncheck the option "Only allow compound objects to have child objects associated with them" at admin/islandora/solution_pack_config/compound_object (Administration > Islandora > Solution Pack Configuration > Compound Object Solution Pack), any object, regardless of its content model, can have children. Currently, the content model of the parent objects created by this module is hard coded at https://github.com/MarcusBarnes/islandora_compound_batch/blob/master/includes/object.inc#L175. It would be useful to all the user to pass in a --parent_content_model parameter to override this.

mjordan commented 6 years ago

I'll work on a PR for this.

mjordan commented 6 years ago

Thinking about this a bit more, we probably want to provide a couple options:

For example, if we had input like this:

input_directory
├── parent_one
│   ├── first_child
│   │   ├── MODS.xml
│   │   └── OBJ.jp2
│   ├── second_child
│   │   ├── MODS.xml
│   │   └── OBJ.jp2
│   └── MODS.xml
│   └── OBJ.tiff  // <- parent_one's binary
└── parent_two
    ├── first_child
    │   ├── MODS.xml
    │   └── OBJ.jp2
    ├── second_child
    │   ├── MODS.xml
    │   └── OBJ.jp2
    └── OBJ.pdf  // <- parent_two's binary
    └── MODS.xml

The presence of OBJ.tiff would assign the islandora:sp_large_image_cmodel content model to parent_one, and the presence of OBJ.pdf would assign the islandora:sp_pdf content model to parent_two.

Questions about the first example, where the parents have binary files that determine their content models:

  1. should we require a drush parameter (maybe something like --parent_content_model=any?) or let the mere presence of a binary file at the parent level determine what content model to assign?
  2. in the first example, if there is no binary, do we default to islandora:compoundCModel?
mjordan commented 6 years ago

@MarcusBarnes any thoughts on the previous comment?

MarcusBarnes commented 6 years ago

Addressed in pull-request https://github.com/MarcusBarnes/islandora_compound_batch/pull/35 (merged with commit https://github.com/MarcusBarnes/islandora_compound_batch/commit/153903765a61eb0f938e8c10468b3d3d213a1e81).