Spike: eholdings App and License App Integration
Priority
Labels
Environment
Template
Description
Development Team
Release
Story Points
Sprint
clones
relates to
Checklist
hideTestRail: Results
Activity
Ian Ibbotson (Use this one) January 25, 2019 at 2:47 PMEdited
TL;DR : I updated the module README.md https://github.com/folio-org/mod-licenses with info on how mod-licenses supports the scenarios in this use case. Happy to talk about the extended support needed to get mod-licenses to store links to things. Not a massive task IMO
Search for licenses by doing a http GET to /licenses/licenses.
This endpoint supports the filters= query parameter as per mod-agreements. Any property in the license domain (https://github.com/folio-org/mod-licenses/blob/master/service/grails-app/domain/org/olf/licenses/License.groovy) model can be used, for example
curl --header "X-Okapi-Tenant: diku" "http://localhost:9130/licenses/licenses?filters=name%3dtest&stats=true"
will search for a license name starting with test. Looking at the domain model, you will see that License extends Taggable
License also extends CustomProperties
Create a license by posting to that URL endpoint also
curl -sSL -H 'Accept:application/json' -H 'Content-Type: application/json' -H 'X-OKAPI-TENANT: diku' -XPOST "$TARGET/licenses/licenses" -d '
{
"name": "Academic Rights Press/Test Consortium/InteLex Collections - Perpetual Purchase Agreementi 2",
"description": "This is a test licenses",
"customProperties": {
"licenseEndAdvanceNoticeRequired": ["Yes"]
}
}
'
Linking to licenses
Licenses does not currently store links to any other objects (For example, agreements points in to licenses, not vice-versa) - so we would expect people wanting to refer to a license to find the license and then refer to it's .id property ( a UUID).
We could however add an arbitrary references list to licenses that allow links to anything else in the folio system like this
License.links [ { linkToType:'eholdings.package', linkToId:'ID-OF-EHOLDINGS-PACKAGE' },... ]
We would need to schedule that work however, please shout if you want us to do this. It's not currently the way links to licenses are organised tho.
Ability to link to attached license
Obviously, if you store the UUID of the license, you just link to /licenses/licenses/UUID - that works today
If you want to have references to external systems, as the suggestion above, you would use the query api to find all licenses attached, that would look something like this:
curl --header "X-Okapi-Tenant: diku" "http://localhost:9130/licenses/licenses?filters=links.linkToType=eholdings.package&filters=links.linkToId=ID-TO-LINK&stats=true"
This would work automatically once the domain model above was set up.
Ability to return the number of licenses
using the query endpoint curl --header "X-Okapi-Tenant: diku" "http://localhost:9130/licenses/licenses with &stats=true returns the number of licenses in the system (As you are implicitly doing a search for *). You can filter by license status values, or query the refdata endpoint to get refdata value lists.
Current mod-license clients would do this by nulling out the UUID in their own store, so is no business of license.
In the world were we enable licenses to have outbound links, PUTting
links : [ { id:UUID-OF-LINK, _delete:trie } ] to /licenses/licenses/{UUID_OF_LICENSE}
would cause the license link to be deleted. This would work automatically, once the domain model for links was established.
A library may want to use the Licenses app to track license documentation between the library and a vendor. We want to support the ability for a library to associate a license(s) to an eholdings provider/package/title+package record.
The library should be able to add a license to
one provider
multiple package
multiple title+package
Screenshots
https://drive.google.com/file/d/1B-2EkPollcCibuMT28np2-BvV8LdODcD/view?usp=sharing
https://drive.google.com/file/d/1d0uF1fz2il_mzLLzzf5BJhK7EphvZqq2/view?usp=sharing
Spike Deliverables:
Determine if current License App functionality supports
Ability to search for Licenses [done]
Ability to create Licenses [done]
Ability to attach a license to eholdings provider / package/ title+package [done]
Ability to access attached license record via eholdings provider/package/title+package detail records [done]
Ability to return # of licenses and statuses [done]
Ability to unassign a license from a provider/package/title+package [done]
Determine approach to store relationships between Licenses and eholdings. [done. Licenses app will support storing relationship with link array.]
Determine if Licenses app can support the above screenshots
Document findings on confluence
Present to team