08-23-2007 03:31 AM
Input form
<html>
<head>
<title>***** ex_listDocsSpace.html *****</title>
</head>
<body>
<form method="POST" action="http://vaio-sugai:8080/alfresco/command/script/execute" accept-charset="UTF-8" >
<br>JavaScript call from HTML form<br>
<br>
<input type="text" name="scriptPath" size="100" value="/Company Home/User Homes/ex_listDocsSpace.js">
<br><br>
<input type="text" name="spacePath" size="100" value="User Homes">
<br><br>
<input type="text" name="templatePath" size="100" value="User Homes/ex_listDocsSpace.ftl">
<br><br>
<input type="submit">
</form>
</body>
</html>
[JavaScript code]
var arg = new Array();
arg = args;
var script = arg["scriptPath"];
var spacePath = arg["spacePath"];
var templatePath = arg["templatePath"];
var result = "args check !" + "<br>";
result += "arg[script] : " + script + "<br>";
result += "arg[spacePath] : " + spacePath + "<br>";
result += "arg[templatePath] : " + templatePath + "<br><br>"; // 10
space = userhome;
var spaceNode = space.childByNamePath(spacePath);
if ( spaceNode == null) {
result += "spaceNode not found !" + "<br>";
} else {
result += "spaceNode.name = " + spaceNode.name + "<br>";
}
// Get templateNode
var templateNode = space.childByNamePath(templatePath);
result += "templateNodeName = " + templateNode.name + "<br>";
// set spaceNode to current space
space = spaceNode;
// Execute processTemplate
var outString = new String("");
outString += space.processTemplate(templateNode);
result += outString + "<br>";
result;
[Template]
<#– Renders list of all the documents in the Space –>
<table>
<#list space.children as child>
<#if child.isDocument>
<tr><td>${child.properties.name}</td></tr>
</#if>
</#list>
</table>
09-06-2007 04:33 AM
09-10-2007 08:36 AM
10-11-2007 12:14 AM
10-11-2007 05:33 AM
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.