04-29-2015 05:22 PM
define(["dojo/_base/declare",
"alfresco/core/Core",
"dojo/_base/lang",
"alfresco/core/CoreXhr",
"service/constants/Default",
"dojo/json",
"dojo/_base/array"],
function(declare, Core, lang, CoreXhr, AlfConstants, JSON, array) {
return declare([Core, CoreXhr], {
// other code here
myFunction: function custom_myService__myFunction(response, originalRequestConfig) {
this.alfLog("log", "myFunction called");
var options = [];
//var rawData = JSON.parse(response);
var rawData = JSON.parse('{"hello":"world"}', true);
// code below never executes ???
this.alfLog("log", "rawdata: " + rawdata);
if (rawData && rawData.aspects)
{
this.alfLog("log", "flag2");
var aspects = rawData.aspects;
for (var i=0; i<aspects.length; i++)
{
this.alfLog("log", "flag3");
options.push({
value: aspects.value,
label: aspects.label
});
this.alfLog("log", "flag4");
}
}
this.alfLog("log", "aspects options: " + options);
this.alfPublish(originalRequestConfig.data.responseTopic, options);
}
});
});
05-08-2015 04:32 PM
05-12-2015 08:27 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.