Skip to content

Commit

Permalink
Fixes GeoNode#10290 complete_ISO_contact_roles_per_ressource_base_wit…
Browse files Browse the repository at this point in the history
…h_multiplicity
  • Loading branch information
mwallschlaeger committed Jan 12, 2023
1 parent d060599 commit 945d08a
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 111 deletions.
9 changes: 0 additions & 9 deletions geonode/catalogue/backends/pycsw_local_mappings.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,6 @@
'pycsw:Publisher': 'publisher_csv',
'pycsw:Contributor': 'contributor_csv',
'pycsw:Processor': 'processor_csw',

# 'pycsw:MetadataAuthor': 'metadata_author_csv',
# 'pycsw:Custodian': 'custodian_csv',
# 'pycsw:Distributor': 'distributor_csv',
# 'pycsw:ResourceUser': 'resource_user_csv',
# 'pycsw:ResourceProvider': 'resource_provider_csv',
# 'pycsw:Originator': 'originator_csv',
# 'pycsw:PrincipalInvestigator': 'principal_investigator_csv',

'pycsw:Relation': 'relation',
'pycsw:Links': 'download_links',
}
Expand Down
131 changes: 29 additions & 102 deletions geonode/catalogue/templates/catalogue/full_metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,58 +12,57 @@
<gmd:hierarchyLevel>
<gmd:MD_ScopeCode codeSpace="ISOTC211/19115" codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#MD_ScopeCode" codeListValue="dataset">dataset</gmd:MD_ScopeCode>
</gmd:hierarchyLevel>

