Sébastien Geindre ha scritto:
Justin Deoliveira a écrit :
Hi Sébastien,
I think you will have to use a string format function against the date
to get this to work with the raw value.
${<timstampField>?string("yyyy-MM-ddTHH:mm:ss")}
with ${validity_start_time?string("yyyy-MM-ddTHH:mm:ss")} ,
i have the following error :
22 oct. 15:24:57 ERROR [freemarker.runtime] -
Expected number, date, or string. validity_start_time evaluated instead to freemarker.template.SimpleHash on line 1, column 3 in time.ftl.
The problematic instruction:
----------
==> ${validity_start_time?string("yyyy-MM-ddTHH:mm:ss")} [on line 1, column 1 in time.ftl]
----------
Java backtrace for programmers:
----------
freemarker.template.TemplateException: Expected number, date, or string. validity_start_time evaluated instead to freemarker.template.SimpleHash on line 1, column 3 in time.ftl.
validity_start_time is an attribute, right? So the proper way should
be:
${validity_start_time.rawValue?string("yyyy-MM-ddTHH:mm:ss")}
(I guess)
Let me know
Cheers
Andrea
Andrea Aime a écrit :
Sébastien Geindre ha scritto:
Justin Deoliveira a écrit :
Hi Sébastien,
I think you will have to use a string format function against the date
to get this to work with the raw value.
${<timstampField>?string("yyyy-MM-ddTHH:mm:ss")}
with ${validity_start_time?string("yyyy-MM-ddTHH:mm:ss")} ,
i have the following error :
22 oct. 15:24:57 ERROR [freemarker.runtime] -
Expected number, date, or string. validity_start_time evaluated instead to freemarker.template.SimpleHash on line 1, column 3 in time.ftl.
The problematic instruction:
----------
==> ${validity_start_time?string("yyyy-MM-ddTHH:mm:ss")} [on line 1, column 1 in time.ftl]
----------
Java backtrace for programmers:
----------
freemarker.template.TemplateException: Expected number, date, or string. validity_start_time evaluated instead to freemarker.template.SimpleHash on line 1, column 3 in time.ftl.
validity_start_time is an attribute, right? So the proper way should
be:
${validity_start_time.rawValue?string("yyyy-MM-ddTHH:mm:ss")}
(I guess)
Let me know
i did try this...
with ${validity_start_time.rawValue?string("yyyy-MM-ddTHH:mm:ss")}
the following one :
22 oct. 15:30:26 ERROR [freemarker.runtime] -
Expression validity_start_time.rawValue is undefined on line 1, column 3 in time.ftl.
The problematic instruction:
----------
==> ${validity_start_time.rawValue?string("yyyy-MM-ddTHH:mm:ss")} [on line 1, column 1 in time.ftl]
----------
Java backtrace for programmers:
----------
freemarker.core.InvalidReferenceException: Expression validity_start_time.rawValue is undefined on line 1, column 3 in time.ftl.
at freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:124)
at freemarker.core.TemplateObject.invalidTypeException(TemplateObject.java:134)
Cheers
Andrea
--
Sébastien Geindre
DPREVI/AERO/DEV
sebastien.geindre __at__ meteo.fr
Sébastien Geindre ha scritto:
Andrea Aime a écrit :
Sébastien Geindre ha scritto:
Justin Deoliveira a écrit :
Hi Sébastien,
I think you will have to use a string format function against the date
to get this to work with the raw value.
${<timstampField>?string("yyyy-MM-ddTHH:mm:ss")}
with ${validity_start_time?string("yyyy-MM-ddTHH:mm:ss")} ,
i have the following error :
22 oct. 15:24:57 ERROR [freemarker.runtime] -
Expected number, date, or string. validity_start_time evaluated instead to freemarker.template.SimpleHash on line 1, column 3 in time.ftl.
The problematic instruction:
----------
==> ${validity_start_time?string("yyyy-MM-ddTHH:mm:ss")} [on line 1, column 1 in time.ftl]
----------
Java backtrace for programmers:
----------
freemarker.template.TemplateException: Expected number, date, or string. validity_start_time evaluated instead to freemarker.template.SimpleHash on line 1, column 3 in time.ftl.
validity_start_time is an attribute, right? So the proper way should
be:
${validity_start_time.rawValue?string("yyyy-MM-ddTHH:mm:ss")}
(I guess)
Let me know
i did try this...
with ${validity_start_time.rawValue?string("yyyy-MM-ddTHH:mm:ss")}
the following one :
22 oct. 15:30:26 ERROR [freemarker.runtime] -
Expression validity_start_time.rawValue is undefined on line 1, column 3 in time.ftl.
The problematic instruction:
----------
==> ${validity_start_time.rawValue?string("yyyy-MM-ddTHH:mm:ss")} [on line 1, column 1 in time.ftl]
----------
Oh hum, this is strange... support for rawValue has been introduced
by Gabriel some days ago while fixing http://jira.codehaus.org/browse/GEOS-1393.
How old is your GeoServer checkout?
Cheers
Andrea
Andrea Aime a écrit :
Sébastien Geindre ha scritto:
Andrea Aime a écrit :
Sébastien Geindre ha scritto:
Justin Deoliveira a écrit :
Hi Sébastien,
I think you will have to use a string format function against the date
to get this to work with the raw value.
${<timstampField>?string("yyyy-MM-ddTHH:mm:ss")}
with ${validity_start_time?string("yyyy-MM-ddTHH:mm:ss")} ,
i have the following error :
22 oct. 15:24:57 ERROR [freemarker.runtime] -
Expected number, date, or string. validity_start_time evaluated instead to freemarker.template.SimpleHash on line 1, column 3 in time.ftl.
The problematic instruction:
----------
==> ${validity_start_time?string("yyyy-MM-ddTHH:mm:ss")} [on line 1, column 1 in time.ftl]
----------
Java backtrace for programmers:
----------
freemarker.template.TemplateException: Expected number, date, or string. validity_start_time evaluated instead to freemarker.template.SimpleHash on line 1, column 3 in time.ftl.
validity_start_time is an attribute, right? So the proper way should
be:
${validity_start_time.rawValue?string("yyyy-MM-ddTHH:mm:ss")}
(I guess)
Let me know
i did try this...
with ${validity_start_time.rawValue?string("yyyy-MM-ddTHH:mm:ss")}
the following one :
22 oct. 15:30:26 ERROR [freemarker.runtime] -
Expression validity_start_time.rawValue is undefined on line 1, column 3 in time.ftl.
The problematic instruction:
----------
==> ${validity_start_time.rawValue?string("yyyy-MM-ddTHH:mm:ss")} [on line 1, column 1 in time.ftl]
----------
Oh hum, this is strange... support for rawValue has been introduced
by Gabriel some days ago while fixing http://jira.codehaus.org/browse/GEOS-1393.
How old is your GeoServer checkout?
i did svn update yesterday.
which file could i check ? svn version...
Cheers
Andrea
--
Sébastien Geindre
DPREVI/AERO/DEV
sebastien.geindre __at__ meteo.fr
Sébastien Geindre ha scritto:
i did svn update yesterday.
which file could i check ? svn version...
All you have to do is to run svn info
and it'll tell you at which revision you
are (I'm at 7645).
Anyways, this thread is starting to be a bit
long. Any chance you can open a jira issue
for it, and attach to it all the relevant
bits needed to reproduce your problem, that is:
* original data
* templates
* expected vs actual results?
Cheers
Andrea
> Oh hum, this is strange... support for rawValue has been introduced
> by Gabriel some days ago while fixing
> http://jira.codehaus.org/browse/GEOS-1393.
> How old is your GeoServer checkout?
i did svn update yesterday.
which file could i check ? svn version...
hi Sébastien,
the one doing the trick is org.geoserver.template.FeatureWrapper
please also take a look at FeatureTemplateTest.testRawValue().
You can may be help improve the test case, as I'm not that familiar with the
template syntax.
let us know how it goes.
cheers,
Gabriel
> Cheers
> Andrea
Gabriel Roldán a écrit :
Oh hum, this is strange... support for rawValue has been introduced
by Gabriel some days ago while fixing
http://jira.codehaus.org/browse/GEOS-1393.
How old is your GeoServer checkout?
i did svn update yesterday.
which file could i check ? svn version...
hi Sébastien,
the one doing the trick is org.geoserver.template.FeatureWrapper
please also take a look at FeatureTemplateTest.testRawValue().
You can may be help improve the test case, as I'm not that familiar with the template syntax.
I played with Junit test on rawValue. It works...
So i tried with adding the version on the depedency of freemarker in main module
<dependency>
<groupId>org.freemarker</groupId>
<artifactId>freemarker</artifactId>
<version>2.3.9</version>
</dependency>
and it works !!!
rawValue is ok, i 'll find the right format...
thanks all !
let us know how it goes.
cheers,
Gabriel
Cheers
Andrea
--
Sébastien Geindre
DPREVI/AERO/DEV
sebastien.geindre __at__ meteo.fr
Sébastien Geindre ha scritto:
I played with Junit test on rawValue. It works...
So i tried with adding the version on the depedency of freemarker in main module
<dependency>
<groupId>org.freemarker</groupId>
<artifactId>freemarker</artifactId>
<version>2.3.9</version>
</dependency>
and it works !!!
We should have no versions declared outside the root pom.xml.
All modules inherit the ones declared there, and we're
already using freemarker 2.3.9 so... this leaves me wondering
why adding the version was necessary at all... ???
Cheers
Andrea