[ckan-dev] Multiedit: Extension to allow easy editing of multiple datasets at once
Jaakko Louhio
jaakko.louhio at floapps.com
Fri Feb 24 13:57:28 UTC 2012
Hi,
There was need for an easy way to update multiple datasets at once in a
CKAN project I'm currently involved in. I figured that there might be need
for this kind of functionality elsewhere too, so I made an extension
called 'multiedit'. Here is a brief overview of what this extension does
and how it works.
What the extension does is, it implements a new view for CKAN dataset
search. Search works just like the regular CKAN search. The new view shows
package title and a selected field in a table form. This table is also
sortable. Editing is done by the CKAN dataset edit form, which is reduced
with javascript to show one field at a time (the selected field is shown
on the table). This allows easy multiediting using the same custom forms
that are already used to edit datasets in CKAN anyway. Hopefully this
solution should work with most form customizations.
From the edit form, you can select which field you want to edit and new
values for selected field. Table allows you to select datasets to edit.
New values are then updated to datasets through CKAN api. There is a fancy
spinner showing that update is in progress and new values are updated to
table when update is finished, etc.
In order to use 'multiedit', user needs to be logged in. This is because
updates are done by CKAN api using ajax and updates through api require
apikey, if I'm not mistaken.
Listing even couple of hundred datasets can be taxing, so there is a
configuration value in CKAN config to allow selecting sane limit to how
many datasets can be listed and edited at once.
Extension is currently located at
https://bitbucket.org/floapps/ckanext-multiedit
There is a branch for CKAN 1.4.x version, which it was originally
developed for, and also a branch for CKAN 1.5.x version, which may or may
not be compatible with CKAN 1.6 version.
There are still some rough spots in this extension that may need to be
sorted out, but it works already quite well. As for future plans regarding
this extension, adding multiple datasets to a group at once could be a
feature to add.
If there are questions about this extension, I'll be happy to answer them.
-- Jaakko
More information about the ckan-dev
mailing list