cancel
Showing results for 
Search instead for 
Did you mean: 

CMIS query preparation - TimeZone issue

nikes
Champ on-the-rise
Champ on-the-rise
Hi All,

I am using Apache CXF framework and generated client side stub classes for CMIS.
Alfresco : 3.2r2
Java      : 1.6

I am not able to perform search using creationdate/modifieddate for documents.

I am getting date in following format in java code,

SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.sssZ");
Date newDate = new Date();
String strDate = formatter.format(newDate);

String query = "SELECT * FROM cmis:document where cmis:creationDate >= ' " + strDate + " ' ";


Here value of strDate contains following format,
2010-06-18T17:06:49.049+0530

It throws following exception when I execute query method of DiscoveryService

org.alfresco.service.cmr.repository.datatype.TypeConversionException: Failed to convert date 2010-06-18T17:07:36.036+0530 to string

Kindly suggest in which format to prepare date values in WHERE clause of CMIS query language.

Thanks for any help.
Nikesh
1 REPLY 1

gclaussn
Champ in-the-making
Champ in-the-making
Hi Nikes

use this pattern to query documents, which greater or lesser creation date.
"SELECT * FROM cmis:document WHERE cmis:creationDate > TIMESTAMP '2010-06-01T00:00:00.000+00:00'"

best regards, gclaussn
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.