{% with layer.poc as poc %}
{% for contact_roles, label in layer.get_defined_contact_roles %}
{% for contact_role in contact_roles %}
<gmd:contact>
<gmd:CI_ResponsibleParty>
<gmd:individualName {% if not poc.name %}gco:nilReason="missing"{% endif %}>
{% if poc.name %} <gco:CharacterString>{{ poc.name }}</gco:CharacterString> {% endif %}
<gmd:individualName {% if not contact_role.first_name or not contact_role.last_name %}gco:nilReason="missing">{% else %}>
<gco:CharacterString>{{ contact_role.first_name }} {{ contact_role.last_name}}</gco:CharacterString>{% endif %}
</gmd:individualName>
<gmd:organisationName {% if not poc.organization %}gco:nilReason="missing"{% endif %}>
{% if poc.organization %} <gco:CharacterString>{{ poc.organization }}</gco:CharacterString> {% endif %}
<gmd:organisationName {% if not contact_role.organization %}gco:nilReason="missing"{% endif %}>
{% if contact_role.organization %} <gco:CharacterString>{{ contact_role.organization }}</gco:CharacterString> {% endif %}
</gmd:organisationName>
<gmd:positionName {% if not poc.position %}gco:nilReason="missing"{%endif%}>
{% if poc.position %}<gco:CharacterString>{{ poc.position }}</gco:CharacterString> {% endif %}
<gmd:positionName {% if not contact_role.position %}gco:nilReason="missing"{%endif%}>
{% if contact_role.position %}<gco:CharacterString>{{ contact_role.position }}</gco:CharacterString> {% endif %}
</gmd:positionName>
<gmd:contactInfo>
<gmd:CI_Contact>
<gmd:phone>
<gmd:CI_Telephone>
<gmd:voice {% if not poc.voice %}gco:nilReason="missing"{% endif %}>
{% if poc.voice %}<gco:CharacterString>{{ poc.voice }}</gco:CharacterString>{% endif %}
<gmd:voice {% if not contact_role.voice %}gco:nilReason="missing"{% endif %}>
{% if contact_role.voice %}<gco:CharacterString>{{ contact_role.voice }}</gco:CharacterString>{% endif %}
</gmd:voice>
<gmd:facsimile {% if not poc.fax %}gco:nilReason="missing"{% endif %}>
{% if poc.fax %}<gco:CharacterString>{{ poc.fax }}</gco:CharacterString> {%endif %}
<gmd:facsimile {% if not contact_role.fax %}gco:nilReason="missing"{% endif %}>
{% if contact_role.fax %}<gco:CharacterString>{{ contact_role.fax }}</gco:CharacterString> {%endif %}
</gmd:facsimile>
</gmd:CI_Telephone>
</gmd:phone>
<gmd:address>
<gmd:CI_Address>
<gmd:deliveryPoint {% if not poc.delivery %}gco:nilReason="missing"{% endif %}>
{% if poc.delivery %}<gco:CharacterString>{{ poc.delivery }}</gco:CharacterString>{% endif %}
<gmd:deliveryPoint {% if not contact_role.delivery %}gco:nilReason="missing"{% endif %}>
{% if contact_role.delivery %}<gco:CharacterString>{{ contact_role.delivery }}</gco:CharacterString>{% endif %}
</gmd:deliveryPoint>
<gmd:city {% if not poc.city %}gco:nilReason="missing"{% endif %}>
{% if poc.city %}<gco:CharacterString>{{ poc.city }}</gco:CharacterString>{% endif %}
<gmd:city {% if not contact_role.city %}gco:nilReason="missing"{% endif %}>
{% if contact_role.city %}<gco:CharacterString>{{ contact_role.city }}</gco:CharacterString>{% endif %}
</gmd:city>
<gmd:administrativeArea {%if not poc.area %}gco:nilReason="missing"{% endif %}>
{% if poc.area %}<gco:CharacterString>{{ poc.area }}</gco:CharacterString>{% endif %}
<gmd:administrativeArea {%if not contact_role.area %}gco:nilReason="missing"{% endif %}>
{% if contact_role.area %}<gco:CharacterString>{{ contact_role.area }}</gco:CharacterString>{% endif %}
</gmd:administrativeArea>
<gmd:postalCode {%if not poc.zipcode %}gco:nilReason="missing"{% endif %}>
{% if poc.zipcode %}<gco:CharacterString>{{ poc.zipcode }}</gco:CharacterString>{% endif %}
<gmd:postalCode {%if not contact_role.zipcode %}gco:nilReason="missing"{% endif %}>
{% if contact_role.zipcode %}<gco:CharacterString>{{ contact_role.zipcode }}</gco:CharacterString>{% endif %}
</gmd:postalCode>
<gmd:country {% if not poc.country %}gco:nilReason="missing"{% endif %}>
{% if poc.country %}<gco:CharacterString>{{ poc.country }}</gco:CharacterString>{% endif %}
<gmd:country {% if not contact_role.country %}gco:nilReason="missing"{% endif %}>
{% if contact_role.country %}<gco:CharacterString>{{ contact_role.country }}</gco:CharacterString>{% endif %}
</gmd:country>
<gmd:electronicMailAddress {% if not poc.email %}gco:nilReason="missing"{% endif %}>
{% if poc.email %}<gco:CharacterString>{{ poc.email }}</gco:CharacterString>{% endif %}
<gmd:electronicMailAddress {% if not contact_role.email %}gco:nilReason="missing"{% endif %}>
{% if contact_role.email %}<gco:CharacterString>{{ contact_role.email }}</gco:CharacterString>{% endif %}
</gmd:electronicMailAddress>
</gmd:CI_Address>
</gmd:address>
{% if poc.user %}
<gmd:onlineResource>
<gmd:CI_OnlineResource>
<gmd:linkage>
<gmd:URL>{{ SITEURL }}{{ layer.poc.get_absolute_url }}</gmd:URL>
<gmd:URL>{{ SITEURL }}{{ contact_role.get_absolute_url }}</gmd:URL>
</gmd:linkage>
<gmd:protocol>
<gco:CharacterString>WWW:LINK-1.0-http--link</gco:CharacterString>
Expand All @@ -73,87 +72,15 @@
</gmd:description>
</gmd:CI_OnlineResource>
</gmd:onlineResource>
{% endif %}
</gmd:CI_Contact>
</gmd:contactInfo>
<gmd:role>
<gmd:CI_RoleCode codeSpace="ISOTC211/19115" codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#CI_RoleCode" codeListValue="pointOfContact">pointOfContact</gmd:CI_RoleCode>
<gmd:CI_RoleCode codeSpace="ISOTC211/19115" codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#CI_RoleCode" codeListValue="{{ label }}">{{ label }}</gmd:CI_RoleCode>
</gmd:role>
</gmd:CI_ResponsibleParty>
</gmd:contact>
{% endwith %}

