Extension Switzerland Ng


Extension Basics

Title
Switzerland Ng
Name
ckanext-switzerland-ng
Type
Public extension
Description
The `ckanext-switzerland-ng` extension enhances CKAN for use with DCAT-AP Switzerland, providing te
CKAN versions
Download-Url (zip)
Last commit
7 months ago (2025-06-06 14:39:42)
Url to repo
Category
Content Management


Background Infos

Description (long)
Show details

ckanext-switzerland

CKAN extension for DCAT-AP Switzerland, templates and different plugins for opendata.swiss.

Requirements

  • CKAN 2.6+
  • ckanext-scheming
  • ckanext-fluent

Update translations

To generate an updated ckanext-switzerland.pot file inside the Docker container, use the following commands:

docker-compose exec ckan bash
source /usr/lib/ckan/venv/bin/activate
cd /usr/lib/ckanext/ckanext-switzerland-ng/
python setup.py extract_messages

Copy any new strings that you want to translate from the new ckanext-switzerland.pot into the ckanext-switzerland.po file for each language, and add the translations.

After that compile the po files into mo files:

python setup.py compile_catalog

Log out of the ckan container (ctrl+D) and restart it for the new translations to be used:

docker-compose restart ckan

Installation

To install ckanext-switzerland:

  1. Activate your CKAN virtual environment, for example:

    . /usr/lib/ckan/default/bin/activate

  2. Install the ckanext-switzerland Python package into your virtual environment:

    pip install ckanext-switzerland

  3. Add switzerland 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

This extension uses the following config options (.ini file)

# the URL of the WordPress AJAX interface
ckanext.switzerland.wp_ajax_url = https://opendata.swiss/cms/wp-admin/admin-ajax.php

# number of harvest jobs to keep per harvest source when cleaning up harvest objects   
ckanext.switzerland.number_harvest_jobs_per_source = 2

# piwik config
piwik.site_id = 1
piwik.url = piwik.opendata.swiss

# Name and Email Address for notifications about new showcases
ckanext.switzerland.showc
Version
Version release date
(not set)
Contact name
opendata.swiss
Contakt email
(not set)
Contact Url
(not set)


Installation Guide

Configuration hints

To install ckanext-switzerland:

  1. Activate your CKAN virtual environment, for example:

    . /usr/lib/ckan/default/bin/activate

  2. Install the ckanext-switzerland Python package into your virtual environment:

    pip install ckanext-switzerland

  3. Add switzerland 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:

Plugins to configure (ckan.ini)
switzerland_ng
CKAN Settings (ckan.ini)
# ckanext.switzerland.wp_ajax_url = https://opendata.swiss/cms/wp-admin/admin-ajax.php
# ckanext.switzerland.number_harvest_jobs_per_source = 2
# ckanext.switzerland.showcase_admin_email =
    ckanext.switzerland.showcase_admin_name =
# ckanext.switzerland.env = local
# ckanext.switzerland.prod_env_url =

    # URL to use for constructing the SWITCH connectome url for a dataset
# ckanext.switzerland.switch_connectome_base_url =

## Development Installation
DB migration to be executed
(not set)
<< back to Extensions