Submission Form to Enforce Entity Type Configuration Based on Collection
Describe the bug
I would like a way for our DSpace item-submission.xml and submission-form.xml files to enforce the dspace.entity.type during the submission process. Right now, while we have mapped and defined a custom submission form per Collection Entity type, adding relationships doesn't work because unless we include the Entity dropdown, it picks an Entity for that item "behind the scenes." If we do allow users to specify their Entity, potentially one that doesn't match the Collection Entity type, it throws an error when you try to add a relationship on the form that doesn't match that Item's BTS Entity type, but no explanation why.
To Reproduce
- Create a custom submission form and item submission configuration.
- Map Entities to Collections.
- Try to submit an item for a Collection with a defined Entity without explicitly setting the Entity.
Expected behavior
I would just like the form to get the Entity from the Collection.
Related work
Link to any related tickets or PRs here.
Allow me to further elaborate.
In our item-submission.xml, we have the following Entity defined for collections:
<name-map collection-entity-type="Project" submission-name="Project"/>
<name-map collection-entity-type="ConceptSet" submission-name="ConceptSet"/>
<name-map collection-entity-type="Phenotype" submission-name="Phenotype"/>
<name-map collection-entity-type="Resources" submission-name="Resource"/>
<submission-process name="ConceptSet">
<step id="collection"/>
<step id="ConceptSetForm"/>
<step id="upload"/>
<step id="itemAccessConditions"/>
<step id="cclicense"/>
</submission-process>
However, when we actually try to use the submission form, we expected that the submission form for that Entity Collection would automatically enforce the same Entity for the item being submitted. Instead, the Entity selection defaults to some Entity "behind the scenes" and will return an error if you try to set up relationships.
So you have to allow users to select an Entity and that Entity HAS to be the same as the Collection Entity, if you want Collections to only store Items of its Entity type.
I would like a way to force the selection to be the same as the Collection Entity type. I guess this is perhaps something I could potentially contribute once the "rushed development frenzy" stage of our project is over.