我需要特定文件夹路径下的所有文档
我的查询是:
query = "SELECT cmis:name FROM cmis:document WHERE CONTAINS('PATH:\"/app:Company Home/st:Sites/*\"')"
发生以下异常:
org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException: 05070198 Request failed 400 /solr4/alfresco/cmis?wt=json&fl=DBID%2Cscore&rows=100&df=TEXT&start=0&loc
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)
我的文档路径如下:
/Sites/site_name/documentLibrary/PIM Data/3600011/rnd/VphotometricDrawings.polar diagram/en
答案 0 :(得分:2)
我不确定你的查询的PATH部分是否正确,你可能想看一下,例如:
" SELECT * FROM cmis:document WHERE CONTAINS('路径:\" /应用:company_home / ST:站点/ * \"&#39)。"
另请参阅以下链接:
http://docs.alfresco.com/4.1/references/API-JS-iso9075Encode.html
答案 1 :(得分:1)
尝试此查询。它应该工作
String folder_query = "SELECT cmis:path,cmis:objectId,cmis:allowedChildObjectTypeIds FROM cmis:folder where CONTAINS('PATH:\"/app:company_home/st:sites/cm:mysite/cm:myLibrary/"
+ your own path + "//*\"')";
它会为您提供文件夹ID。通过使用文件夹ID,您可以访问您的文档。
String query = "Select cmis:contentStreamMimeType,cmis:objectId FROM cmis:document where IN_FOLDER('" + objectId
+ "') and cmis:contentStreamMimeType = 'application/pdf'";