cancel
Showing results for 
Search instead for 
Did you mean: 

CMISQueryService with SearchParameters

franciscoduarte
Champ in-the-making
Champ in-the-making

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 4

angelborroy
Community Manager Community Manager
Community Manager

What is the value of nodeGUID?

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

Hyland Developer Evangelist

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

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

Yes, I'm sure it is.

Getting started

Explore our Alfresco products with the links below. Use labels to filter content by product module.