Justin Deoliveira ha scritto:
> Hi Andrea,
> 
> This approach will leave wfs 1.1 and gml3 encoding out in the cold since
> it takes a different approach to this. It relies on coming up with
> defined mappings from java classes to xml schema data types. I admit
> that in the case of dates the mapping is not clean.

Ok, I looked at the situation with a bit more detail, and it turned out
to be much easier than I thought (a minor bug fix for a great result, at 
least from Geoserver point of view).

I've opened a new issue for this, since the approach is different, and 
less invasive, than the one suggested for geot-620, which I'll close as 
a won't fix.
http://jira.codehaus.org/browse/GEOT-1188
(I'll commit the patch as soons as WFS 1.0 cite test with the patch 
included are completely done and passed).

Basically, most data stores are already doing the right thing, and
reporting precise data type. All JDBC data stores are really using
java.sql.Date, java.sql.Time and java.sql.TimeStamp in both the
attribyte type definition and as the actual attribute values.
Shapefile is only capable of dealing with generic dates, and is using 
java.util.Date.

The only real issue was that the GML feature type and feature encoders
were ignoring those types! A tiny patch there makes it work fine.

Justin, I think the same fixes can be applied to the new GML encoders.
(btw, the feature type encoder should really be something included
in Geotools imho, if I'm not mistaken it's in Geoserver now, right?).

The only significant datastore not doing fine afaik is the WFS one,
which uses java.util.Date for all xs types if I'm not mistaken.

Now, as a rule of thumb, since these classes are already in the jdk,
we could ask other datastore capables of distinguishing between date, 
time and datetime to use java.sql.Date and java.sql.Time for
xs:date and xs:time. That would solve all problems in the short term,
and would not require a dependence on Joda time (that's the library I
was suggesting to use).
Maybe we should add an article to the developers guide.

For the longer term, we'll have to watch Bryce proposal.

Cheers
Andrea

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Geotools-devel mailing list
Geotools-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to