[ckan-dev] Organization hierarchy

Stefan Oderbolz stefan.oderbolz at liip.ch
Tue Aug 9 07:30:26 UTC 2016


Hi Lucia,

we used ckanext-hierarchy for opendata.swiss as well. All you have to do is
to override the organization_tree.html template and add your customization.
For the Swiss portal, we had to make sure, that the organizations are
translated correctly (you can find the code here:
https://github.com/ogdch/ckanext-switzerland/blob/master/ckanext/switzerland/templates/organization/snippets/organization_tree.html
).


As for your problem of datasets belonging to multiple organizations: this
is a rather hard problem. To enable this is CKAN core would require to
rewrite a lot of code, as the authorization is connected to organization
(i.e. as a member of an organization, you can edit its datasets). If this
is more a display issue, I'd suggest to tweak the Solr index. The package
controller interface has a method "before_index" that you can use to do
this (see
http://docs.ckan.org/en/latest/extensions/plugin-interfaces.html#ckan.plugins.interfaces.IPackageController.before_index).
I would probably create a new field where you can save all organizations.
In the end this shouldn't be hard, as it already works for groups and under
the hood organizations are implemented as groups.

I'd be very interested in this kind of improvement, as this is a
requirement we might encounter as well.

Best Regards Stefan

On Mon, Aug 8, 2016 at 8:04 PM, <lucia.espona at wsl.ch> wrote:

> Hi everyone,
>
> I would like to have a hierarchical structure for my organizations so I
> used the extension https://github.com/datagovuk/ckanext-hierarchy.
>
> I plan to improve the display, that seems an easy task but if someone has
> already done some work I will be very grateful if it can be shared with me.
>
> I also would like that the datasets from one organization also belong to
> the parent one. For example, I want that when you filter the datasets on
> the facets by one organization, all the datasets belonging to its
> children appear.
>
> Any hints how to achieve this? One solution would be to allow datasets to
> belong to more than one organization, alternatively I guess one could
> configure the indexing for Solr.
>
> Many thanks in advance for your help.
>
> Best,
> Lucia
>
> _________________________________________________________
> Dr. Lucia Espona Pernas
>
> Swiss Federal Institute for Forest, Snow and Landscape Research WSL
> Hauptgebäaude Labortrakt (HL C21)
> Zürcherstrasse 111
> 8903 Birmensdorf
> Switzerland
>
> +41 44 739 28 71 phone direct
> +41 44 739 21 11 reception
>
> www.wsl.ch
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> https://lists.okfn.org/mailman/listinfo/ckan-dev
> Unsubscribe: https://lists.okfn.org/mailman/options/ckan-dev
>
>


-- 
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/20160809/52a9d89c/attachment-0003.html>


More information about the ckan-dev mailing list