jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From AnupChatterjee <anup.chatter...@marketlive.com>
Subject Re: Querying for all modified nodes based on jcr:lastModified
Date Fri, 25 Apr 2008 16:53:06 GMT

Thanks Jukka!

This is the way I tried and it worked. Upon researching further I also
stumbled upon the xs:dateTime which I need to specify and used your
approach. I wish there was more documentation and samples on XPATH queries
where they would mention how to create the Value.

- Anup

Jukka Zitting wrote:
> 
> 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
> 
> 

-- 
View this message in context: http://www.nabble.com/Querying-for-all-modified-nodes-based-on-jcr%3AlastModified-tp16851289p16898162.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Mime
View raw message