AnsweredAssumed Answered

how to create and register webscript

Question asked by pmarreddy on Jul 18, 2007
Latest reply on Jul 21, 2007 by pmarreddy
hi,

i am trying to create a web script in folder
/Company Home/Data Dictionary/Web Scripts/org/alfresco/sample

and my

swsearch.get.desc.xml

<webscript>
<shortname>sw Search</shortname>
<description> search term</description>
<url>/sw/swsearch</url>
<format default="html">extension</format>
<authentication>guest</authentication>
<transaction>required</transaction>
</webscript>


swsearch.get.html.ftl

<html>
<body>
<img src="${url.context}/images/logo/AlfrescoLogo32.png" alt="Alfresco" />
Blog query: ${args.q}
<br>
<table>
<#list resultset as node>
<tr>
<td><img src="${url.context}${node.icon16}"/>
<td><a href="${url.serviceContext}/api/node/content/${node.nodeRef.storeRef.protocol}/${node.nodeRef.storeRef.identifier}/${node.nodeRef.id}/${node.name?url}">${node.name}</a>
</tr>
</#list>
</table>
</body>
</html>

swsearch.get.js


// check that search term has been provided
if (args.q == undefined || args.q.length == 0)
{
status.code = 400;
status.message = "Search term has not been provided.";
status.redirect = true;
}
else
{
// perform search
var nodes = search.luceneSearch( "(TYPE:\"{http://www.mydomain.com/model/pariksha/1.0}quiz\") AND (@pk\\:tags:\""+args.q +"\")");
model.resultset = nodes;
}



i dont know what i amdoing wron but when i try http://localhost:8080/alfresco/service/sw/swsearch

i am getting Script url /sw/swsearch does not map to a Web Script.

thanks prasanth

Outcomes