sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Desruisseaux (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (SIS-119) Support <gmx:FileName> and <gmx:MimeFileType> elements
Date Thu, 12 Feb 2015 19:27:13 GMT

    [ https://issues.apache.org/jira/browse/SIS-119?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14318814#comment-14318814
] 

Martin Desruisseaux edited comment on SIS-119 at 2/12/15 7:27 PM:
------------------------------------------------------------------

Note that it is still possible to configure the SIS marshaller for producing the {{<gco:CharacterString>}}
elements instead than the gmx one if desired. The {{org.apache.sis.xml.XML}} class defines
a number of properties, among them there is [XML.STRING_SUBSTITUTES|http://sis.apache.org/apidocs/org/apache/sis/xml/XML.html#STRING_SUBSTITUTES].

For example if one wants to substitute {{<gmx:FileName>}} and {{<gmx:MimeType>}}
by {{<gco:CharacterString>}} elements, he can write:

{code:java}
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);
{code}

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



was (Author: desruisseaux):
Note that it is still possible to configure the SIS marshaller for producing the {{<gco:CharacterString>}}
elements instead than the gmx one if desired. The {{org.apache.sis.xml.XML}} class defines
a number of properties, among them there is: [XML.STRING_SUBSTITUTES|http://sis.apache.org/apidocs/org/apache/sis/xml/XML.html#STRING_SUBSTITUTES]

For example if one wants to substitute {{<gmx:FileName>}} and {{<gmx:MimeType>}}
by {{<gco:CharacterString>)) elements, he can write:

{code:java}
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);
{code}

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


> Support <gmx:FileName> and <gmx:MimeFileType> elements
> ------------------------------------------------------
>
>                 Key: SIS-119
>                 URL: https://issues.apache.org/jira/browse/SIS-119
>             Project: Spatial Information Systems
>          Issue Type: Improvement
>          Components: Metadata
>    Affects Versions: 0.3
>            Reporter: Martin Desruisseaux
>            Assignee: Martin Desruisseaux
>             Fix For: 0.4
>
>
> The {{<gco:CharacterString>}} XML elements can sometime be replaced by {{<gmx:FileName>}}
elements are marshalling time. The later contains a {{src}} attribute, which may contains
an absolute path. Example from ISO 19139:
> {code:xml}
> <fileName>
>    <gmx:FileName src="../path/wkj98723.jpg">Overview</gmx:FileName>
> </fileName>
> {code}
> Likewise for {{<gmx:MimeFileType>}}:
> {code:xml}
> <fileType>
>    <gmx:MimeFileType type="image/tiff"> Graphic TIFF </gmx:MimeFileType>
> </fileType>
> {code}
> The main usage for those elements seem to be in {{MD_BrowseGraphic}}.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message