airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lah...@apache.org
Subject svn commit: r1384490 - /incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/
Date Thu, 13 Sep 2012 19:44:14 GMT
Author: lahiru
Date: Thu Sep 13 19:44:13 2012
New Revision: 1384490

URL: http://svn.apache.org/viewvc?rev=1384490&view=rev
Log:
updating existing resources to the database

Modified:
    incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ApplicationDescriptorResource.java
    incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ConfigurationResource.java
    incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ExperimentResource.java
    incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/GatewayResource.java
    incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/HostDescriptorResource.java
    incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/PublishWorkflowResource.java
    incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ServiceDescriptorResource.java
    incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/UserResource.java
    incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/UserWorkflowResource.java

Modified: incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ApplicationDescriptorResource.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ApplicationDescriptorResource.java?rev=1384490&r1=1384489&r2=1384490&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ApplicationDescriptorResource.java
(original)
+++ incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ApplicationDescriptorResource.java
Thu Sep 13 19:44:13 2012
@@ -251,6 +251,8 @@ public class ApplicationDescriptorResour
         applicationDescriptor.setService_descriptor_ID(serviceDescName);
         applicationDescriptor.setHost_descriptor_ID(hostDescName);
         if (existingAppDesc != null) {
+            applicationDescriptor.setUser(user);
+            applicationDescriptor.setApplication_descriptor_xml(content);
             applicationDescriptor = em.merge(existingAppDesc);
         } else {
             em.merge(applicationDescriptor);

Modified: incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ConfigurationResource.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ConfigurationResource.java?rev=1384490&r1=1384489&r2=1384490&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ConfigurationResource.java
(original)
+++ incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ConfigurationResource.java
Thu Sep 13 19:44:13 2012
@@ -153,9 +153,10 @@ public class ConfigurationResource exten
             configuration.setConfig_key(configKey);
             configuration.setConfig_val(configVal);
             configuration.setExpire_date(expireDate);
-            if(existing != null){
-               configuration = em.merge(existing);
-            }  else {
+            if (existing != null) {
+                existing.setExpire_date(expireDate);
+                configuration = em.merge(existing);
+            } else {
                 em.merge(configuration);
             }
 

Modified: incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ExperimentResource.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ExperimentResource.java?rev=1384490&r1=1384489&r2=1384490&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ExperimentResource.java
(original)
+++ incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ExperimentResource.java
Thu Sep 13 19:44:13 2012
@@ -160,6 +160,10 @@ public class ExperimentResource extends 
         experiment.setGateway(gateway);
         experiment.setSubmitted_date(submittedDate);
         if(existingExp != null){
+            existingExp.setGateway(gateway);
+            existingExp.setProject(project);
+            existingExp.setUser(user);
+            existingExp.setSubmitted_date(submittedDate);
             experiment = em.merge(existingExp);
         } else{
            em.merge(experiment);

Modified: incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/GatewayResource.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/GatewayResource.java?rev=1384490&r1=1384489&r2=1384490&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/GatewayResource.java
(original)
+++ incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/GatewayResource.java
Thu Sep 13 19:44:13 2012
@@ -401,6 +401,7 @@ public class GatewayResource extends Abs
         gateway.setGateway_name(gatewayName);
         gateway.setOwner(owner);
         if (existingGateway != null) {
+            existingGateway.setOwner(owner);
             gateway = em.merge(existingGateway);
         } else {
             em.persist(gateway);

Modified: incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/HostDescriptorResource.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/HostDescriptorResource.java?rev=1384490&r1=1384489&r2=1384490&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/HostDescriptorResource.java
(original)
+++ incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/HostDescriptorResource.java
Thu Sep 13 19:44:13 2012
@@ -205,6 +205,8 @@ public class HostDescriptorResource exte
         hostDescriptor.setHost_descriptor_xml(content);
         hostDescriptor.setUser(user);
         if(existingHost_desc != null){
+            existingHost_desc.setUser(user);
+            existingHost_desc.setHost_descriptor_xml(content);
             hostDescriptor = em.merge(existingHost_desc);
         } else {
             em.merge(hostDescriptor);

Modified: incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/PublishWorkflowResource.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/PublishWorkflowResource.java?rev=1384490&r1=1384489&r2=1384490&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/PublishWorkflowResource.java
(original)
+++ incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/PublishWorkflowResource.java
Thu Sep 13 19:44:13 2012
@@ -231,6 +231,11 @@ public class PublishWorkflowResource ext
         user.setUser_name(createdUser);
         publishedWorkflow.setUser(user);
         if(existingWF != null){
+            existingWF.setUser(user);
+            existingWF.setPublished_date(publishedDate);
+            existingWF.setWorkflow_content(content);
+            existingWF.setVersion(version);
+            existingWF.setPath(path);
             publishedWorkflow = em.merge(existingWF);
         }else {
             em.merge(gateway);

Modified: incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ServiceDescriptorResource.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ServiceDescriptorResource.java?rev=1384490&r1=1384489&r2=1384490&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ServiceDescriptorResource.java
(original)
+++ incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ServiceDescriptorResource.java
Thu Sep 13 19:44:13 2012
@@ -148,6 +148,8 @@ public class ServiceDescriptorResource e
         user.setUser_name(userName);
         serviceDescriptor.setUser(user);
         if(existingServiceDesc != null) {
+            existingServiceDesc.setUser(user);
+            existingServiceDesc.setService_descriptor_xml(content);
             serviceDescriptor = em.merge(existingServiceDesc);
         }else {
             em.merge(serviceDescriptor);

Modified: incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/UserResource.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/UserResource.java?rev=1384490&r1=1384489&r2=1384490&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/UserResource.java
(original)
+++ incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/UserResource.java
Thu Sep 13 19:44:13 2012
@@ -124,6 +124,7 @@ public class UserResource extends Abstra
         user.setUser_name(userName);
         user.setPassword(password);
         if(existingUser != null){
+            existingUser.setPassword(password);
             user = em.merge(existingUser);
         }else {
             em.persist(user);

Modified: incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/UserWorkflowResource.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/UserWorkflowResource.java?rev=1384490&r1=1384489&r2=1384490&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/UserWorkflowResource.java
(original)
+++ incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/UserWorkflowResource.java
Thu Sep 13 19:44:13 2012
@@ -134,14 +134,16 @@ public class UserWorkflowResource extend
         userWorkflow.setTemplate_name(name);
         userWorkflow.setLast_updated_date(lastUpdateDate);
         userWorkflow.setWorkflow_graph(content);
-        Gateway gateway = new Gateway();
-        gateway.setGateway_name(gateway.getGateway_name());
-        userWorkflow.setGateway(gateway);
-        Users user = new Users();
-        user.setUser_name(worker.getUser());
-        userWorkflow.setUser(user);
+        userWorkflow.setGateway_name(this.gateway.getGatewayName());
+        userWorkflow.setOwner(this.getWorker().getUser());
         userWorkflow.setPath(path);
         if(existingWF != null){
+            existingWF.setGateway_name(this.gateway.getGatewayName());
+            existingWF.setOwner(this.getWorker().getUser());
+            existingWF.setTemplate_name(name);
+            existingWF.setLast_updated_date(lastUpdateDate);
+            existingWF.setPath(path);
+            existingWF.setWorkflow_graph(content);
             userWorkflow = em.merge(existingWF);
         } else {
             em.merge(userWorkflow);



Mime
View raw message