cancel
Showing results for 
Search instead for 
Did you mean: 

CMIS: strange behaviour in querying

ltenze
Champ in-the-making
Champ in-the-making
Dear all,

I encountered a big problem in my alfresco-cmis installation.
I am trying to make some queries via CMIS and I am not able to get the correct answer when I am using cmis:lastModificationDate. For example, I tested the following query:
select cmisSmiley SurprisedbjectId, cmis:name, cmisSmiley SurprisedbjectTypeId
from cmis:document where IN_FOLDER('workspace://SpacesStore/1a60ae05-2eac-4f1e-84bc-3c9abefb1f23') AND cmis:lastModificationDate < TIMESTAMP '2011-10-20T00:00:00.000Z'

This query returns an empty result.
Therefore I checked the complementary query by changing "lesser than" < with "greater than" > :
select cmisSmiley SurprisedbjectId, cmis:name, cmisSmiley SurprisedbjectTypeId
from cmis:document where IN_FOLDER('workspace://SpacesStore/1a60ae05-2eac-4f1e-84bc-3c9abefb1f23') AND cmis:lastModificationDate > TIMESTAMP '2011-10-20T00:00:00.000Z'

I tested other timestamp format (instead of using Z I used +00:00 -00:00 and so on), but without any result.

The answer is always empty. I do not understand why. If I remove the "AND …" part, all documents are displayed.
I am not able to find any log in the alfresco installation to check if any error is present (I tried by looking at catalina.out and alfresco.log).

Have you any idea to solve this problem?
Thanks in advance!
Livius
21 REPLIES 21

ltenze
Champ in-the-making
Champ in-the-making
Hi Jeff,

I installed a fresh copy of alfresco 4.0d and I tested the code you send me, with the proper modifications. The result is always the same. When I use inequality (<, >, >=, <=) condition with date, I get an empty result.

Thanks.
Livio

jpotts
World-Class Innovator
World-Class Innovator
Are you using the binary installer for 4.0d or the WAR-only distribution? How are you creating the documents you are querying for? Through CMIS or one of the web clients?

Jeff

ltenze
Champ in-the-making
Champ in-the-making
Hi Jeff,

I used the the binary installer (alfresco-community-4.0.d-installer-linux-x64.bin) and the documents are upload in alfresco by share web clients.

Thanks.
Livio

andy
Champ on-the-rise
Champ on-the-rise
Hi

This is a bug fix from 3.3 that lost its way when merged forward to 4.0 with the old and new (open)CMIS support.
It works in 3.4 as this does not use opencmis by default.
In 4.0 it fails as one end of the range query is not built correctly.

See https://issues.alfresco.com/jira/browse/ALF-12944

Andy

victorromanyuk
Champ in-the-making
Champ in-the-making
So will it be fixed?
I downloaded and installed Alfresco Community  v4.0 on 29th March 2012. The bug is still there. Queries with dates return empty list. (Only with operators <, >, <=, >= ). Queries with operators =, <> return valid result.
Here is the example of query caught by Fiddler:
select * from cmis:document WHERE cmis:creationDate &gt; TIMESTAMP '2012-03-27T21:17:00.000Z' - no entries though many documents have to be returned.
Regards, Victor

andy
Champ on-the-rise
Champ on-the-rise
Hi

It is fixed.
It will be in the next community release.

If you need this to work before then you can either use the old CMIS api (as 3.4) or consider the Enterprise version of Alfresco.

Andy

acarpine
Champ in-the-making
Champ in-the-making
Honestly I still cannot to use query with timestamp also in the Alfresco 4 Enterprise Edition
The simple query
SELECT * FROM cmis:document
WHERE cmis:creationDate > TIMESTAMP '2011-04-01T00:00:00.000+02:00'
returns always 0 results

andy
Champ on-the-rise
Champ on-the-rise
Hi

Exactly which Alfresco version are you using?

Andy

acarpine
Champ in-the-making
Champ in-the-making
Hi Andy,
the version I'm using is:

Alfresco Enterprise v4.0.0
(800) schema 5025
Spring Surf and Spring WebScripts - v1.0.0
(Release 968)


Andrea

andy
Champ on-the-rise
Champ on-the-rise
Hi

See https://issues.alfresco.com/jira/browse/ALF-12944
Fixed for V 4.0.1.
The fix is not in any 4.0.0 hot fix as far as I know.

The work around is to use the 3.4 cmis query urls which are fine (not the new open cmis versions which are affected by this issue)

Andy