Ticket #189 (closed enhancement: fixed)
Multiple download urls
Reported by: | dread | Owned by: | dread |
---|---|---|---|
Priority: | critical | Milestone: | v0.11 |
Component: | ckan | Keywords: | |
Cc: | Repository: | ||
Theme: |
Description (last modified by dread) (diff)
See also: PackageResources which defines a 'distribution' as a package's payload (perhaps with metadata). In our case, at least within CKAN, the representation of the distribution will just be the reference to get it (plus some minor metadata). We are expanding this functionality to be any kind of 'resource' associated with a package since it is likely in some cases people will want to link to a file containing a part, but not the whole, of a package's data.
As a
User (package editor and package user)
I want to
(package editor) Associate multiple distributions with a package.
(package user) Easily have access to multiple distributions of a package should they exist.
Implementation
There is an object called 'Resource' with the following attributes:
- url (text) (required in UI, but not in db table)
- format (text)
- description (text)
- package (association) - a resource is always associated with 1 package
A package's list of resources will have an order which is preserved. The first in the list will be known as the 'default resource' (the presumption will always be that this is a 'distribution').
How to replace download url
download_url removed and replaced as a proxy attribute. Read returns the url of the default distribution. Write changes the url of the default resource. Ensures backward compatibility.
REST API has new attribute in package dictionary 'resouces' - an ordered list.
In WUI, replace download url in package read with a table of the distributions.
In the WUI package edit, be able to add/remove/edit/reorder distributions.
Example
Example part of package:
Distributions:
http://some.com/pollution.pdf | Original report | |
http://some.com/pollution.csv | csv | Original data |
http://some.com/pollution | sparql | Linked version of data |
Existing data to be migrated to new structure.
Cost: 4 days
Change History
comment:2 Changed 4 years ago by dread
- Priority changed from awaiting triage to critical
- Description modified (diff)
comment:5 Changed 4 years ago by dread
- Status changed from new to closed
- Resolution set to fixed
All done in 5 days in: cset:5c7f0ebd728c cset:20374a1ee763 cset:02ce73aef595 cset:36eda4112f72 cset:dd285dd1b821
Also made relevant changes in importer, create-search-test-data and data4nr. It wasn't clear that download_url could be made a SA proxy, so instead put download_url proxy in the REST interface to maintain compatibility with existing clients.