revert-dabc3590
mharindu 9 years ago
commit 5f917e51f1

@ -27,7 +27,7 @@ function onRequest(context) {
"backendApiUri": devicemgtProps["httpsURL"] + "/android_sense/stats/"
};
} 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);
if (device && device.status != "error") {
return {

@ -25,7 +25,7 @@ function onRequest(context) {
];
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);
if (device && device.status != "error") {
return {

@ -18,7 +18,7 @@
function onRequest(context) {
var device = context.unit.params.device;
var devicemgtProps = require("/app/conf/reader/main.js")["conf"];
var devicemgtProps = require("/app/modules/conf-reader/main.js")["conf"];
var constants = require("/app/modules/constants.js");
var websocketEndpoint = devicemgtProps["httpsURL"].replace("https", "wss");
var tokenPair = session.get(constants.ACCESS_TOKEN_PAIR_IDENTIFIER);

@ -18,7 +18,7 @@
function onRequest(context){
var viewModel = {};
var devicemgtProps = require("/app/conf/reader/main.js")["conf"];
var devicemgtProps = require("/app/modules/conf-reader/main.js")["conf"];
viewModel.hostName = devicemgtProps["httpsWebURL"];
return viewModel;
}

@ -17,7 +17,7 @@
*/
function onRequest(context) {
var devicemgtProps = require("/app/conf/reader/main.js")["conf"];
var devicemgtProps = require("/app/modules/conf-reader/main.js")["conf"];
var devices = context.unit.params.devices;
var deviceType = context.uriParams.deviceType;
@ -29,7 +29,7 @@ function onRequest(context) {
"backendApiUri": devicemgtProps["httpsURL"] + "/arduino/device/stats/"
};
} 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);
if (device && device.status != "error") {
return {

@ -25,7 +25,7 @@ function onRequest(context) {
];
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);
if (device && device.status != "error") {
return {"device": device, "backendApiUri" : devicemgtProps["httpsURL"] + "/arduino/", "autoCompleteParams" : autoCompleteParams};

@ -19,7 +19,7 @@
function onRequest(context) {
var log = new Log("stats.js");
var device = context.unit.params.device;
var devicemgtProps = require("/app/conf/reader/main.js")["conf"];
var devicemgtProps = require("/app/modules/conf-reader/main.js")["conf"];
var constants = require("/app/modules/constants.js");
var websocketEndpoint = devicemgtProps["wssURL"].replace("https", "wss");
var tokenPair = session.get(constants.ACCESS_TOKEN_PAIR_IDENTIFIER);

@ -23,7 +23,7 @@ var uriMatcher = new URIMatcher(String(uri));
var log = new Log("api/policy-api.jag");
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;

@ -23,7 +23,7 @@
* @returns {*} A context object that returns the dynamic state of this page to be presented
*/
function onRequest(context) {
var devicemgtProps = require("/app/conf/reader/main.js")["conf"];
var devicemgtProps = require("/app/modules/conf-reader/main.js")["conf"];
var page = {};
page["usernameJSRegEx"] = devicemgtProps.userValidationConfig.usernameJSRegEx;
page["usernameHelpText"] = devicemgtProps.userValidationConfig.usernameHelpMsg;

@ -18,7 +18,7 @@
function onRequest(context) {
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 autoCompleteParams = context.unit.params.autoCompleteParams;
var controlOperations = operationModule.getControlOperations(device.type);

@ -19,7 +19,7 @@
function onRequest(context) {
var log = new Log("policy-view-edit-unit backend js");
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;
return context;
}

@ -19,7 +19,7 @@
function onRequest(context) {
var log = new Log("policy-view-edit-unit backend js");
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;
return context;
}

@ -22,7 +22,7 @@ function onRequest(context) {
var DTYPE_CONF_DEVICE_TYPE_KEY = "deviceType";
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 response = userModule.getRoles();
var wizardPage = {};

@ -17,7 +17,7 @@
*/
function onRequest(context) {
var devicemgtProps = require("/app/conf/reader/main.js")["conf"];
var devicemgtProps = require("/app/modules/conf-reader/main.js")["conf"];
var devices = context.unit.params.devices;
var deviceType = context.uriParams.deviceType;
@ -29,7 +29,7 @@ function onRequest(context) {
"backendApiUri": devicemgtProps["httpsURL"] + "/raspberrypi/device/stats/"
};
} 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);
if (device && device.status != "error") {
return {

@ -25,7 +25,7 @@ function onRequest(context) {
];
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);
if (device && device.status != "error") {
return {"device": device, "backendApiUri" : devicemgtProps["httpsURL"] + "/raspberrypi/", "autoCompleteParams" : autoCompleteParams};

@ -19,7 +19,7 @@
function onRequest(context) {
var log = new Log("stats.js");
var device = context.unit.params.device;
var devicemgtProps = require("/app/conf/reader/main.js")["conf"];
var devicemgtProps = require("/app/modules/conf-reader/main.js")["conf"];
var constants = require("/app/modules/constants.js");
var websocketEndpoint = devicemgtProps["wssURL"].replace("https", "wss");
var tokenPair = session.get(constants.ACCESS_TOKEN_PAIR_IDENTIFIER);

@ -17,7 +17,7 @@
*/
function onRequest(context) {
var devicemgtProps = require("/app/conf/reader/main.js")["conf"];
var devicemgtProps = require("/app/modules/conf-reader/main.js")["conf"];
var devices = context.unit.params.devices;
var deviceType = context.uriParams.deviceType;
@ -29,7 +29,7 @@ function onRequest(context) {
"backendApiUri": devicemgtProps["httpsURL"] + "/virtual_firealarm/device/stats/"
};
} 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);
if (device && device.status != "error") {
return {

@ -25,7 +25,7 @@ function onRequest(context) {
];
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);
if (device && device.status != "error") {
return {"device": device, "backendApiUri" : devicemgtProps["httpsURL"] + "/virtual_firealarm/", "autoCompleteParams" : autoCompleteParams};

@ -19,7 +19,7 @@
function onRequest(context) {
var log = new Log("stats.js");
var device = context.unit.params.device;
var devicemgtProps = require("/app/conf/reader/main.js")["conf"];
var devicemgtProps = require("/app/modules/conf-reader/main.js")["conf"];
var constants = require("/app/modules/constants.js");
var websocketEndpoint = devicemgtProps["wssURL"].replace("https", "wss");
var jwtService = carbon.server.osgiService('org.wso2.carbon.identity.jwt.client.extension.service.JWTClientManagerService');

@ -285,6 +285,9 @@ public class AndroidAPIUtils {
OperationCodes.DEVICE_INFO.equals(operation.getCode())) {
try {
if (log.isDebugEnabled()){
log.debug("Operation response: " + operation.getOperationResponse());
}
Device device = new Gson().fromJson(operation.getOperationResponse(), Device.class);
org.wso2.carbon.device.mgt.common.device.details.DeviceInfo deviceInfo = convertDeviceToInfo(device);
updateDeviceInfo(deviceIdentifier, deviceInfo);
@ -403,8 +406,6 @@ public class AndroidAPIUtils {
}
} else {
if (prop.getName().equalsIgnoreCase("CPU_INFO")) {
deviceInfo.setTotalRAMMemory(Double.parseDouble(getProperty(prop.getValue(), "User")));
deviceInfo.getDeviceDetailsMap().put("cpuUser",
getProperty(prop.getValue(), "User"));
deviceInfo.getDeviceDetailsMap().put("cpuSystem",

@ -39,6 +39,13 @@
<method>GET</method>
</Permission>
<Permission>
<name>Modify Tenant configuration</name>
<path>/device-mgt/admin/platform-configs/add</path>
<url>/configuration</url>
<method>PUT</method>
</Permission>
<Permission>
<name>Add Tenant configuration</name>
<path>/device-mgt/admin/platform-configs/add</path>

@ -22,7 +22,7 @@ function onRequest(context) {
var deviceId = request.getParameter("id");
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);
if (device) {

@ -1 +1,29 @@
{{unit "mdm.unit.policy.wizard"}}
<div class="container col-centered wr-content policy-profile">
<div class="wr-form">
<h1 id="policy-profile-page-wizard-title" class="page-sub-title">ADD POLICY</h1>
<hr>
<div id="policy-profile-wizard-steps" class="row wr-wizard"></div>
<hr>
<div class="row">
<div class="col-lg-12">
<h4 class="visible-xs">Step 2: Configure profile</h4>
<br>
<div id="policy-profile-main-error-msg" class="alert alert-danger hidden" role="alert">
<i class="icon fw fw-error"></i><span></span>
</div>
<div class="wr-advance-operations">
<div class="wr-advance-operations-init">
<br>
&nbsp;&nbsp;&nbsp;&nbsp;<i class="fw fw-settings fw-spin fw-2x"></i>
&nbsp;&nbsp;&nbsp;Loading platform features . . .
<br><br>
</div>
</div>
<div class="wr-input-control wr-btn-grp">
<a href="javascript:void(0)" class="wr-btn wizard-stepper" data-is-back-btn="true" data-current="policy-profile" data-next="policy-platform">Back</a>
<a href="javascript:void(0)" class="wr-btn wizard-stepper" data-current="policy-profile" data-next="policy-criteria" data-validate="true">Continue</a>
</div>
</div>
</div>
</div>
</div>

@ -18,7 +18,7 @@
function onRequest(context){
var viewModel = {};
var devicemgtProps = require("/app/conf/reader/main.js")["conf"];
var devicemgtProps = require("/app/modules/conf-reader/main.js")["conf"];
viewModel.hostName = devicemgtProps["httpsURL"];
return viewModel;
}

@ -48,7 +48,7 @@
View
</a>
{{#if permissions.ADD_POLICY}}
<a href="/emm/policies/add-policy">
<a href="/emm/policy/add">
<span class="fw-stack">
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-add fw-stack-1x"></i>
@ -79,7 +79,7 @@
View
</a>
{{#if permissions.ADD_USER}}
<a href="/emm/users/add-user">
<a href="/emm/user/add">
<span class="fw-stack">
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-add fw-stack-1x"></i>
@ -110,7 +110,7 @@
View
</a>
{{#if permissions.ADD_ROLE}}
<a href="/emm/roles/add-role">
<a href="/emm/role/add">
<span class="fw-stack">
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-add fw-stack-1x"></i>

@ -17,12 +17,14 @@
*/
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 mdmProps = require("/app/modules/conf-reader/main.js")["conf"];
context["permissions"] = userModule.getUIPermissions();
new Log().info("## Permissions : "+ stringify(userModule.getUIPermissions()));
context["enrollmentURL"] = generalConfig["host"] + generalConfig["enrollmentDir"];
return context;
var viewModel = {};
viewModel.permissions = userModule.getUIPermissions();
new Log().debug("## Permissions : " + stringify(userModule.getUIPermissions()));
//TODO: Move enrollment URL into app-conf.json
viewModel.enrollmentURL = mdmProps.enrollmentUrl;
return viewModel;
}

@ -1,6 +1,6 @@
function onRequest(context) {
// 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();
if (typesListResponse["status"] == "success") {
context["types"] = typesListResponse["content"];

@ -19,7 +19,7 @@
function onRequest(context) {
var log = new Log("policy-view-edit-unit backend js");
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.users = userModule.getUsersByUsername().content;
return context;

@ -19,7 +19,7 @@
function onRequest(context) {
var log = new Log("policy-view-edit-unit backend js");
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;
return context;
}

@ -17,7 +17,7 @@
*/
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 response = userModule.getRoles();
var wizardPage = {};

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

@ -18,7 +18,7 @@
function onRequest(context){
var viewModel = {};
var devicemgtProps = require("/app/conf/reader/main.js")["conf"];
var devicemgtProps = require("/app/modules/conf-reader/main.js")["conf"];
viewModel.hostName = devicemgtProps["httpsURL"];
return viewModel;
}
Loading…
Cancel
Save