I need help populating dropdown list in Alfresco Share. I've created a WebScript API which I read the content of a folder in the repository. As a service in Alfresco (repository) it works. However, I need that DropDown in Share.
Here is what I did in Alfresco:
var folder = roothome.childByNamePath(url.extension);
if (folder == undefined || !folder.isContainer)
{
status.code = 404;
status.message = "Folder " + url.extension + " not found.";
status.redirect = true;
}
model.folder = folder;
<webscript>
<shortname>Folder Listing Sample</shortname>
<description>Sample demonstrating the listing of folder contents</description>
<url>/folder/{path}</url>
<format default="html">argument</format>
<authentication>user</authentication>
<transaction>required</transaction>
</webscript>
<html>
<head>
<title>${folder.displayPath}/${folder.name}</title>
</head>
<body>
Folder: ${folder.displayPath}/${folder.name}
<br>
<select id='selectItems' name='selectItems' onchange='dropdown2()'>
<#list folder.children as child>
<option value='${child.nodeRef}'>${child.properties.name}</option>
</#list>
</select>
</body>
</html>
<#macro encodepath node><#if node.parent?exists><@encodepath node=node.parent/>/${node.name?url}</#if></#macro>
I need this dropdown in Share. Since variables like: userhome, companyhome and such aren't accessible from Share WebScripts, I don't know how to get info from Alfresco and display it in Share. Any help would be appreciated.