Question

https://github.com/okfn/ckanext-harvest/blob/release-v2.0/README.rst#the-ckan-harvester mentions that you can specify a "default_groups" config option in order to have all harvested records added to a group.

Does this still work in CKAN 2.0? Is there an analogous "default_organizations" config parameter?

I've tried to use the "default_groups" parameter by putting a JSON object into the form at /harvest/edit/my-source

{ "default_groups": ["my-group"] }

A group called "my-group" exists, however I'm just updating harvested packages, not creating new ones.

fetch_consumer logs:

2013-04-17 15:34:07,707 DEBUG [ckanext.spatial.harvesters.base.import] Import stage for harvest object: 66b01129-bcce-4bc8-9a67-1d7ece67b998
2013-04-17 15:34:07,708 DEBUG [ckanext.spatial.harvesters.base] Using config: {u'default_groups': [u'my-group']}
2013-04-17 15:34:07,713 DEBUG [ckanext.spatial.validation.validation] Starting validation against profile(s) iso19139
2013-04-17 15:34:07,770 DEBUG [ckanext.spatial.validation.validation] Validated against "ISO19139 XSD Schema"
2013-04-17 15:34:07,770 INFO  [ckanext.spatial.validation.validation] Validation passed
2013-04-17 15:34:07,898 DEBUG [ckanext.spatial.plugin] Received: u'{"type": "Polygon", "coordinates": [[[-116.016, 30.5461], [-116.016, 37.5297], [-108.281, 37.5297], [-108.281, 30.5461], [-116.016, 30.5461]]]}'
2013-04-17 15:34:07,902 DEBUG [ckanext.spatial.lib] Extent for package 7c5646d5-6689-49f6-94fb-0eaf54f84959 unchanged
2013-04-17 15:34:08,149 INFO  [ckanext.spatial.harvesters.base.import] Updated package 7c5646d5-6689-49f6-94fb-0eaf54f84959 with guid 4e6b8f72f7d6c3856f092c6b8501195f
Was it helpful?

Solution

From your logs, I assume that you are using the spatial harvesters (eg CSW). The documentation that you pointed to refers to the CKAN-to-CKAN harvester (ie to harvest other CKAN instances). We will improve the docs to avoid confusion.

Good news is that the spatial harvesters will automatically assign any new dataset to the same organization that your harvest source belongs to, so there is no need to use any configuration setting (this still needs to be implemented on the CKAN harvester). Just make sure to define an organization for the harvest source when creating it or editing it. Note that you will only see this field if the user you are logged in with belongs to an organization.

Organization field in the harvest source form

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top