To install ckanext-spc:
Activate your CKAN virtual environment, for example:
. /usr/lib/ckan/default/bin/activate
Install the ckanext-spc and its requirements into your virtual environment:
pip install ckanext-spc pip install -r dev-requirements.txt
Add
spc
to theckan.plugins
setting in your CKAN config file (by default the config file is located at/etc/ckan/default/production.ini
).For the SpcNadaHarvester to work, install this branch of ckanext-ddi:
github.com/roly97/ckanext-ddi/tree/nada_harvester
. Alternatively, install the original ckanext-ddi extensiongithub.com/liip/ckanext-ddi
and then replace the filesddiharvester.py
andmetadata.py
with the changed files found inckanext-ddi_changes
directory in this repo.Update SOLR schema:
<field name="topic" type="string" indexed="true" stored="true" multiValued="true"/>
Update DB schema:
paster spc db-upgrade -c config.ini
Restart CKAN. For example if you've deployed CKAN with Apache on Ubuntu:
sudo service apache2 reload
Config options:
scheming.dataset_schemas = ckanext.spc.schemas:dataset.json
To install ckanext-spc for development, activate your CKAN virtualenv and do:
git clone https://github.com/DataShades/ckanext-spc.git cd ckanext-spc python setup.py develop pip install -r dev-requirements.txt paster spc db-upgrade -c config.ini
This extension provides new template macro _nested_field_ which is used for rendering fields in nested schemas. It can be easily added to any page that have access to dataset metadata via next snippet:
{{ nested_field(parent_field_name, index_of_current_field_amoung_other_siblings, current_field_name, parent_data_dict, parent_errors_dict) }}
More examples can be found in templates/macro/spc.html.
- Recently updated dataset(within thematic area)::
- http://ckan.url/api/action/package_search?q=extras_thematic_area_string:%22Climate%20Change%22&sort=metadata_modified+desc
- Most popular dataset(within thematic area)::
- http://site.url/api/action/package_search?q=extras_thematic_area_string:%22Climate%20Change%22&sort=extras_ga_view_count+desc
Develeopment server with the examples started via:
npm run dev-widgets
When development phase completed, build widgets with:
npm run build-widgets
Widgets registered inside SPCWidgets global JS variable. Use them form your CKAN JS modules as following:
var widget = new SPCWidgets.SearchForm({target: document.querySelector(selector)})
To run the tests, do:
pytest --ckan-ini test.ini ckanext/spc
- Name used in config: spc_oaipmh_harvester
- Dataset type: publications
- Sources:
- Name used in config: spc_dkan_harvester
- Dataset type: dataset
- Sources:
Url | Title | Settings | Organization |
---|---|---|---|
- Name used in config: spc_gbif_harvester
- Dataset type: biodiversity_data
- Sources:
Url | Title | Settings | Organization |
---|---|---|---|
http://api.gbif.org | GBIF SPREP published | {"topic": "Fisheries", "hosting_org": "cd3512e7-886c-4873-b629-740abe8ae74e", "q": "-spc"} | sprep |
http://api.gbif.org | GBIF SPC published | {"topic": "Fisheries", "hosting_org": "cd3512e7-886c-4873-b629-740abe8ae74e", "q": "+spc"} | spc-fame |
- Name used in config: spc_prdr_publications_harvester
- Dataset type: publications
- Sources:
Url | Title | Settings | Organization |
---|---|---|---|
https://prdr-dev.spc.links.com.au/api/action/publications_list | SPC PRDR Publications | {"topic": "Energy"} | spc-gem |
- Name used in config: spc_prdr_res_energy_harvester
- Dataset type: dataset
- Sources:
Url | Title | Settings | Organization |
---|---|---|---|
https://prdr-dev.spc.links.com.au/api/action/energy_resources_list | SPC PRDR Data | {"topic": "Energy"} | spc-gem |
- Name used in config: spc_sprep_harvester
- Dataset type: dataset
- Sources:
- Biodiversity data - EML schema
- This Dataset type has multiple fields which includes subfields:
- Creator
- Metadata Provider
- Associated Party
- Keyword Set
- Coverage
- Maintenance
- Contact
- Methods
- Project
- Dataset - DCAT schema
- Geographic data - ANZLIC schema
- Publications - Dublin Core schema
curl https://patch-diff.githubusercontent.com/raw/ckan/ckan/pull/5546.diff | git apply curl https://patch-diff.githubusercontent.com/raw/ckan/ckan/pull/5594.diff | git apply