airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chath...@apache.org
Subject airavata git commit: fixing bug in clone experiment - AIRAVATA-1626
Date Tue, 10 Mar 2015 19:18:09 GMT
Repository: airavata
Updated Branches:
  refs/heads/master 56efa8e5e -> 4000b82c0


fixing bug in clone experiment - AIRAVATA-1626


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

Branch: refs/heads/master
Commit: 4000b82c0dbbbae8fe54c396114ea84da5c09dde
Parents: 56efa8e
Author: Chathuri Wimalasena <kamalasini@gmail.com>
Authored: Tue Mar 10 15:18:04 2015 -0400
Committer: Chathuri Wimalasena <kamalasini@gmail.com>
Committed: Tue Mar 10 15:18:04 2015 -0400

----------------------------------------------------------------------
 .../airavata/api/server/handler/AiravataServerHandler.java       | 4 ++--
 .../persistance/registry/jpa/impl/ExperimentRegistry.java        | 3 +++
 2 files changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/4000b82c/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
index f250f37..a2bd3c7 100644
--- a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
+++ b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
@@ -85,7 +85,6 @@ import org.apache.airavata.registry.cpi.RegistryModelType;
 import org.apache.airavata.registry.cpi.utils.Constants;
 import org.apache.airavata.workflow.catalog.WorkflowCatalogFactory;
 import org.apache.thrift.TException;
-import org.python.antlr.ast.Str;
 
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -1360,6 +1359,7 @@ public class AiravataServerHandler implements Airavata.Iface {
                 throw new ExperimentNotFoundException("Requested experiment id " + existingExperimentID
+ " does not exist in the system..");
             }
             Experiment existingExperiment = (Experiment)registry.get(RegistryModelType.EXPERIMENT,
existingExperimentID);
+            String gatewayId = (String)registry.getValue(RegistryModelType.EXPERIMENT, existingExperimentID,
Constants.FieldConstants.ExperimentConstants.GATEWAY);
             existingExperiment.setCreationTime(AiravataUtils.getCurrentTimestamp().getTime());
             if (validateString(newExperiementName)){
                 existingExperiment.setName(newExperiementName);
@@ -1370,7 +1370,7 @@ public class AiravataServerHandler implements Airavata.Iface {
             if (existingExperiment.getErrors() != null ){
                 existingExperiment.getErrors().clear();
             }
-            return (String)registry.add(ParentDataType.EXPERIMENT, existingExperiment, null);
+            return (String)registry.add(ParentDataType.EXPERIMENT, existingExperiment, gatewayId);
         } catch (Exception e) {
             logger.errorId(existingExperimentID, "Error while cloning the experiment with
existing configuration...", e);
             AiravataSystemException exception = new AiravataSystemException();

http://git-wip-us.apache.org/repos/asf/airavata/blob/4000b82c/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ExperimentRegistry.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ExperimentRegistry.java
b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ExperimentRegistry.java
index 0c90322..0da148b 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ExperimentRegistry.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ExperimentRegistry.java
@@ -62,6 +62,7 @@ public class ExperimentRegistry {
             if (!ResourceUtils.isUserExist(experiment.getUserName())) {
                 ResourceUtils.addUser(experiment.getUserName(), null);
             }
+
             experimentID = getExperimentID(experiment.getName());
             experiment.setExperimentID(experimentID);
             ExperimentResource experimentResource = new ExperimentResource();
@@ -2002,6 +2003,8 @@ public class ExperimentRegistry {
                 return ThriftDataModelConversion.getExperiment(resource);
             } else if (fieldName.equals(Constants.FieldConstants.ExperimentConstants.USER_NAME))
{
                 return resource.getExecutionUser();
+            }else if (fieldName.equals(Constants.FieldConstants.ExperimentConstants.GATEWAY))
{
+                return resource.getGateway().getGatewayId();
             } else if (fieldName.equals(Constants.FieldConstants.ExperimentConstants.EXPERIMENT_NAME))
{
                 return resource.getExpName();
             } else if (fieldName.equals(Constants.FieldConstants.ExperimentConstants.EXPERIMENT_DESC))
{


Mime
View raw message