cancel
Showing results for 
Search instead for 
Did you mean: 

How can I get all documents with their respective directory using CMIS? (Como eu consigo buscar todos os documentos com seu respetivo diretório usando CMIS)

gustavosandrade
Champ in-the-making
Champ in-the-making

How can I perform the search of all documents, from a respective site eg 'sispat', and bring the paths of all the documents?

I made a query that returns the paths of all folders:

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

But I wanted one that made the relationship between folder and document, for example:

Name document | path

Document-x.pdf  |  /sites/sispat/documentlibary/folder1/document-x.pdf

como eu posso realizar a busca de todos os documentos, de um respectivo site por exemplo 'sispat', e trazer os paths de todos os documentos?

Eu fiz uma consulta que retorna os paths de todas as pastas:
SELECT * FROM cmis:folder WHERE CONTAINS('PATH:\"/app:company_home/st:sites/cm:sispat/cm:documentLibrary//*/*/*\"')

Mas eu queria uma que fizesse a relação entre pasta e documento, trazendo por exemplo:
name document | Path
document-x.pdf | /sites/sispat/documentlibary/folder1/document-x.pdf

5 REPLIES 5

kaynezhang
World-Class Innovator
World-Class Innovator

Why not just use getDescendant or getFolderTree method of Folder class and iterate folder tree assemble path you self.

I do not think you understood my doubt. I need to perform all this search in a query and this query should return the document name linked to the path of the same document

I do not think you understood my doubt.

I need to perform all this search in a query and this query should return the
document name linked to the path of the same document.

Example:
Name Document | PATH
Paper.doc     |/sites/sispat/documentLibary/folder/Paper.doc

I don´t think that this is working with such a document based query because only folders have a path property. Joining documents and folders would help, but I don´t know if Alfresco is supporting joins in the meantime (https://community.alfresco.com/docs/DOC-5898-cmis-query-language#w_cmis3adocument  -The Alfresco implementation currently does not support JOIN except as an extension to support aspects. This extension is Alfresco specific.)

jego
Star Contributor
Star Contributor

Why not selecting all documents with the IN_TREE clause?

Example: SELECT cmis:name FROM cmis:document WHERE IN_TREE(‘folder id’)

I hope this helps.

Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.