airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scnakand...@apache.org
Subject [1/2] airavata git commit: AIRAVATA-1538 Deleting AppInterface to Module mapping when deleting a Module
Date Sun, 05 Jul 2015 15:59:01 GMT
Repository: airavata
Updated Branches:
  refs/heads/airavata-0.15-release-branch c5debce4b -> 21106fa28


AIRAVATA-1538 Deleting AppInterface to Module mapping when deleting a Module


Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/c44964ed
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/c44964ed
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/c44964ed

Branch: refs/heads/airavata-0.15-release-branch
Commit: c44964ed266058d3e7d9b567552210946d599f88
Parents: 4d5d579
Author: Supun Nakandala <scnakandala@apache.org>
Authored: Sun Jul 5 21:26:03 2015 +0530
Committer: Supun Nakandala <scnakandala@apache.org>
Committed: Sun Jul 5 21:26:03 2015 +0530

----------------------------------------------------------------------
 .../catalog/data/impl/ApplicationInterfaceImpl.java          | 8 ++++++--
 .../catalog/data/resources/AppModuleMappingResource.java     | 4 +++-
 2 files changed, 9 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/c44964ed/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/impl/ApplicationInterfaceImpl.java
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/impl/ApplicationInterfaceImpl.java
b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/impl/ApplicationInterfaceImpl.java
index 4f12eac..56863cb 100644
--- a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/impl/ApplicationInterfaceImpl.java
+++ b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/impl/ApplicationInterfaceImpl.java
@@ -395,8 +395,12 @@ public class ApplicationInterfaceImpl implements ApplicationInterface
{
     @Override
     public boolean removeApplicationModule(String moduleId) throws AppCatalogException {
         try {
-            AppModuleResource resource = new AppModuleResource();
-            resource.remove(moduleId);
+            AppModuleResource appModuleResource = new AppModuleResource();
+            appModuleResource.remove(moduleId);
+            AppModuleMappingResource appModuleMappingResource = new AppModuleMappingResource();
+            HashMap ids = new HashMap();
+            ids.put(AbstractResource.AppModuleMappingConstants.MODULE_ID, appModuleResource.getModuleId());
+            appModuleMappingResource.remove(ids);
             return true;
         }catch (Exception e){
             logger.error("Error while removing app module "+moduleId, e);

http://git-wip-us.apache.org/repos/asf/airavata/blob/c44964ed/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/AppModuleMappingResource.java
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/AppModuleMappingResource.java
b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/AppModuleMappingResource.java
index a44229d..4e38872 100644
--- a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/AppModuleMappingResource.java
+++ b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/AppModuleMappingResource.java
@@ -94,7 +94,9 @@ public class AppModuleMappingResource extends AbstractResource {
             em = AppCatalogJPAUtils.getEntityManager();
             em.getTransaction().begin();
             AppCatalogQueryGenerator generator= new AppCatalogQueryGenerator(APP_MODULE_MAPPING);
-            generator.setParameter(AppModuleMappingConstants.INTERFACE_ID, ids.get(AppModuleMappingConstants.INTERFACE_ID));
+            if (ids.get(AppModuleMappingConstants.INTERFACE_ID) != null) {
+                generator.setParameter(AppModuleMappingConstants.INTERFACE_ID, ids.get(AppModuleMappingConstants.INTERFACE_ID));
+            }
             if (ids.get(AppModuleMappingConstants.MODULE_ID) != null){
                 generator.setParameter(AppModuleMappingConstants.MODULE_ID, ids.get(AppModuleMappingConstants.MODULE_ID));
             }


Mime
View raw message