[Hippo-cms7-user] [Hippo Hilter on HSTQuery] - date problem

senofonte senofonte123 at gmail.com
Wed Apr 20 02:04:50 CEST 2011


Hi,

i had a problem using the HSTQuery with a lot of filters wich one is a Date.
For Each AND Filter I Use this kind of code:

 <code>
 Filter titleFilter = hstQuery.createFilter();
 titleFilter.addContains("@mynamespace:field", "fieldvaluetocheck");
 filter.addAndFilter(titleFilter);
 </code>

It works for all the AND Filters, but when I add a Filters for a Date (it's
an Advanced Search Form)
using and expression like:

 <code>
 Filter f = new FilterImpl();
 f.addLessOrEqualThan("@namespace:dateField", "xs:dateTime('" +
xmlCal.toXMLFormat() + "')");
 </code>

(where xmlCal it's a XmlGregorianCalendar)

the method addLessOrEqualThan (and also the others method) don't evaluate
the xs:dateTime 
and use that expression like a String, so the HstQuery produced it's
something like ... <= 'xs:dateTime(...)'.
How can I disabile the "'"?

I Also tried to add a Filter with addJCRExpression(), but the normal filters
and a JCRExpression Filter cant' find nothing.

Thanks,
S

--
View this message in context: http://hippo.2275632.n2.nabble.com/Hippo-Hilter-on-HSTQuery-date-problem-tp6289135p6289135.html
Sent from the Hippo CMS 7 mailing list archive at Nabble.com.



More information about the Hippo-cms7-user mailing list