Skip to main content

CKAN Organization hierarchy - templates and configuration

Project description

Travis CI status

Latest version on pypi

License

ckanext-hierarchy - Organization hierarchy for CKAN

Organizations can be arranged into a tree hierarchy.

This new hierarchical arrangement of organizations is displayed using templates in this extension, instead of the usual list: Screenshot of organizations page

Provides a new field on the organization edit form to select a parent organization: Screenshot of organization edit page

When viewing an organization you see its context within the tree in the side bar. In addition you can widen search of the organization's datasets to include datasets in sub-organizations too: Screenshot of organization page

Technical details

Templates:

  • /organization - now shows the organization hierarchy instead of list
  • /organization/about/{id} - now also shows the relevant part of the hierarchy

Snippets (used by hierarchy and ckanext-scheming):

  • /scheming/form_snippets/org_hierarchy.html

In order to make hierarchy work with ckanext-scheming you need to enable hierarchy and then use corresponding form_snippet in your org_schema. For example, you may add next field:

{
    "field_name": "not_used",
    "label": "Parent organization",
    "display_snippet": null,
    "form_snippet": "org_hierarchy.html",
    "validators": "ignore_missing"
}

Optionally one could also specify a full name and leave the field 'title' for the short name or acronym (more convenient for display).

{
    "field_name": "longname",
    "label": "Full Name",
    "validators": "ignore_missing unicode",
    "form_snippet": "large_text.html",
    "form_attrs": {"data-module": "slug-preview-target"},
    "form_placeholder": "My Organization full name",
    "display_snippet": null
}

TODO:

  • make the trees prettier with JSTree

Requirements

This extension requires CKAN v2.8 or later.

Installation

To install ckanext-hierarchy:

  1. Activate your CKAN virtual environment, for example:

    . /usr/lib/ckan/default/bin/activate
    
  2. Install the ckanext-hierarchy Python package into your virtual environment:

    cd /usr/lib/ckan/default/src
    pip install -e "git+https://github.com/davidread/ckanext-hierarchy.git#egg=ckanext-hierarchy"
    pip install -r ckanext-hierarchy/requirements.txt
    
  3. Add hierarchy to the ckan.plugins setting in your CKAN config file (by default the config file is located at /etc/ckan/default/production.ini).

  4. Restart CKAN. For example if you've deployed CKAN with Apache on Ubuntu:

     sudo service apache2 reload
    

Config settings

None at present

Tests

To run the tests, do::

pytest --ckan-ini=test.ini ckanext/hierarchy/tests

Licence and copyright

This module is openly licensed with AGPLv3 - see LICENSE file.

Copyright belongs to commit authors. Commits 2013-2017 by @davidread are Crown Copyright.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ckanext-hierarchy-1.0.2.tar.gz (25.3 kB view details)

Uploaded Source

Built Distribution

ckanext_hierarchy-1.0.2-py3-none-any.whl (28.6 kB view details)

Uploaded Python 3

File details

Details for the file ckanext-hierarchy-1.0.2.tar.gz.

File metadata

  • Download URL: ckanext-hierarchy-1.0.2.tar.gz
  • Upload date:
  • Size: 25.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.1 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0

File hashes

Hashes for ckanext-hierarchy-1.0.2.tar.gz
Algorithm Hash digest
SHA256 da9d579dacd2872b3f798cec8429907e18f40dca37f11dcf838c8f51125d9d3f
MD5 ffe4dae11f6c884c93af98d93c2f0627
BLAKE2b-256 6ff9bb5230c349959994b355f495316295fc2567e05a63c0bed8cd119382dbfd

See more details on using hashes here.

Provenance

File details

Details for the file ckanext_hierarchy-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: ckanext_hierarchy-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 28.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.1 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0

File hashes

Hashes for ckanext_hierarchy-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 766d046f261d2e27f86460de3a07847af4009c1ef055a664bf63f4c9ed170e4b
MD5 19fce560a2c5bf3c6eb0a17c63cfa225
BLAKE2b-256 229486fc2fe55dbf6110f59a4f8e36bd01feed1b203b42c18c50af31a23ada32

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page