bodleian / iiif-manifest-editor

The Bodleian's IIIF Manifest Editor
http://dmt.bodleian.ox.ac.uk/
MIT License
82 stars 22 forks source link

Change manifest discovery to fetch from top-level collection URIs instead of hard-coded JSON #40

Closed emmastanford closed 6 years ago

emmastanford commented 7 years ago

Instead of copying the collection to a JSON file hosted on the server, have a file with a list of top-level collection URIs. This way we can easily add new collections, and existing collections will be up-to-date. I don't know how significantly this will affect load time. Possibly the fetched collections could be cached locally for a set time, if fetching them anew each time slows things down a lot.

jeffreycwitt commented 7 years ago

+1, SCTA collections update fairly often. Manifest editor discovery will become out of date very quickly if results are not periodically refreshed.

schwemmer commented 7 years ago

The reason why I did it this way, besides performance, is that some of the providers do not work when I fetch the collection URI because of CORS issues. Here is a complete list of which providers I added and which ones work and don't work:

So I will either have to remove Biblissima, SCTA and Stanford or look into other ways of making the request without getting blocked or have those 3 content providers at CORS headers to their collection URLs.

@jeffreycwitt The error I get for SCTA, for example, looks like this:

Fetch API cannot load http://scta.info/iiif/collection/scta. Redirect from 'http://scta.info/iiif/collection/scta' to 'http://scta.info/iiif/scta/collection' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:3000' is therefore not allowed access.

schwemmer commented 7 years ago

@jeffreycwitt I just noticed that when I update the collection URI for SCTA to http://scta.info/iiif/scta/collection (instead of http://scta.info/iiif/collection/scta) it works perfectly!

I got the wrong URL from https://github.com/ryanfb/iiif-universe/blob/gh-pages/iiif-universe.json

schwemmer commented 7 years ago

I created a PR on IIIF Universe to update the collection URIs for SCTA and e-codices: https://github.com/ryanfb/iiif-universe/pull/11

schwemmer commented 7 years ago

@emmastanford The top-level collections for all content providers are now fetched directly from the collection URIs instead of hard-coded. Sadly, I had to remove Biblissima and Stanford for this. But I am confident that we can bring them back before too long...

And I added 3 new content providers too: National Library of Scotland, Durham University and TextGrid.

Could you test these changes using the develop branch and let me know if all looks fine to you? I will then merge into master.

regisrob commented 6 years ago

@schwemmer cc @emmastanford The CORS issue on the top-level collection URL should be fixed now: http://biblissima.fr/iiif/collection/top Thanks for the feedback, and do not hesitate to tell me if anything wrong in the IIIF collections or anywhere else...

As an alternative to the current Biblissima logo (yellow on a blue background), which is very small due to the baseline text, you could use one of this two images instead, if you want: http://static.biblissima.fr/images/logo-biblissima-300w.png (transparent png) or http://static.biblissima.fr/images/logo-biblissima-350w.jpg (black text on white background)

schwemmer commented 6 years ago

Thank you @regisrob!

schwemmer commented 6 years ago

@emmastanford I think we can merge this to master

emmastanford commented 6 years ago

Wonderful!

schwemmer commented 6 years ago

Merged to master and deployed to the Heroku instance: http://morning-journey-27147.herokuapp.com

emmastanford commented 6 years ago

We'll be deploying this in the Bodleian instance next week as part of a larger set of updates.