| 3 | | Replacement of the single 'Download url' field with a table that can have multiple rows, each containing a URL, the format and a description. Full read and write access to this table in the Web UI and over the REST API. |
| | 3 | == As a == |
| | 4 | |
| | 5 | User (package editor and package user) |
| | 6 | |
| | 7 | == I want to == |
| | 8 | |
| | 9 | (package editor) |
| | 10 | Associate multiple distributions with a package. |
| | 11 | |
| | 12 | (package user) |
| | 13 | Easily have access to multiple distributions of a package should they exist. |
| | 14 | |
| | 15 | == Implementation == |
| | 16 | |
| | 17 | There is an object called 'Distribution' with the following attributes: |
| | 18 | |
| | 19 | * url (text) (required in UI, but not in db table) |
| | 20 | * format (text) |
| | 21 | * description (text) |
| | 22 | * package (association) - a distribution is always associated with 1 package |
| | 23 | |
| | 24 | A package's list of distributions will have an order which is preserved. The first in the list will be known as the 'default distribution'. |
| | 25 | |
| | 26 | === How to replace download url === |
| | 27 | |
| | 28 | download_url removed and replaced as a proxy attribute. Read returns the url of the default distribution. Write changes the url of the default distribution. Ensures backward compatibility. |
| | 29 | |
| | 30 | REST API has new attribute in package dictionary 'distributions' - an ordered list. |
| | 31 | |
| | 32 | In WUI, replace download url in package read with a table of the distributions. |
| | 33 | |
| | 34 | In the WUI package edit, be able to add/remove/edit/reorder distributions. |
| | 35 | |
| | 36 | == Example == |