jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jukka Zitting" <jukka.zitt...@gmail.com>
Subject Re: Querying for all modified nodes based on jcr:lastModified
Date Thu, 24 Apr 2008 20:43:25 GMT
Hi,

On Thu, Apr 24, 2008 at 8:40 PM, AnupChatterjee
<anup.chatterjee@marketlive.com> wrote:
>  I'm trying to query the repository for all the modified nodes under nt:file
>  changed since a particular TimeStamp
>
>  The problem I'm having is with querying with the right format of
>  lastModified
>  I have tried the XPATH query -
>  "//element(*, nt:file)/*[@jcr:lastModified > " + sqlTimestamp + "]"
>
>  java.sql.TimeStamp.toString as well as getTime() which returns long
>  millsecs. Any ideas on what the right format is

The easiest way to get the correct date format is the Value.getString() method:

    Calendar timestamp = ...;
    Value value = session.getValueFactory().createValue(timestamp);
    String xpath = "//*[@jcr:lastModified > xs:dateTime('" +
value.getString() + "')]";

BR,

Jukka Zitting

Mime
View raw message