AnsweredAssumed Answered

CMIS Query with ORDER BY

Question asked by blb on Apr 14, 2016
HI,
I'm afraid to ask another dumbass question…

After few hours of googling, I don't see anything about my error.

Why this cmis query works on Alfresco 5.1 but doesn't work on alfresco 5.0.0 ?????


<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_PORT => "8080",
  CURLOPT_URL => "http://192.168.137.153:8080/alfresco/api/-default-/public/cmis/versions/1.1/browser?alf_ticket=TICKET_bdfd336aa4a28d7a0ccf3b0c29587f337d3c9de4&skipCount=0&maxItems=10",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "cmisaction=query&statement=SELECT%20cmis%3AversionSeriesId%20as%20id%2Ccmis%3Aname%20as%20name%2Ccmis%3AcontentStreamMimeType%20as%20type%2Ccmis%3AcreationDate%20as%20created_at%2Ccmis%3AlastModificationDate%20as%20updated_at%20from%20cmis%3Adocument%20AS%20D%20where%20IN_FOLDER(D%2C'4cd9b8a9-c06a-4ab5-a231-356c3b40c6d1')%20OR%20IN_FOLDER(D%2C'dab65306-35ea-4acb-9325-c53380c4a069')%20OR%20IN_FOLDER(D%2C'ad7a52d5-f6be-42cf-80bf-ffc140826efc')%20OR%20IN_FOLDER(D%2C'462c8eae-c40a-4865-aa4b-ad79a5c8597b')%20OR%20IN_FOLDER(D%2C'ea7266db-4184-4b78-94d0-be40947d14f8')%20OR%20IN_FOLDER(D%2C'1d739de1-4926-49aa-8072-eb433fcfedae')%20OR%20IN_FOLDER(D%2C'4688342f-39fa-490f-95b6-005476033f22')%20OR%20IN_FOLDER(D%2C'd99ab345-8833-498d-a84a-e83a23c87c85')%20OR%20IN_FOLDER(D%2C'dfa74b4e-3b69-425d-b34a-3625cfdff504')%20OR%20IN_FOLDER(D%2C'3ec1a679-0cff-4623-b000-aaaf4220bb68')%20OR%20IN_FOLDER(D%2C'88bc654b-4af0-4a2f-996a-c4336097c9f3')%20OR%20IN_FOLDER(D%2C'179def44-2733-41c2-a413-48f3ecaab24d')%20OR%20IN_FOLDER(D%2C'0a6c2258-09b4-401c-9c86-ff77a8370e8d')%20OR%20IN_FOLDER(D%2C'a54d5a67-8c89-419d-84cc-cce5d8f32786')%20OR%20IN_FOLDER(D%2C'8a7037da-9d8f-41ac-9438-91f22b2164c9')%20OR%20IN_FOLDER(D%2C'e585ec5c-927d-411c-b0d7-6cb917ef888a')%20OR%20IN_FOLDER(D%2C'b79cb920-c90b-4629-b8c0-0bdbc26fdf46')%20OR%20IN_FOLDER(D%2C'48e495c6-b467-45a4-aeac-04e70dc93f35')%20OR%20IN_FOLDER(D%2C'9878f2c9-2e00-45d4-92e7-13ec33a444af')%20OR%20IN_FOLDER(D%2C'0b214c61-6176-4c41-bcb5-a9986f37d3b8')%20OR%20IN_FOLDER(D%2C'4b7076a5-cb23-4c49-81e2-1c195c4cafe3')%20OR%20IN_FOLDER(D%2C'f055a4af-2842-4467-b33b-d305bccb285e')%20OR%20IN_FOLDER(D%2C'fe905450-7b33-4ff4-8dc9-a7fb984e954d')%20OR%20IN_FOLDER(D%2C'25257a64-83e4-4338-abae-9233ed469e12')%20OR%20IN_FOLDER(D%2C'e1a7755a-c5e4-4349-9393-10e8ed46ac2b')%20OR%20IN_FOLDER(D%2C'7a7bc61c-a43e-49be-adbd-8913b0a11e0a')%20OR%20IN_FOLDER(D%2C'cee526d4-cfdb-4f59-958d-9d5c8fde7187')%20OR%20IN_FOLDER(D%2C'f302d3c2-f753-4995-888b-c403b4a9733c')%20OR%20IN_FOLDER(D%2C'd8c02a53-1cf4-405e-9d52-78c61a6a0a85')%20OR%20IN_FOLDER(D%2C'4cfcd36f-5176-4229-81be-b150ffa52339')%20OR%20IN_FOLDER(D%2C'2420764f-c3e7-4dec-a284-56151d8ef16d')%20OR%20IN_FOLDER(D%2C'61714f1f-044c-4e3b-b3e5-00156843c16b')%20OR%20IN_FOLDER(D%2C'15b1ca1e-9aa1-4ecb-a288-069f5b9bcc50')%20OR%20IN_FOLDER(D%2C'b2d874de-84e5-4702-9ccc-b7a12863d6dd')%20OR%20IN_FOLDER(D%2C'e3cc2948-f2d7-4e0e-866f-494eab8e3d26')%20ORDER%20BY%20cmis%3AcreationDate&succinct=true",
  CURLOPT_HTTPHEADER => array(
    "cache-control: no-cache",
    "content-type: application/x-www-form-urlencoded",
    "postman-token: 85e7c16e-a741-f6df-6ab8-29cd736f27b5"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}


