CMISQueryService with SearchParameters

cancel
Showing results for 
Search instead for 
Did you mean: 
franciscoduarte
Member II

CMISQueryService with SearchParameters

Hi,

I'm trying to execute a cmis query through the CMISQueryService using SearchParameters and I'm having the following error :

SearchParameters searchParameters = new SearchParameters();
StoreRef storeRef = new StoreRef(StoreRef.PROTOCOL_WORKSPACE, "SpacesStore");
searchParameters.addStore(storeRef);
searchParameters.setLanguage(SearchService.LANGUAGE_CMIS_ALFRESCO);
searchParameters.setQuery("SELECT * FROM cmis:document WHERE IN_FOLDER('" + nodeGUID + "')");

ResultSet result = icmisQueryService.getResults(searchParameters);

 But I'm getting the error below :

WARN  [mvc.support.DefaultHandlerExceptionResolver] [http-nio-8080-exec-7] Resolved [org.springframework.http.converter.HttpMessageNotWritableException: Could not write JSON: (was java.lang.UnsupportedOperationException); nested exception is com.fasterxml.jackson.databind.JsonMappingException: (was java.lang.UnsupportedOperationException) (through reference chain: org.alfresco.repo.search.impl.lucene.PagingLuceneResultSet["wrapped"]->org.alfresco.repo.security.permissions.impl.acegi.FilteringResultSet["resultSetMetaData"]->org.alfresco.repo.search.SimpleResultSetMetaData["columns"])]

Any ideas?

Thank you,

Francisco Duarte

4 Replies
angelborroy
Alfresco Employee

Re: CMISQueryService with SearchParameters

What is the value of nodeGUID?

It should be something without "workspace://spaceStore/" prefix. In CMIS only the ID is used.

Hyland Developer Evangelist
franciscoduarte
Member II

Re: CMISQueryService with SearchParameters

Is something like this : 2059b02c-3275-11ec-8d3d-0242ac130003.

angelborroy
Alfresco Employee

Re: CMISQueryService with SearchParameters

This is working fine for me...

SELECT * FROM cmis:document 
WHERE IN_FOLDER('dfb8291f-56b9-4843-8d55-7364ad628b3c')

May you verify that node is a Folder?

Hyland Developer Evangelist
franciscoduarte
Member II

Re: CMISQueryService with SearchParameters

Yes, I'm sure it is.