geonetwork / core-geonetwork

GeoNetwork is a catalog application to manage spatially referenced resources. It provides powerful metadata editing and search functions as well as an interactive web map viewer. It is currently used in numerous Spatial Data Infrastructure initiatives across the world.
http://geonetwork-opensource.org/
GNU General Public License v2.0
404 stars 481 forks source link

Importing MEF file with thumbnails doesn't set the proper url in the xml used since 3.2.x #1730

Open josegar74 opened 7 years ago

josegar74 commented 7 years ago

In previous versions of GeoNetwork the thumbnails were stored with this format (file name only):

<gmd:graphicOverview>
    <gmd:MD_BrowseGraphic>
        <gmd:fileName>
            <gco:CharacterString>
                image.png
            </gco:CharacterString>
        </gmd:fileName>
        <gmd:fileDescription>
            <gco:CharacterString>thumbnail</gco:CharacterString>
        </gmd:fileDescription>
        <gmd:fileType>
            <gco:CharacterString>png</gco:CharacterString>
        </gmd:fileType>
    </gmd:MD_BrowseGraphic>
</gmd:graphicOverview>

With the new API in 3.2.x the format has change to this (using full url to API to return the image):

<gmd:graphicOverview>
    <gmd:MD_BrowseGraphic>
        <gmd:fileName>
            <gco:CharacterString>
                http://SERVER/geonetwork/srv/api/records/ec7148d3-80e7-4957-8c2e-cd6f4ba8a723/attachments/image.png
            </gco:CharacterString>
        </gmd:fileName>
        <gmd:fileDescription>
            <gco:CharacterString>large_thumbnail</gco:CharacterString>
        </gmd:fileDescription>
    </gmd:MD_BrowseGraphic>
</gmd:graphicOverview>

The MEF import copies the thumbnails to the data folder, but unfortunately doesn't handle this conversion in the gmd:fileName format and there's no batch process to fix.

For now the only fix seem a manual one, editing each metadata and editing the thumbnail to re-link it to the related image. Not optimal for large imports.

Also not clear what would happen if exporting in 3.2.x a MEF file and importing in other server if the url in gmd:fileName would be updated to set the new server name.

pvgenuchten commented 7 years ago

Same issue applies to other files included in the mef. If a mef includes files I'd expect the links in the metadata will be updated on import to point to the local files

fxprunayre commented 7 years ago

will be updated on import to point to the local files

Do you have any idea why it is not the case already ? I'll do that change too.

josegar74 commented 7 years ago

See code changes done in https://github.com/geonetwork/core-geonetwork/pull/1772

pvgenuchten commented 6 years ago

relates to https://github.com/geonetwork/core-geonetwork/issues/2099

arbakker commented 6 years ago

@fxprunayre has this issue been resolved?

PascalLike commented 6 years ago

@arbakker I tried to fix it here https://github.com/geonetwork/core-geonetwork/pull/2539

etj commented 5 years ago

The issue seems to be partially solved as of 3.6.0. The thumbnail is properly set, while the link to the large_thumbnail is broken.

         <gmd:graphicOverview>
            <gmd:MD_BrowseGraphic>
               <gmd:fileName gco:nilReason="missing">
                  <gco:CharacterString>http://localhost:8080/geonetwork/srv/api/records/PROPER_UUID/attachments/</gco:CharacterString>
               </gmd:fileName>
               <gmd:fileDescription>
                  <gco:CharacterString>large_thumbnail</gco:CharacterString>
               </gmd:fileDescription>
            </gmd:MD_BrowseGraphic>
         </gmd:graphicOverview>
         <gmd:graphicOverview xmlns:srv="http://www.isotc211.org/2005/srv">
            <gmd:MD_BrowseGraphic>
               <gmd:fileName>
<gco:CharacterString>http://localhost:8080/geonetwork/srv/api/records/PROPER_UUID/attachments/mythumbnail_s.png</gco:CharacterString>
               </gmd:fileName>
               <gmd:fileDescription>
                  <gco:CharacterString>thumbnail</gco:CharacterString>
               </gmd:fileDescription>
               <gmd:fileType>
                  <gco:CharacterString>png</gco:CharacterString>
               </gmd:fileType>
            </gmd:MD_BrowseGraphic>
         </gmd:graphicOverview>