Hi Jason,
First off its never a bother :).
Secondly picked up on a bug so nice work!!. I have to look into it a bit
more but I believe that what is happening is this.
When the date gets pulled out of the database it gets thrown into a java
Date object... at which point the date has no format. When the date gets
thrown into freemarker its gets converted to a string using the default
java date format which converts it to the format MM/dd/yy HH:ss.
So... long story short try the freemarker statement:
${timeattribute.value?date("MM/dd/yy HH:ss")}
Let me know if this works for you.I have created a jira task to remedy
this.
http://jira.codehaus.org/browse/GEOS-1290
Feel free to sign up as a watcher for it. Then you can grab the nightly
build after it is fixed.
-Justin
Jason Pickering wrote:
Hi Everyone,
Sorry to bother you yet again with this, but I had yet another question.
I managed to solve the problem that I had yesterday regarding styling of
KML with freemarker templates, in combination with an SLD. That seems to
work fine now. However, I am having some formatting issues with dates. I
created a time.ftl template with the following information....
${timeattribute.value?date}
what is returned in the KML is this..
<TimeStamp>
<when>0006-03-17T00:00:00</when>
</TimeStamp>
From the database, I get this...
"2006-03-17" which is returned in a Postgres date type.
I have tried various combinations of Freemarker built-ins (as per the
Freemarker documenation and the Geoserver examples), without any luck,
often ending in an exception.
I would like the formatting of the date, to be maintained like it is in
the original data "yyyy-mm-dd" but it seems that the "2" from "2006"
gets deleted for some reason.
Any pointers would be appreciated.
Thanks and best regards,
Jason
On 8/15/07, *Justin Deoliveira* <jdeolive@anonymised.com
<mailto:jdeolive@anonymised.com> > wrote:
Hi Jason,
Can you be a bit more specific about what you are trying to accomplish.
You are trying to change the placemark icon? Or just the color of it?
Could you perhaps include the sld you are using? Thanks
-Justin
Jason Pickering wrote:
> Wow. Very cool, I must say to see this in action.
But of course,
> there are a few problems....
>
> I have developed some simple freemarker templates to output KML to
> Google earth via Geoserver from a PostGIS backend. I can control
output
> of the description, name, and time now, which is nice.
However, is it
> possible to control the markers that are used? I have defined a SLD
> based on a given attribute in the dataset to control styling. The
style
> shows up as expected in OpenLayers, but does not seem to work
properly
> with Google Earth. All points come out with the same color.
>
> Am I missing something here?
>
> Thanks again,
> Jason
>
>
>
>
>
>
------------------------------------------------------------------------
>
>
-------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems? Stop.
> Now Search log events and configuration files using AJAX and a
browser.
> Download your FREE copy of Splunk now >> http://get.splunk.com/
>
> !DSPAM:4007,46c31c14151741849620573!
>
>
>
------------------------------------------------------------------------
>
> _______________________________________________
> Geoserver-users mailing list
> Geoserver-users@lists.sourceforge.net
<mailto:Geoserver-users@lists.sourceforge.net>
> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>
>
> !DSPAM:4007,46c31c14151741849620573!
--
Justin Deoliveira
The Open Planning Project
http://topp.openplans.org
!DSPAM:4007,46c3f143314271637810514!
------------------------------------------------------------------------
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
!DSPAM:4007,46c3f143314271637810514!
------------------------------------------------------------------------
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users
!DSPAM:4007,46c3f143314271637810514!
--
Justin Deoliveira
The Open Planning Project
http://topp.openplans.org