Set supplementary information for a licence

Description

eResource Managers can optionally add supplementary documents to a License record, as well as remove them or edit their details.

  • No other non-admin roles can manage supplementary License information

Workflow / UI Notes

  • Set from within License (edit pane) > Supplementary Information panel when editing the License record.

  • Display within License (preview pane) > Supplementary Information panel.

  • Sort by

    • document category (alphabetic)

    • document name (alphabetic)

Data stored for supplementary documents associated with License records:

  • Name (string) (required)

  • document location (at least one of the following is required)

    • Physical Location (string)

    • URL (url)

  • Note (paragraph) (optional)

  • Document Category (tenant-defined list, no default) (optional required). For test purposes, pre-populate options with:

    • Consortium authorisation statement

    • Product data sheet

    • Vendor terms and conditions

Notes, constraints and business rules

  • A License can have 0, 1 or multiple supplementary information documents associated with it.

  • Each supplementary document may have 0 or 1 document category

  • Document Category options are for supplementary information only

Out of Scope

  • File upload

  • UI for configuring document categories

Assumed FOLIO UI conventions are followed for fields and validation, including visual indicators for presenting external URLs and display of empty fields (such as notes)

Attachments

3
100% Done

Checklist

hide

TestRail: Results

Activity

Show:

Jag Goraya April 24, 2019 at 5:44 PM

Sorting requirements not resolved, but not blocking. Proceeding to QA without. Bug to be raised as necessary.

Claudia Malzer April 18, 2019 at 4:48 PM

Thanks . Override the compareTo method was something I thought of, because I did that in a java project before. But I get a type-mismatched error when I add the line SortedSet supplementaryDocs to License.groovy

Ian Ibbotson (Use this one) April 18, 2019 at 2:19 PM
Edited

Ah - the general consensus seems to be to replace the Set with a SortedSet implementation - Be worth talking this through with steve - he might have done this before.

https://stackoverflow.com/questions/2840364/what-is-the-best-way-to-declare-sorted-association-in-grails-domain-classes

Ian Ibbotson (Use this one) April 18, 2019 at 2:15 PM

Hmm thats tricky - unfortunately the default sort order on collections needs the reciprocal belongsTo: element on the related class. Because, in this case, that class is DocumentAttachment, which is linked to in two different ways, we can't do that here.

It might be that simply specifying the sort: order on the documentAttachment class will automatically be applied to the subquery that gets run - I'd try that first - for example :

class Book {

static mapping = {
sort "releaseDate"
}
}

If that doesn't work, then we might need to be more creative - One approach would be to create @transient getSortedDocs() {.... which returns a list with a manual .sort() applied - thats not pretty, or symmetrical with the put call, but it might work.

No more thoughts at the moment... pondering...

Claudia Malzer April 17, 2019 at 4:51 PM

, : turns out that I need help with the sorting. Tried to do it the same way as in Entitlement.groovy in mod-agreements, but I get the following error:

nested exception is org.grails.datastore.mapping.model.DatastoreConfigurationException: Default sort for associations [org.olf.licenses.License->supplementaryDocs] are not supported with unidirectional one to many relationships.

Done

Details

Components

Assignee

Reporter

Labels

Priority

Story Points

Sprint

Development Team

Bienenvolk

TestRail: Cases

Open TestRail: Cases

TestRail: Runs

Open TestRail: Runs
Created March 9, 2019 at 10:06 AM
Updated May 28, 2019 at 8:45 AM
Resolved April 25, 2019 at 6:29 PM
TestRail: Cases
TestRail: Runs