Minor model tweaks to support parsing generic ISO documents
Add validator for ISO 19139 NGDC XSD schema
Add validator for FGDC XSD schema
Allow to define the validation profiles via source config

The profiles used are decided as follows:

1. 'validator_profiles' property of the harvest source config
object
2. 'ckan.spatial.validator.profiles' configuration option in
the ini file
3. Default value as defined in DEFAULT_VALIDATOR_PROFILES
Better check for config object
copied harvester class, registering the new plugin in setup.py. ready to be edited
fixed OGPDHarvester, fixed setup.py, harvester uses now limit, harvester imports only packages with resources
Integrate OGPDHarvester plugin

From the inheritance point of view I thing it is the best to let the
OGPDHarvester derive from the GeminiCswHarvester class. I addition I
have adjusted the plugin path in the setup.py.

There was a typo in setting up the CSW client for the harvester which
made in invocation to the not present CSW server method.

Signed-off-by: Konrad Reiche <konrad.reiche@gmail.com>
Merge branch 'origin/ogpd' into ogpd
started resource filter, added error message
Fix incompatibilities with different etree APIs

Due to varieties in different versions of the ElementTree APIs the
harvester tried to access the tag attribute in an ElementTree object.
The tag attribute, however, is only available in an Element object.

This leads to the problem, that the import stage will fail with every
fetched XML document with the error:

Error getting the CSW record with GUID ...

The actual exception message, which is swallowed, is: 'ElementTree'
object has no attribute 'tag'

Since there is already an exception handling which tries to deal with
these incompatibilies, I have switched the lines as Esra has explained
in the last meeting.

Signed-off-by: Konrad Reiche <konrad.reiche@gmail.com>
Add individual INSPIRE package writer and document

As a matter of fact the current Gemini XPath expressions differ from
what is known from the INSPIRE fields. This was noticed on the metadata
legal constraints, for instance the use limitation, a very general
constraint on the data usage, is used for determining the legal public
access in Gemini.

Hence, I have created a separate InspireDocument in the metadata model
and a separate write package method and import stage for the OGPD
Harvester.

For the legal constraints the fields accessConstraints, useConstraints
and otherConstraints are used now, as it is described in the German
translation for the ISO 19115 from GDI-DE as well.

Also I have changed the name for the OGPD Harvester from csw to ogpd in
order to differ from the GeminiCswHarvester

Signed-off-by: Konrad Reiche <konrad.reiche@gmail.com>
Fix XPath expression for access-/useConstraints

I made the mistake to use the subnode gdo:CharacterString for access-
and useConstraints as well. Both fields, however, are defined with
values from gdm:MD_RestrictionCode. Both values should now be parsed
correctly and at least for accessConstraints I am getting values now.

Signed-off-by: Konrad Reiche <konrad.reiche@gmail.com>
turned off validation, added WMS check to every resource
changed multiplicity of type, added search paths to resource and resourcetype
added group mapping to import_package
Implement license mapping

For the OGD schema there are three fields to determine the terms of use
for a given resource. The 'license_id' is a certain enumeration type. The
'license_url' points, if given, to a description, respectively definition
of the license and in the field 'otherÄ additional information can given
specified.

The latter one is often required when a default mapping is not
applicable. So far this is often the case. Hence the default
'license_id' is 'other-closed' and additional information are harvested
from the INSPIRE constraint fields.

The license mapping is done in a separate Python module within the method
'translate_license_data'. If this method returns None it indicates to drop
the current CSW entry.

Signed-off-by: Konrad Reiche <konrad.reiche@gmail.com>
modified group model: each package is added to each group and subgroup
Merge remote branch 'origin/ogpd' into ogpd

Conflicts:
	ckanext/spatial/harvesters.py
Refined license mapping

There were still some problems with the license mapping, one included
the processing of unicode characters. Where umlauts are used I encode
the string as unicode, also the license_map file has now a unicode
declaration in the head comment.

Since the harvester uses `json.dumps` to serialize dictionaries
I have added the argument `ensure_ascii = False`. This way the unicode
characters are displayed correctly afterwards and not encoded with
backslash and their corresponding code.

I have also fixed the typo where I wrote terms_of_use.id instead of
terms_of_use.license_id.

Signed-off-by: Konrad Reiche <konrad.reiche@gmail.com>