Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[udig-devel] Re: [Geoserver-devel] We're generating invalid dates in GML....

Justin Deoliveira ha scritto:
Hmmm, I am surprised the wfs 1.0 cite tests pass as they do a lot of
testing against dates... But i guess that is just date and not datetime
so that makes sense.

Hmm... that's suprising nonetheless... attributes encoding in Geotools
FeatureTranslator is handled in FeatureTranslator.handleAttribute:

if (Geometry.class.isAssignableFrom(value.getClass())) {
    geometryTranslator.encode((Geometry) value, srsName);
} else {
    String text = value.toString();
    contentHandler.characters(text.toCharArray(), 0,
        text.length());
}

Sooo.... it seems to me it was working only because of sheer luck? :-)

Looking at the FeatureTypeEncoder, every subclass of java.util.Date
will be turned into a xs:datetime, so I guess wfs 1.0 passed only
because we use Postgis as the backing store, which was configured
to use a date type, and returned as a result a java.sql.Date that
toStrings to something which is in the format CCYY-MM-dd, apparently
another format supported by xs:datetime.

Cheers
Andrea


Back to the top