3
votes

I am trying to fetch all documents from alfresco using path

SELECT cmis:path,cmis:objectId,cmis:allowedChildObjectTypeIds
FROM cmis:folder
WHERE CONTAINS('PATH:\"/app:company_home/st:sites/cm:my_tite/cm:documentLibrary/cm:PIM_x0020_Data//*\"')

is working fine but when add one more column in query it is not working

SELECT cmis:path,cmis:objectId,cmis:allowedChildObjectTypeIds
FROM cmis:folder
WHERE CONTAINS('PATH:\"/app:company_home/st:sites/cm:my_site/cm:documentLibrary/cm:3600009//*\"')

and this is throwing Exception

ERROR [hsRndDatasheetJob::de.hybris.platform.servicelayer.internal.jalo.ServicelayerJob] (hsRndDatasheetJob) [HSLoggingAspect] Cause : {} org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException: 05090122 Request failed 400 /solr4/alfresco/cmis?wt=json&fl=DBID%2Cscore&rows=100&df=TEXT&start=0&loca le=en_IN&alternativeDic=DEFAULT_DICTIONARY&cmisVersion=CMIS_1_1&fq=%7B%21afts%7DAUTHORITY_FILTER_FROM_JSON&fq=%7B%21afts%7DTENANT_FILTER_FROM_JSON at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.convertStatusCode(AbstractAtomPubService.java:487) at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.post(AbstractAtomPubService.java:629) at org.apache.chemistry.opencmis.client.bindings.spi.atompub.DiscoveryServiceImpl.query(DiscoveryServiceImpl.java:145) at org.apache.chemistry.opencmis.client.runtime.SessionImpl$3.fetchPage(SessionImpl.java:600) at org.apache.chemistry.opencmis.client.runtime.util.AbstractIterator.getCurrentPage(AbstractIterator.java:132) at org.apache.chemistry.opencmis.client.runtime.util.CollectionIterator.hasNext(CollectionIterator.java:48) at com.hs.alfresco.services.impl.HSBaseAlfrescoService.getDocumentsByPath(HSBaseAlfrescoService.java:302) at com.hs.alfresco.services.impl.HSBaseAlfrescoService$$FastClassBySpringCGLIB$$ee750fc3.invoke() at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:717) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) at org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:52) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)

1
But they're not the same query, one does: PATH:\"/app:company_home/st:sites/cm:my_tite/cm:documentLibrary/cm:PIM_x0020_Data//*\"' And the other does: 'PATH:\"/app:company_home/st:sites/cm:my_site/cm:documentLibrary/cm:3600009//*\"' Please check again using the same String and make sure the issue isn't due to the different Contains secitonDraken
PATH:\"/app:company_home/st:sites/cm:my_tite/cm:documentLibrary/cm:PIM_x0020_Da‌​ta/cm:3600009//*\"' is also not workinguser3370281

1 Answers

3
votes

The problem is the fact that your folder starts with number. Look into ISO9075, encoding your string should do the trick.

http://docs.alfresco.com/4.1/references/API-JS-iso9075Encode.html