Closed ianwallen closed 1 year ago
At least in old versions of GeoNetwork the file description was assigned to identify the type of thumbnail. I've tested in 3.12.x and that seems no longer the case, uploading a file:
<gmd:graphicOverview>
<gmd:MD_BrowseGraphic>
<gmd:fileName>
<gco:CharacterString>https://vanilla.geocat.net/geonetwork/srv/api/records/d4c832cd-3277-4b22-82a1-e6704c87043c/attachments/thumbnail.png</gco:CharacterString>
</gmd:fileName>
</gmd:MD_BrowseGraphic>
</gmd:graphicOverview>
I think that check can be removed. @fxprunayre can you check if there might be a reason I'm missing?
I think that check can be removed
Yes it is more historical reason. We used to create a small and large thumbnail with different fixed labels. Adding this in the XPath in that migration was mainly to focus on those type of thumbnail uploaded in GeoNetwork. We can probably remove it now indeed.
Describe the bug When importing a metadata record from an MEF file, I expect all the attachments from the source site to be converted to the url of the server where it is being imported. But this is not happening due to missing gmd:fileDescription
To Reproduce Steps to reproduce the behavior:
Create a metadata (on server one using port 8080) and export the record. Ensure that it has the following for the graphicOverview
Expected behavior Expected the url "http://localhost:8080/geonetwork/srv/api/records/9d93095e-7c97-11ed-a1eb-0242ac120002/attachments/test.png" to be changed to the address used by the server where it was imported. i.e. http://localhost:8081/geonetwork/srv/api/records/9d93095e-7c97-11ed-a1eb-0242ac120002/attachments/test.png
Additional context The issue seems to be related to the following
https://github.com/geonetwork/core-geonetwork/blob/6fae61a049e814614e785e3a5295f739e428ba54/core/src/main/java/org/fao/geonet/MetadataResourceDatabaseMigration.java#L150-L162
It is based on the following xpath https://github.com/geonetwork/core-geonetwork/blob/6fae61a049e814614e785e3a5295f739e428ba54/core/src/main/java/org/fao/geonet/MetadataResourceDatabaseMigration.java#L80-L81
It seems like the url is being skipped because the [gmd:fileDescription/gco:CharacterString] is required. Is there a reason why a gmd:fileDescription is required when the data is in gmd:fileName?