cancel
Showing results for 
Search instead for 
Did you mean: 

Returning folder/space path and name as part of search reslt

shikarishambu
Champ in-the-making
Champ in-the-making
I have a custom search webscript that takes a space, content type and a few other parameters and returns the list of documents in the space and its children that match the content type/its derivatives. I would like to return the folder path and name associated with the returned document.

I have tried
${row.properties.folder.displayPath}
and that does not seem to work. How do I return the location of the file/document as part of the search results?

TIA
4 REPLIES 4

stevegreenbaum
Champ in-the-making
Champ in-the-making
Not sure of the exact context of your question, but here goes.  In the controller, return the documents to the Freemarker template (e.g., model.documentlist).  Using Freemarker list function reference documentlist as child (perhaps that is what you were referring to as row in your example). 
The path is child.displayPath.  Then concatonate child.name.  You'll also have to add the server and context to front (http://localhost/alfresco/).

You don't need properties.folder.

shikarishambu
Champ in-the-making
Champ in-the-making
Thanks. That worked. I was wondering if there is a way to get the Folder Title. The displaypath is kind of long and my folder names have no spaces in them. For better readability it would be nice if I could get the folder title.

TIA

stevegreenbaum
Champ in-the-making
Champ in-the-making
Yes, you can retrieve the folder's title as a property of the folder.

shikarishambu
Champ in-the-making
Champ in-the-making
${row.parent.properties.title}