From 0790c0ed7f2698114068f1661e0b3a627f69c232 Mon Sep 17 00:00:00 2001 From: Rasika Perera Date: Fri, 9 Sep 2016 19:26:02 +0530 Subject: [PATCH 01/10] Fixing dashboard user count issue --- .../app/pages/mdm.page.dashboard/public/js/dashboard.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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/public/js/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/public/js/dashboard.js index 740ec8f20..66f554c21 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/public/js/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/public/js/dashboard.js @@ -53,7 +53,7 @@ $(document).ready(function () { updateStats("/api/device-mgt/v1.0/policies?offset=0&limit=1", "#policy-count"); } if ($("#user-count").data("user-count")) { - updateStats("/api/device-mgt/v1.0/users?offset=0&limit=1", "#user-count"); + updateStats("/api/device-mgt/v1.0/users/count", "#user-count"); } if ($("#role-count").data("role-count")) { updateStats("/api/device-mgt/v1.0/roles?offset=0&limit=1", "#role-count"); From 5438a421de343873a2e8425948028c93463302a0 Mon Sep 17 00:00:00 2001 From: Rasika Perera Date: Thu, 15 Sep 2016 07:33:00 +0530 Subject: [PATCH 02/10] Fixing Permissions are not published for Windows through WebApp Lifecycle Listener --- .../api/services/ConfigurationMgtService.java | 6 +++-- .../DeviceManagementAdminService.java | 15 ++++++++++++- .../api/services/DeviceManagementService.java | 22 ++++++++++++++----- 3 files changed, 35 insertions(+), 8 deletions(-) diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/ConfigurationMgtService.java b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/ConfigurationMgtService.java index aa84ad75b..b5428ba07 100644 --- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/ConfigurationMgtService.java +++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/ConfigurationMgtService.java @@ -18,6 +18,7 @@ package org.wso2.carbon.device.mgt.mobile.windows.api.services; +import io.swagger.annotations.Api; import org.wso2.carbon.apimgt.annotations.api.API; import org.wso2.carbon.apimgt.annotations.api.Permission; import org.wso2.carbon.apimgt.annotations.api.Scope; @@ -35,11 +36,12 @@ import javax.ws.rs.*; @API(name = "Windows Configuration Management", version = "1.0.0", context = "api/device-mgt/windows/v1.0/services/configuration", tags = {"windows"}) - +@Api(value = "Windows Configuration Management", + description = "This carries all the resources related to Windows configurations management functionalities") @WebService +@Path("services/configuration") @Produces({"application/json", "application/xml"}) @Consumes({"application/json", "application/xml"}) -@Path("services/configuration") public interface ConfigurationMgtService { /** diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/DeviceManagementAdminService.java b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/DeviceManagementAdminService.java index 4d96f8acd..c53d91417 100644 --- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/DeviceManagementAdminService.java +++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/DeviceManagementAdminService.java @@ -18,10 +18,17 @@ package org.wso2.carbon.device.mgt.mobile.windows.api.services; +import io.swagger.annotations.Api; +import org.wso2.carbon.apimgt.annotations.api.API; import org.wso2.carbon.apimgt.annotations.api.Permission; import org.wso2.carbon.device.mgt.mobile.windows.api.common.exceptions.WindowsDeviceEnrolmentException; -import javax.ws.rs.*; +import javax.jws.WebService; +import javax.ws.rs.Consumes; +import javax.ws.rs.HeaderParam; +import javax.ws.rs.POST; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import java.util.List; @@ -29,6 +36,12 @@ import java.util.List; /** * Interface for Admin operations persisting. This interface accepts operations added via UI. */ +@Api(value = "Windows Device Management Administrative Service", + description = "Device management related admin APIs.") +@API(name = "Windows Device Management Administrative Service", version = "1.0.0", + context = "api/device-mgt/windows/v1.0/admin/devices", + tags = {"devicemgt_windows"}) +@WebService @Path("/admin/devices") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/DeviceManagementService.java b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/DeviceManagementService.java index 2559fc25d..5f0f84421 100644 --- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/DeviceManagementService.java +++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/DeviceManagementService.java @@ -18,20 +18,31 @@ package org.wso2.carbon.device.mgt.mobile.windows.api.services; +import io.swagger.annotations.Api; +import org.wso2.carbon.apimgt.annotations.api.API; import org.wso2.carbon.device.mgt.common.Device; import org.wso2.carbon.device.mgt.common.license.mgt.License; import org.wso2.carbon.device.mgt.mobile.windows.api.common.exceptions.WindowsConfigurationException; import org.wso2.carbon.device.mgt.mobile.windows.api.common.util.Message; import javax.jws.WebService; -import javax.ws.rs.*; +import javax.ws.rs.Consumes; +import javax.ws.rs.GET; +import javax.ws.rs.PUT; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; import java.util.List; /** - * Windows Device Management REST-API implementation. - * All end points supports JSON, XMl with content negotiation. + * Windows Device Management REST-API implementation. All end points supports JSON, XMl with content negotiation. */ +@Api(value = "Windows Device Management", + description = "This carries all the resources related to Windows device management functionalities") +@API(name = "Windows Device Management", version = "1.0.0", + context = "api/device-mgt/windows/v1.0/devices", + tags = {"devicemgt_windows"}) @WebService @Path("/devices") @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) @@ -61,14 +72,15 @@ public interface DeviceManagementService { /** * Update Windows device details of given device id. * - * @param deviceId Device Id. - * @param device Device details to be updated. + * @param deviceId Device Id. + * @param device Device details to be updated. * @return Returns the message whether device update or not. * @throws WindowsConfigurationException occurred while updating the Device Info. */ @PUT @Path("{id}") Message updateDevice(@PathParam("id") String deviceId, Device device) throws WindowsConfigurationException; + /** * Fetch the Licence agreement for specific windows platform. * From 9b2f73acfbe5dc97b8e8b0c158074df75773d41e Mon Sep 17 00:00:00 2001 From: Rasika Perera Date: Thu, 15 Sep 2016 08:04:58 +0530 Subject: [PATCH 03/10] Fixing EMM-1557: Notifications anchor points to a wrong URL of the device. --- .../public/templates/notifications.hbs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.ui.navbar.nav-menu/public/templates/notifications.hbs b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.ui.navbar.nav-menu/public/templates/notifications.hbs index 82edfc498..3d9a571b4 100644 --- a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.ui.navbar.nav-menu/public/templates/notifications.hbs +++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.ui.navbar.nav-menu/public/templates/notifications.hbs @@ -2,11 +2,11 @@
  • - - Device Type : {{deviceIdentifier.type}} + Device Type : {{deviceType}}

    {{description}}

    From 9f258df1d22abf0eb984790e52287a27e3d2d550 Mon Sep 17 00:00:00 2001 From: Rasika Perera Date: Thu, 15 Sep 2016 08:34:00 +0530 Subject: [PATCH 04/10] Fixing EMM-1551: Notifications are flooded on side pane. --- .../units/mdm.unit.ui.navbar.nav-menu/public/js/nav-menu.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.ui.navbar.nav-menu/public/js/nav-menu.js b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.ui.navbar.nav-menu/public/js/nav-menu.js index d80f6c6d5..13c43e5da 100644 --- a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.ui.navbar.nav-menu/public/js/nav-menu.js +++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.ui.navbar.nav-menu/public/js/nav-menu.js @@ -117,7 +117,7 @@ function loadNewNotifications() { var currentUser = notifications.data("currentUser"); $.template("notification-listing", notifications.attr("src"), function (template) { - var serviceURL = emmAdminBasePath + "/notifications?status=NEW"; + var serviceURL = emmAdminBasePath + "/notifications?offset=0&limit=5&status=NEW"; invokerUtil.get( serviceURL, // on success @@ -128,6 +128,7 @@ function loadNewNotifications() { if (responsePayload["notifications"]) { if (responsePayload.count > 0) { viewModel["notifications"] = responsePayload["notifications"]; + viewModel["appContext"] = context; $(messageSideBar).html(template(viewModel)); } else { $(messageSideBar).html(''); From b576e23d97deff07f9c2f14d32b9e47e85f8bc4e Mon Sep 17 00:00:00 2001 From: Rasika Perera Date: Thu, 15 Sep 2016 08:34:18 +0530 Subject: [PATCH 05/10] Improvements to notifications side pane --- .../public/templates/notifications.hbs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.ui.navbar.nav-menu/public/templates/notifications.hbs b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.ui.navbar.nav-menu/public/templates/notifications.hbs index 3d9a571b4..91205c376 100644 --- a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.ui.navbar.nav-menu/public/templates/notifications.hbs +++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.ui.navbar.nav-menu/public/templates/notifications.hbs @@ -2,11 +2,11 @@
  • - - Device Type : {{deviceType}} + {{deviceType}}

    {{description}}

    From c9ec2bea0167d27eb0b919c1473b556e0ab441f3 Mon Sep 17 00:00:00 2001 From: Rasika Perera Date: Thu, 15 Sep 2016 08:53:16 +0530 Subject: [PATCH 06/10] Fixing EMM-1552: Policy Create view Allingment issue in final step --- .../devicemgt/app/units/mdm.unit.policy.create/create.hbs | 1 + 1 file changed, 1 insertion(+) diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.policy.create/create.hbs b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.policy.create/create.hbs index a3ba6759b..5d5c13a91 100644 --- a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.policy.create/create.hbs +++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.policy.create/create.hbs @@ -86,6 +86,7 @@
    +
    From 6ad54b5f019fd561446e7ba2d082b44f6c221777 Mon Sep 17 00:00:00 2001 From: Rasika Perera Date: Thu, 15 Sep 2016 09:18:21 +0530 Subject: [PATCH 07/10] Fixing EMM-1351: Issue in components refresh function in device detail page --- .../app/units/mdm.unit.device.view/view.hbs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.device.view/view.hbs b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.device.view/view.hbs index 8345741ac..862ef44fd 100644 --- a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.device.view/view.hbs +++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.device.view/view.hbs @@ -219,7 +219,7 @@