kamidu 8 years ago
commit e0d9e1659c

@ -27,7 +27,7 @@ function onRequest(context) {
"backendApiUri": devicemgtProps["httpsURL"] + "/android_sense/stats/" "backendApiUri": devicemgtProps["httpsURL"] + "/android_sense/stats/"
}; };
} else if (deviceType != null && deviceType != undefined && deviceId != null && deviceId != undefined) { } else if (deviceType != null && deviceType != undefined && deviceId != null && deviceId != undefined) {
var deviceModule = require("/app/modules/device.js").deviceModule; var deviceModule = require("/app/modules/business-controllers/device.js")["deviceModule"];
var device = deviceModule.viewDevice(deviceType, deviceId); var device = deviceModule.viewDevice(deviceType, deviceId);
if (device && device.status != "error") { if (device && device.status != "error") {
return { return {

@ -25,7 +25,7 @@ function onRequest(context) {
]; ];
if (deviceType != null && deviceType != undefined && deviceId != null && deviceId != undefined) { if (deviceType != null && deviceType != undefined && deviceId != null && deviceId != undefined) {
var deviceModule = require("/app/modules/device.js").deviceModule; var deviceModule = require("/app/modules/business-controllers/device.js")["deviceModule"];
var device = deviceModule.viewDevice(deviceType, deviceId); var device = deviceModule.viewDevice(deviceType, deviceId);
if (device && device.status != "error") { if (device && device.status != "error") {
return { return {

@ -29,7 +29,7 @@ function onRequest(context) {
"backendApiUri": devicemgtProps["httpsURL"] + "/arduino/device/stats/" "backendApiUri": devicemgtProps["httpsURL"] + "/arduino/device/stats/"
}; };
} else if (deviceType != null && deviceType != undefined && deviceId != null && deviceId != undefined) { } else if (deviceType != null && deviceType != undefined && deviceId != null && deviceId != undefined) {
var deviceModule = require("/app/modules/device.js").deviceModule; var deviceModule = require("/app/modules/business-controllers/device.js")["deviceModule"];
var device = deviceModule.viewDevice(deviceType, deviceId); var device = deviceModule.viewDevice(deviceType, deviceId);
if (device && device.status != "error") { if (device && device.status != "error") {
return { return {

@ -25,7 +25,7 @@ function onRequest(context) {
]; ];
if (deviceType != null && deviceType != undefined && deviceId != null && deviceId != undefined) { if (deviceType != null && deviceType != undefined && deviceId != null && deviceId != undefined) {
var deviceModule = require("/app/modules/device.js").deviceModule; var deviceModule = require("/app/modules/business-controllers/device.js")["deviceModule"];
var device = deviceModule.viewDevice(deviceType, deviceId); var device = deviceModule.viewDevice(deviceType, deviceId);
if (device && device.status != "error") { if (device && device.status != "error") {
return {"device": device, "backendApiUri" : devicemgtProps["httpsURL"] + "/arduino/", "autoCompleteParams" : autoCompleteParams}; return {"device": device, "backendApiUri" : devicemgtProps["httpsURL"] + "/arduino/", "autoCompleteParams" : autoCompleteParams};

@ -23,7 +23,7 @@ var uriMatcher = new URIMatcher(String(uri));
var log = new Log("api/policy-api.jag"); var log = new Log("api/policy-api.jag");
var constants = require("/app/modules/constants.js"); var constants = require("/app/modules/constants.js");
var policyModule = require("/app/modules/policy.js").policyModule; var policyModule = require("/app/modules/business-controllers/policy.js")["policyModule"];
var deviceType, deviceId; var deviceType, deviceId;

@ -18,7 +18,7 @@
function onRequest(context) { function onRequest(context) {
var log = new Log("operation.js"); var log = new Log("operation.js");
var operationModule = require("/app/modules/operation.js").operationModule; var operationModule = require("/app/modules/business-controllers/operation.js")["operationModule"];
var device = context.unit.params.device; var device = context.unit.params.device;
var autoCompleteParams = context.unit.params.autoCompleteParams; var autoCompleteParams = context.unit.params.autoCompleteParams;
var controlOperations = operationModule.getControlOperations(device.type); var controlOperations = operationModule.getControlOperations(device.type);

@ -19,7 +19,7 @@
function onRequest(context) { function onRequest(context) {
var log = new Log("policy-view-edit-unit backend js"); var log = new Log("policy-view-edit-unit backend js");
log.debug("calling policy-view-edit-unit"); log.debug("calling policy-view-edit-unit");
var userModule = require("/app/modules/user.js").userModule; var userModule = require("/app/modules/business-controllers/user.js")["userModule"];
context.roles = userModule.getRoles().content; context.roles = userModule.getRoles().content;
return context; return context;
} }

@ -19,7 +19,7 @@
function onRequest(context) { function onRequest(context) {
var log = new Log("policy-view-edit-unit backend js"); var log = new Log("policy-view-edit-unit backend js");
log.debug("calling policy-view-edit-unit"); log.debug("calling policy-view-edit-unit");
var userModule = require("/app/modules/user.js").userModule; var userModule = require("/app/modules/business-controllers/user.js")["userModule"];
context.roles = userModule.getRoles().content; context.roles = userModule.getRoles().content;
return context; return context;
} }

@ -22,7 +22,7 @@ function onRequest(context) {
var DTYPE_CONF_DEVICE_TYPE_KEY = "deviceType"; var DTYPE_CONF_DEVICE_TYPE_KEY = "deviceType";
var DTYPE_CONF_DEVICE_TYPE_LABEL_KEY = "label"; var DTYPE_CONF_DEVICE_TYPE_LABEL_KEY = "label";
var userModule = require("/app/modules/user.js")["userModule"]; var userModule = require("/app/modules/business-controllers/user.js")["userModule"];
var utility = require('/app/modules/utility.js').utility; var utility = require('/app/modules/utility.js').utility;
var response = userModule.getRoles(); var response = userModule.getRoles();
var wizardPage = {}; var wizardPage = {};

@ -29,7 +29,7 @@ function onRequest(context) {
"backendApiUri": devicemgtProps["httpsURL"] + "/raspberrypi/device/stats/" "backendApiUri": devicemgtProps["httpsURL"] + "/raspberrypi/device/stats/"
}; };
} else if (deviceType != null && deviceType != undefined && deviceId != null && deviceId != undefined) { } else if (deviceType != null && deviceType != undefined && deviceId != null && deviceId != undefined) {
var deviceModule = require("/app/modules/device.js").deviceModule; var deviceModule = require("/app/modules/business-controllers/device.js")["deviceModule"];
var device = deviceModule.viewDevice(deviceType, deviceId); var device = deviceModule.viewDevice(deviceType, deviceId);
if (device && device.status != "error") { if (device && device.status != "error") {
return { return {

@ -25,7 +25,7 @@ function onRequest(context) {
]; ];
if (deviceType != null && deviceType != undefined && deviceId != null && deviceId != undefined) { if (deviceType != null && deviceType != undefined && deviceId != null && deviceId != undefined) {
var deviceModule = require("/app/modules/device.js").deviceModule; var deviceModule = require("/app/modules/business-controllers/device.js")["deviceModule"];
var device = deviceModule.viewDevice(deviceType, deviceId); var device = deviceModule.viewDevice(deviceType, deviceId);
if (device && device.status != "error") { if (device && device.status != "error") {
return {"device": device, "backendApiUri" : devicemgtProps["httpsURL"] + "/raspberrypi/", "autoCompleteParams" : autoCompleteParams}; return {"device": device, "backendApiUri" : devicemgtProps["httpsURL"] + "/raspberrypi/", "autoCompleteParams" : autoCompleteParams};

@ -29,7 +29,7 @@ function onRequest(context) {
"backendApiUri": devicemgtProps["httpsURL"] + "/virtual_firealarm/device/stats/" "backendApiUri": devicemgtProps["httpsURL"] + "/virtual_firealarm/device/stats/"
}; };
} else if (deviceType != null && deviceType != undefined && deviceId != null && deviceId != undefined) { } else if (deviceType != null && deviceType != undefined && deviceId != null && deviceId != undefined) {
var deviceModule = require("/app/modules/device.js").deviceModule; var deviceModule = require("/app/modules/business-controllers/device.js")["deviceModule"];
var device = deviceModule.viewDevice(deviceType, deviceId); var device = deviceModule.viewDevice(deviceType, deviceId);
if (device && device.status != "error") { if (device && device.status != "error") {
return { return {

@ -25,7 +25,7 @@ function onRequest(context) {
]; ];
if (deviceType != null && deviceType != undefined && deviceId != null && deviceId != undefined) { if (deviceType != null && deviceType != undefined && deviceId != null && deviceId != undefined) {
var deviceModule = require("/app/modules/device.js").deviceModule; var deviceModule = require("/app/modules/business-controllers/device.js")["deviceModule"];
var device = deviceModule.viewDevice(deviceType, deviceId); var device = deviceModule.viewDevice(deviceType, deviceId);
if (device && device.status != "error") { if (device && device.status != "error") {
return {"device": device, "backendApiUri" : devicemgtProps["httpsURL"] + "/virtual_firealarm/", "autoCompleteParams" : autoCompleteParams}; return {"device": device, "backendApiUri" : devicemgtProps["httpsURL"] + "/virtual_firealarm/", "autoCompleteParams" : autoCompleteParams};

@ -22,7 +22,7 @@ function onRequest(context) {
var deviceId = request.getParameter("id"); var deviceId = request.getParameter("id");
if (deviceType != null && deviceType != undefined && deviceId != null && deviceId != undefined) { if (deviceType != null && deviceType != undefined && deviceId != null && deviceId != undefined) {
var deviceModule = require("/app/modules/device.js").deviceModule; var deviceModule = require("/app/modules/business-controllers/device.js")["deviceModule"];
var device = deviceModule.viewDevice(deviceType, deviceId); var device = deviceModule.viewDevice(deviceType, deviceId);
if (device) { if (device) {

@ -17,7 +17,7 @@
*/ */
function onRequest(context) { function onRequest(context) {
var userModule = require("/app/modules/user.js")["userModule"]; var userModule = require("/app/modules/business-controllers/user.js")["userModule"];
var generalConfig = context.app.conf["generalConfig"]; var generalConfig = context.app.conf["generalConfig"];
context["permissions"] = userModule.getUIPermissions(); context["permissions"] = userModule.getUIPermissions();

@ -1,6 +1,6 @@
function onRequest(context) { function onRequest(context) {
// var log = new Log("platform-configuration-unit backend js"); // var log = new Log("platform-configuration-unit backend js");
var userModule = require("/app/modules/user.js")["userModule"]; var userModule = require("/app/modules/business-controllers/user.js")["userModule"];
var typesListResponse = userModule.getPlatforms(); var typesListResponse = userModule.getPlatforms();
if (typesListResponse["status"] == "success") { if (typesListResponse["status"] == "success") {
context["types"] = typesListResponse["content"]; context["types"] = typesListResponse["content"];

@ -19,7 +19,7 @@
function onRequest(context) { function onRequest(context) {
var log = new Log("policy-view-edit-unit backend js"); var log = new Log("policy-view-edit-unit backend js");
log.debug("calling policy-view-edit-unit"); log.debug("calling policy-view-edit-unit");
var userModule = require("/app/modules/user.js").userModule; var userModule = require("/app/modules/business-controllers/user.js")["userModule"];
context.roles = userModule.getRoles().content; context.roles = userModule.getRoles().content;
context.users = userModule.getUsersByUsername().content; context.users = userModule.getUsersByUsername().content;
return context; return context;

@ -19,7 +19,7 @@
function onRequest(context) { function onRequest(context) {
var log = new Log("policy-view-edit-unit backend js"); var log = new Log("policy-view-edit-unit backend js");
log.debug("calling policy-view-edit-unit"); log.debug("calling policy-view-edit-unit");
var userModule = require("/app/modules/user.js").userModule; var userModule = require("/app/modules/business-controllers/user.js")["userModule"];
context.roles = userModule.getRoles().content; context.roles = userModule.getRoles().content;
return context; return context;
} }

@ -17,7 +17,7 @@
*/ */
function onRequest(context) { function onRequest(context) {
var userModule = require("/app/modules/user.js")["userModule"]; var userModule = require("/app/modules/business-controllers/user.js")["userModule"];
var utility = require('/app/modules/utility.js').utility; var utility = require('/app/modules/utility.js').utility;
var response = userModule.getRoles(); var response = userModule.getRoles();
var wizardPage = {}; var wizardPage = {};

@ -27,7 +27,7 @@ function onRequest(context) {
return options.fn(this); return options.fn(this);
} }
}); });
var userModule = require("/app/modules/user.js")["userModule"]; var userModule = require("/app/modules/business-controllers/user.js")["userModule"];
var mdmProps = require('/app/conf/reader/main.js')["conf"]; var mdmProps = require('/app/conf/reader/main.js')["conf"];
var constants = require("/app/modules/constants.js"); var constants = require("/app/modules/constants.js");
var uiPermissions = userModule.getUIPermissions(); var uiPermissions = userModule.getUIPermissions();

Loading…
Cancel
Save