{% with layer.metadata_author as metadata_author %}
<gmd:contact>
<gmd:CI_ResponsibleParty>
<gmd:individualName {% if not metadata_author.name %}gco:nilReason="missing"{% endif %}>
{% if metadata_author.name %} <gco:CharacterString>{{ metadata_author.name }}</gco:CharacterString> {% endif %}
</gmd:individualName>
<gmd:organisationName {% if not metadata_author.organization %}gco:nilReason="missing"{% endif %}>
{% if metadata_author.organization %} <gco:CharacterString>{{ metadata_author.organization }}</gco:CharacterString> {% endif %}
</gmd:organisationName>
<gmd:positionName {% if not metadata_author.position %}gco:nilReason="missing"{%endif%}>
{% if metadata_author.position %}<gco:CharacterString>{{ metadata_author.position }}</gco:CharacterString> {% endif %}
</gmd:positionName>
<gmd:contactInfo>
<gmd:CI_Contact>
<gmd:phone>
<gmd:CI_Telephone>
<gmd:voice {% if not metadata_author.voice %}gco:nilReason="missing"{% endif %}>
{% if metadata_author.voice %}<gco:CharacterString>{{ metadata_author.voice }}</gco:CharacterString>{% endif %}
</gmd:voice>
<gmd:facsimile {% if not metadata_author.fax %}gco:nilReason="missing"{% endif %}>
{% if metadata_author.fax %}<gco:CharacterString>{{ metadata_author.fax }}</gco:CharacterString> {%endif %}
</gmd:facsimile>
</gmd:CI_Telephone>
</gmd:phone>
<gmd:address>
<gmd:CI_Address>
<gmd:deliveryPoint {% if not metadata_author.delivery %}gco:nilReason="missing"{% endif %}>
{% if metadata_author.delivery %}<gco:CharacterString>{{ metadata_author.delivery }}</gco:CharacterString>{% endif %}
</gmd:deliveryPoint>
<gmd:city {% if not metadata_author.city %}gco:nilReason="missing"{% endif %}>
{% if metadata_author.city %}<gco:CharacterString>{{ metadata_author.city }}</gco:CharacterString>{% endif %}
</gmd:city>
<gmd:administrativeArea {%if not metadata_author.area %}gco:nilReason="missing"{% endif %}>
{% if metadata_author.area %}<gco:CharacterString>{{ metadata_author.area }}</gco:CharacterString>{% endif %}
</gmd:administrativeArea>
<gmd:postalCode {%if not metadata_author.zipcode %}gco:nilReason="missing"{% endif %}>
{% if metadata_author.zipcode %}<gco:CharacterString>{{ metadata_author.zipcode }}</gco:CharacterString>{% endif %}
</gmd:postalCode>
<gmd:country {% if not metadata_author.country %}gco:nilReason="missing"{% endif %}>
{% if metadata_author.country %}<gco:CharacterString>{{ metadata_author.country }}</gco:CharacterString>{% endif %}
</gmd:country>
<gmd:electronicMailAddress {% if not metadata_author.email %}gco:nilReason="missing"{% endif %}>
{% if metadata_author.email %}<gco:CharacterString>{{ metadata_author.email }}</gco:CharacterString>{% endif %}
</gmd:electronicMailAddress>
</gmd:CI_Address>
</gmd:address>
{% if metadata_author.user %}
<gmd:onlineResource>
<gmd:CI_OnlineResource>
<gmd:linkage>
<gmd:URL>{{ SITEURL }}{{ layer.metadata_author.get_absolute_url }}</gmd:URL>
</gmd:linkage>
<gmd:protocol>
<gco:CharacterString>WWW:LINK-1.0-http--link</gco:CharacterString>
</gmd:protocol>
<gmd:description>
<gco:CharacterString>GeoNode profile page</gco:CharacterString>
</gmd:description>
</gmd:CI_OnlineResource>
</gmd:onlineResource>
{% endif %}
</gmd:CI_Contact>
</gmd:contactInfo>
<gmd:role>
<gmd:CI_RoleCode codeSpace="ISOTC211/19115" codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#CI_RoleCode" codeListValue="author">author</gmd:CI_RoleCode>
</gmd:role>
</gmd:CI_ResponsibleParty>
</gmd:contact>
{% endwith %}


{% endfor %}
{% endfor %}
<gmd:dateStamp>
<gco:DateTime>{{layer.csw_insert_date|date:"Y-m-d\TH:i:s\Z"}}</gco:DateTime>
</gmd:dateStamp>
Expand Down Expand Up @@ -295,7 +222,7 @@
</gmd:CI_Contact>
</gmd:contactInfo>
<gmd:role>
<gmd:CI_RoleCode codeSpace="ISOTC211/19115" codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#CI_RoleCode" codeListValue="originator">originator</gmd:CI_RoleCode>
<gmd:CI_RoleCode codeSpace="ISOTC211/19115" codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#CI_RoleCode" codeListValue="owner">owner</gmd:CI_RoleCode>
</gmd:role>
</gmd:CI_ResponsibleParty>
</gmd:pointOfContact>
Expand Down

0 comments on commit 945d08a

Please sign in to comment.