From c1cda6283174db9ab610ce7142222c8a00be5bc9 Mon Sep 17 00:00:00 2001 From: Sudarshan Kumar Date: Mon, 27 Jul 2020 19:48:32 +0530 Subject: App Onboarding - Delete app not working App Onboarding - Delete app not working Issue-ID: PORTAL-963 Change-Id: I6ec10fc4266b4d66d5393925411a90d0245b3e72 Signed-off-by: Sudarshan Kumar --- .../onap/portalapp/portal/service/EPAppCommonServiceImpl.java | 11 +++++++++++ .../src/main/webapp/WEB-INF/fusion/orm/EP.hbm.xml | 7 +++++++ 2 files changed, 18 insertions(+) (limited to 'ecomp-portal-BE-common/src/main') diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/EPAppCommonServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/EPAppCommonServiceImpl.java index 54510d2c..a4463c7f 100644 --- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/EPAppCommonServiceImpl.java +++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/EPAppCommonServiceImpl.java @@ -75,6 +75,7 @@ import org.onap.portalapp.portal.domain.EPUserAppsManualSortPreference; import org.onap.portalapp.portal.domain.EPUserAppsSortPreference; import org.onap.portalapp.portal.domain.EPWidgetsManualSortPreference; import org.onap.portalapp.portal.domain.EcompApp; +import org.onap.portalapp.portal.domain.MicroserviceData; import org.onap.portalapp.portal.domain.UserRole; import org.onap.portalapp.portal.domain.UserRoles; import org.onap.portalapp.portal.ecomp.model.AppCatalogItem; @@ -975,6 +976,16 @@ public class EPAppCommonServiceImpl implements EPAppService { } final Map params = new HashMap<>(); params.put("app_id", appid); + + //Checking if App is associated with any exiting microservices- ep_microservice: + final Map queryparams = new HashMap<>(); + queryparams.put("applicationId", appid); + List microservicesList = dataAccessService.executeNamedQuery( "getMicroservicesByAppId", queryparams, null); + if(microservicesList!=null && microservicesList.size()>0) { + fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_METHOD_NOT_ALLOWED); + return fieldsValidator; + } + List EPUserAppRolesRequestList= new ArrayList<>(); EPUserAppRolesRequestList = dataAccessService.executeNamedQuery( "getRequestIdsForApp", params, null); for(int i=0;i + + + + + -- cgit 1.2.3-korg