cancel
Showing results for 
Search instead for 
Did you mean: 

CMIS quiery with timestamp question

r_hunter
Champ in-the-making
Champ in-the-making
Hi!
i need to get last modified documents in alfresco repository using web request
i ve read that document http://wiki.alfresco.com/wiki/CMIS_Query_Language and try to execute query:
http://localhost:8080/alfresco/service/cmis/query?q=SELECT * FROM cmis:document WHERE cmis:lastModificationDate > TIMESTAMP'2009-04-01T12:15:00.000Z'
and have got an !empty responce
<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:app="http://www.w3.org/2007/app" xmlns:cmisra="http://docs.oasis-open.org/ns/cmis/restatom/200908/" xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/" xmlns:alf="http://www.alfresco.org" xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/">
<author><name>hunter</name></author>
<generator version="4.0.0 (b 3835)">Alfresco (Community)</generator>
<icon>http://localhost:8080/alfresco/images/logo/AlfrescoLogo16.ico</icon>
<id>http://www.alfresco.org/rss/atom/urn:uuid:resultset</id>
<link rel="service" href="http://localhost:8080/alfresco/service/cmis'/>
<link rel="self" href="http://localhost:8080/alfresco/service/cmis/query?q=SELECT%20*%20FROM%20cmis:document%20WHERE%20cmis...>
<title>Result set for SELECT * FROM cmis:document WHERE cmis:lastModificationDate &gt; TIMESTAMP&apos;2010-04-01T12:15:00.000Z&apos;</title>

<updated>2012-01-08T11:52:53.294+02:00</updated>
<opensearch:totalResults>0</opensearch:totalResults>
<opensearch:startIndex>0</opensearch:startIndex>
<opensearch:itemsPerPage>-1</opensearch:itemsPerPage>
<cmisra:numItems>0</cmisra:numItems>
</feed>
Pleace help me to get working "last modified documents" query
3 REPLIES 3

r_hunter
Champ in-the-making
Champ in-the-making
that request return all documents
http://localhost:8080/share/page/feed/components/documentlibrary/feed/all/site/mysite/documentlibrar...
but is it possible to limit documents by last modified date?

mitpatoliya
Star Collaborator
Star Collaborator
This might be because of date format you are using.
Try with other date format
i.e SELECT * FROM cmis:document WHERE cmis:creationDate < TIMESTAMP '2010-04-01T00:00:00.000+00:00'

Also I think if that does not work you can limit the result by IN clause as follow.
SELECT * FROM cmis:document WHERE cmis:creationDate IN ( TIMESTAMP '2010-03-31T12:52:12.123Z' )

jpotts
World-Class Innovator
World-Class Innovator