Closed mjordan closed 6 years ago
I'll work on a PR for this.
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.
--parent_content_model
to allow the user to specify a content model for all parents in the batch, e.g., --parent_content_model=islandora:sp_pdf
islandora:compoundCModel
.Questions about the first example, where the parents have binary files that determine their content models:
--parent_content_model=any
?) or let the mere presence of a binary file at the parent level determine what content model to assign?islandora:compoundCModel
?@MarcusBarnes any thoughts on the previous comment?
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).
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.