From 9dad03b7c90a6b77690ca1ca95aa114f5d069063 Mon Sep 17 00:00:00 2001 From: lasanthaDLPDS Date: Fri, 31 May 2019 18:31:55 +0530 Subject: [PATCH] Improve category adding API --- .../core/dao/impl/application/GenericApplicationDAOImpl.java | 2 +- .../admin/ApplicationManagementPublisherAdminAPIImpl.java | 2 +- .../src/main/resources/conf/application-mgt.xml | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/application/GenericApplicationDAOImpl.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/application/GenericApplicationDAOImpl.java index 587a5cafb7..4840cf1e5c 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/application/GenericApplicationDAOImpl.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/application/GenericApplicationDAOImpl.java @@ -813,7 +813,7 @@ public class GenericApplicationDAOImpl extends AbstractDAOImpl implements Applic try { Connection conn = this.getDBConnection(); List distinctCategoryIds = new ArrayList<>(); - String sql = "SELECT DISTINCT AP_APP_CATEGORY.ID AS ID FROM AP_APP_CATEGORY"; + String sql = "SELECT DISTINCT AP_APP_CATEGORY_ID AS ID FROM AP_APP_CATEGORY_MAPPING;"; try (PreparedStatement ps = conn.prepareStatement(sql)) { try (ResultSet rs = ps.executeQuery()) { while (rs.next()) { diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/src/main/java/org/wso2/carbon/device/application/mgt/publisher/api/services/impl/admin/ApplicationManagementPublisherAdminAPIImpl.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/src/main/java/org/wso2/carbon/device/application/mgt/publisher/api/services/impl/admin/ApplicationManagementPublisherAdminAPIImpl.java index 9890d037b8..ddca629ac6 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/src/main/java/org/wso2/carbon/device/application/mgt/publisher/api/services/impl/admin/ApplicationManagementPublisherAdminAPIImpl.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/src/main/java/org/wso2/carbon/device/application/mgt/publisher/api/services/impl/admin/ApplicationManagementPublisherAdminAPIImpl.java @@ -43,7 +43,7 @@ import java.util.List; * Implementation of Application Management related APIs. */ @Produces({"application/json"}) -@Path("/applications") +@Path("/admin/applications") public class ApplicationManagementPublisherAdminAPIImpl implements ApplicationManagementPublisherAdminAPI { private static Log log = LogFactory.getLog(ApplicationManagementPublisherAdminAPIImpl.class); diff --git a/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/conf/application-mgt.xml b/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/conf/application-mgt.xml index 2d6dc36c31..11ce3c44c0 100644 --- a/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/conf/application-mgt.xml +++ b/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/conf/application-mgt.xml @@ -151,6 +151,10 @@ perm:app:publisher:view perm:app:publisher:update perm:app:store:view + perm:app:subscription:install + perm:app:subscription:uninstall + perm:admin:app:review:update + perm:admin:app:publisher:update app-mgt