metadata101 / iso19115-3

10 stars 16 forks source link

Adding overview images to records #35

Open andy3092 opened 6 years ago

andy3092 commented 6 years ago

Overview images are not being added or appearing in metadata records under this schema due to a new way overview images are handled in the iso19115-3 schema. This is due to the deprecation of the old method. See the discussion below for further details.

Hi Guys Note: in ISO 19115-3 there is a new way of managing overviews The original way is still there but deprecated Ideally use:

/mdb:MD_Metadata/mdb:identificationInfo/mri:MD_DataIdentification/mri:graphicOverview/mcc:MD_BrowseGraphic/~
     mcc:fileName/gco:CharacterString       <!-- this element is mandatory although cit:name below duplicates its use -->
                                                                                 <!-- this was always a clumsy way of providing the filePath -->
                                                                                 <!-- this element could be managed as null eg  mcc:filename/ -->
     mcc:linkage/cit:CI_OnlineResource/~
            cit:linkage/gco:CharacterString        <!-- this was claen way of providing the filePath -->
            cit:name/gco:CharacterString          <!-- Tidier way of dealing with the name (not filename) of the browse graphic -->
            cit:description/gco:CharacterString <!-- Good way of dealing with the WCAG2 requirements for description of images -->

Cheers

e BLEYS Evert Mr Data Manager Australian Bureau of Agricultural and Resource Economics and Sciences Department of Agriculture and Water Resources

Hi All

I have been testing the iso19115-3 template using 3.4.3 with the iso19115-3 schema being compiled in.

I have been having issues with adding overview images to new records. I go through the motions of trying to add a new resource.

Setting the as Link dropdown as Overview for the rull resource or a subset

I add the url for the image, the image appears and then I click the green Add online resource button.

The window disappears and takes me back to the metadata record.

With no overview resource being added. Saved the metadata record still no overview visible.

Tried it by uploading an image and selecting it and also adding the url of an already hosted image on a webserver. No luck.

Also monitored the log for any errors with nothing appearing in the log.

I tried adding another resource like an ArcGIS lyr file without any issues and the tried adding a pdf file as well to see if there were issues for other resources. These links appeared fine within the metadata document.

I also tried importing (although maybe or may not be a separate issue) when importing mef pr individual records originally being in iso-19139 they imported fine if imported as iso-19139 with the overviews being added as expected. When I tried to do a conversion from 19139 to 19115-3 I had the same issue with the overviews not appearing.

sraAusstage commented 6 years ago

Hey Andy - is there a workaround for this issue? I'm not sure I understand the code you posted to use?

fxprunayre commented 6 years ago

Testing it graphic overview are added and visible properly in the search results. So the feature is working but encoding could be improved probably.

image

image

Encoding is currently made using the same as in ISO19139

         <mri:graphicOverview>
            <mcc:MD_BrowseGraphic>
               <mcc:fileName>
                  <gco:CharacterString>http://localhost:8080/geonetwork/srv/api/records/e12921cc-8cf3-49b2-9dca-1f8da01156d1/attachments/DSC06149.JPG</gco:CharacterString>
               </mcc:fileName>
               <mcc:fileDescription>
                  <gco:CharacterString>Tree map</gco:CharacterString>
               </mcc:fileDescription>
            </mcc:MD_BrowseGraphic>
         </mri:graphicOverview>

A "better" encoding would be

         <mri:graphicOverview>
            <mcc:MD_BrowseGraphic>
               <mcc:fileName>
                  <gco:CharacterString>??</gco:CharacterString>
               </mcc:fileName>
               <mcc:fileDescription>
                  <gco:CharacterString>Tree map</gco:CharacterString>
               </mcc:fileDescription>
               <mcc:linkage>
                  <cit:CI_OnlineResource>
                     <cit:linkage>
                        <gco:CharacterString>http://localhost:8080/geonetwork/srv/api/records/e12921cc-8cf3-49b2-9dca-1f8da01156d1/attachments/DSC06149.JPG</gco:CharacterString>
                     </cit:linkage>
                  </cit:CI_OnlineResource>
               </mcc:linkage>

But then what to put in filename which is mandatory ?

Can be improved in here https://github.com/metadata101/iso19115-3/blob/3.4.x/src/main/plugin/iso19115-3/process/thumbnail-add.xsl#L90

Ref document https://github.com/ISO-TC211/XML/blob/master/standards.iso.org/iso/19115/-3/mcc/1.0/commonClasses.xsd#L10

sraAusstage commented 5 years ago

Hey there. I'm sorry to be a hassle - I'm still really new at this and getting my head around how Geonetwork works. I've tried to understand the responses above but can't find a way to get the overview images to save to a record.

Could someone please point me in the direction of the plugin files that need to be edited? I'm using the plugin version iso19115-3-3.4.x with Geonetwork 3.4.1.0

josegar74 commented 5 years ago

Thumbnails and other files that can be added to the metadata are added to the xml using an xslt process (GeoNetwork uses heavily xslt for metadata updates).

Xslt processes are defined in this folder of the schema: https://github.com/metadata101/iso19115-3/tree/3.4.x/src/main/plugin/iso19115-3/process

For example, when you add a thumbnail image, it's called a service in the backend that uses this xslt process: https://github.com/metadata101/iso19115-3/blob/3.4.x/src/main/plugin/iso19115-3/process/thumbnail-add.xsl

The process updates the metadata with the mri:graphicOverview element.

sraAusstage commented 5 years ago

Thanks for that josegar74

I managed to resolve the issue with that information.

for anyone playing along at home -I had a look at geonetwork\WEB-INF\data\config\schema_plugins\iso19115-3\process\thumbnail-add.xsl and discovered that the parameters expected

<xsl:param name="thumbnail_url"/>  
<xsl:param name="thumbnail_desc" select="''"/>

were not actually receiving any values. I managed to get thumbnail images to attach to a record by adding the following

`

` and replacing all references to thumbnail_url with url and thumbnail_desc to desc

File attached thumbnail-add.zip

juanluisrp commented 5 years ago

@sraAusstage this problem with the parameters names would be fixed in geonetwork/core-geonetwork#3852 and geonetwork/core-geonetwork#3853 for GN 3.6.x and 3.4.x.