Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Contents

Table of Contents

Info
titleAvailability

Available since starting with katl-commons 2.5.5.

Introduction

Since Starting with version 2.5.5, katl-commons exposes a REST service to facilitate arbitrary execution of SIL scripts. These services are available via HTTP POST at <your_base_url>/rest/keplerrominfo/refapp/latest/async-script and <your_base_url>/rest/keplerrominfo/refapp/latest/async. The service responses are all JSON formatted (see Beans below).

...


Code Block
titleExample Request using AJS
AJS.$.ajax({
 type: 'POST',
 contentType: "application/json",
 url : "http://localhost:7210/rest/keplerrominfo/refapp/latest/async/getResult",
 data : JSON.stringify({
   key: 4
  }),
 success : function(data) {
    console.log(data);
 },
 beforeSend: function (xhr){
     xhr.setRequestHeader('Authorization', "Basic " + btoa(username + ":" + password));
 }
});



Code Block
titleExample JSON Response for checkScript
{
 "running":false,
 "outcome": {
	 "valid": true
 }
}




Code Block
titleExample JSON Response for checkScript
{
 "running":false,
 "outcome" : {
 	"errors" : [
		{
			"errLine":1
			"error":"Encountered <DOUBLE>  at line 1, column 13. Was expecting one of:  ";" , "." , "." "
		}
	]
 }
}


Code Block
titleExample JSON Response for runScript
{
 "running":false,
 "outcome" : {
	"results":["string returned from script"] // array of values returned by script using "return val1, val2";
 }
}



Beans

Anchor
ScriptFileListResponse
ScriptFileListResponse
ScriptFileListResponse

...