Conversation
|
Testing required env preparationIn settings, add the RNDT app and set the metadata template: You should also add (manually, at the moment), the thesauri at https://github.com/geosolutions-it/geonode-rndt/tree/118_port_to_geonode5/thesauri adminYou should create (at least) 3 group profiles. Then, in the RNDT admin tab, create 2 public administrations, annotating their IPA. The IPA is the code that will be prefixed into the resource's UUID in order to find out to which PA the resource belongs to. In the RNDT tab you can also associate PA to group profiles using the "Group Profile RNDT" entries. Associate 2 of the group profiles to the 2 created PAs. test casesCreate a layer, and edit its metadata. Test: Metadata customizationMetadata should have:
Test: IPA prefixed UUIDThe UUID of a resource should be prefixed with the IPA code of the associated group, in the format "IPA:UUID"
Test: import / export metadata
Test: migrationData from a GeoNode4/RNDT instance should be imported and migrated. This test can be postponed to the first real migration. |
There was a problem hiding this comment.
Tests
Test: Metadata customization: Passed (no comments)
Test: IPA prefixed UUID : Passed (no comments)
Test: import / export metadata
In the exported metadata the RNDT is included in the metadataStandardName
<gmd:metadataStandardName>
<gco:CharacterString>Linee Guida RNDT</gco:CharacterString>
</gmd:metadataStandardName>
but not in metadataStandardVersion
<gmd:metadataStandardVersion>
<gco:CharacterString>2.0</gco:CharacterString>
</gmd:metadataStandardVersion>
Also, all the custom fields of the libraries are existed in the exported metadata except from this field: ConditionsApplyingToAccessAndUse
I noticed the same with the above, when I imported a metadata xml.
Setup
Regarding the setup of the library in a new GeoNode database:
If I include the library in the settings and then run the manage.py migrate in a fresh database I got the following error:
Traceback (most recent call last):
File "/home/gpetr/.virtualenvs/geonode_env/lib/python3.10/site-packages/django/db/backends/utils.py", line 89, in _execute
return self.cursor.execute(sql, params)
psycopg2.errors.UndefinedTable: relation "base_restrictioncodetype" does not exist
LINE 1: ...ion", "base_restrictioncodetype"."is_choice" FROM "base_rest...
Instead, if I run the manage.py migrate in two steps (1) in the main GeoNode (without the library) and (2) after including the library, the migrations are registered correctly.
|
The required format for <gmd:metadataStandardName>
<gco:CharacterString>Linee Guida RNDT</gco:CharacterString>
</gmd:metadataStandardName>
<gmd:metadataStandardVersion>
<gco:CharacterString>2.0</gco:CharacterString>
</gmd:metadataStandardVersion>
<gmd:resourceConstraints>
<gmd:MD_LegalConstraints>
<gmd:useConstraints>
<gmd:MD_RestrictionCode
codeList="http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/resources/Codelist/ML_gmxCodelists.xml#MD_RestrictionCode"
codeListValue="otherRestrictions">otherRestrictions</gmd:MD_RestrictionCode>
</gmd:useConstraints>
<gmd:otherConstraints>
{% if metadata.rndt_ConditionsApplyingToAccessAndUse.inspire_url %}
<gmx:Anchor xlink:href="{{metadata.rndt_ConditionsApplyingToAccessAndUse.url}}">{{metadata.rndt_ConditionsApplyingToAccessAndUse.url|rndt_get_keyword_label_by_about}}</gmx:Anchor>
{% else %}
<gco:CharacterString>{{metadata.rndt_ConditionsApplyingToAccessAndUse.freetext}}</gco:CharacterString>
{% endif %}
</gmd:otherConstraints>
</gmd:MD_LegalConstraints>
</gmd:resourceConstraints> |
|
@etj thank you for providing more information. TestsTest: Metadata customization: Passed (no comments) SetupRegarding the setup of the library in a new GeoNode database: Instead, if I run the |
rndt/metadata/handler.py
Outdated
|
|
||
| def __init__(self) -> None: | ||
| super().__init__() | ||
| self.otherRestrictions = RestrictionCodeType.objects.filter(identifier="otherRestrictions").first() or \ |
There was a problem hiding this comment.
@etj this line: self.otherRestrictions = RestrictionCodeType.objects.filter(identifier="otherRestrictions").first() or \ produces a migration error:
Traceback (most recent call last):
File "/home/gpetr/.virtualenvs/geonode_env/lib/python3.10/site-packages/django/db/backends/utils.py", line 89, in _execute
return self.cursor.execute(sql, params)
psycopg2.errors.UndefinedTable: relation "base_restrictioncodetype" does not exist
LINE 1: ...ion", "base_restrictioncodetype"."is_choice" FROM "base_rest...
I propose to replace that line with something like:
@property
def otherRestrictions(self):
from geonode.base.models import RestrictionCodeType
return (
RestrictionCodeType.objects.filter(identifier="otherRestrictions").first()
r RestrictionCodeType.objects.filter(description="otherRestrictions").first()
)
``
This PR contains cumulative commits to be squashed for the alignment of this app to GeoNode5 (#118 )
Replaces #119 (was incorrectly targeted at 4.4.x)
First commit features a working metdata editor.
It removes all the pre-5 geonode hooks, templates, etc, and implements: