[ckan-dev] Creation of datasets/resources via API
Aaron McGlinchy
McGlinchyA at landcareresearch.co.nz
Sun Mar 29 21:45:17 UTC 2015
We have an addin for excel that records metadata, does some QA, and posts the worksheet(s) to our test CKAN instance as either or both tab delimited text (.tsv) or xlsx files.
We can get it to create a new datatset and load the worksheets as resources, along with metadata.
There are a couple of things causing us problems:
1) we have established some licence choices for users in a json file, so via the web interface they appear in the drop down. When we set the licences field value via the API the value looks like it has been set, but unlike when created via the web UI the licence text on the lower left side does not have the hyperlink to the licence details. AND, when we go manage the dataset the value that we had set for licence reverts to another value (the first choice in the licence 'list'), and when you save any edits (or even if you yourself made no changes) then the licence is 'activated' (i.e. hyperlink works) when viewing the record. Note - the value we are setting for the licence is the same as those in the 'list'.
2) Similarly, when we set a spatial 'extra' field with some (valid) geojson value, then value gets stored, but it is not 'activated' in the sense that a spatial extent is displayed (it is just blank), but if you mange/edit the dataset, do not make any change, and simply save ('update dataset'), then the dataset extent becomes active and the info in the spatial field is displayed.
So, question is how do we 'activate' the value we set for licence and spatial from the API, and hopefully doing so will fix the issue of the licence getting changed if the dataset is managed/edited.
Thanks
Aaron
________________________________
Please consider the environment before printing this email
Warning: This electronic message together with any attachments is confidential. If you receive it in error: (i) you must not read, use, disclose, copy or retain it; (ii) please contact the sender immediately by reply email and then delete the emails.
The views expressed in this email may not be those of Landcare Research New Zealand Limited. http://www.landcareresearch.co.nz
More information about the ckan-dev
mailing list