ckanext-switzerland
CKAN extension for DCAT-AP Switzerland, templates and different plugins for opendata.swiss.
Requirements
- CKAN 2.11+
- ckanext-scheming
- ckanext-fluent
Installation
- Activate your CKAN virtual environment
- Install the ckanext-switzerland-ng Python package:
git clone https://github.com/opendata-swiss/ckanext-switzerland-ng.git
cd ckanext-switzerland-ng
pip install -e .
- Add relevant plugins to the
ckan.plugins setting. This package contains several plugins. See project.entry-points."ckan.plugins" in pyproject.toml for an up-to-date list.
- Restart CKAN
Config Settings
See ckanext/switzerland/config_declaration.yaml.
Development Installation
git clone https://github.com/opendata-swiss/ckanext-switzerland-ng.git
cd ckanext-switzerland-ng
pip install -e .[dev]
Update Format-Mapping
To update the Format-Mapping edit the format-mapping.yaml, following the YAML-Syntax.
Update Translations
To generate an updated ckanext-switzerland.pot file inside the Docker container:
docker-compose exec ckan bash
source /usr/lib/ckan/venv/bin/activate
cd /usr/lib/ckanext/ckanext-switzerland-ng/
python setup.py extract_messages
Add Users as Members to Groups
For opendata.swiss we use groups in the sense of categories. Users with the role admin are automatically added as admin to each group.
curl {ckan_url}/api/3/action/ogdch_add_users_to_groups?user_id=greta.mayer&group_id=administration
curl {ckan_url}/api/3/action/ogdch_add_users_to_groups?group_id=administration
curl {ckan_url}/api/3/action/ogdch_add_users_to_groups?user_id=greta.mayer
curl {ckan_url}/api/3/action/ogdch_add_users_to_groups
License
AGPL-3.0