cancel
Showing results for 
Search instead for 
Did you mean: 

Get current folder path

laurent1050
Champ in-the-making
Champ in-the-making
Hi,

I've made a web script in Alfresco to get the description of a folder: /slingshot/doclib/folderdescription/site/{site}/{container}/{path}
Everythig is ok, I get the description of the my folder using
http://localhost:8080/alfresco/service/slingshot/doclib/folderdescription/site/mySite/documentlibrar...

Know, I want to ask this web script from Share, using remote.call

var mySite = page.url.templateArgs.site;
var myFolderPath = ???;
remote.call("/slingshot/doclib/folderdescription/site/" + mySite + "/documentlibrary/" + myFolderPath);
But I don't know how to get the current folder path ?

In fact, what I need to show in the document library is the description of the current folder.
For example, in the page showing the content of the A/B folder in my Share site (http://localhost:8080/share/page/site/mySite/documentlibrary#filter=path|/A/B&page=1), I want to show the description of the folder B.

Thanks for your answers
Laurent
5 REPLIES 5

mikeh
Star Contributor
Star Contributor
Why not simply add the parent folder's description to the original response?
doclist.get.json.ftl
<#if doclist.parent??>
   <#assign parentNode = doclist.parent.node>
   "nodeRef": "${parentNode.nodeRef}",
   "description": "${parentNode.properties.description!""}",
   …

Then in on the client, access it using
this.doclistMetadata.parent.description

Thanks,
Mike

laurent1050
Champ in-the-making
Champ in-the-making
Thanks Mike for your answer.

No problem to ot update doclist.get.json.ftl, the json content is correctly modified.

But where in share can I use
this.doclistMetadata.parent.description
I don't know in which file I can access this.doclistMetadata…. Is it in documentlibrary.ftl or in documentlibrary.js or smowhere else ???

Laurent

mikeh
Star Contributor
Star Contributor
It's documentlist.js

Thanks,
Mike

laurent1050
Champ in-the-making
Champ in-the-making
Thanks Mike,

It's correct, you're the king 🙂

But I'm surprised that some content is generated using javascript. It was not possible to use freemarker to generate all pages ???
I think that it's not very practical……. newbie opinion  :wink:

Laurent

mikeh
Star Contributor
Star Contributor
We get far more flexibility using the YUI components and client-side JavaScript rather than returning HTML from Freemarker scripts on the web tier.

Thanks,
Mike