error :

{
  "exception": "runtime",
  "message": "0314159800 Request failed 500 /solr4/alfresco/cmis?wt=json&fl=DBID%2Cscore&rows=10&df=TEXT&start=0&locale=fr_FR&alternativeDic=DEFAULT_DICTIONARY&cmisVersion=CMIS_1_1&fq=%7B%21afts%7DAUTHORITY_FILTER_FROM_JSON&fq=%7B%21afts%7DTENANT_FILTER_FROM_JSON",
  "stacktrace": "org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException: 0314159800 Request failed 500 /solr4/alfresco/cmis?wt=json&fl=DBID%2Cscore&rows=10&df=TEXT&start=0&locale=fr_FR&alternativeDic=DEFAULT_DICTIONARY&cmisVersion=CMIS_1_1&fq=%7B%21afts%7DAUTHORITY_FILTER_FROM_JSON&fq=%7B%21afts%7DTENANT_FILTER_FROM_JSON\n\tat org.alfresco.opencmis.AlfrescoCmisExceptionInterceptor.invoke(AlfrescoCmisExceptionInterceptor.java:99)\n\tat org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)\n\tat org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)\n\tat com.sun.proxy.$Proxy288.query(Unknown Source)\n\tat org.apache.chemistry.opencmis.server.support.wrapper.ConformanceCmisServiceWrapper.query(ConformanceCmisServiceWrapper.java:1157)\n\tat org.apache.chemistry.opencmis.server.impl.browser.DiscoveryService$Query.serve(DiscoveryService.java:76)\n\tat org.apache.chemistry.opencmis.server.shared.Dispatcher.dispatch(Dispatcher.java:91)\n\tat org.apache.chemistry.opencmis.server.impl.browser.CmisBrowserBindingServlet.dispatch(CmisBrowserBindingServlet.java:355)\n\tat org.apache.chemistry.opencmis.server.impl.browser.CmisBrowserBindingServlet.service(CmisBrowserBindingServlet.java:234)\n\tat javax.servlet.http.HttpServlet.service(HttpServlet.java:727)\n\tat org.alfresco.opencmis.CMISServletDispatcher.execute(CMISServletDispatcher.java:180)\n\tat org.alfresco.opencmis.CMISWebScript.execute(CMISWebScript.java:51)\n\tat org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContainer.java:418)\n\tat org.alfresco.rest.api.PublicApiRepositoryContainer.transactionedExecute(PublicApiRepositoryContainer.java:45)\n\tat org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecuteAs(RepositoryContainer.java:600)\n\tat org.alfresco.repo.web.scripts.RepositoryContainer.executeScriptInternal(RepositoryContainer.java:380)\n\tat org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java:261)\n\tat org.alfresco.rest.api.PublicApiRepositoryContainer.access$101(PublicApiRepositoryContainer.java:26)\n\tat org.alfresco.rest.api.PublicApiRepositoryContainer$2.doWork(PublicApiRepositoryContainer.java:99)\n\tat org.alfresco.repo.tenant.TenantUtil.runAsWork(TenantUtil.java:119)\n\tat org.alfresco.repo.tenant.TenantUtil.runAsTenant(TenantUtil.java:88)\n\tat org.alfresco.rest.api.PublicApiRepositoryContainer.executeScript(PublicApiRepositoryContainer.java:95)\n\tat org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:378)\n\tat org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:209)\n\tat org.alfresco.repo.web.scripts.TenantWebScriptServlet.service(TenantWebScriptServlet.java:74)\n\tat org.alfresco.rest.api.PublicApiWebScriptServlet.service(PublicApiWebScriptServlet.java:53)\n\tat javax.servlet.http.HttpServlet.service(HttpServlet.java:727)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)\n\tat org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)\n\tat org.alfresco.web.app.servlet.GlobalLocalizationFilter.doFilter(GlobalLocalizationFilter.java:61)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)\n\tat org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)\n\tat org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)\n\tat org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)\n\tat org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)\n\tat org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)\n\tat org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)\n\tat org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)\n\tat org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)\n\tat org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)\n\tat org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)\n\tat org.apache.tomcat.util.net.AprEndpoint$SocketWithOptionsProcessor.run(AprEndpoint.java:2378)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)\n\tat java.lang.Thread.run(Unknown Source)\nCaused by: org.alfresco.repo.search.impl.lucene.LuceneQueryParserException: 0314159800 Request failed 500 /solr4/alfresco/cmis?wt=json&fl=DBID%2Cscore&rows=10&df=TEXT&start=0&locale=fr_FR&alternativeDic=DEFAULT_DICTIONARY&cmisVersion=CMIS_1_1&fq=%7B%21afts%7DAUTHORITY_FILTER_FROM_JSON&fq=%7B%21afts%7DTENANT_FILTER_FROM_JSON\n\tat org.alfresco.repo.search.impl.solr.SolrQueryHTTPClient.postQuery(SolrQueryHTTPClient.java:616)\n\tat org.alfresco.repo.search.impl.solr.SolrQueryHTTPClient.postSolrQuery(SolrQueryHTTPClient.java:559)\n\tat org.alfresco.repo.search.impl.solr.SolrQueryHTTPClient.executeQuery(SolrQueryHTTPClient.java:520)\n\tat org.alfresco.repo.search.impl.solr.SolrQueryLanguage.executeQuery(SolrQueryLanguage.java:51)\n\tat org.alfresco.repo.search.impl.solr.DbOrIndexSwitchingQueryLanguage.executeQuery(DbOrIndexSwitchingQueryLanguage.java:214)\n\tat org.alfresco.repo.search.impl.solr.SolrOpenCMISQueryServiceImpl.query(SolrOpenCMISQueryServiceImpl.java:89)\n\tat sun.reflect.GeneratedMethodAccessor711.invoke(Unknown Source)\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)\n\tat java.lang.reflect.Method.invoke(Unknown Source)\n\tat org.alfresco.repo.management.subsystems.SubsystemProxyFactory$1.invoke(SubsystemProxyFactory.java:72)\n\tat org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)\n\tat org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)\n\tat com.sun.proxy.$Proxy133.query(Unknown Source)\n\tat org.alfresco.opencmis.CMISConnector.query(CMISConnector.java:2918)\n\tat org.alfresco.opencmis.AlfrescoCmisServiceImpl.query(AlfrescoCmisServiceImpl.java:2373)\n\tat sun.reflect.GeneratedMethodAccessor710.invoke(Unknown Source)\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)\n\tat java.lang.reflect.Method.invoke(Unknown Source)\n\tat org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)\n\tat org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)\n\tat org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)\n\tat org.alfresco.repo.transaction.RetryingTransactionInterceptor$1.execute(RetryingTransactionInterceptor.java:79)\n\tat org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:454)\n\tat org.alfresco.repo.transaction.RetryingTransactionInterceptor.invoke(RetryingTransactionInterceptor.java:69)\n\tat org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)\n\tat org.alfresco.opencmis.AlfrescoCmisStreamInterceptor.invoke(AlfrescoCmisStreamInterceptor.java:72)\n\tat org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)\n\tat org.alfresco.opencmis.AlfrescoCmisServiceInterceptor.invoke(AlfrescoCmisServiceInterceptor.java:101)\n\tat org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)\n\tat org.alfresco.opencmis.AlfrescoCmisExceptionInterceptor.invoke(AlfrescoCmisExceptionInterceptor.java:83)\n\t… 48 more\n"
}


If I remove all the "OR IN_FOLDER" conditions then it works on alfresco 5.0.0 …


Outcomes