From 40907a954a3ea2a99600fd36751f859910beb877 Mon Sep 17 00:00:00 2001 From: Madawa Soysa Date: Wed, 9 Nov 2016 14:39:02 +0530 Subject: [PATCH 1/2] Adding cache prevention filter to emm-web-agent app --- .../jaggeryapps/emm-web-agent/jaggery.conf | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/jaggery.conf b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/jaggery.conf index 8107ef9430..6279943bdd 100644 --- a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/jaggery.conf +++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/jaggery.conf @@ -93,5 +93,21 @@ } } } + ], + "filters": [ + { + "name": "URLBasedCachePreventionFilter", + "class": "org.wso2.carbon.ui.filters.cache.URLBasedCachePreventionFilter" + } + ], + "filterMappings": [ + { + "name": "URLBasedCachePreventionFilter", + "url": "/api/*" + }, + { + "name": "URLBasedCachePreventionFilter", + "url": "/enrollment/*" + } ] } From b699cb8e4c35f0073b432c626e89a9171e201686 Mon Sep 17 00:00:00 2001 From: inoshperera Date: Wed, 9 Nov 2016 16:44:43 +0530 Subject: [PATCH 2/2] adding a new table to keep track of the profies pushed to an ios device --- .../resources/dbscripts/plugins/ios/h2.sql | 13 ++++++++++ .../resources/dbscripts/plugins/ios/mssql.sql | 13 ++++++++++ .../resources/dbscripts/plugins/ios/mysql.sql | 14 +++++++++++ .../dbscripts/plugins/ios/oracle.sql | 24 +++++++++++++++++++ .../dbscripts/plugins/ios/postgresql.sql | 17 +++++++++++++ 5 files changed, 81 insertions(+) diff --git a/features/mobile-plugins-feature/mobile-base-plugin-feature/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/ios/h2.sql b/features/mobile-plugins-feature/mobile-base-plugin-feature/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/ios/h2.sql index a115e54575..4164bc5442 100644 --- a/features/mobile-plugins-feature/mobile-base-plugin-feature/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/ios/h2.sql +++ b/features/mobile-plugins-feature/mobile-base-plugin-feature/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/ios/h2.sql @@ -31,3 +31,16 @@ CREATE TABLE IF NOT EXISTS `IOS_FEATURE` ( `DESCRIPTION` VARCHAR(200) NULL, PRIMARY KEY (`FEATURE_ID`) ); + +-- ----------------------------------------------------- +-- Table `IOS_DEVICE_PROFILE` +-- ----------------------------------------------------- +CREATE TABLE IF NOT EXISTS `IOS_DEVICE_PROFILE` ( + `ID` INT NOT NULL AUTO_INCREMENT, + `OPERATION_ID` VARCHAR(10) NOT NULL, + `OPERATION_CODE` VARCHAR(1000) NULL, + `PROFILE_ID` VARCHAR(1000) NULL, + `DEVICE_IDENTIFICATION` VARCHAR(300) DEFAULT NULL, + `PROPERTIES` TEXT DEFAULT NULL, + PRIMARY KEY (`ID`) +); 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 9d816fe8fb..4f8be9cd33 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 @@ -33,3 +33,16 @@ IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[I LONGITUDE VARCHAR(45) NULL DEFAULT NULL, PRIMARY KEY (MOBILE_DEVICE_ID) ); + +-- ----------------------------------------------------- +-- Table `IOS_DEVICE_PROFILE` +-- ----------------------------------------------------- +CREATE TABLE IOS_DEVICE_PROFILE ( + ID INT NOT NULL IDENTITY, + OPERATION_ID VARCHAR(10) NOT NULL, + OPERATION_CODE VARCHAR(1000) NULL, + PROFILE_ID VARCHAR(1000) NULL, + DEVICE_IDENTIFICATION VARCHAR(300) DEFAULT NULL, + PROPERTIES VARCHAR(max) DEFAULT NULL, + PRIMARY KEY (ID) +); \ No newline at end of file diff --git a/features/mobile-plugins-feature/mobile-base-plugin-feature/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/ios/mysql.sql b/features/mobile-plugins-feature/mobile-base-plugin-feature/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/ios/mysql.sql index 3f617b7c74..badeb22cf2 100644 --- a/features/mobile-plugins-feature/mobile-base-plugin-feature/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/ios/mysql.sql +++ b/features/mobile-plugins-feature/mobile-base-plugin-feature/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/ios/mysql.sql @@ -31,3 +31,17 @@ CREATE TABLE IF NOT EXISTS `IOS_FEATURE` ( `DESCRIPTION` VARCHAR(200) NULL, PRIMARY KEY (`FEATURE_ID`) ) ENGINE = InnoDB; + + +-- ----------------------------------------------------- +-- Table `IOS_DEVICE_PROFILE` +-- ----------------------------------------------------- +CREATE TABLE IF NOT EXISTS `IOS_DEVICE_PROFILE` ( + `ID` INT NOT NULL AUTO_INCREMENT, + `OPERATION_ID` VARCHAR(10) NOT NULL, + `OPERATION_CODE` VARCHAR(1000) NULL, + `PROFILE_ID` VARCHAR(1000) NULL, + `DEVICE_IDENTIFICATION` VARCHAR(300) DEFAULT NULL, + `PROPERTIES` TEXT DEFAULT NULL, + PRIMARY KEY (`ID`) +); diff --git a/features/mobile-plugins-feature/mobile-base-plugin-feature/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/ios/oracle.sql b/features/mobile-plugins-feature/mobile-base-plugin-feature/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/ios/oracle.sql index 2323717317..b747da6ab5 100644 --- a/features/mobile-plugins-feature/mobile-base-plugin-feature/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/ios/oracle.sql +++ b/features/mobile-plugins-feature/mobile-base-plugin-feature/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/ios/oracle.sql @@ -50,4 +50,28 @@ FOR EACH ROW BEGIN SELECT IOS_FEATURE_ID_INC_SEQ.NEXTVAL INTO :NEW.ID FROM DUAL; END; +/ + +-- ----------------------------------------------------- +-- Table `IOS_DEVICE_PROFILE` +-- ----------------------------------------------------- +CREATE TABLE IOS_DEVICE_PROFILE ( + ID NUMBER(10) NOT NULL, + OPERATION_ID VARCHAR2(10) NOT NULL, + OPERATION_CODE VARCHAR2(1000) NULL, + PROFILE_ID VARCHAR2(1000) NULL, + DEVICE_IDENTIFICATION VARCHAR2(300) DEFAULT NULL, + PROPERTIES CLOB DEFAULT NULL, + PRIMARY KEY (ID) +); + +-- Generate ID using sequence and trigger +CREATE SEQUENCE IOS_DEVICE_PROFILE_seq START WITH 1 INCREMENT BY 1; + +CREATE OR REPLACE TRIGGER IOS_DEVICE_PROFILE_seq_tr + BEFORE INSERT ON IOS_DEVICE_PROFILE FOR EACH ROW + WHEN (NEW.ID IS NULL) +BEGIN + SELECT IOS_DEVICE_PROFILE_seq.NEXTVAL INTO :NEW.ID FROM DUAL; +END; / \ No newline at end of file diff --git a/features/mobile-plugins-feature/mobile-base-plugin-feature/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/ios/postgresql.sql b/features/mobile-plugins-feature/mobile-base-plugin-feature/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/ios/postgresql.sql index c03e68e4a7..170e9d8e90 100644 --- a/features/mobile-plugins-feature/mobile-base-plugin-feature/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/ios/postgresql.sql +++ b/features/mobile-plugins-feature/mobile-base-plugin-feature/org.wso2.carbon.device.mgt.mobile.feature/src/main/resources/dbscripts/plugins/ios/postgresql.sql @@ -31,3 +31,20 @@ CREATE TABLE IF NOT EXISTS IOS_DEVICE ( LONGITUDE VARCHAR(45) NULL DEFAULT NULL, PRIMARY KEY (MOBILE_DEVICE_ID) ); + + + +-- ----------------------------------------------------- +-- Table `IOS_DEVICE_PROFILE` +-- ----------------------------------------------------- +CREATE SEQUENCE IOS_DEVICE_PROFILE_seq; + +CREATE TABLE IF NOT EXISTS IOS_DEVICE_PROFILE ( + ID INT NOT NULL DEFAULT NEXTVAL ('IOS_DEVICE_PROFILE_seq'), + OPERATION_ID VARCHAR(10) NOT NULL, + OPERATION_CODE VARCHAR(1000) NULL, + PROFILE_ID VARCHAR(1000) NULL, + DEVICE_IDENTIFICATION VARCHAR(300) DEFAULT NULL, + PROPERTIES TEXT DEFAULT NULL, + PRIMARY KEY (ID) +);