Commit Graph

189 Commits

Author SHA1 Message Date
amercader baf7b5da67 [#8] Rename harvested document model to ISODocument
GeminiDocument has been kept for backwards incompatibility.
2013-02-13 19:16:36 +00:00
amercader dadd174293 [#8] Make sure only list and dict extras are dumped as JSON 2013-02-13 18:48:53 +00:00
amercader 00a0b5946b [#8] Add transform_to_iso method
This can be overridden by custom harvesters willing to support non ISO
formats (like FGDC). It is called whrn the original_document and
original_format harvest object extras are present. Custom harvesters are
responsible for transforming the original document to ISO.
2013-02-13 18:33:58 +00:00
amercader 641ffad589 Remove silly debug message 2013-02-13 17:49:15 +00:00
amercader 305951aeb5 [#8] Make get_package_dict public and document
So it is more obvious that it can be overridden by custom harvesters.
2013-02-13 17:06:01 +00:00
amercader 1d8a4c17c4 [#8] Update harvesters for CsW, WAF and Doc sources
These are the new versions of the spatial harvesters with significant
improvement over previous ones.
2013-02-12 18:29:30 +00:00
amercader f153b0f4ba [#8] Minor fixes in base harvester 2013-02-12 18:26:03 +00:00
amercader c7d872af7e [#8] Rename source config object and method to avoid confusion 2013-02-12 18:07:05 +00:00
amercader 24270cb4cb [#8] Move Gemini harvesters and updated base harvester to own files
Prior to the merging of the new spatial harvesters, the existing ones
based on Gemini and UKLP have been moved to their own namespace
(ckanext.spatial.harvesters.gemini). The plugin points have been updated
so users currently using these harvesters will still be able to use them
as normal.

The base harvester (SpatialHarvester) has been updated with new methods,
most significally '_get_package_dict' and 'import_stage'. Note that
SpatialHarvester now extends HarvesterBase on ckanext-harvest, which had
some of its methods updated.

TODO: still some geo.data.gov specific bits!
2013-02-12 17:40:41 +00:00
amercader b7f486ce04 [#8] Adapt model parsing code to make it ISO 19115 friendly
Changes in multiplicity to support the ISO 19115 spec rather than just
the Gemini 2 one. Thanks to @dread for his help on this.

Summary of the changes:

* dataset-reference-date: Set to 1..*
Note that there was a bug with mutliple values allowed per date.
Returned object should now be like:
 "dataset-reference-date": [{"type": "creation", "value": "2004-02"},
{"type": "revision", "value": "2006-07-03"}]

* metadata-languge: Set to 0..1

* resource-type: Set to *. That means that a list is now returned

* bbox: Set to *. Note that bboxes are now returned as objects such as:
[{"north":xxx, "south":xxx,, "east":xxx, "west":xxx}, {"north":xxx,
  "south":xxx,, "east":xxx, "west":xxx}]

The existing Gemini based harvesters and validators have been adapted,
all tests pass.
2013-02-11 17:35:06 +00:00
amercader 672e168bfa [#8] Adapt harvest tests to CKAN 2.0
Add new mandatory fields when creating sources, status dict has new
keys, CKAN lower cases formats, take into account harvest source
datasets.

Added a local getcapabilities response to avoid remote 404s.

Note that the TestValidation tests need to be fixed, as 27c4ee81e
removed the validation from the gather stage.
2013-02-11 16:57:38 +00:00
amercader 456d127967 Remove dataset_extent_map from test-core.ini 2013-02-08 17:50:08 +00:00
David Read b0312ed3a5 Conflicts:
ckanext/spatial/harvesters.py
	ckanext/spatial/tests/test_harvest.py
2013-02-08 17:47:32 +00:00
David Read fe2ebe016f Conflicts:
ckanext/spatial/harvesters.py
2013-02-08 17:40:19 +00:00
David Read f7d23dd576 #154 Gemini schematron 1.3 has been accepted, so loses the "a" suffix. 2013-02-08 17:38:41 +00:00
David Read aa080e9f75 #noticket No functionality has changed! Factored out responsible_organisation stuff into a separate method to add tests to show what it does. 2013-02-08 17:38:05 +00:00
David Read 9daff6a5b2 #noticket Tests added to clarify license URL extraction. 2013-02-08 17:36:34 +00:00
David Read e20080e69d Latest schematron added. FCSC is a good test of it. 2013-02-08 17:35:31 +00:00
David Read 6e23ae55c8 Relaxed "Multiplicity Check" so that it does not raise Exceptions any more - just log errors. This is because they are simply duplicates of the Gemini Schematron. Adria agreed these will be deleted anyway in 2.0. 2013-02-08 17:34:43 +00:00
David Read 779e00cd75 [xs] Improve docstrings and error messages. 2013-02-08 17:33:42 +00:00
David Read 5bcffdf14b More debug logging added to WAF harvester. 2013-02-08 17:33:16 +00:00
David Read 44728f12f7 Add XSL for converting Gemini XML to nice HTML, used in controllers/api.py. 2013-02-08 17:31:34 +00:00
David Read bcdf360b01 Spatial query can now be ordered. Does not play nicely with SOLR options - just uses that to get the facets counts and return each result. Have added performance tests for two alternative queries.
- Added a config option ('ckanext.spatial.use_postgis_sorting') to
activate this as this behaviour will be deprecated in the future
in favour of Solr 4 spatial sorting capabilities.
Also fixed the tests

Conflicts:

	ckanext/spatial/plugin.py
2013-02-08 17:28:37 +00:00
David Read fb4b041b30 Adding Parslow constraints schema previously missed. 2013-02-08 16:41:44 +00:00
David Read 8e0f7c7148 Added lower level tests for bbox search (at the lib level), complementing the API level ones.
Conflicts:

	ckanext/spatial/plugin.py
2013-02-08 16:41:02 +00:00
David Read 46fb0030a5 Comments about on cardinality/multiplicity. 2013-02-08 16:38:14 +00:00
David Read d2c97fe3cc Added new Parslow Constraints Schematron to test. Added command to validate on the command-line. 2013-02-08 16:37:44 +00:00
David Read 9ea3295b46 Get the validation XML to be included in the distribution. 2013-02-08 16:36:36 +00:00
David Read 892b44a3b3 Added useful logging to the validation report. Useful to have the date (i.e. version) in the name of the Eden schema. 2013-02-08 16:35:59 +00:00
amercader 3142794524 Merge branch '2.0-validation-changes' into release-v2.0 2013-02-07 12:45:02 +00:00
amercader 461607f06f Merge branch 'release-v2.0' into 2.0-validation-changes 2013-01-21 16:30:59 +00:00
amercader fd1071959e [#6] Move to Leaflet for dataset map widget
For this particular use case Leaflet offered the best option. Also
solves the issue when showing extent covering the whole world.
2013-01-18 15:12:09 +00:00
amercader 66b72163d5 Remove stuff from html.py
The rest will eventually go when we migrate the spatial search snippet.
2013-01-18 15:11:06 +00:00
amercader 70f7f6144b Factor out DGU code from the dataset map
It now lives in the DGU extension:

https://github.com/datagovuk/ckanext-dgu/blob/master/ckanext/dgu/theme/public/scripts/dgu-dataset-map.js
2013-01-18 13:32:30 +00:00
amercader 0991841eaf Update README
WMS preview, dataset map snippets, formatting fixes.
2013-01-18 13:08:33 +00:00
amercader 3da5807eb4 [#6] Update dataset map to be a pure snippet
No need to load an extension.
2013-01-18 13:07:26 +00:00
amercader 21a85a6b3f [#4] Register resources only once for all plugins
spatial_metadata will load the resources (public, templates and
resources) for all plugins to use, as it needs to be loaded anyway.
2013-01-15 20:00:46 +00:00
amercader 7abfb4eb61 Use plugins toolkit whenver possible on plugin.py 2013-01-15 19:57:31 +00:00
amercader da7bb48eb5 Merge branch 'release-v2.0' into 2.0-validation-changes 2013-01-14 14:03:04 +00:00
amercader 711391e971 [#4] Rewrtie WMS preview plugin for ResourcePreview interface
Much simplified plugin for previewing WMS. It requires the
resource_proxy plugin to work.

Also clean up public and template dir to mimic core layout.
2013-01-14 13:59:15 +00:00
kindly 4e47141717 add extra resource locator 2012-12-24 10:43:44 +00:00
amercader c927d8b6ab Add method for adding custom validators
This probably needs to be done properly, adding them once on startup
somehow.
2012-12-20 18:26:40 +00:00
amercader 615a58ce93 Reduce log level for harvest object errors 2012-11-21 16:22:55 +00:00
amercader 9ea721e256 Encode remote documents from CSW servers as unicode 2012-11-20 15:42:07 +00:00
amercader 6cf7f79942 Save line if present when storing object errors 2012-11-20 11:47:04 +00:00
amercader 7113466760 Update harvesters to new validator outputs 2012-11-19 18:12:40 +00:00
amercader e12e38cab0 Improvements on the validation code
To make easier to filter and display errors on the UI, the validators
have been modified to return the message and line number separately. The
return format for validators is now:

(is_valid, [(error_message_string, error_line_number)])

Also the XSD based validators were returning only the last error found on
the document, instead of iterating the whole error log. Harvesters should
create a harvest object error for each of this validation errors.

Tests have been adapted to these changes.
2012-11-19 17:15:16 +00:00
amercader 0379852fe0 Merge branch '2641-spatial-widgets-new-theme' into release-v2.0 2012-11-12 16:44:05 +00:00
amercader b82dd4a9c0 Merge branch 'csw-harvester-enhancements' into release-v2.0 2012-11-12 16:43:52 +00:00
amercader a84268abf6 Don't trust the number of records returned by the remote server
Sometimes, even when requesting 10 records, the CSW server returns less
of them (see eg http://goo.gl/b7Rdj, only 9 records returned). The
current check made the process stop on this case, missing other
identifiers.
2012-11-02 11:12:46 +00:00