1 | | Add the resource validation page to the form. This page checks resource links, and provides |
2 | | feedback to the user about dead-links, or whether a resource looks like it should be an |
3 | | additional resource rather than a proper resource. |
| 1 | * On the resources tab, there's a "Check Resources" button which, when clicked makes an ajax request |
| 2 | with the list of URLs entered by the user. |
| 3 | |
| 4 | * The server checka each link for errors and header information about the linked resource. (Using |
| 5 | ckanext/archiver/tasks.py:link_checker()). |
| 6 | |
| 7 | * The server returns a list of dicts (json), containing information about the linked resource, and |
| 8 | the client uses that to: |
5 | | **Analysis not carried out yet.** |
| 10 | - populate the format field of each resource |
| 11 | |
| 12 | The (guessed) 'file_extension' populates the '__format' field. If it's 'htm' or 'html', |
| 13 | then we assume it's a listing page, and so don't populate the format field with 'htm' or |
| 14 | 'html'. |
| 15 | |
| 16 | - provide feedback if a URL appears to be invalid |
| 17 | |
| 18 | If the URL doesn't appear to be a URL at all, or returns a HTTP error, or times-out, then |
| 19 | URL field is highlighted in red to indicate it's a bad URL. A tooltip shows the |
| 20 | error message to the user. |
| 21 | |
| 22 | - [Optional] provide feedback if a URL appears to point to "Additional Information" - ie the |
| 23 | Resource should be entered under "Additional Resources", rather than "Timeseries" or |
| 24 | "Individual" datasets. |
| 25 | |
| 26 | Analysis and further description on etherpad: http://ckan.okfnpad.org/dgu-package-form? [Section I] |