[geotk] CSW client : marshalling issue

Martin Desruisseaux martin.desruisseaux at geomatys.fr
Tue May 17 12:38:13 EDT 2011


Hello Damiano

The handling of dates in XML documents currently requires the geotk-temporal 
module, which still in the "pending" section of Geotoolkit.org. Just ensure that 
a JAR file from the following directory is presents on your classpath and it 
should work:

http://maven.geotoolkit.org/org/geotoolkit/pending/geotk-temporal/

     Regards,

         Martin


Le 17/05/11 16:47, Damiano ALBANI a écrit :
> Hello,
>
> This time, I have a marshalling issue, related to dates.
> Given a Citation object with this getDates() getter:
>
>     @Override
>     public Collection<? extends CitationDate> getDates() {
>         List<CitationDate> dates = new ArrayList<CitationDate>();
>
>         dates.add(new CitationDate() {
>             @Override
>             public DateType getDateType() {
>                 return DateType.PUBLICATION;
>             }
>
>             @Override
>             public Date getDate() {
>                 return new Date();
>             }
>         });
>
>         dates.add(new CitationDate() {
>             @Override
>             public DateType getDateType() {
>                 return DateType.CREATION;
>             }
>
>             @Override
>             public Date getDate() {
>                 return new Date();
>             }
>         });
>
>         return dates;
>     }
>
> GeoToolkit generates some XML which only contains half the information:
>
> <gmd:identificationInfo>
> <gmd:MD_DataIdentification>
> <gmd:citation>
> <gmd:CI_Citation>
>                     [...]
>
> <gmd:date>
> <gmd:CI_Date>
> <gmd:dateType>
> <gmd:CI_DateTypeCode codeSpace="eng" codeListValue="publication" 
> codeList="http://schemas.opengis.net/iso/19139/20070417/resources/Codelist/gmxCodelists.xml#CI_DateTypeCode">Publication</gmd:CI_DateTypeCode>
> </gmd:dateType>
> </gmd:CI_Date>
> </gmd:date>
> <gmd:date>
> <gmd:CI_Date>
> <gmd:dateType>
> <gmd:CI_DateTypeCode codeSpace="eng" codeListValue="creation" 
> codeList="http://schemas.opengis.net/iso/19139/20070417/resources/Codelist/gmxCodelists.xml#CI_DateTypeCode">Creation</gmd:CI_DateTypeCode>
> </gmd:dateType>
> </gmd:CI_Date>
> </gmd:date>
>
>                     [...]
> </gmd:CI_Citation>
> </gmd:citation>
>
> See, the actual date value is missing, only the type of date is shown.
> I am using Geotoolkit 3.x-SNAPSHOT.
>
> Furthermore, I saw that the value returned by Citation.getEditionDate() is not 
> serialized at all. Don't know if it's done on purpose.
>
> Thanks,
>


More information about the Geotoolkit mailing list