AnsweredAssumed Answered

Getting a value from the url

Question asked by sandile on Feb 11, 2013
Latest reply on Feb 12, 2013 by sandile
Hi

I am trying to retrieve the noderef and serialnumber arguments from the url.
Every time i try to implement it gives me an error message "script url does not map to a webscript"

<DESCRIPTOR file>
<webscript>
   <shortname>Update Serial Number</shortname>
   <description>Update Serial Number of Equipment Proxy Document</description>
   <family>Green Energy</family>
   <url>/com/greenenergy/em/lab2/updateserialnum/{serialnum}/{noderef}</url>
   <format default="html"/>
   <authentication>user</authentication>
</webscript>




<SCRIPT CONTROLL file>

var serialnum = url.templateArgs["serialnum"];

//var noderef = url.templateArgs["noderef"];


// search for node by noderef

var noderef="workspace://SpacesStore/85f170c7-26af-42d8-a913-6c8c6e8d51ff";
var doc = search.findNode(noderef);


if(doc!=null) {
   
// update the serial number property

   doc.properties["geem:serialnum"]=serialnum;

   doc.save();

   model.message="Node (" + noderef + ") updated.";

}
else {
   status.redirect=true;

   status.code=500;

   status.message="Document/node was not found!";

}


<FTL file>
${message}

Outcomes