New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mapping collection #35
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be managed using the spring data rest approach for association endpoint
https://docs.spring.io/spring-data/rest/docs/current/reference/html/#repository-resources.association-
it will be useful to state something about the "inverse endpoint". Which is our plan? do we want to implement the item mapper functionality also on the collection side (i.e. /api/core/collections/:uuid/items)?
items.md
Outdated
@@ -137,6 +137,172 @@ Example: <https://dspace7.4science.it/dspace-spring-rest/#https://dspace7.4scien | |||
|
|||
It returns the collection where the item belong to | |||
|
|||
### Mapping Collections | |||
**GET /api/core/items/<:uuid>/mappingCollections** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is an association. This should be included in the list of links returned by the single item endpoint.
It is important to clarify if the returned list include or not the owningCollection. I have no strong preference about it: probably excluding the owningCollection from the returned list could simplify some use cases on the client side but I guess it will add extra effort on the rest implementation or at least some "hack" on the code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with @abollini.
Also, I wonder if this should simply be called collections
in the links
on an Item...especially if we have it also include the owningCollection
. I don't see a reason to actually use the term "mapping" or "mapped" in the REST API unless we really need to distinguish it from owningCollection
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the "included in the list of links returned by the single item endpoint", are you implying the HAL link to mappingCollections as displayed in
https://dspace7-internal.atmire.com/rest/#/rest/api/core/items/a649a58a-6b5a-4c15-9151-093cd6841491
Would you just want us to also update the item Rest Contract to contain this HAL links in the sample JSON?
The mapping collections don't include the owning collection, we will mention that explicitly in the Rest Contract
The reason to be explicit about this being mapping collections is to also easily allow a UI to add/remove mapping collections for an item. The difference with the owning collection is important here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Overall, this looks good now. I will however admit that I don't really like the term mappingCollections
as "mapping" sounds like an action, not an object/resource. I'd prefer this endpoint be renamed to mappedCollections
. But, if others are OK with this terminology, I'll let it go (I don't feel that strongly here).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
items.md
Outdated
@@ -137,6 +137,172 @@ Example: <https://dspace7.4science.it/dspace-spring-rest/#https://dspace7.4scien | |||
|
|||
It returns the collection where the item belong to | |||
|
|||
### Mapping Collections | |||
**GET /api/core/items/<:uuid>/mappingCollections** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
Thanks @abollini for the feedback. |
2203a43
to
c927c23
Compare
conflict on #44 has been solved. I suggest to merge it as by my understanding it reflects what we agree and don't require further work in fixing links |
Merging, as this has been updated as requested and has approval from myself & @abollini . |
This PR includes alterations to the items.md contract to add for mapping of items to collections.
JIRA: https://jira.duraspace.org/browse/DS-4097