Alfresco: Unable to CMIS query by path

南笙酒味 提交于 2021-01-28 13:33:16

问题


I am trying to find out the contents of a folder in Alfresco, using the following CMIS query:

SELECT * 
FROM cmis:document 
WHERE CONTAINS('PATH:"/app:company_home/st:sites/cm:GM/cm:emir/cm:FAQ//*"')

In Node Browser, if I navigate to that folder I see the following value for Primary Path

(I have added line breaks to make it easier to read):

/{http://www.alfresco.org/model/application/1.0}company_home
/{http://www.alfresco.org/model/site/1.0}sites
/{http://www.alfresco.org/model/content/1.0}GM
/{http://www.alfresco.org/model/content/1.0}EMIR
/{http://www.alfresco.org/model/content/1.0}FAQ

But Alfresco is failing with the following message:

Caused by: org.alfresco.scripts.ScriptException: 05120032 Failed to execute script 'classpath*:alfresco/templates/webscripts/org/alfresco/cmis/queries.post.cmisquery.js': 05120 031 Unknown column/property PATH

I am testing against Alfresco Community 3.3.


回答1:


You can use the following query for simple search

SELECT * FROM cmis:document WHERE IN_FOLDER('id_of_folder')

or the following query for recursive search

SELECT * FROM cmis:document WHERE IN_TREE('id_of_folder').

if you want search by path, you can use:

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

For more details view also the official specification

http://docs.oasis-open.org/cmis/CMIS/v1.1/os/CMIS-v1.1-os.html




回答2:


Do yourself a favor and upgrade.

Your query works for me in the share node browser (does not throw exceptions) as either cmis-strict or cmis-alfresco .

SELECT * 
FROM cmis:document 
WHERE CONTAINS('PATH:"/app:company_home/st:sites//*"')

Gives me a whole lot of results.



来源:https://stackoverflow.com/questions/24190975/alfresco-unable-to-cmis-query-by-path

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!