From 8a4b97ebf9631a2c2743a145950b554ebb7cb8b7 Mon Sep 17 00:00:00 2001 From: hasuniea Date: Tue, 9 Aug 2016 18:00:49 +0530 Subject: [PATCH 01/51] refactoring windowsapi --- .../org.wso2.carbon.device.mgt.mobile.windows.api/pom.xml | 4 ++-- .../pom.xml | 2 +- .../src/main/resources/p2.inf | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/pom.xml b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/pom.xml index 4aedb77be..98ef25353 100644 --- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/pom.xml +++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/pom.xml @@ -46,7 +46,7 @@ 2.2 - ${project.artifactId} + api#device-mgt#windows#v1.0 @@ -72,7 +72,7 @@ - + diff --git a/features/mobile-plugins-feature/windows-plugin-feature/org.wso2.carbon.device.mgt.mobile.windows.feature/pom.xml b/features/mobile-plugins-feature/windows-plugin-feature/org.wso2.carbon.device.mgt.mobile.windows.feature/pom.xml index 633bd9f20..a2d51efef 100644 --- a/features/mobile-plugins-feature/windows-plugin-feature/org.wso2.carbon.device.mgt.mobile.windows.feature/pom.xml +++ b/features/mobile-plugins-feature/windows-plugin-feature/org.wso2.carbon.device.mgt.mobile.windows.feature/pom.xml @@ -118,7 +118,7 @@ true ${project.build.directory}/maven-shared-archive-resources/webapps/ - mdm-windows-agent.war + api#device-mgt#windows#v1.0.war diff --git a/features/mobile-plugins-feature/windows-plugin-feature/org.wso2.carbon.device.mgt.mobile.windows.feature/src/main/resources/p2.inf b/features/mobile-plugins-feature/windows-plugin-feature/org.wso2.carbon.device.mgt.mobile.windows.feature/src/main/resources/p2.inf index 11320712c..d70e9fe99 100644 --- a/features/mobile-plugins-feature/windows-plugin-feature/org.wso2.carbon.device.mgt.mobile.windows.feature/src/main/resources/p2.inf +++ b/features/mobile-plugins-feature/windows-plugin-feature/org.wso2.carbon.device.mgt.mobile.windows.feature/src/main/resources/p2.inf @@ -1,13 +1,13 @@ instructions.configure = \ org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.mobile.windows_${feature.version}/jaggeryapps/,target:${installFolder}/../../deployment/server/jaggeryapps/,overwrite:true);\ -org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.mobile.windows_${feature.version}/webapps/mdm-windows-agent.war,target:${installFolder}/../../deployment/server/webapps/mdm-windows-agent.war,overwrite:true);\ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.mobile.windows_${feature.version}/webapps/api#device-mgt#windows#v1.0.war,target:${installFolder}/../../deployment/server/webapps/api#device-mgt#windows#v1.0.war,overwrite:true);\ org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.mobile.windows_${feature.version}/dbscripts/plugins/,target:${installFolder}/../../../dbscripts/cdm/plugins/windows,overwrite:true);\ org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../database/);\ org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.mobile.windows_${feature.version}/database/,target:${installFolder}/../../database/,overwrite:true);\ instructions.unconfigure = \ -org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../deployment/server/webapps/mdm-windows-agent.war);\ -org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../deployment/server/webapps/mdm-windows-agent);\ +org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../deployment/server/webapps/api#device-mgt#windows#v1.0.war);\ +org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../deployment/server/webapps/api#device-mgt#windows#v1.0);\ org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.windows.device-view);\ org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.windows.policy-edit);\ org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.windows.policy-view);\ From b9289e801f54ef934ba0549eb7e558dada7ed653 Mon Sep 17 00:00:00 2001 From: mharindu Date: Thu, 11 Aug 2016 12:21:28 +0530 Subject: [PATCH 02/51] Addin carbon 4.4.7 migration changes --- components/iot-plugins/pom.xml | 2 +- .../pom.xml | 2 +- pom.xml | 20 ++++++++++--------- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/components/iot-plugins/pom.xml b/components/iot-plugins/pom.xml index 283ad011f..b92b509a0 100644 --- a/components/iot-plugins/pom.xml +++ b/components/iot-plugins/pom.xml @@ -36,7 +36,7 @@ androidsense-plugin arduino-plugin raspberrypi-plugin - virtual-fire-alarm-plugin + iot-base-plugin iot-analytics diff --git a/features/iot-plugins-feature/iot-base-plugin-feature/org.wso2.carbon.device.mgt.iot.adapter.feature/pom.xml b/features/iot-plugins-feature/iot-base-plugin-feature/org.wso2.carbon.device.mgt.iot.adapter.feature/pom.xml index 5bd1455c0..94c09f835 100644 --- a/features/iot-plugins-feature/iot-base-plugin-feature/org.wso2.carbon.device.mgt.iot.adapter.feature/pom.xml +++ b/features/iot-plugins-feature/iot-base-plugin-feature/org.wso2.carbon.device.mgt.iot.adapter.feature/pom.xml @@ -172,7 +172,7 @@ org.igniterealtime.smack.wso2:smackx:${smackx.wso2.version} - org.wso2.carbon.identity:org.wso2.carbon.identity.oauth.stub:${carbon.identity.version} + org.wso2.carbon.identity:org.wso2.carbon.identity.oauth.stub:${identity.inbound.auth.oauth.version} diff --git a/pom.xml b/pom.xml index aa5241f92..7d016858e 100644 --- a/pom.xml +++ b/pom.xml @@ -1000,13 +1000,13 @@ org.wso2.carbon.identity org.wso2.carbon.identity.oauth.stub - ${carbon.identity.version} + ${identity.inbound.auth.oauth.version} provided org.wso2.carbon.identity org.wso2.carbon.identity.oauth - ${carbon.identity.version} + ${identity.inbound.auth.oauth.version} provided @@ -1087,7 +1087,7 @@ 1.7 - 4.4.3 + 4.4.7 [4.4.0, 4.5.0) 1.5.4 @@ -1130,23 +1130,25 @@ 4.4.8 - 4.6.0 + 4.7.0 - 5.0.7 + 5.2.0 + 5.1.2 + 5.1.1 [5.0.7, 6.0.0) - 4.5.0 + 4.6.0 - 4.4.8 + 4.6.0 - 4.5.8 + 4.6.4 - 5.0.3 + 6.0.4 3.0.4.wso2v1 From e9601dcbb3330b193cba13b864fba5f83a5fabe1 Mon Sep 17 00:00:00 2001 From: mharindu Date: Fri, 12 Aug 2016 08:42:50 +0530 Subject: [PATCH 03/51] Fixed dependancy issues --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 7d016858e..80f252789 100644 --- a/pom.xml +++ b/pom.xml @@ -1142,7 +1142,7 @@ 4.6.0 - 4.6.0 + 4.5.6 4.6.4 From 2b3967fd71ca80e36d1f29aa5e1d6d31663d13fe Mon Sep 17 00:00:00 2001 From: mharindu Date: Mon, 5 Sep 2016 16:39:13 +0530 Subject: [PATCH 04/51] Partial commit of migration --- .../org.wso2.carbon.device.mgt.mobile/pom.xml | 2 +- pom.xml | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile/pom.xml b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile/pom.xml index 15706b2c0..b6c82279e 100644 --- a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile/pom.xml +++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile/pom.xml @@ -58,7 +58,7 @@ javax.xml.bind.*, javax.naming, javax.sql, - javax.xml.parsers, + javax.xml.parsers; version=0.0.0, org.w3c.dom, org.wso2.carbon.context, org.wso2.carbon.utils.*, diff --git a/pom.xml b/pom.xml index 7c8444626..3c998c4af 100644 --- a/pom.xml +++ b/pom.xml @@ -623,10 +623,10 @@ org.wso2.carbon org.wso2.carbon.identity.oauth - - org.wso2.carbon - org.wso2.carbon.apimgt.keymgt.client - + + + + org.apache.poi poi-ooxml @@ -1077,6 +1077,11 @@ hibernate-validator ${hibernate-validator.version} + + org.wso2.carbon.apimgt + org.wso2.carbon.apimgt.keymgt.client + ${carbon.api.mgt.version} + From 2a0b5009353b7afb56d57c1dcde3f85d48219d4c Mon Sep 17 00:00:00 2001 From: Ace Date: Wed, 14 Sep 2016 17:23:33 +0530 Subject: [PATCH 05/51] Updating to latest appm/apim/identity dependencies --- .../pom.xml | 12 +++++++++++ .../pom.xml | 16 +++++++++------ pom.xml | 20 +++++++++---------- 3 files changed, 32 insertions(+), 16 deletions(-) diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/pom.xml b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/pom.xml index 25f928cff..e49cc981d 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/pom.xml +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/pom.xml @@ -176,6 +176,12 @@ org.wso2.carbon.devicemgt org.wso2.carbon.device.mgt.analytics.data.publisher provided + + + org.slf4j + slf4j-api + + org.wso2.carbon.analytics @@ -199,6 +205,12 @@ io.swagger swagger-jaxrs + + + org.slf4j + slf4j-api + + javax.servlet diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/pom.xml b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/pom.xml index 9e8559a17..dcb03745d 100644 --- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/pom.xml +++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/pom.xml @@ -173,13 +173,13 @@ - org.apache.ws.commons.axiom - axiom-api + org.apache.ws.commons.axiom.wso2 + axiom - + log4j log4j @@ -206,11 +206,11 @@ saaj-impl - org.bouncycastle + org.bouncycastle.wso2 bcpkix-jdk15on - org.bouncycastle + org.wso2.orbit.org.bouncycastle bcprov-jdk15on @@ -269,6 +269,10 @@ org.wso2.carbon.identity org.wso2.carbon.identity.base + + org.slf4j + slf4j-api + diff --git a/pom.xml b/pom.xml index 3c998c4af..27d0be33e 100644 --- a/pom.xml +++ b/pom.xml @@ -912,15 +912,15 @@ ${wss4j.security.common.version} - org.apache.ws.commons.axiom - axiom-api + org.apache.ws.commons.axiom.wso2 + axiom ${axiom-api.version} - + log4j log4j @@ -952,14 +952,14 @@ ${saaj-impl.version} - org.bouncycastle + org.bouncycastle.wso2 bcpkix-jdk15on ${bcpkix-jdk15on.version} - org.bouncycastle + org.wso2.orbit.org.bouncycastle bcprov-jdk15on - ${bcpkix-jdk15on.version} + 1.52.0.wso2v1 org.codehaus.plexus @@ -1092,7 +1092,7 @@ 1.7 - 4.4.7 + 4.4.9 [4.4.0, 4.5.0) 1.5.4 @@ -1186,13 +1186,13 @@ 6.0 - 1.2.14 + 1.2.11.wso2v10 1.2.17 3.0.5.RELEASE 2.1.0.RELEASE 2.2.8 1.3.18 - 1.49 + 1.52.0.wso2v1 3.0.21 2.2 1.6.17 From 03c0108db5e5682b3c19f273c0edc4d4b008a63e Mon Sep 17 00:00:00 2001 From: Ace Date: Tue, 20 Sep 2016 10:39:34 +0530 Subject: [PATCH 06/51] Removing unwanted dependencies from windows api --- .../pom.xml | 12 ++++++++++++ pom.xml | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/pom.xml b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/pom.xml index 7e95730a3..9b4fabc76 100644 --- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/pom.xml +++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/pom.xml @@ -175,6 +175,7 @@ org.apache.ws.commons.axiom.wso2 axiom + provided @@ -311,10 +319,12 @@ org.wso2.tomcat tomcat-servlet-api + provided com.google.code.gson gson + provided org.wso2.carbon.devicemgt @@ -335,11 +345,13 @@ org.codehaus.jettison.wso2 jettison 1.1.wso2v1 + provided org.json.wso2 json 2.0.0.wso2v1 + provided io.swagger diff --git a/pom.xml b/pom.xml index 99edcd28c..62174b774 100644 --- a/pom.xml +++ b/pom.xml @@ -955,7 +955,7 @@ org.wso2.orbit.org.bouncycastle bcprov-jdk15on - 1.52.0.wso2v1 + ${bcpkix-jdk15on.version} org.codehaus.plexus From 282fe25b4749152b57f5e173db27cece18af1298 Mon Sep 17 00:00:00 2001 From: Ace Date: Wed, 21 Sep 2016 12:57:03 +0530 Subject: [PATCH 07/51] Fixing dependency related issues --- .../org.wso2.carbon.device.mgt.mobile.windows.api/pom.xml | 2 +- pom.xml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/pom.xml b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/pom.xml index 9b4fabc76..3285a76d1 100644 --- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/pom.xml +++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/pom.xml @@ -208,7 +208,7 @@ saaj-impl - org.bouncycastle.wso2 + org.wso2.orbit.org.bouncycastle bcpkix-jdk15on provided diff --git a/pom.xml b/pom.xml index 62174b774..35fbda17b 100644 --- a/pom.xml +++ b/pom.xml @@ -948,7 +948,7 @@ ${saaj-impl.version} - org.bouncycastle.wso2 + org.wso2.orbit.org.bouncycastle bcpkix-jdk15on ${bcpkix-jdk15on.version} @@ -1149,7 +1149,7 @@ 4.6.4 - 6.0.4 + 6.0.5-SNAPSHOT 3.0.4.wso2v1 From d7872782cc401ff89497db22d281921a4a9733a7 Mon Sep 17 00:00:00 2001 From: dilanua Date: Thu, 22 Sep 2016 15:58:13 +0530 Subject: [PATCH 08/51] https://wso2.org/jira/browse/EMM-1608 --- .../app/pages/mdm.page.devices/public/js/device-listing.js | 7 +++---- 1 file changed, 3 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/pages/mdm.page.devices/public/js/device-listing.js b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.devices/public/js/device-listing.js index f48713e26..d8c1aa2ed 100644 --- a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.devices/public/js/device-listing.js +++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.devices/public/js/device-listing.js @@ -95,8 +95,6 @@ function loadDevices() { "data": [] }; - return JSON.stringify(json); - } else if (data["count"] > 0) { $(noDeviceView).remove(); $("#enroll-btn").removeClass('hidden'); @@ -127,8 +125,9 @@ function loadDevices() { "data": objects }; - return JSON.stringify(json); } + + return JSON.stringify(json); }; // possible params - nRow, aData, dataIndex @@ -146,7 +145,7 @@ function loadDevices() { var deviceType = row.deviceType; var deviceIdentifier = row.deviceIdentifier; var url = "#"; - if (status != 'REMOVED') { + if (row.status != 'REMOVED') { url = "device/" + deviceType + "?id=" + deviceIdentifier; } return '
' + From 13aedbc6c62d8afc6a764f0b63bfe05fd075a505 Mon Sep 17 00:00:00 2001 From: dilanua Date: Thu, 22 Sep 2016 18:19:28 +0530 Subject: [PATCH 09/51] Updating notifications side bar - UI --- .../mdm.unit.ui.navbar.nav-menu/public/js/nav-menu.js | 10 +++------- .../public/templates/notifications.hbs | 4 ++-- 2 files changed, 5 insertions(+), 9 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/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 870efca1e..86cde4124 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 @@ -85,11 +85,7 @@ var updateNotificationCountOnSuccess = function (data, textStatus, jqXHR) { if (jqXHR.status == 200 && data) { var responsePayload = JSON.parse(data); var newNotificationsCount = responsePayload["count"]; - if (newNotificationsCount > 5) { - $(notificationBubble).html("5 +  NEW"); - $(notificationBubble).removeClass("hidden"); - $(notificationSpacer).removeClass("hidden"); - } else if (newNotificationsCount <= 5 && newNotificationsCount > 0) { + if (newNotificationsCount > 0) { $(notificationBubble).html(newNotificationsCount + " NEW"); $(notificationBubble).removeClass("hidden"); $(notificationSpacer).removeClass("hidden"); @@ -111,7 +107,7 @@ function loadNewNotificationsOnSideViewPanel() { if ($("#right-sidebar").attr("is-authorized") == "false") { $("#notification-bubble-wrapper").remove(); } else { - var serviceURL = emmAdminBasePath + "/notifications?offset=0&limit=5&status=NEW"; + var serviceURL = emmAdminBasePath + "/notifications?offset=0&limit=6&status=NEW"; invokerUtil.get(serviceURL, updateNotificationCountOnSuccess, updateNotificationCountOnError); loadNewNotifications(); } @@ -126,7 +122,7 @@ function loadNewNotifications() { var currentUser = notifications.data("currentUser"); $.template("notification-listing", notifications.attr("src"), function (template) { - var serviceURL = emmAdminBasePath + "/notifications?offset=0&limit=5&status=NEW"; + var serviceURL = emmAdminBasePath + "/notifications?offset=0&limit=6&status=NEW"; invokerUtil.get( serviceURL, // on success 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 765b29af1..cbbe19976 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 @@ -5,9 +5,9 @@
  • - Failure on {{deviceType}} {{deviceName}} From 212dcae8e729d69802450df17bab44af13ddf79a Mon Sep 17 00:00:00 2001 From: harshanl Date: Thu, 22 Sep 2016 18:24:58 +0530 Subject: [PATCH 10/51] Added scheduled time to App-install operation --- .../android/bean/ApplicationInstallation.java | 10 ++++++++ .../bean/ApplicationUninstallation.java | 11 --------- .../android/bean/ApplicationUpdate.java | 2 +- .../DeviceManagementAdminServiceImpl.java | 24 +++++++++++++++++++ 4 files changed, 35 insertions(+), 12 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/bean/ApplicationInstallation.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/ApplicationInstallation.java index 454dc905a..8a69e2eff 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/ApplicationInstallation.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/ApplicationInstallation.java @@ -44,6 +44,8 @@ public class ApplicationInstallation extends AndroidOperation implements Seriali @ApiModelProperty(name = "url", value = "Application URL", required = true) private String url; + @ApiModelProperty(name = "schedule", value = "Application install schedule.", required = false) + private String schedule; public String getAppIdentifier() { return appIdentifier; @@ -68,4 +70,12 @@ public class ApplicationInstallation extends AndroidOperation implements Seriali public void setUrl(String url) { this.url = url; } + + public String getSchedule() { + return schedule; + } + + public void setSchedule(String schedule) { + this.schedule = schedule; + } } 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/bean/ApplicationUninstallation.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/ApplicationUninstallation.java index 5c078f87d..a5356ae59 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/ApplicationUninstallation.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/ApplicationUninstallation.java @@ -43,10 +43,6 @@ public class ApplicationUninstallation extends AndroidOperation implements Seria @Pattern(regexp = "^[A-Za-z]*$") private String type; - @ApiModelProperty(name = "name", value = "The name of the application.", required = true) - @Size(min = 2, max = 45) - private String name; - public String getAppIdentifier() { return appIdentifier; } @@ -63,11 +59,4 @@ public class ApplicationUninstallation extends AndroidOperation implements Seria this.type = type; } - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } } 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/bean/ApplicationUpdate.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/ApplicationUpdate.java index 14f7c31db..95241b444 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/ApplicationUpdate.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/ApplicationUpdate.java @@ -44,7 +44,7 @@ public class ApplicationUpdate extends AndroidOperation implements Serializable private String type; @ApiModelProperty(name = "url", value = "The URL of the application.", required = true) private String url; - @ApiModelProperty(name = "schedule", value = "Application update schedule.", required = true) + @ApiModelProperty(name = "schedule", value = "Application update schedule.", required = false) private String schedule; public String getAppIdentifier() { 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/services/impl/DeviceManagementAdminServiceImpl.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/DeviceManagementAdminServiceImpl.java index 11840a669..71e0a1c30 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/DeviceManagementAdminServiceImpl.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/DeviceManagementAdminServiceImpl.java @@ -534,6 +534,18 @@ public class DeviceManagementAdminServiceImpl implements DeviceManagementAdminSe throw new BadRequestException( new ErrorResponse.ErrorResponseBuilder().setCode(400l).setMessage(errorMessage).build()); } + String scheduledTime = applicationInstallationBeanWrapper.getOperation().getSchedule(); + if (scheduledTime != null && !scheduledTime.isEmpty()) { + SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ"); + try { + String formattedScheduledDate = format.format(format.parse(scheduledTime)); + applicationInstallationBeanWrapper.getOperation().setSchedule(formattedScheduledDate); + } catch (ParseException e) { + String errorMessage = "Invalid date string is provided in for schedule parameter"; + throw new BadRequestException( + new ErrorResponse.ErrorResponseBuilder().setCode(400l).setMessage(errorMessage).build()); + } + } ApplicationInstallation applicationInstallation = applicationInstallationBeanWrapper.getOperation(); JSONObject payload = new JSONObject(applicationInstallation.toJSON()); @@ -615,6 +627,18 @@ public class DeviceManagementAdminServiceImpl implements DeviceManagementAdminSe throw new BadRequestException( new ErrorResponse.ErrorResponseBuilder().setCode(400l).setMessage(errorMessage).build()); } + String scheduledTime = applicationUpdateBeanWrapper.getOperation().getSchedule(); + if (scheduledTime != null && !scheduledTime.isEmpty()) { + SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ"); + try { + String formattedScheduledDate = format.format(format.parse(scheduledTime)); + applicationUpdateBeanWrapper.getOperation().setSchedule(formattedScheduledDate); + } catch (ParseException e) { + String errorMessage = "Invalid date string is provided in for schedule parameter"; + throw new BadRequestException( + new ErrorResponse.ErrorResponseBuilder().setCode(400l).setMessage(errorMessage).build()); + } + } ApplicationUpdate applicationUpdate = applicationUpdateBeanWrapper.getOperation(); ProfileOperation operation = new ProfileOperation(); operation.setCode(AndroidConstants.OperationCodes.UPDATE_APPLICATION); From 36d4c7dfcbfe26ddb826a8be542ee0e5998f4be0 Mon Sep 17 00:00:00 2001 From: dilanua Date: Thu, 22 Sep 2016 18:35:13 +0530 Subject: [PATCH 11/51] Updating emm device listing - UI --- .../public/js/device-listing.js | 33 ++----------------- 1 file changed, 3 insertions(+), 30 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.devices/public/js/device-listing.js b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.devices/public/js/device-listing.js index d8c1aa2ed..9d1e6e7fc 100644 --- a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.devices/public/js/device-listing.js +++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.devices/public/js/device-listing.js @@ -149,7 +149,8 @@ function loadDevices() { url = "device/" + deviceType + "?id=" + deviceIdentifier; } return '
    ' + - '
    ' + '' + + '

  • ' } }, { @@ -219,7 +220,6 @@ function loadDevices() { function () { $(".icon .text").res_text(0.2); $('#device-grid').removeClass('hidden'); - $("#loading-content").remove(); }, { "placeholder" : "Search By Device Name", "searchKey" : "name" @@ -244,38 +244,11 @@ function loadDevices() { // }); //} -function initPage() { -// var currentUser = $("#device-listing").data("currentUser"); -// var serviceURL = "/api/device-mgt/v1.0/devices"; -// -// invokerUtil.get( -// serviceURL, -// function (data) { -// if (data) { -// data = JSON.parse(data); -// if (data["count"] > 0) { -// $(".bulk-action-row").removeClass('hidden'); -// $("#device-table").removeClass('hidden'); -// loadDevices(); -// } else { -// $("#enroll-btn").addClass('hidden'); -// $("#advanced-search-btn").addClass('hidden'); -// $("#device-table").addClass('hidden'); -// $("#no-device-view").removeClass('hidden'); -// } -// } -// }, function () { -// initPage(); -// } -// ); - loadDevices(); -} - /* * DOM ready functions. */ $(document).ready(function () { - initPage(); + loadDevices(); /* Adding selected class for selected devices */ $(deviceCheckbox).each(function () { From bff3b3ee12c39f42c8c5d3de566772e219230e7f Mon Sep 17 00:00:00 2001 From: dilanua Date: Thu, 22 Sep 2016 19:45:29 +0530 Subject: [PATCH 12/51] Fix for JIRA: https://wso2.org/jira/browse/EMM-1610 --- .../app/units/mdm.unit.device.view/view.hbs | 509 +++++++++--------- .../app/units/mdm.unit.device.view/view.js | 4 + 2 files changed, 264 insertions(+), 249 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 862ef44fd..67f86d7b5 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 @@ -3,16 +3,17 @@ {{unit "mdm.unit.device.qr-modal"}} {{#zone "content"}} - {{#if isAuthorized}} -

    - Device {{device.name}} - {{#if device.viewModel.model}} - + {{#if deviceFound}} + {{#if isAuthorized}} +

    + Device {{device.name}} + {{#if device.viewModel.model}} + ( {{device.viewModel.vendor}} {{device.viewModel.model}} ) - {{/if}} -

    -
    + {{/if}} +

    +
    @@ -72,304 +73,314 @@
    -
    - - {{#defineZone "device-detail-properties"}} -
    -
    - +
    + + {{#defineZone "device-detail-properties"}} +
    +
    + -
    -