Populate access start and access end dates (ERM-395)

[ERM-399] Populate access to/access from dates on PCIs created from GOKb Created: 05/Aug/19  Updated: 19/Sep/19  Resolved: 19/Sep/19

Status: Closed
Project: ERM Platform
Components: None
Affects versions: None
Fix versions: None
Parent: Populate access start and access end dates

Type: Sub-task Priority: TBD
Reporter: Owen Stephens Assignee: Owen Stephens
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original estimate: Not Specified

Sprint: ERM Sprint 70, ERM Sprint 72

 Description   

On importing/sycning data from GOKb to the Agreements Local KB, the access_to and access_from dates on PCIs should be set based on the access_to and access_from dates on GOKb TIPP records (//TIPP/access@start and //TIPP/access@end in XML returned by GOKb OAI endpoint)



 Comments   
Comment by Peter Böhm [ 09/Sep/19 ]

Hey steve.osguthorpe, am I right, that the class gokbToERM in https://github.com/folio-org/mod-agreements/blob/master/service/src/main/groovy/org/olf/kb/adapters/GOKbOAIAdapter.groovy needs to be extended?
How can I test the import functionality?

Comment by steve.osguthorpe [ 09/Sep/19 ]

Peter Böhm So yes. That will need extending along with this class https://github.com/folio-org/mod-agreements/blob/master/service/src/main/groovy/org/olf/dataimport/internal/InternalPackageImpl.groovy#L39 that is the internal schema rep of a `ContentItem` and the interface https://github.com/folio-org/mod-agreements/blob/master/service/src/main/groovy/org/olf/dataimport/internal/PackageSchema.groovy#L51 to include 2 new `LocalDate` properties for the new data.

Then you will need to modify the import service to use those new properties, probably in a few places but start here: https://github.com/folio-org/mod-agreements/blob/master/service/grails-app/services/org/olf/PackageIngestService.groovy#L97

If this is too much I can probably change the schema interfaces and implementations to include them and leave the OAI adapter changes and import service changes for you to do?

Comment by Peter Böhm [ 13/Sep/19 ]

Just as a note:

  • The GBV GOKb currently does not present any TIPPs, and therefore no access start/end dates. The "official" GOKb does (at least TIPPs with empty access start/end dates)
Comment by Peter Böhm [ 13/Sep/19 ]

steve.osguthorpe I added some code: https://github.com/folio-org/mod-agreements/compare/master...peterboehm:ERM-399?expand=1 (sorry for the removal of the spaces, I think I fixed it now in my IDE for the future)
I haven't tested it, since I still have some trouble getting the frontend (stripes/workspace) to run locally.

I assume, that to test the code, one would have to add a package from the Agreements --> E-ressources view as in here and check somehow that access dates are pulled over?

Is it possible to test it at all, when the GBV GOkb does not provide Packages with TIPPs/access dates and the Global GOKb only provides empty values (see comment above)?

Comment by steve.osguthorpe [ 13/Sep/19 ]

Peter Böhm - The best thing to do for testing is to drop your tenant schema and then reregister it. That should cause the gokb import to start again. The link above is only the first page of GOKb data...
You can see that other pages...
https://gokbt.gbv.de/gokb/oai/index/packages?verb=ListRecords&metadataPrefix=gokb&resumptionToken=||3|gokb
Have TIPP data.

This is not populating access start and end dates for an agreement but for the TIPP. I would expect that the access start and ends form the GOKb export are set against the PackageContentItem(s) when fetching one from the resources/{id} endpoint.

Comment by steve.osguthorpe [ 13/Sep/19 ]

Also... What you've done so far is looking good, but it is hard for me to tell properly because of the space differences polluting the view.

Comment by Owen Stephens [ 13/Sep/19 ]

Peter Böhm - Felix Hemme has added some access start/end dates to a TIPP in the test GOKb - see https://gokbt.gbv.de/gokb/oai/packages?verb=ListRecords&metadataPrefix=gokb&resumptionToken=%7C%7C55%7Cgokb

Comment by Peter Böhm [ 15/Sep/19 ]

steve.osguthorpe I have restored the spaces for better visualization: https://github.com/folio-org/mod-agreements/compare/master...peterboehm:ERM-399?expand=1

I'm not sure how to drop the tenant schema and reregister it.

So, what's left to do: The code has to be tested, whether it is sufficient or whether more changes are needed.

Generated at Fri Feb 09 00:19:43 UTC 2024 using Jira 1001.0.0-SNAPSHOT#100246-sha1:7a5c50119eb0633d306e14180817ddef5e80c75d.