Skip to content
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

Appending various file extenstions to a collections URL doesn't return helpful, Blacklight-style responses #3261

Open
sandbergja opened this issue Sep 11, 2018 · 1 comment

Comments

@sandbergja
Copy link

Descriptive summary

Blacklight has a lot of handy views that you can access by appending a file extension to a page. For example, you can add .json to the end of a search results or show page to get a JSON representation of it (handy for checking how solr has it indexed). You can add .rss to a search to get an RSS feed for that search.

This is mainly true in hyrax, too. I can append to a search results page (e.g. http://libarchive.linnbenton.edu/catalog.rss?utf8=%E2%9C%93&search_field=all_fields&q=%22sheep+dogs%22) or a show page (http://libarchive.linnbenton.edu/concern/open_educational_resources/ns064618f.json?locale=en). However, I run into problems when I append .rss or .json to a collections page.

Rationale

Our use case for RSS feeds is to embed lists of certain items in our collections into subject and course guides (generated by SubjectsPlus or Libguides). We can still get this from Hyrax, so it's not urgent by any means. It's just not consistent that we can't get this by simply appending .rss to the collection URL.

Our use case for JSON views is to quickly and easily check how solr has a collection indexed.

Behavior

When I append .rss to a collection URL in my 2.2.3 Hyrax instance, I get a completely empty response (http://libarchive.linnbenton.edu/collections/gf06g286m.rss). There is another way to get an RSS feed of a collection, so this isn't a huge loss: you can just do a search limited by your collection, and then append ".rss" to that. (e.g. http://libarchive.linnbenton.edu/catalog.rss?f[member_of_collections_ssim][]=The+Commuter)

When I append .json to a collection URL, I get a 500 error... in JSON! Here's the response:

{"status":500,"error":"Internal Server Error"}

Steps to reproduce the behavior

  1. Navigate to a collection in your Hyrax instance (perhaps using the "Explore Collections" area on the hyrax main page).
  2. Append .rss, .json, or .xml to the URL (before all the parameters you might be passing, like ?locale=en)
@no-reply no-reply added this to the Backlog milestone Sep 11, 2018
@no-reply no-reply added the api label Sep 11, 2018
@no-reply
Copy link
Contributor

Note that a JSON collections issue was recently closed in #3257.

@vantuyls I think we are a bit overdue for a serious API design session. I've created an api tag to help capture these issues.

@hweng hweng self-assigned this Sep 19, 2018
@hweng hweng removed their assignment Oct 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants