As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
function main(){ logger.log("Starting to parse input params"); model.mytestval=JSON.get("testval"); logger.log("Finished to parse input params."); } main();
Is your JavaScript file called sample.get.json.js? The "json" part is important.Thanks,Mike
<webscript> <shortname>Get spaces by category</shortname> <description>Retrieve spaces in specified category</description> <url>/get_nodes_by_category</url> <format default="json">argument</format> <authentication>user</authentication> <transaction>required</transaction> </webscript>
{ "myval":"${mytestval}" }
var testarray = new Array(1); testarray[0]="testval: valuepassedtoscript"; var connector = remote.connect("alfresco"); var data = connector.post("/get_nodes_by_category",jsonUtils.toJSONString(testarray), "application/json"); var results = eval('(' + data + ')'); model.body = results["myval"];
if (json.has("testval") == true){ logger.log("value found!!!"); }
var testarray = new Array(1); testarray[0]="testval: valuepassedtoscript"; connector.post("/get_nodes_by_category",jsonUtils.toJSONString(testarray), "application/json");
var test = { testval: "valuepassedtoscript" }; connector.post("/get_nodes_by_category",jsonUtils.toJSONString(test), "application/json");