02-13-2008 11:02 AM
02-13-2008 12:34 PM
<webscript>
<shortname>WebScript Custom View</shortname>
<description>Add webscript aspect to space node</description>
<url>/webscriptable?n={nodeRef}&w={webscriptUrl}</url>
<format default="html"/>
<authentication>admin</authentication>
<transaction>required</transaction>
</webscript>
(Change the URL and authentication details to suit your deployment)if (args["n"] != null)
{
var dest = search.findNode(args["n"]);
if (dest != null)
{
if (args["add"] != null)
{
dest.addAspect("cm:webscriptable");
dest.properties["cm:webscript"] = args["w"];
}
else
{
dest.removeAspect("cm:webscriptable");
}
dest.save();
}
}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>WebScript Custom View</title>
<style>
body {
font-family: Verdana, Helvetica, sans-serif;
font-size: 10pt;
}
.label {
float: left;
width: 10em;
}
.data {
float: left;
}
.field {
clear: left;
float: left;
padding: 8px;
}
</style>
</head>
<body>
<h3>WebScript Custom View</h3>
<form action="${url.serviceContext}${url.match}" method="get">
<div class="field">
<span class="label">Space nodeRef:</span>
<span class="data"><input type="text" name="n" size="64" /><br />e.g. "workspace://SpacesStore/e3741425-35cf-11dc-9762-4b73d0280543"</span>
</div>
<div class="field">
<span class="label">Webscript URL:</span>
<span class="data"><input type="text" name="w" size="128" value="/wcservice/PATH/TO/WEBSCRIPT?nodeRef={noderef}" /></span>
</div>
<div class="field">
<span><input type="submit" value="Add" name="add" /></span>
<span><input type="submit" value="Remove" name="remove" /></span>
</div>
</form>
</body>
</html>
var nodeRef = args["nodeRef"];
var space = search.findNode(nodeRef);
in your custom view's javascript.02-20-2008 06:25 AM
02-20-2008 06:26 AM
02-20-2008 06:55 AM
When is the UI going to be added?Good question - I don't think it's being planned at the moment. If you'd like to raise an improvement request in JIRA this would help.
Had a quick question: is there any easy way to apply the webscriptable aspect to more than one node at a time? Say a hierarchy of nodes?You should be able to take the example posted in this topic and apply it to the script above, looping through dest's children.
02-20-2008 08:09 AM
03-12-2010 09: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.