[ckan-dev] Newbie: CKAN extensions

Stefan Oderbolz stefan.oderbolz at liip.ch
Wed Oct 25 12:43:18 UTC 2017


Hi Andrew,

I try to answer your questions:

1) To list the installed extensions:
>  Do I list the directory /usr/lib/ckan/default/src/ckan/ckanext ?
>  Are all of subdirectories there 'core' extensions?
>

"core" extensions are simply extensions that will be installed, if you
install CKAN. All CKAN extensions belong to the namespace "ckanext", so
here you can find all current core extensions:
https://github.com/ckan/ckan/tree/master/ckanext



> 2) To enable/disable extensions:
>  Do I edit the ckan.plugins value in /etc/ckan/default/production.ini?
>  Is there anything else to do?
>  Does something need to be restarted after editing?
>

You can name your config file differently and place it in a different
directory, but /etc/ckan/default/production.ini is the default (if you
follow the official documentation to install CKAN).
After editing your config file, you need to restart the webserver, so that
the changes take effect.


>  This was my default: stats text_view image_view recline_view
>  Where are they documented?!
>  They have no entries in the extensions.ckan.org website.
>  A google search finds a passing mention in maintaining/data-viewer.html#
> text-view
>

extensions.ckan.org is a place for the community to promote their
extensions, you don't find the core extensions there. Most of them are
documented in the CKAN documentation:

stats: http://docs.ckan.org/en/ckan-2.7.2/maintaining/stats.html
text_view:
http://docs.ckan.org/en/ckan-2.7.2/maintaining/data-viewer.html#text-view
image_view:
http://docs.ckan.org/en/ckan-2.7.2/maintaining/data-viewer.html#image-view
recline_view:
http://docs.ckan.org/en/ckan-2.7.2/maintaining/data-viewer.html#data-explorer


> 3) To install new extensions:
>  There's no common working method, every single plugin is different?
>  The only common thing is to add the name to ckan.plugins as above?
>  Leaving the documentation about installation to the plugin writer means
> that it's likely to be cryptic ;-)
>

As a developer of a CKAN extension, you have the liberty to do whatever you
want, so some might require more setup than others.

e.g. ckanext-fulltext (
https://github.com/transparenzportalhamburg/ckanext-fulltext#plugin-installation)
adds the possibility to index the contents of resources like PDFs, but it
requires an update to the underlying solr schema, the installation of
additional packages on the server + the normal CKAN installation process.

But apart from more advanced extensions like these, most ckan extensions,
require 3 steps to install:
1. Load your virtualenv
2. Run the installation with pip
3. Add the plugin name to your configuration file (ckan.plugins)

e.g. for ckanext-dcat (https://github.com/ckan/ckanext-dcat#installation):
1. $ pip install -e git+
https://github.com/ckan/ckanext-dcat.git#egg=ckanext-dcat
2. $ pip install -r ckanext-dcat/requirements.txt
3. ckan.plugins = dcat

4) To configure extensions:
>  Unknown
>

This depends entirely on the author of the extension. Some extension
mention certain config options that they require, some provide a web UI to
configure, some use paster commands


Generally: there are best practices, check the repositories of the "ckan"
organization on GitHub starting with "ckanext-":
https://github.com/ckan?utf8=%E2%9C%93&q=ckanext-&type=&language=
And yes this is a rather technical/complex task that is not suitable for
everybody.

Hope this helps.

- Stefan


-- 
Liip AG  // Limmatstrasse 183 //  CH-8005 Zürich
Tel +41 43 500 39 80 // GnuPG 0x7B588C67 // www.liip.ch
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20171025/ce997af8/attachment-0003.html>


More information about the ckan-dev mailing list