You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@sis.apache.org by Emmanuel Blondel <em...@gmail.com> on 2015/02/12 19:49:13 UTC

Question about DefaultBrowseGraphic (gco /gmx namespaces)

Hello,

I'm currently migrating a project metadata module to Apache SIS (soft 
transition using Geotoolkit artifacts), and checking consistency with 
the metadata i had before. I've seen a difference for MD_BrowseGraphic 
(filename, file mime type), referenced here: 
https://issues.apache.org/jira/browse/SIS-119

I'm publishing the metadata in a GeoNetwork catalogue.
I see the gmx tags introduced with Apache SIS are not interpreted by 
Geonetwork, which seems to require gco:CharacterString to correctly 
display the thumbnail. Unfortunately, i've no flexibility on the 
geonetwork side, neither possible application of a patch, nor any 
support from the IT corporate that maintains this catalogue. :-/

I'm wondering if there is some flexibility on Apache SIS that would me 
to keep <gco:CharacterString>, or if i could do a simple workaround.

Many thanks in advance for your advice
Emmanuel



Re: Question about DefaultBrowseGraphic (gco /gmx namespaces)

Posted by Martin Desruisseaux <ma...@geomatys.fr>.
Cool, thanks for letting us known :-)

    Martin

Le 12/02/15 22:21, Emmanuel Blondel a écrit :
> Many thanks Martin for your help. It works perfectly.


Re: Question about DefaultBrowseGraphic (gco /gmx namespaces)

Posted by Emmanuel Blondel <em...@gmail.com>.
Many thanks Martin for your help. It works perfectly.

Le 12/02/2015 20:20, Martin Desruisseaux a écrit :
> Hello Emmanuel
>
> Yes, you can configure the SIS marshaller for producing the
> <gco:CharacterString> element instead than the gmx one. The
> org.apache.sis.xml.XML class defines a number of properties, among them
> there is:
>
> http://sis.apache.org/apidocs/org/apache/sis/xml/XML.html#STRING_SUBSTITUTES
>
> For example if you want to substitute <gmx:FileName> and <gmx:MimeType>
> by <gco:CharacterString> elements, one can write:
>
> Result out = ...; // Where to write the XML (Writer, OutputStream, etc.).
> Map<String,Object> properties = new HashMap<>();
> properties.put(XML.STRING_SUBSTITUTES, new String[] {"filename",
> "mimetype"});
> XML.marshal(metadata, out, properties);
>
> You may take the opportunity for configuring other properties if desired
> (locale, timezone, etc.). The class javadoc of the XML class lists them.
>
>      Martin
>
>
>
> Le 12/02/15 19:49, Emmanuel Blondel a écrit :
>> Hello,
>>
>> I'm currently migrating a project metadata module to Apache SIS (soft
>> transition using Geotoolkit artifacts), and checking consistency with
>> the metadata i had before. I've seen a difference for MD_BrowseGraphic
>> (filename, file mime type), referenced here:
>> https://issues.apache.org/jira/browse/SIS-119
>>
>> I'm publishing the metadata in a GeoNetwork catalogue.
>> I see the gmx tags introduced with Apache SIS are not interpreted by
>> Geonetwork, which seems to require gco:CharacterString to correctly
>> display the thumbnail. Unfortunately, i've no flexibility on the
>> geonetwork side, neither possible application of a patch, nor any
>> support from the IT corporate that maintains this catalogue. :-/
>>
>> I'm wondering if there is some flexibility on Apache SIS that would me
>> to keep <gco:CharacterString>, or if i could do a simple workaround.
>>
>> Many thanks in advance for your advice
>> Emmanuel


Re: Question about DefaultBrowseGraphic (gco /gmx namespaces)

Posted by Martin Desruisseaux <ma...@geomatys.fr>.
Hello Emmanuel

Yes, you can configure the SIS marshaller for producing the
<gco:CharacterString> element instead than the gmx one. The
org.apache.sis.xml.XML class defines a number of properties, among them
there is:

http://sis.apache.org/apidocs/org/apache/sis/xml/XML.html#STRING_SUBSTITUTES

For example if you want to substitute <gmx:FileName> and <gmx:MimeType>
by <gco:CharacterString> elements, one can write:

Result out = ...; // Where to write the XML (Writer, OutputStream, etc.).
Map<String,Object> properties = new HashMap<>();
properties.put(XML.STRING_SUBSTITUTES, new String[] {"filename",
"mimetype"});
XML.marshal(metadata, out, properties);

You may take the opportunity for configuring other properties if desired
(locale, timezone, etc.). The class javadoc of the XML class lists them.

    Martin



Le 12/02/15 19:49, Emmanuel Blondel a écrit :
> Hello,
>
> I'm currently migrating a project metadata module to Apache SIS (soft
> transition using Geotoolkit artifacts), and checking consistency with
> the metadata i had before. I've seen a difference for MD_BrowseGraphic
> (filename, file mime type), referenced here:
> https://issues.apache.org/jira/browse/SIS-119
>
> I'm publishing the metadata in a GeoNetwork catalogue.
> I see the gmx tags introduced with Apache SIS are not interpreted by
> Geonetwork, which seems to require gco:CharacterString to correctly
> display the thumbnail. Unfortunately, i've no flexibility on the
> geonetwork side, neither possible application of a patch, nor any
> support from the IT corporate that maintains this catalogue. :-/
>
> I'm wondering if there is some flexibility on Apache SIS that would me
> to keep <gco:CharacterString>, or if i could do a simple workaround.
>
> Many thanks in advance for your advice
> Emmanuel