From 4590de6a76d60eb5d90e5ea5cdbca1dda23c0ace Mon Sep 17 00:00:00 2001 From: Kamidu Sachith Date: Wed, 4 Nov 2015 15:12:23 +0530 Subject: [PATCH 1/3] chenge the formatter --- .../backend-oauth-authenticator/pom.xml | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/components/identity-extensions/backend-oauth-authenticator/pom.xml b/components/identity-extensions/backend-oauth-authenticator/pom.xml index f626686a0d5..cb64fb694db 100644 --- a/components/identity-extensions/backend-oauth-authenticator/pom.xml +++ b/components/identity-extensions/backend-oauth-authenticator/pom.xml @@ -26,46 +26,46 @@ 4.0.0 bundle - WSO2 Carbon - OAuth Back End Authenticator + WSO2 Carbon - OAuth Back End Authenticator org.wso2.carbon.identity.authenticator.backend.oauth org.wso2.carbon org.wso2.carbon.utils - + org.wso2.carbon.identity org.wso2.carbon.identity.base - + org.wso2.carbon.identity org.wso2.carbon.identity.core - + org.wso2.carbon org.wso2.carbon.core - + org.wso2.carbon org.wso2.carbon.logging - + org.wso2.carbon.identity org.wso2.carbon.identity.application.authentication.framework - + org.wso2.carbon org.wso2.carbon.core.services - + org.wso2.carbon.identity org.wso2.carbon.identity.oauth - + org.wso2.carbon.identity org.wso2.carbon.identity.application.common - + org.wso2.carbon.identity org.wso2.carbon.identity.oauth.stub @@ -89,14 +89,15 @@ ${pom.artifactId} ${carbon.device.mgt.version} Identity backend Bundle - org.wso2.carbon.identity.authenticator.backend.oauth.internal.OauthAuthenticatorServiceComponent + + org.wso2.carbon.identity.authenticator.backend.oauth.internal.OauthAuthenticatorServiceComponent + org.wso2.org.wso2.carbon.identity.authenticator.backend.oauth.internal org.wso2.carbon.identity.authenticator.backend.oauth.* - From d7c942f39526754b5901656ca6f1750e1c3d9da5 Mon Sep 17 00:00:00 2001 From: Kamidu Sachith Date: Tue, 10 Nov 2015 14:51:10 +0530 Subject: [PATCH 2/3] Enable ownership editing on the policy --- .../carbon/policy/mgt/core/dao/impl/PolicyDAOImpl.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/dao/impl/PolicyDAOImpl.java b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/dao/impl/PolicyDAOImpl.java index 9cc11640d66..593c4a88fc3 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/dao/impl/PolicyDAOImpl.java +++ b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/dao/impl/PolicyDAOImpl.java @@ -280,14 +280,15 @@ public class PolicyDAOImpl implements PolicyDAO { try { conn = this.getConnection(); - String query = "UPDATE DM_POLICY SET PRIORITY = ?, UPDATED = ? WHERE ID = ? AND TENANT_ID = ?"; + String query = "UPDATE DM_POLICY SET PRIORITY = ?, UPDATED = ?, OWNERSHIP_TYPE = ? WHERE ID = ? AND TENANT_ID = ?"; stmt = conn.prepareStatement(query); for (Policy policy : policies) { stmt.setInt(1, policy.getPriorityId()); stmt.setInt(2, 1); - stmt.setInt(3, policy.getId()); - stmt.setInt(4, tenantId); + stmt.setString(3, policy.getOwnershipType()); + stmt.setInt(4, policy.getId()); + stmt.setInt(5, tenantId); stmt.addBatch(); } stmt.executeBatch(); From 8953a61cc4e8a4b445a00f682d1ad24c32d728a1 Mon Sep 17 00:00:00 2001 From: Kamidu Sachith Date: Tue, 10 Nov 2015 20:17:59 +0530 Subject: [PATCH 3/3] Enable Owneship type editing in policy --- .../policy/mgt/core/dao/impl/PolicyDAOImpl.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/dao/impl/PolicyDAOImpl.java b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/dao/impl/PolicyDAOImpl.java index 593c4a88fc3..33a56b66239 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/dao/impl/PolicyDAOImpl.java +++ b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/dao/impl/PolicyDAOImpl.java @@ -280,15 +280,14 @@ public class PolicyDAOImpl implements PolicyDAO { try { conn = this.getConnection(); - String query = "UPDATE DM_POLICY SET PRIORITY = ?, UPDATED = ?, OWNERSHIP_TYPE = ? WHERE ID = ? AND TENANT_ID = ?"; + String query = "UPDATE DM_POLICY SET PRIORITY = ?, UPDATED = ? WHERE ID = ? AND TENANT_ID = ?"; stmt = conn.prepareStatement(query); for (Policy policy : policies) { stmt.setInt(1, policy.getPriorityId()); stmt.setInt(2, 1); - stmt.setString(3, policy.getOwnershipType()); - stmt.setInt(4, policy.getId()); - stmt.setInt(5, tenantId); + stmt.setInt(3, policy.getId()); + stmt.setInt(4, tenantId); stmt.addBatch(); } stmt.executeBatch(); @@ -743,7 +742,7 @@ public class PolicyDAOImpl implements PolicyDAO { try { conn = this.getConnection(); String query = "UPDATE DM_POLICY SET NAME = ?, PROFILE_ID = ?, PRIORITY = ?, COMPLIANCE = ?," + - " UPDATED = ?, DESCRIPTION = ? WHERE ID = ? AND TENANT_ID = ?"; + " UPDATED = ?, DESCRIPTION = ?, OWNERSHIP_TYPE = ? WHERE ID = ? AND TENANT_ID = ?"; stmt = conn.prepareStatement(query); stmt.setString(1, policy.getPolicyName()); stmt.setInt(2, policy.getProfile().getProfileId()); @@ -751,8 +750,9 @@ public class PolicyDAOImpl implements PolicyDAO { stmt.setString(4, policy.getCompliance()); stmt.setInt(5, 1); stmt.setString(6, policy.getDescription()); - stmt.setInt(7, policy.getId()); - stmt.setInt(8, tenantId); + stmt.setString(7, policy.getOwnershipType()); + stmt.setInt(8, policy.getId()); + stmt.setInt(9, tenantId); stmt.executeUpdate(); } catch (SQLException e) {