<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<span id="result_box" class="" lang="en"><span class="hps">Hello,</span><br>
<br>
<br>
<span class="hps">I'm </span></span><span id="result_box"
class="" lang="en"><span class="hps"><span id="result_box"
class="" lang="en"><span class="hps">desperately</span> <span
class="hps"></span></span>trying</span> <span class="hps">to
find a way</span> <span class="hps">to read</span> the content
of the <span class="hps">MD_BrowseGraphic</span> <span
class="hps">element as</span> <span class="hps">defined</span>
<span class="hps">below</span> <span class="hps">without touching
the</span> <span class="hps">GeoToolkit</span></span><span
id="result_box" class="" lang="en"><span class="hps"><span
id="result_box" class="" lang="en"><span class="hps"> sources
:<br>
<tt><br>
</tt><tt> <gmd:graphicOverview></tt><tt><br>
</tt><tt> <gmd:MD_BrowseGraphic></tt><tt><br>
</tt><tt> <gmd:fileName></tt><tt><br>
</tt><tt> <gmx:FileName
src="XXXXXXXXXXXTHUMB.JPG"></tt></span></span></span></span><span
id="result_box" class="" lang="en"><span class="hps"><span
id="result_box" class="" lang="en"><span class="hps"><tt><span
id="result_box" class="" lang="en"><span class="hps"><span
id="result_box" class="" lang="en"><span class="hps">XXXXXXXXXXXTHUMB</span></span></span></span></tt><tt></gmx:FileName></tt><tt><br>
</tt><tt> </gmd:fileName></tt><tt><br>
</tt><tt> <gmd:fileDescription></tt><tt><br>
</tt><tt> <mf:DG_BrowseGraphicType
codeList="codelist.xml#DG_BrowseGraphicType"
codeListValue="thumbnail"
codeSpace="CARGENE">Thumbnail</mf:DG_BrowseGraphicType></tt><tt><br>
</tt><tt> </gmd:fileDescription></tt><tt><br>
</tt><tt> <gmd:fileType></tt><tt><br>
</tt><tt> <gmx:MimeFileType
type="image/jpg">JPEG image</gmx:MimeFileType></tt><tt><br>
</tt><tt> </gmd:fileType></tt><tt><br>
</tt><tt> </gmd:MD_BrowseGraphic></tt><tt><br>
</tt><tt> </gmd:graphicOverview></tt><br>
<br>
</span></span></span><br>
<span class="hps">I</span> <span class="hps">created a</span> <span
class="hps"></span><span class="hps">FileName</span> class and <span
class="hps">FileNameAdapter</span> <span class="hps">class as
you can see</span><span class="hps"></span> <span class="hps">below:</span><br>
<br>
<br>
FileName :<br>
----------------------------------------<br>
<tt>package test.gmx;</tt><tt><br>
</tt><tt><br>
</tt><tt>import java.net.URI;</tt><tt><br>
</tt><tt>import javax.xml.bind.annotation.XmlAttribute;</tt><tt><br>
</tt><tt>import javax.xml.bind.annotation.XmlType;</tt><tt><br>
</tt><tt>import javax.xml.bind.annotation.XmlValue;</tt><tt><br>
</tt><tt>import org.geotoolkit.util.Utilities;</tt><tt><br>
</tt><tt>import org.geotoolkit.xml.Namespaces;</tt><tt><br>
</tt><tt><br>
</tt><tt>@XmlType(name = "FileName_Type", namespace =
Namespaces.GMX)</tt><tt><br>
</tt><tt>public class FileName {</tt><tt><br>
</tt><tt> @XmlValue</tt><tt><br>
</tt><tt> private String filename;</tt><tt><br>
</tt><tt><br>
@XmlAttribute(name = "src", namespace = Namespaces.GMX)</tt><tt><br>
</tt><tt> private URI src;</tt><tt><br>
</tt><tt><br>
</tt><tt> /**</tt><tt><br>
</tt><tt> * An empty constructor used by JAXB.</tt><tt><br>
</tt><tt> */</tt><tt><br>
</tt><tt> public FileName() {</tt><tt><br>
</tt><tt> }</tt><tt><br>
</tt><tt><br>
</tt><tt> /**</tt><tt><br>
</tt><tt> * Build a new Schema Component.</tt><tt><br>
</tt><tt> */</tt><tt><br>
</tt><tt> public FileName(final URI src) {</tt><tt><br>
</tt><tt> filename = src.getPath();</tt><tt><br>
</tt><tt> this.src = src;</tt><tt><br>
</tt><tt> }</tt><tt><br>
</tt><tt><br>
</tt><tt> public URI getSrc() {</tt><tt><br>
</tt><tt> return src;</tt><tt><br>
</tt><tt> }</tt><tt><br>
</tt><tt><br>
</tt><tt> public String getFileName() {</tt><tt><br>
</tt><tt> return filename;</tt><tt><br>
</tt><tt> }</tt><tt><br>
</tt><tt><br>
</tt><tt> /**</tt><tt><br>
</tt><tt> * Verify if this entry is identical to the specified
object.</tt><tt><br>
</tt><tt> */</tt><tt><br>
</tt><tt> @Override</tt><tt><br>
</tt><tt> public boolean equals(final Object object) {</tt><tt><br>
</tt><tt> if (object == this) {</tt><tt><br>
</tt><tt> return true;</tt><tt><br>
</tt><tt> }</tt><tt><br>
</tt><tt> if (object instanceof FileName) {</tt><tt><br>
</tt><tt> final FileName that = (FileName) object;</tt><tt><br>
</tt><tt> return Utilities.equals(this.src, that.src);</tt><tt><br>
</tt><tt> }</tt><tt><br>
</tt><tt> return false;</tt><tt><br>
</tt><tt> }</tt><tt><br>
</tt><tt><br>
</tt><tt> @Override</tt><tt><br>
</tt><tt> public String toString() {</tt><tt><br>
</tt><tt> return src.toString();</tt><tt><br>
</tt><tt> }</tt><tt><br>
</tt><tt>}</tt><br>
<br>
<br>
</span><span id="result_box" class="" lang="en"><span
id="result_box" class="" lang="en">----------------------------------------</span></span><br>
<span id="result_box" class="" lang="en"><span id="result_box"
class="" lang="en">FileNameAdapter :<br>
----------------------------------------</span><br>
<tt>package test.gmx;</tt><tt><br>
</tt><tt><br>
</tt><tt>import java.net.URI;</tt><tt><br>
</tt><tt>import java.net.URISyntaxException;</tt><tt><br>
</tt><tt><br>
</tt><tt>import javax.xml.bind.annotation.adapters.XmlAdapter;</tt><tt><br>
</tt><tt><br>
</tt><tt>public final class FileNameAdapter extends
XmlAdapter<FileName, URI> {</tt><tt><br>
</tt><tt><br>
</tt><tt> /**</tt><tt><br>
</tt><tt> * Empty constructor for JAXB.</tt><tt><br>
</tt><tt> */</tt><tt><br>
</tt><tt> FileNameAdapter() {</tt><tt><br>
</tt><tt> }</tt><tt><br>
</tt><tt><br>
</tt><tt> /**</tt><tt><br>
</tt><tt> * Converts a URI read from a XML stream to the
object containing the value. JAXB calls automatically this
method at</tt><tt><br>
</tt><tt> * unmarshalling time.</tt><tt><br>
</tt><tt> * </tt><tt><br>
</tt><tt> * @param value The adapter for this metadata value.</tt><tt><br>
</tt><tt> * @return An {@link URI} which represents the
metadata value.</tt><tt><br>
</tt><tt> * @throws URISyntaxException If the string is not a
valid URI.</tt><tt><br>
</tt><tt> */</tt><tt><br>
</tt><tt> @Override</tt><tt><br>
</tt><tt> public URI unmarshal(final FileName value) throws
URISyntaxException {</tt><tt><br>
</tt><tt> return value.getSrc();</tt><tt><br>
</tt><tt> }</tt><tt><br>
</tt><tt><br>
</tt><tt> /**</tt><tt><br>
</tt><tt> * Converts a {@link URI} to the object to be
marshalled in a XML file or stream. JAXB calls automatically
this</tt><tt><br>
</tt><tt> * method at marshalling time.</tt><tt><br>
</tt><tt> * </tt><tt><br>
</tt><tt> * @param value The URI value.</tt><tt><br>
</tt><tt> * @return The adapter for the given URI.</tt><tt><br>
</tt><tt> */</tt><tt><br>
</tt><tt> @Override</tt><tt><br>
</tt><tt> public FileName marshal(final URI value) {</tt><tt><br>
</tt><tt> return new FileName(value);</tt><tt><br>
</tt><tt> }</tt><tt><br>
</tt><tt>}</tt><br>
<br>
</span><br>
<span id="result_box" class="" lang="en"><span id="result_box"
class="" lang="en"><span id="result_box" class="" lang="en">----------------------------------------</span></span><br>
Package_info<span id="result_box" class="" lang="en"><span
id="result_box" class="" lang="en">:<br>
----------------------------------------</span></span><br>
<br>
<tt>@XmlSchema(elementFormDefault = XmlNsForm.QUALIFIED, namespace
= Namespaces.GMX, xmlns = { @XmlNs(prefix = "gmx", namespaceURI
= Namespaces.GMX) })</tt><tt><br>
</tt><tt>@XmlAccessorType(XmlAccessType.NONE)</tt><tt><br>
</tt><tt>@XmlJavaTypeAdapters({</tt><tt><br>
</tt><tt>
@XmlJavaTypeAdapter(InternationalStringConverter.class),</tt><tt><br>
</tt><tt> @XmlJavaTypeAdapter(value =
fr.cs.kheper.metadata.mgcp.gmx.FileNameAdapter.class, type =
org.geotoolkit.metadata.iso.identification.DefaultBrowseGraphic.class)
})</tt><tt><br>
</tt><tt>package test.gmx;</tt><tt><br>
</tt><tt><br>
</tt><tt>import javax.xml.bind.annotation.XmlAccessType;</tt><tt><br>
</tt><tt>import javax.xml.bind.annotation.XmlAccessorType;</tt><tt><br>
</tt><tt>import javax.xml.bind.annotation.XmlNs;</tt><tt><br>
</tt><tt>import javax.xml.bind.annotation.XmlNsForm;</tt><tt><br>
</tt><tt>import javax.xml.bind.annotation.XmlSchema;</tt><tt><br>
</tt><tt>import
javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;</tt><tt><br>
</tt><tt>import
javax.xml.bind.annotation.adapters.XmlJavaTypeAdapters;</tt><tt><br>
</tt><tt><br>
</tt><tt>import
org.geotoolkit.internal.jaxb.gco.InternationalStringConverter;</tt><tt><br>
</tt><tt>import org.geotoolkit.xml.Namespaces;</tt><br>
<br>
<br>
<span class="hps">Whatever</span> <span class="hps">changes</span>
<span class="hps">I make,</span> <span class="hps">they</span> <span
class="hps">have no effect</span> <span class="hps">or I</span>
<span class="hps">get the following error</span><span>:</span><br>
<tt>com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException:
1 counts of IllegalAnnotationExceptions</tt><tt><br>
</tt><tt>@XmlAttribute/@XmlValue need to reference a Java type
that maps to text in XML.</tt><tt><br>
</tt><tt> this problem is related to the following location:</tt><tt><br>
</tt><tt> at private java.net.URI test.gmx.FileName.src</tt><tt><br>
</tt><tt> at test.gmx.FileName</tt><br>
<br>
<span class="hps">Can</span> <span class="hps">-</span> <span
class="hps">you help me</span> <span class="hps">read this</span>
<span class="hps">item and its contents</span><span class="">?</span><br>
<br>
<span class="hps">Thank you</span> <span class="hps">in advance,</span></span>
<div class="moz-signature">-- <br>
<hr size="3" width="700" align="left" color="midnightblue">
<table border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td border="0" cellspacing="0" cellpadding="0"><a
href="www.c-s.fr" hreflang="fr"><img
src="cid:part1.09050406.03010009@c-s.fr" alt=""
align="left" border="0"></a></td>
<td><font size="1" face="verdana">
<b>Vincent GAUDISSART</b><br>
Architecte Système d'Information<br>
<a
href="https://thor.si.c-s.fr/blogs/cs-blogs-business/">
<b>Division ESPACE & Renseignement</b></a><b> -
Département APPLICATIONS</b><br>
<br>
<b>CS Systèmes d'Information</b><br>
Parc de la Grande Plaine - 5, Rue Brindejonc des
Moulinais - BP 15872<br>
31506 Toulouse Cedex 05 - FRANCE<br>
Tel : +33 561 17 62 72 / Accueil : +33 561 17 66 66 <br>
Email : <a class="moz-txt-link-freetext"
href="mailto:vincent.gaudissart@c-s.fr">vincent.gaudissart@c-s.fr</a>
</font></td>
<td><img src="cid:part5.07080702.00060207@c-s.fr" alt=""
align="right" border="0"></td>
</tr>
</tbody>
</table>
<hr size="3" width="700" align="left" color="midnightblue"> </div>
</body>
</html>