From 34ce9108a2ed338f67f02d4da87a2c08c7f9cd4c Mon Sep 17 00:00:00 2001 From: mharindu Date: Tue, 2 Aug 2016 14:57:00 +0530 Subject: [PATCH 1/3] Added configuration modifcation permission --- .../src/main/webapp/META-INF/permissions.xml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/webapp/META-INF/permissions.xml b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/webapp/META-INF/permissions.xml index a2e3b1e1dc..399d5c8035 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/webapp/META-INF/permissions.xml +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/webapp/META-INF/permissions.xml @@ -39,6 +39,13 @@ GET + + Modify Tenant configuration + /device-mgt/admin/platform-configs/add + /configuration + PUT + + Add Tenant configuration /device-mgt/admin/platform-configs/add From d186a48ed84ad96c7ac561f4f11381e435683a62 Mon Sep 17 00:00:00 2001 From: charitha Date: Tue, 2 Aug 2016 15:47:46 +0530 Subject: [PATCH 2/3] Removed invalid property insertion. --- .../carbon/mdm/services/android/util/AndroidAPIUtils.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/util/AndroidAPIUtils.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/util/AndroidAPIUtils.java index 323da65c01..19db99dddb 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/util/AndroidAPIUtils.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/util/AndroidAPIUtils.java @@ -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", From 3d25102d30cea853c99a39fc452e8474a38938be Mon Sep 17 00:00:00 2001 From: Rasika Perera Date: Tue, 2 Aug 2016 15:37:45 +0530 Subject: [PATCH 3/3] Adding enrollment url into view model --- .../app/pages/mdm.page.dashboard/dashboard.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.dashboard/dashboard.js b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.dashboard/dashboard.js index 8843a908e8..2f881b8301 100644 --- a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.dashboard/dashboard.js +++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.dashboard/dashboard.js @@ -19,10 +19,12 @@ function onRequest(context) { var userModule = require("/app/modules/business-controllers/user.js")["userModule"]; var generalConfig = context.app.conf["generalConfig"]; + var mdmProps = require('/app/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; } \ No newline at end of file