From 19a2c1d1bd62eb9e981552cde41619cf37bdc16c Mon Sep 17 00:00:00 2001 From: kamidu Date: Mon, 3 Oct 2016 11:50:57 +0530 Subject: [PATCH 1/2] Fix for Jira issue : EMM-1639 --- .../units/mdm.unit.ui.navbar.nav-menu/public/js/nav-menu.js | 1 + .../public/templates/notifications.hbs | 4 ++-- 2 files changed, 3 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/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 86cde4124e..865bd38659 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 @@ -133,6 +133,7 @@ function loadNewNotifications() { if (responsePayload["notifications"]) { if (responsePayload.count > 0) { viewModel["notifications"] = responsePayload["notifications"]; + viewModel.contextPath = context; $(messageSideBar).html(template(viewModel)); } else { $(messageSideBar).html( 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 cbbe199763..c80eecb97e 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 df6b0f9612a06a02c2bd596eafb1fe7cbfefa4c5 Mon Sep 17 00:00:00 2001 From: harshanl Date: Mon, 3 Oct 2016 12:16:45 +0530 Subject: [PATCH 2/2] Updated MSSQL scripts to have IF-NOT-EXISTS statements --- .../src/main/resources/dbscripts/plugins/mssql.sql | 2 ++ .../src/main/resources/dbscripts/plugins/android/mssql.sql | 2 ++ .../src/main/resources/dbscripts/plugins/ios/mssql.sql | 4 +++- .../src/main/resources/dbscripts/plugins/windows/mssql.sql | 4 +++- .../src/main/resources/dbscripts/plugins/mssql.sql | 4 +++- 5 files changed, 13 insertions(+), 3 deletions(-) diff --git a/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/src/main/resources/dbscripts/plugins/mssql.sql b/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/src/main/resources/dbscripts/plugins/mssql.sql index 2269e4c190..3cd14ad6ad 100644 --- a/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/src/main/resources/dbscripts/plugins/mssql.sql +++ b/features/mobile-plugins-feature/android-plugin-feature/org.wso2.carbon.device.mgt.mobile.android.feature/src/main/resources/dbscripts/plugins/mssql.sql @@ -1,6 +1,7 @@ -- ----------------------------------------------------- -- Table `AD_DEVICE` -- ----------------------------------------------------- +IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[AD_DEVICE]') AND TYPE IN (N'U')) CREATE TABLE AD_DEVICE ( DEVICE_ID VARCHAR(45) NOT NULL, GCM_TOKEN VARCHAR(1000) NULL DEFAULT NULL, @@ -21,6 +22,7 @@ CREATE TABLE AD_DEVICE ( -- ----------------------------------------------------- -- Table `AD_FEATURE` -- ----------------------------------------------------- +IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[AD_FEATURE]') AND TYPE IN (N'U')) CREATE TABLE AD_FEATURE ( ID INT NOT NULL IDENTITY, CODE VARCHAR(45) NOT NULL, diff --git a/features/mobile-plugins-feature/mobile-base-plugin-feature/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/android/mssql.sql b/features/mobile-plugins-feature/mobile-base-plugin-feature/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/android/mssql.sql index 2269e4c190..3cd14ad6ad 100644 --- a/features/mobile-plugins-feature/mobile-base-plugin-feature/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/android/mssql.sql +++ b/features/mobile-plugins-feature/mobile-base-plugin-feature/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/android/mssql.sql @@ -1,6 +1,7 @@ -- ----------------------------------------------------- -- Table `AD_DEVICE` -- ----------------------------------------------------- +IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[AD_DEVICE]') AND TYPE IN (N'U')) CREATE TABLE AD_DEVICE ( DEVICE_ID VARCHAR(45) NOT NULL, GCM_TOKEN VARCHAR(1000) NULL DEFAULT NULL, @@ -21,6 +22,7 @@ CREATE TABLE AD_DEVICE ( -- ----------------------------------------------------- -- Table `AD_FEATURE` -- ----------------------------------------------------- +IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[AD_FEATURE]') AND TYPE IN (N'U')) CREATE TABLE AD_FEATURE ( ID INT NOT NULL IDENTITY, CODE VARCHAR(45) NOT NULL, diff --git a/features/mobile-plugins-feature/mobile-base-plugin-feature/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/ios/mssql.sql b/features/mobile-plugins-feature/mobile-base-plugin-feature/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/ios/mssql.sql index 5205ff6f2b..9d816fe8fb 100644 --- a/features/mobile-plugins-feature/mobile-base-plugin-feature/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/ios/mssql.sql +++ b/features/mobile-plugins-feature/mobile-base-plugin-feature/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/ios/mssql.sql @@ -1,6 +1,7 @@ -- ----------------------------------------------------- -- Table `IOS_FEATURE` -- ----------------------------------------------------- +IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[IOS_FEATURE]') AND TYPE IN (N'U')) CREATE TABLE IOS_FEATURE ( ID INT NOT NULL IDENTITY, CODE VARCHAR(45) NOT NULL, @@ -12,7 +13,8 @@ CREATE TABLE IOS_FEATURE ( -- ----------------------------------------------------- -- Table `IOS_DEVICE` -- ----------------------------------------------------- - CREATE TABLE IOS_DEVICE ( +IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[IOS_DEVICE]') AND TYPE IN (N'U')) + CREATE TABLE IOS_DEVICE ( MOBILE_DEVICE_ID VARCHAR(45) NOT NULL, APNS_PUSH_TOKEN VARCHAR(100) NULL DEFAULT NULL, MAGIC_TOKEN VARCHAR(100) NULL DEFAULT NULL, diff --git a/features/mobile-plugins-feature/mobile-base-plugin-feature/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/windows/mssql.sql b/features/mobile-plugins-feature/mobile-base-plugin-feature/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/windows/mssql.sql index 5935151854..524a483c7c 100644 --- a/features/mobile-plugins-feature/mobile-base-plugin-feature/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/windows/mssql.sql +++ b/features/mobile-plugins-feature/mobile-base-plugin-feature/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/windows/mssql.sql @@ -1,6 +1,7 @@ -- ----------------------------------------------------- -- Table `WINDOWS_FEATURE` -- ----------------------------------------------------- +IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[WIN_FEATURE]') AND TYPE IN (N'U')) CREATE TABLE WIN_FEATURE ( ID INT NOT NULL IDENTITY, CODE VARCHAR(45) NOT NULL, @@ -12,7 +13,8 @@ CREATE TABLE WIN_FEATURE ( -- ----------------------------------------------------- -- Table `WINDOWS_DEVICE` -- ----------------------------------------------------- - CREATE TABLE WIN_DEVICE ( +IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[WIN_DEVICE]') AND TYPE IN (N'U')) +CREATE TABLE WIN_DEVICE ( DEVICE_ID VARCHAR(45) NOT NULL, CHANNEL_URI VARCHAR(100) NULL DEFAULT NULL, DEVICE_INFO TEXT NULL DEFAULT NULL, diff --git a/features/mobile-plugins-feature/windows-plugin-feature/org.wso2.carbon.device.mgt.mobile.windows.feature/src/main/resources/dbscripts/plugins/mssql.sql b/features/mobile-plugins-feature/windows-plugin-feature/org.wso2.carbon.device.mgt.mobile.windows.feature/src/main/resources/dbscripts/plugins/mssql.sql index 5935151854..524a483c7c 100644 --- a/features/mobile-plugins-feature/windows-plugin-feature/org.wso2.carbon.device.mgt.mobile.windows.feature/src/main/resources/dbscripts/plugins/mssql.sql +++ b/features/mobile-plugins-feature/windows-plugin-feature/org.wso2.carbon.device.mgt.mobile.windows.feature/src/main/resources/dbscripts/plugins/mssql.sql @@ -1,6 +1,7 @@ -- ----------------------------------------------------- -- Table `WINDOWS_FEATURE` -- ----------------------------------------------------- +IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[WIN_FEATURE]') AND TYPE IN (N'U')) CREATE TABLE WIN_FEATURE ( ID INT NOT NULL IDENTITY, CODE VARCHAR(45) NOT NULL, @@ -12,7 +13,8 @@ CREATE TABLE WIN_FEATURE ( -- ----------------------------------------------------- -- Table `WINDOWS_DEVICE` -- ----------------------------------------------------- - CREATE TABLE WIN_DEVICE ( +IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[WIN_DEVICE]') AND TYPE IN (N'U')) +CREATE TABLE WIN_DEVICE ( DEVICE_ID VARCHAR(45) NOT NULL, CHANNEL_URI VARCHAR(100) NULL DEFAULT NULL, DEVICE_INFO TEXT NULL DEFAULT NULL,