From 699d92f7bd9ecd7afbd39c51991e11d2d5d735db Mon Sep 17 00:00:00 2001 From: Dileesha Rajapakse Date: Mon, 7 Dec 2015 13:57:38 +0530 Subject: [PATCH 1/7] Added DM_DEVICE_CERTIFICATE Table into SQL Scripts --- .../src/main/resources/dbscripts/cdm/mssql.sql | 9 ++++++++- .../src/main/resources/dbscripts/cdm/mysql.sql | 6 ++++++ .../main/resources/dbscripts/cdm/oracle.sql | 18 ++++++++++++++++++ .../resources/dbscripts/cdm/postgresql.sql | 7 +++++++ 4 files changed, 39 insertions(+), 1 deletion(-) diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/mssql.sql b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/mssql.sql index 447a99f142..fc5639649f 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/mssql.sql +++ b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/mssql.sql @@ -1,9 +1,16 @@ CREATE TABLE DM_DEVICE_TYPE ( - ID INT IDENTITY NOT NULL, + ID INTEGER IDENTITY NOT NULL, NAME VARCHAR(300) DEFAULT NULL, PRIMARY KEY (ID) ); +CREATE TABLE DM_DEVICE_CERTIFICATE ( + ID INTEGER IDENTITY NOT NULL, + SERIAL_NUMBER VARCHAR(500) DEFAULT NULL, + CERTIFICATE VARBINARY(max) DEFAULT NULL, + PRIMARY KEY (ID) +); + CREATE TABLE DM_DEVICE ( ID INTEGER identity NOT NULL, DESCRIPTION VARCHAR(max) DEFAULT NULL, diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/mysql.sql b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/mysql.sql index e340450d4c..2132a66d0e 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/mysql.sql +++ b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/mysql.sql @@ -4,6 +4,12 @@ CREATE TABLE IF NOT EXISTS DM_DEVICE_TYPE ( PRIMARY KEY (ID) )ENGINE = InnoDB; +CREATE TABLE IF NOT EXISTS DM_DEVICE_CERTIFICATE ( + ID INTEGER auto_increment NOT NULL, + SERIAL_NUMBER VARCHAR(500) DEFAULT NULL, + CERTIFICATE BLOB DEFAULT NULL, + PRIMARY KEY (ID) +)ENGINE = InnoDB; CREATE TABLE IF NOT EXISTS DM_DEVICE ( ID INTEGER AUTO_INCREMENT NOT NULL, diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/oracle.sql b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/oracle.sql index 229556c110..dd6fa2c621 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/oracle.sql +++ b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/oracle.sql @@ -18,6 +18,24 @@ WHEN (NEW.ID IS NULL) END; / +CREATE TABLE DM_DEVICE_CERTIFICATE ( + ID NUMBER(10) NOT NULL, + SERIAL_NUMBER VARCHAR2(500) DEFAULT NULL, + CERTIFICATE BLOB DEFAULT NULL, + PRIMARY KEY (ID) +); + +-- Generate ID using sequence and trigger +CREATE SEQUENCE DM_DEVICE_CERTIFICATE_seq START WITH 1 INCREMENT BY 1; + +CREATE OR REPLACE TRIGGER DM_DEVICE_CERTIFICATE_seq_tr +BEFORE INSERT ON DM_DEVICE_CERTIFICATE FOR EACH ROW +WHEN (NEW.ID IS NULL) + BEGIN + SELECT DM_DEVICE_CERTIFICATE_seq.NEXTVAL INTO :NEW.ID FROM DUAL; + END; +/ + CREATE TABLE DM_DEVICE ( ID NUMBER(10) NOT NULL, DESCRIPTION CLOB DEFAULT NULL, diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/postgresql.sql b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/postgresql.sql index e86d97eff9..f04cb691b7 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/postgresql.sql +++ b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/postgresql.sql @@ -3,6 +3,13 @@ CREATE TABLE IF NOT EXISTS DM_DEVICE_TYPE ( NAME VARCHAR(300) DEFAULT NULL ); +CREATE TABLE IF NOT EXISTS DM_DEVICE_CERTIFICATE ( + ID BIGSERIAL PRIMARY KEY, + SERIAL_NUMBER VARCHAR(500) DEFAULT NULL, + CERTIFICATE BYTEA DEFAULT NULL, + PRIMARY KEY (ID) +); + CREATE TABLE IF NOT EXISTS DM_DEVICE ( ID BIGSERIAL NOT NULL PRIMARY KEY, DESCRIPTION TEXT DEFAULT NULL, From 6f5720086413b5504ca2e8416c2f68ad4ab29410 Mon Sep 17 00:00:00 2001 From: Kamidu Sachith Date: Wed, 9 Dec 2015 14:40:33 +0530 Subject: [PATCH 2/7] Hanlde dependancy in dynamic client registration by removing recursive dependancy --- .../dynamic-client-web/pom.xml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/components/identity-extensions/dynamic-client-registration/dynamic-client-web/pom.xml b/components/identity-extensions/dynamic-client-registration/dynamic-client-web/pom.xml index 4db2c17fcb..d5e0ed76db 100644 --- a/components/identity-extensions/dynamic-client-registration/dynamic-client-web/pom.xml +++ b/components/identity-extensions/dynamic-client-registration/dynamic-client-web/pom.xml @@ -63,8 +63,18 @@ - org.apache.cxf - cxf-rt-frontend-jaxws + org.apache.ws.commons.axiom + axiom-api + provided + + + org.apache.ws.commons.axiom + axiom-impl + provided + + + org.apache.ws.commons.axiom.wso2 + axiom provided From 865f5a500e9805cd1a973101576e038dbacf6582 Mon Sep 17 00:00:00 2001 From: geethkokila Date: Wed, 9 Dec 2015 20:02:58 +0530 Subject: [PATCH 3/7] Fixing the build failure due to neethi bundle being plugged in to web app lib folder --- .../dynamic-client-web/pom.xml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/components/identity-extensions/dynamic-client-registration/dynamic-client-web/pom.xml b/components/identity-extensions/dynamic-client-registration/dynamic-client-web/pom.xml index 4db2c17fcb..e4d5c62f7e 100644 --- a/components/identity-extensions/dynamic-client-registration/dynamic-client-web/pom.xml +++ b/components/identity-extensions/dynamic-client-registration/dynamic-client-web/pom.xml @@ -134,6 +134,16 @@ org.wso2.carbon.identity org.wso2.carbon.identity.application.mgt provided + + + org.apache.neethi.wso2 + neethi + + + org.apache.neethi + neethi + + com.googlecode.json-simple.wso2 From 49ae3298f4ee6d0ba4935d69ca72fb2b985b7cd4 Mon Sep 17 00:00:00 2001 From: geethkokila Date: Wed, 9 Dec 2015 20:06:28 +0530 Subject: [PATCH 4/7] Fixing the build failure due to neethi bundle being plugged in to web app lib folder --- .../dynamic-client-web/pom.xml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/components/identity-extensions/dynamic-client-registration/dynamic-client-web/pom.xml b/components/identity-extensions/dynamic-client-registration/dynamic-client-web/pom.xml index 39c0b8524c..9df732403c 100644 --- a/components/identity-extensions/dynamic-client-registration/dynamic-client-web/pom.xml +++ b/components/identity-extensions/dynamic-client-registration/dynamic-client-web/pom.xml @@ -160,6 +160,18 @@ json-simple provided + + + org.apache.neethi.wso2 + neethi + provided + + + org.apache.neethi + neethi + provided + + org.codehaus.jackson jackson-jaxrs From 5e40035c4bfdd4d3c78764404877afaa69319f76 Mon Sep 17 00:00:00 2001 From: geethkokila Date: Wed, 9 Dec 2015 20:26:08 +0530 Subject: [PATCH 5/7] Fixing the build failure - forgot to commit to this file --- pom.xml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/pom.xml b/pom.xml index d041463e52..408d066248 100644 --- a/pom.xml +++ b/pom.xml @@ -1247,6 +1247,19 @@ gson ${google.gson.version} + + + + + org.apache.neethi.wso2 + neethi + ${neethi.wso2.version} + + + org.apache.neethi + neethi + ${neethi.version} + @@ -1543,6 +1556,10 @@ 1.1.1 1.2 + + 2.0.4 + 2.0.4.wso2v4 + github-scm From 4acd3411b4fea920272fb2424a9f7b54c9438847 Mon Sep 17 00:00:00 2001 From: geethkokila Date: Thu, 10 Dec 2015 11:19:15 +0530 Subject: [PATCH 6/7] Changing the identity version --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 408d066248..0931a9c063 100644 --- a/pom.xml +++ b/pom.xml @@ -1504,7 +1504,7 @@ 4.6.0 - 5.0.3-SNAPSHOT + 5.0.3 4.5.0 From 96366de4dd53c5118ba07cad737a9a2406ec8232 Mon Sep 17 00:00:00 2001 From: Dileesha Rajapakse Date: Thu, 10 Dec 2015 15:30:17 +0530 Subject: [PATCH 7/7] Fixed syntax errors in sequence creation --- .../src/main/resources/dbscripts/cdm/oracle.sql | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/oracle.sql b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/oracle.sql index dd6fa2c621..10e92f5047 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/oracle.sql +++ b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/dbscripts/cdm/oracle.sql @@ -23,11 +23,11 @@ CREATE TABLE DM_DEVICE_CERTIFICATE ( SERIAL_NUMBER VARCHAR2(500) DEFAULT NULL, CERTIFICATE BLOB DEFAULT NULL, PRIMARY KEY (ID) -); - +) +/ -- Generate ID using sequence and trigger -CREATE SEQUENCE DM_DEVICE_CERTIFICATE_seq START WITH 1 INCREMENT BY 1; - +CREATE SEQUENCE DM_DEVICE_CERTIFICATE_seq START WITH 1 INCREMENT BY 1 NOCACHE +/ CREATE OR REPLACE TRIGGER DM_DEVICE_CERTIFICATE_seq_tr BEFORE INSERT ON DM_DEVICE_CERTIFICATE FOR EACH ROW WHEN (NEW.ID IS NULL)