airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From samin...@apache.org
Subject svn commit: r1382342 - in /incubator/airavata/trunk/modules: commons/registry-api/src/main/java/org/apache/airavata/registry/api/ commons/registry-api/src/main/java/org/apache/airavata/registry/api/exception/gateway/ commons/registry-api/src/main/java/...
Date Sat, 08 Sep 2012 18:51:20 GMT
Author: samindaw
Date: Sat Sep  8 18:51:20 2012
New Revision: 1382342

URL: http://svn.apache.org/viewvc?rev=1382342&view=rev
Log:
new reg api integration

Added:
    incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/exception/gateway/PublishedWorkflowAlreadyExistsException.java   (with props)
    incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/exception/gateway/PublishedWorkflowDoesNotExistsException.java   (with props)
    incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/exception/worker/ExperimentAlreadyExistsException.java   (with props)
    incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/exception/worker/ExperimentDoesNotExistsException.java   (with props)
    incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/exception/worker/UserWorkflowAlreadyExistsException.java   (with props)
    incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/exception/worker/UserWorkflowDoesNotExistsException.java   (with props)
Removed:
    incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/provenance/impl/jpa/AiravataJPAProvenanceRegistry.java
Modified:
    incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/WorkspaceProject.java
    incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/impl/AiravataJCRRegistry.java
    incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/Test.java
    incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/AiravataJPARegistry.java
    incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ProjectResource.java
    incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/UserResource.java

Modified: incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/WorkspaceProject.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/WorkspaceProject.java?rev=1382342&r1=1382341&r2=1382342&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/WorkspaceProject.java (original)
+++ incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/WorkspaceProject.java Sat Sep  8 18:51:20 2012
@@ -24,6 +24,10 @@ package org.apache.airavata.registry.api
 import java.util.Date;
 import java.util.List;
 
+import org.apache.airavata.common.registry.api.exception.RegistryException;
+import org.apache.airavata.registry.api.exception.worker.ExperimentDoesNotExistsException;
+import org.apache.airavata.registry.api.exception.worker.WorkspaceProjectDoesNotExistsException;
+
 public class WorkspaceProject{
 	private String projectName;
 	private ProjectsRegistry projectsRegistry;
@@ -49,15 +53,15 @@ public class WorkspaceProject{
 		this.projectsRegistry = projectsRegistry;
 	}
 	
-	public void createExperiment(AiravataExperiment experiment){
+	public void createExperiment(AiravataExperiment experiment) throws WorkspaceProjectDoesNotExistsException, ExperimentDoesNotExistsException{
 		getProjectsRegistry().addExperiment(getProjectName(), experiment);
 	}
 	
-	public List<AiravataExperiment> getExperiments(){
+	public List<AiravataExperiment> getExperiments() throws RegistryException{
 		return getProjectsRegistry().getExperiments(getProjectName());
 	}
 	
-	public List<AiravataExperiment> getExperiments(Date from, Date to){
+	public List<AiravataExperiment> getExperiments(Date from, Date to) throws RegistryException{
 		return getProjectsRegistry().getExperiments(getProjectName(),from, to);
 	}
 }

Added: incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/exception/gateway/PublishedWorkflowAlreadyExistsException.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/exception/gateway/PublishedWorkflowAlreadyExistsException.java?rev=1382342&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/exception/gateway/PublishedWorkflowAlreadyExistsException.java (added)
+++ incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/exception/gateway/PublishedWorkflowAlreadyExistsException.java Sat Sep  8 18:51:20 2012
@@ -0,0 +1,34 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.registry.api.exception.gateway;
+
+import org.apache.airavata.common.registry.api.exception.RegistryException;
+
+public class PublishedWorkflowAlreadyExistsException extends RegistryException {
+
+	private static final long serialVersionUID = -8006347245307495767L;
+
+	public PublishedWorkflowAlreadyExistsException(String workflowTemplateName) {
+		super("The workflow "+workflowTemplateName+" is already published!!!");
+	}
+
+}

Propchange: incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/exception/gateway/PublishedWorkflowAlreadyExistsException.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/exception/gateway/PublishedWorkflowDoesNotExistsException.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/exception/gateway/PublishedWorkflowDoesNotExistsException.java?rev=1382342&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/exception/gateway/PublishedWorkflowDoesNotExistsException.java (added)
+++ incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/exception/gateway/PublishedWorkflowDoesNotExistsException.java Sat Sep  8 18:51:20 2012
@@ -0,0 +1,34 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.registry.api.exception.gateway;
+
+import org.apache.airavata.common.registry.api.exception.RegistryException;
+
+public class PublishedWorkflowDoesNotExistsException extends RegistryException {
+
+	private static final long serialVersionUID = -8006347245307495767L;
+
+	public PublishedWorkflowDoesNotExistsException(String workflowTemplateName) {
+		super("There is no workflow named "+workflowTemplateName+" published!!!");
+	}
+
+}

Propchange: incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/exception/gateway/PublishedWorkflowDoesNotExistsException.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/exception/worker/ExperimentAlreadyExistsException.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/exception/worker/ExperimentAlreadyExistsException.java?rev=1382342&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/exception/worker/ExperimentAlreadyExistsException.java (added)
+++ incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/exception/worker/ExperimentAlreadyExistsException.java Sat Sep  8 18:51:20 2012
@@ -0,0 +1,34 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.registry.api.exception.worker;
+
+import org.apache.airavata.common.registry.api.exception.RegistryException;
+
+public class ExperimentAlreadyExistsException extends RegistryException {
+
+	private static final long serialVersionUID = -8006347245307495767L;
+
+	public ExperimentAlreadyExistsException(String experimentId) {
+		super("The experiment "+experimentId+" already added to the registry!!!");
+	}
+
+}

Propchange: incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/exception/worker/ExperimentAlreadyExistsException.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/exception/worker/ExperimentDoesNotExistsException.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/exception/worker/ExperimentDoesNotExistsException.java?rev=1382342&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/exception/worker/ExperimentDoesNotExistsException.java (added)
+++ incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/exception/worker/ExperimentDoesNotExistsException.java Sat Sep  8 18:51:20 2012
@@ -0,0 +1,34 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.registry.api.exception.worker;
+
+import org.apache.airavata.common.registry.api.exception.RegistryException;
+
+public class ExperimentDoesNotExistsException extends RegistryException {
+
+	private static final long serialVersionUID = -8006347245307495767L;
+
+	public ExperimentDoesNotExistsException(String experimentId) {
+		super("The experiment "+experimentId+" is not present in the registry!!!");
+	}
+
+}

Propchange: incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/exception/worker/ExperimentDoesNotExistsException.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/exception/worker/UserWorkflowAlreadyExistsException.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/exception/worker/UserWorkflowAlreadyExistsException.java?rev=1382342&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/exception/worker/UserWorkflowAlreadyExistsException.java (added)
+++ incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/exception/worker/UserWorkflowAlreadyExistsException.java Sat Sep  8 18:51:20 2012
@@ -0,0 +1,34 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.registry.api.exception.worker;
+
+import org.apache.airavata.common.registry.api.exception.RegistryException;
+
+public class UserWorkflowAlreadyExistsException extends RegistryException {
+
+	private static final long serialVersionUID = -8006347245307495767L;
+
+	public UserWorkflowAlreadyExistsException(String workflowTemplateName) {
+		super("The workflow "+workflowTemplateName+" already exists in user space!!!");
+	}
+
+}

Propchange: incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/exception/worker/UserWorkflowAlreadyExistsException.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/exception/worker/UserWorkflowDoesNotExistsException.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/exception/worker/UserWorkflowDoesNotExistsException.java?rev=1382342&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/exception/worker/UserWorkflowDoesNotExistsException.java (added)
+++ incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/exception/worker/UserWorkflowDoesNotExistsException.java Sat Sep  8 18:51:20 2012
@@ -0,0 +1,34 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.registry.api.exception.worker;
+
+import org.apache.airavata.common.registry.api.exception.RegistryException;
+
+public class UserWorkflowDoesNotExistsException extends RegistryException {
+
+	private static final long serialVersionUID = -8006347245307495767L;
+
+	public UserWorkflowDoesNotExistsException(String workflowTemplateName) {
+		super("The workflow "+workflowTemplateName+" does not exists in user space!!!");
+	}
+
+}

Propchange: incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/exception/worker/UserWorkflowDoesNotExistsException.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/impl/AiravataJCRRegistry.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/impl/AiravataJCRRegistry.java?rev=1382342&r1=1382341&r2=1382342&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/impl/AiravataJCRRegistry.java (original)
+++ incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/impl/AiravataJCRRegistry.java Sat Sep  8 18:51:20 2012
@@ -687,9 +687,9 @@ public class AiravataJCRRegistry extends
     }
 
     public String saveOutput(String workflowId, List<ActualParameter> parameters) throws RegistryException{
-    	if (getProvenanceRegistry()!=null){
-    		return getProvenanceRegistry().saveOutput(workflowId, parameters);
-    	}
+//    	if (getProvenanceRegistry()!=null){
+//    		return getProvenanceRegistry().saveOutput(workflowId, parameters);
+//    	}
     	Session session = null;
         String result = null;
         try {
@@ -714,9 +714,9 @@ public class AiravataJCRRegistry extends
     }
 
     public List<ActualParameter> loadOutput(String workflowId) throws RegistryException{
-    	if (getProvenanceRegistry()!=null){
-    		return getProvenanceRegistry().loadOutput(workflowId);
-    	}
+//    	if (getProvenanceRegistry()!=null){
+//    		return getProvenanceRegistry().loadOutput(workflowId);
+//    	}
         Session session = null;
         ArrayList<ActualParameter> result = new ArrayList<ActualParameter>();
         try {

Modified: incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/Test.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/Test.java?rev=1382342&r1=1382341&r2=1382342&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/Test.java (original)
+++ incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/Test.java Sat Sep  8 18:51:20 2012
@@ -1,24 +1,15 @@
 package org.apache.airavata.persistance.registry.jpa;
 
-import org.apache.airavata.persistance.registry.jpa.model.Project;
-import org.apache.airavata.persistance.registry.jpa.model.Users;
-import org.apache.airavata.persistance.registry.jpa.resources.ApplicationDescriptorResource;
 import org.apache.airavata.persistance.registry.jpa.resources.GatewayResource;
-import org.apache.airavata.persistance.registry.jpa.resources.HostDescriptorResource;
 import org.apache.airavata.persistance.registry.jpa.resources.ProjectResource;
-import org.apache.airavata.persistance.registry.jpa.resources.PublishWorkflowResource;
-import org.apache.airavata.persistance.registry.jpa.resources.ServiceDescriptorResource;
 import org.apache.airavata.persistance.registry.jpa.resources.UserResource;
-import org.apache.airavata.registry.api.PublishedWorkflowRegistry;
-
-import java.sql.Date;
 
 
 public class Test {
 
     public static void main(String[] args) {
         GatewayResource gatewayResource = new GatewayResource();
-        gatewayResource.setName("abc");
+        gatewayResource.setGatewayName("abc");
 //        gatewayResource.setGatewayID(1);
 
         // ProjectResource projectResource = (ProjectResource)gatewayResource.create(ResourceType.PROJECT);

Modified: incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/AiravataJPARegistry.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/AiravataJPARegistry.java?rev=1382342&r1=1382341&r2=1382342&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/AiravataJPARegistry.java (original)
+++ incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/AiravataJPARegistry.java Sat Sep  8 18:51:20 2012
@@ -30,6 +30,10 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+import javax.persistence.EntityManager;
+import javax.persistence.EntityManagerFactory;
+import javax.persistence.Query;
+
 import org.apache.airavata.common.registry.api.exception.RegistryException;
 import org.apache.airavata.commons.gfac.type.ApplicationDeploymentDescription;
 import org.apache.airavata.commons.gfac.type.HostDescription;
@@ -46,6 +50,9 @@ import org.apache.airavata.persistance.r
 import org.apache.airavata.persistance.registry.jpa.resources.ServiceDescriptorResource;
 import org.apache.airavata.persistance.registry.jpa.resources.UserWorkflowResource;
 import org.apache.airavata.persistance.registry.jpa.resources.WorkerResource;
+import org.apache.airavata.provenance.model.Experiment_Data;
+import org.apache.airavata.provenance.model.Node_Data;
+import org.apache.airavata.provenance.model.Workflow_Data;
 import org.apache.airavata.registry.api.AiravataExperiment;
 import org.apache.airavata.registry.api.AiravataRegistry2;
 import org.apache.airavata.registry.api.AiravataUser;
@@ -65,6 +72,7 @@ import org.apache.airavata.registry.api.
 import org.apache.airavata.registry.api.exception.worker.WorkspaceProjectDoesNotExistsException;
 import org.apache.airavata.registry.api.workflow.WorkflowExecution;
 import org.apache.airavata.registry.api.workflow.WorkflowIOData;
+import org.apache.airavata.registry.api.workflow.WorkflowInstance;
 import org.apache.airavata.registry.api.workflow.WorkflowInstanceStatus;
 import org.apache.airavata.registry.api.workflow.WorkflowInstanceStatus.ExecutionStatus;
 import org.apache.airavata.registry.api.workflow.WorkflowNodeGramData;
@@ -673,211 +681,336 @@ public class AiravataJPARegistry extends
     }
 
     public void setAiravataRegistry(AiravataRegistry2 registry) {
-        //To change body of implemented methods use File | Settings | File Templates.
+        //redundant
     }
 
     public void setAiravataUser(AiravataUser user) {
-        //To change body of implemented methods use File | Settings | File Templates.
+        setUser(user);
     }
 
-	@Override
-	public boolean saveWorkflowExecutionUser(String experimentId, String user)
+    
+    private static final String PERSISTENCE_UNIT_NAME = "airavata_provenance";
+	private EntityManagerFactory factory;
+	
+    @Override
+	public WorkflowExecution getWorkflowExecution(String arg0)
 			throws RegistryException {
 		// TODO Auto-generated method stub
-		return false;
+		return null;
 	}
 
 	@Override
-	public String getWorkflowExecutionUser(String experimentId)
+	public List<WorkflowExecution> getWorkflowExecutionByUser(String arg0)
 			throws RegistryException {
 		// TODO Auto-generated method stub
 		return null;
 	}
 
 	@Override
-	public String getWorkflowExecutionName(String experimentId)
-			throws RegistryException {
+	public List<WorkflowExecution> getWorkflowExecutionByUser(String arg0,
+			int arg1, int arg2) throws RegistryException {
 		// TODO Auto-generated method stub
 		return null;
 	}
 
 	@Override
-	public boolean saveWorkflowExecutionName(String experimentId,
-			String workflowIntanceName) throws RegistryException {
+	public List<String> getWorkflowExecutionIdByUser(String arg0)
+			throws RegistryException {
 		// TODO Auto-generated method stub
-		return false;
+		return null;
 	}
 
 	@Override
-	public boolean saveWorkflowExecutionStatus(String experimentId,
-			ExecutionStatus status) throws RegistryException {
+	public String getWorkflowExecutionMetadata(String arg0)
+			throws RegistryException {
 		// TODO Auto-generated method stub
-		return false;
+		return null;
 	}
 
 	@Override
-	public WorkflowInstanceStatus getWorkflowExecutionStatus(String experimentId)
+	public String getWorkflowExecutionName(String arg0)
 			throws RegistryException {
 		// TODO Auto-generated method stub
 		return null;
 	}
 
 	@Override
-	public String getWorkflowExecutionMetadata(String experimentId)
+	public List<WorkflowIOData> getWorkflowExecutionOutput(String arg0)
 			throws RegistryException {
-		// TODO Auto-generated method stub
 		return null;
 	}
 
 	@Override
-	public boolean saveWorkflowExecutionMetadata(String experimentId,
-			String metadata) throws RegistryException {
-		// TODO Auto-generated method stub
-		return false;
+	public WorkflowIOData getWorkflowExecutionOutput(String instanceID, String nodeID)
+			throws RegistryException {
+        EntityManager em = factory.createEntityManager();
+		em.getTransaction().begin();
+        Query q = em.createQuery("SELECT p FROM Node_Data p WHERE p.workflow_InstanceID = :workflow_InstanceID AND p.node_id = :node_id");
+        q.setParameter("workflow_InstanceID", instanceID);
+        q.setParameter("node_id", nodeID);
+        Node_Data singleResult = (Node_Data) q.getSingleResult();
+        WorkflowServiceIOData workflowIOData = new WorkflowServiceIOData(singleResult.getOutputs(),instanceID,instanceID,null,nodeID,null);
+        return workflowIOData;
 	}
 
 	@Override
-	public boolean saveWorkflowExecutionServiceInput(
-			WorkflowServiceIOData workflowInputData) throws RegistryException {
+	public String[] getWorkflowExecutionOutputNames(String arg0)
+			throws RegistryException {
 		// TODO Auto-generated method stub
-		return false;
+		return null;
 	}
 
 	@Override
-	public boolean saveWorkflowExecutionServiceOutput(
-			WorkflowServiceIOData workflowOutputData) throws RegistryException {
-		// TODO Auto-generated method stub
-		return false;
+	public WorkflowInstanceStatus getWorkflowExecutionStatus(String instanceID)
+			throws RegistryException {
+		EntityManager em = factory.createEntityManager();
+		em.getTransaction().begin();
+        Query q = em.createQuery("SELECT p FROM Workflow_Data p WHERE p.workflow_InstanceID = :workflow_InstanceID");
+        q.setParameter("workflow_InstanceID", instanceID);
+        Workflow_Data singleResult = (Workflow_Data) q.getSingleResult();
+        WorkflowInstanceStatus workflowInstanceStatus = new
+                WorkflowInstanceStatus(new WorkflowInstance(singleResult.getExperiment_Data().getExperiment_ID(),singleResult.getTemplate_name())
+                ,ExecutionStatus.valueOf(singleResult.getStatus()),new Date(singleResult.getLast_update_time().getTime()));
+        return workflowInstanceStatus;
 	}
 
 	@Override
-	public List<WorkflowServiceIOData> searchWorkflowExecutionServiceInput(
-			String experimentIdRegEx, String workflowNameRegEx,
-			String nodeNameRegEx) throws RegistryException {
-		// TODO Auto-generated method stub
+	public String getWorkflowExecutionUser(String arg0)
+			throws RegistryException {
+
 		return null;
 	}
 
 	@Override
-	public List<WorkflowServiceIOData> searchWorkflowExecutionServiceOutput(
-			String experimentIdRegEx, String workflowNameRegEx,
-			String nodeNameRegEx) throws RegistryException {
+	public boolean saveWorkflowData(WorkflowRunTimeData arg0)
+			throws RegistryException {
 		// TODO Auto-generated method stub
-		return null;
+		EntityManager em = factory.createEntityManager();
+		em.getTransaction().begin();
+		Query q = em.createQuery("SELECT p FROM Experiment_Data p WHERE p.experiment_ID = :exp_ID");
+		q.setParameter("exp_ID", arg0.getExperimentID());
+		Experiment_Data eData = (Experiment_Data) q.getSingleResult();
+		
+		Workflow_Data wData = new Workflow_Data();
+		wData.setExperiment_Data(eData);
+		wData.setExperiment_Data(eData);
+		wData.setTemplate_name(arg0.getTemplateID());
+		wData.setWorkflow_instanceID(arg0.getWorkflowInstanceID());
+		wData.setStatus(arg0.getWorkflowStatus().toString());
+		wData.setStart_time(arg0.getStartTime());
+		
+		em.persist(wData);
+		
+		em.getTransaction().commit();
+		em.close();
+		
+		return true;
 	}
 
 	@Override
-	public boolean saveWorkflowExecutionOutput(String experimentId,
-			String outputNodeName, String output) throws RegistryException {
+	public boolean saveWorkflowExecutionMetadata(String arg0, String arg1)
+			throws RegistryException {
 		// TODO Auto-generated method stub
-		return false;
+		return true;
 	}
 
 	@Override
-	public boolean saveWorkflowExecutionOutput(String experimentId,
-			WorkflowIOData data) throws RegistryException {
+	public boolean saveWorkflowExecutionName(String arg0, String arg1)
+			throws RegistryException {
 		// TODO Auto-generated method stub
-		return false;
+		
+		EntityManager em = factory.createEntityManager();
+		em.getTransaction().begin();
+		
+		Experiment_Data expData = new Experiment_Data();
+		expData.setExperiment_ID(arg0);
+		expData.setName(arg1);
+		
+		em.persist(expData);
+		
+		em.getTransaction().commit();
+		em.close();
+		
+		return true;
 	}
 
 	@Override
-	public WorkflowIOData getWorkflowExecutionOutput(String experimentId,
-			String outputNodeName) throws RegistryException {
+	public boolean saveWorkflowExecutionOutput(String arg0, WorkflowIOData arg1)
+			throws RegistryException {
 		// TODO Auto-generated method stub
-		return null;
+		return true;
 	}
 
 	@Override
-	public List<WorkflowIOData> getWorkflowExecutionOutput(String experimentId)
-			throws RegistryException {
+	public boolean saveWorkflowExecutionOutput(String arg0, String arg1,
+			String arg2) throws RegistryException {
 		// TODO Auto-generated method stub
-		return null;
+		return false;
 	}
 
 	@Override
-	public String[] getWorkflowExecutionOutputNames(String exeperimentId)
+	public boolean saveWorkflowExecutionServiceInput(WorkflowServiceIOData arg0)
 			throws RegistryException {
 		// TODO Auto-generated method stub
-		return null;
+		EntityManager em = factory.createEntityManager();
+		em.getTransaction().begin();
+		
+		Query q = em.createQuery("SELECT w FROM Workflow_Data w WHERE w.workflow_instanceID = :workflow_ID");
+		q.setParameter("workflow_ID", arg0.getWorkflowInstanceId());
+		Workflow_Data wData = (Workflow_Data) q.getSingleResult();
+		
+		Node_Data nData = new Node_Data();
+		nData.setWorkflow_Data(wData);
+		nData.setNode_id(arg0.getNodeId());
+		nData.setInputs(arg0.getValue());
+		nData.setNode_type((arg0.getNodeType().getNodeType().toString()));
+		nData.setStatus(arg0.getNodeStatus().getExecutionStatus().toString());
+		
+		em.persist(nData);
+	
+		em.getTransaction().commit();
+		em.close();
+		
+		return true;
 	}
 
 	@Override
-	public WorkflowExecution getWorkflowExecution(String experimentId)
+	public boolean saveWorkflowExecutionServiceOutput(WorkflowServiceIOData arg0)
 			throws RegistryException {
 		// TODO Auto-generated method stub
-		return null;
+
+        EntityManager em = factory.createEntityManager();
+		em.getTransaction().begin();
+		
+		Query q = em.createQuery("SELECT w FROM Workflow_Data w WHERE w.workflow_instanceID = :workflow_ID");
+		q.setParameter("workflow_ID", arg0.getWorkflowInstanceId());
+		Workflow_Data wData = (Workflow_Data) q.getSingleResult();
+
+		q = em.createQuery("SELECT p FROM Node_Data p WHERE p.workflow_Data = :workflow_data AND p.node_id = :node_ID");
+		q.setParameter("workflow_data", wData);
+		q.setParameter("node_ID", arg0.getNodeId());
+		Node_Data nData = (Node_Data) q.getSingleResult();
+		nData.setOutputs(arg0.getValue());
+
+		em.getTransaction().commit();
+		em.close();
+
+		
+		return true;
 	}
 
 	@Override
-	public List<String> getWorkflowExecutionIdByUser(String user)
+	public boolean saveWorkflowExecutionStatus(String arg0, ExecutionStatus arg1)
 			throws RegistryException {
 		// TODO Auto-generated method stub
-		return null;
+		
+		EntityManager em = factory.createEntityManager();
+		em.getTransaction().begin();
+		
+		Query q = em.createQuery("SELECT w FROM Workflow_Data w WHERE w.workflow_instanceID = :workflow_ID");
+		q.setParameter("workflow_ID", arg0);
+		Workflow_Data wData = (Workflow_Data) q.getSingleResult();
+
+		wData.setStatus(arg1.toString());
+		em.persist(wData);
+		em.getTransaction().commit();
+		em.close();
+		
+		return true;
 	}
 
 	@Override
-	public List<WorkflowExecution> getWorkflowExecutionByUser(String user)
+	public boolean saveWorkflowExecutionUser(String arg0, String arg1)
 			throws RegistryException {
 		// TODO Auto-generated method stub
-		return null;
+		return false;
 	}
 
 	@Override
-	public List<WorkflowExecution> getWorkflowExecutionByUser(String user,
-			int pageSize, int pageNo) throws RegistryException {
+	public boolean saveWorkflowLastUpdateTime(String arg0, Timestamp arg1)
+			throws RegistryException {
 		// TODO Auto-generated method stub
-		return null;
+		return false;
 	}
 
 	@Override
-	public boolean saveWorkflowData(WorkflowRunTimeData runTimeData)
+	public boolean saveWorkflowNodeGramData(WorkflowNodeGramData arg0)
 			throws RegistryException {
 		// TODO Auto-generated method stub
-		return false;
+		
+		EntityManager em = factory.createEntityManager();
+		em.getTransaction().begin();
+		
+		Query q = em.createQuery("SELECT w FROM Workflow_Data w WHERE w.workflow_instanceID = :workflow_ID");
+		q.setParameter("workflow_ID", arg0);
+		Workflow_Data wData = (Workflow_Data) q.getSingleResult();
+		
+		q = em.createQuery("SELECT p FROM Node_Data p WHERE p.workflow_Data = :workflow_data AND p.node_id = :node_ID");
+		q.setParameter("workflow_data", wData);
+		q.setParameter("node_ID", arg0.getNodeID());
+		em.getTransaction().commit();
+		em.close();
+		
+		return true;
 	}
 
 	@Override
-	public boolean saveWorkflowStatus(String workflowInstanceID,
-			WorkflowInstanceStatus workflowStatus) throws RegistryException {
+	public boolean saveWorkflowNodeGramLocalJobID(String arg0, String arg1,
+			String arg2) throws RegistryException {
 		// TODO Auto-generated method stub
 		return false;
 	}
 
 	@Override
-	public boolean saveWorkflowLastUpdateTime(String workflowInstanceID,
-			Timestamp lastUpdateTime) throws RegistryException {
+	public boolean saveWorkflowNodeLastUpdateTime(String arg0, String arg1,
+			Timestamp arg2) throws RegistryException {
 		// TODO Auto-generated method stub
 		return false;
 	}
 
 	@Override
-	public boolean saveWorkflowNodeStatus(String workflowInstanceID,
-			String workflowNodeID, ExecutionStatus status)
-			throws RegistryException {
+	public boolean saveWorkflowNodeStatus(String arg0, String arg1,
+			ExecutionStatus arg2) throws RegistryException {
 		// TODO Auto-generated method stub
-		return false;
+		
+		EntityManager em = factory.createEntityManager();
+		em.getTransaction().begin();
+		
+		Query q = em.createQuery("SELECT w FROM Workflow_Data w WHERE w.workflow_instanceID = :workflow_ID");
+		q.setParameter("workflow_ID", arg0);
+		Workflow_Data wData = (Workflow_Data) q.getSingleResult();
+		
+		q = em.createQuery("SELECT p FROM Node_Data p WHERE p.workflow_Data = :workflow_data AND p.node_id = :node_ID");
+		q.setParameter("workflow_data", wData);
+		q.setParameter("node_ID", arg1);
+		Node_Data nData = (Node_Data) q.getSingleResult();
+		nData.setStatus(arg2.toString());
+		
+		em.getTransaction().commit();
+		em.close();
+		
+		return true;
 	}
 
 	@Override
-	public boolean saveWorkflowNodeLastUpdateTime(String workflowInstanceID,
-			String workflowNodeID, Timestamp lastUpdateTime)
+	public boolean saveWorkflowStatus(String arg0, WorkflowInstanceStatus arg1)
 			throws RegistryException {
 		// TODO Auto-generated method stub
 		return false;
 	}
 
 	@Override
-	public boolean saveWorkflowNodeGramData(
-			WorkflowNodeGramData workflowNodeGramData) throws RegistryException {
+	public List<WorkflowServiceIOData> searchWorkflowExecutionServiceInput(
+			String arg0, String arg1, String arg2) throws RegistryException {
 		// TODO Auto-generated method stub
-		return false;
+
+		return null;
 	}
 
 	@Override
-	public boolean saveWorkflowNodeGramLocalJobID(String workflowInstanceID,
-			String workflowNodeID, String localJobID) throws RegistryException {
+	public List<WorkflowServiceIOData> searchWorkflowExecutionServiceOutput(
+			String arg0, String arg1, String arg2) throws RegistryException {
 		// TODO Auto-generated method stub
-		return false;
+		return null;
 	}
-
 }

Modified: incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ProjectResource.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/ProjectResource.java?rev=1382342&r1=1382341&r2=1382342&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ProjectResource.java (original)
+++ incubator/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ProjectResource.java Sat Sep  8 18:51:20 2012
@@ -55,7 +55,7 @@ public class ProjectResource extends Abs
         if (type == ResourceType.EXPERIMENT) {
             ExperimentResource experimentResource = new ExperimentResource();
             experimentResource.setGateway(getGateway());
-            experimentResource.setProjectID(id);
+            experimentResource.setProject(this);
             experimentResource.setWorker(getWorker());
             return experimentResource;
         } else {
@@ -88,7 +88,7 @@ public class ProjectResource extends Abs
             q.setParameter("ex_name", name);
             Experiment experiment = (Experiment) q.getSingleResult();
             ExperimentResource experimentResource = new ExperimentResource(experiment.getExperiment_ID());
-            experimentResource.setProjectID(experiment.getProject().getProject_ID());
+            experimentResource.setProject(this);
             experimentResource.setWorker(getWorker());
             experimentResource.setGateway(getGateway());
             experimentResource.setSubmittedDate(experiment.getSubmitted_date());
@@ -103,7 +103,7 @@ public class ProjectResource extends Abs
         begin();
         Query q = em.createQuery("SELECT p FROM Project p WHERE p.project_name = :proj_name");
         q.setParameter("proj_name", keys[0]);
-        List resultList = q.getResultList();
+        List<?> resultList = q.getResultList();
         if (resultList.size() != 0) {
             for (Object result : resultList) {
                 Project project = (Project) result;
@@ -128,7 +128,7 @@ public class ProjectResource extends Abs
                 for (Object result : results) {
                     Experiment experiment = (Experiment) result;
                     ExperimentResource experimentResource = new ExperimentResource(experiment.getExperiment_ID());
-                    experimentResource.setProjectID(experiment.getProject().getProject_ID());
+                    experimentResource.setProject(this);
                     experimentResource.setGateway(new GatewayResource(experiment.getGateway().getGateway_name()));
                     experimentResource.setWorker(new WorkerResource(experiment.getUser().getUser_name(), experimentResource.getGateway()));
                     experimentResource.setSubmittedDate(experiment.getSubmitted_date());

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=1382342&r1=1382341&r2=1382342&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 Sat Sep  8 18:51:20 2012
@@ -20,16 +20,13 @@
 */
 package org.apache.airavata.persistance.registry.jpa.resources;
 
+import java.util.ArrayList;
+import java.util.List;
+
 import org.apache.airavata.persistance.registry.jpa.Resource;
 import org.apache.airavata.persistance.registry.jpa.ResourceType;
-import org.apache.airavata.persistance.registry.jpa.model.Experiment;
-import org.apache.airavata.persistance.registry.jpa.model.User_Workflow;
 import org.apache.airavata.persistance.registry.jpa.model.Users;
 
-import javax.persistence.Query;
-import java.util.ArrayList;
-import java.util.List;
-
 public class UserResource extends AbstractResource {
     private String userName;
     private String password;
@@ -56,56 +53,10 @@ public class UserResource extends Abstra
     }
 
     public Resource create(ResourceType type) {
-        if(type == ResourceType.PROJECT){
-            ProjectResource projectResource = new ProjectResource();
-            projectResource.setUserName(userName);
-            return projectResource;
-        }else if (type == ResourceType.USER_WORKFLOW) {
-            UserWorkflowResource userWorkflowResource = new UserWorkflowResource();
-            userWorkflowResource.setUserName(userName);
-//            userWorkflowResource.setProjectID();
-            return userWorkflowResource;
-        } else if (type == ResourceType.EXPERIMENT) {
-            ExperimentResource experimentResource = new ExperimentResource();
-//            experimentResource.setProjectID(id);
-            experimentResource.setUserName(userName);
-            return experimentResource;
-        }else if(type == ResourceType.PUBLISHED_WORKFLOW){
-            PublishWorkflowResource publishWorkflowResource = new PublishWorkflowResource();
-            publishWorkflowResource.setCreatedUser(userName);
-            return publishWorkflowResource;
-        }else if(type == ResourceType.HOST_DESCRIPTOR){
-            HostDescriptorResource hostDescriptorResource = new HostDescriptorResource();
-            hostDescriptorResource.setUserName(userName);
-            return hostDescriptorResource;
-        } else if (type == ResourceType.SERVICE_DESCRIPTOR){
-            ServiceDescriptorResource serviceDescriptorResource = new ServiceDescriptorResource();
-            serviceDescriptorResource.setUserName(userName);
-            return serviceDescriptorResource;
-        } else if(type == ResourceType.APPLICATION_DESCRIPTOR){
-            ApplicationDescriptorResource applicationDescriptorResource = new ApplicationDescriptorResource();
-            applicationDescriptorResource.setUpdatedUser(userName);
-            return applicationDescriptorResource;
-        }else {
-            return null;
-        }
+        return null;
     }
 
     public void remove(ResourceType type, Object name) {
-        begin();
-        if (type == ResourceType.USER_WORKFLOW) {
-            Query q = em.createQuery("Delete p FROM User_Workflow p WHERE p.owner = :owner and p.user_workflow_name = :usrwf_name and p.gateway_name =: gate_name");
-            q.setParameter("owner", userName);
-            q.setParameter("usrwf_name", name);
-            q.setParameter("gate_name", gatewayName);
-            q.executeUpdate();
-        } else if (type == ResourceType.EXPERIMENT) {
-            Query q = em.createQuery("Delete p FROM Experiment p WHERE p.user_name = :usr_name and p.experiment_ID = :ex_name");
-            q.setParameter("user_name", userName);
-            q.setParameter("ex_name", name);
-            q.executeUpdate();
-        }
-        end();
 
     }
 
@@ -114,34 +65,6 @@ public class UserResource extends Abstra
     }
 
     public Resource get(ResourceType type, Object name) {
-        begin();
-        if (type == ResourceType.USER_WORKFLOW) {
-            Query q = em.createQuery("SELECT p FROM User_Workflow p WHERE p.owner = :usr_name and p.user_workflow_name = :usrwf_name and p.gateway_name =:gate_name");
-            q.setParameter("user_name", userName);
-            q.setParameter("usrwf_name", name);
-            q.setParameter("gate_name", gatewayName);
-            User_Workflow userWorkflow = (User_Workflow) q.getSingleResult();
-            UserWorkflowResource userWorkflowResource = new UserWorkflowResource(userWorkflow.getGateway().getGateway_name(), userName, userWorkflow.getTemplate_name());
-            userWorkflowResource.setContent(userWorkflow.getWorkflow_graph());
-            userWorkflowResource.setLastUpdateDate(userWorkflow.getLast_updated_date());
-            end();
-            return userWorkflowResource;
-        } else if (type == ResourceType.EXPERIMENT) {
-            Query q = em.createQuery("SELECT p FROM Experiment p WHERE p.user_name = :usr_name and p.experiment_ID = :ex_name");
-            q.setParameter("user_name", userName);
-            q.setParameter("ex_name", name);
-            Experiment experiment = (Experiment) q.getSingleResult();
-            ExperimentResource experimentResource = new ExperimentResource(experiment.getExperiment_ID());
-            experimentResource.setProjectID(experiment.getProject().getProject_ID());
-            Users user = new Users();
-            user.setUser_name(userName);
-            user.setPassword(password);
-            experiment.setUser(user);
-            experiment.setSubmitted_date(experiment.getSubmitted_date());
-            experiment.setUser(experiment.getUser());
-            end();
-            return experimentResource;
-        }
         return null;
     }
 
@@ -151,43 +74,12 @@ public class UserResource extends Abstra
 
     public List<Resource> get(ResourceType type) {
         List<Resource> resourceList = new ArrayList<Resource>();
-        begin();
-        if (type == ResourceType.USER_WORKFLOW) {
-            Query q = em.createQuery("SELECT p FROM User_Workflow p WHERE p.user_name = :usr_name");
-            q.setParameter("user_name", userName);
-            List results = q.getResultList();
-            if (results.size() != 0) {
-                for (Object result : results) {
-                    User_Workflow userWorkflow = (User_Workflow) result;
-                    UserWorkflowResource userWorkflowResource = new UserWorkflowResource(userWorkflow.getGateway().getGateway_name(), userWorkflow.getUser().getUser_name(), userWorkflow.getTemplate_name());
-                    userWorkflowResource.setContent(userWorkflow.getWorkflow_graph());
-                    userWorkflowResource.setLastUpdateDate(userWorkflow.getLast_updated_date());
-                    resourceList.add(userWorkflowResource);
-                }
-            }
-        } else if (type == ResourceType.EXPERIMENT) {
-            Query q = em.createQuery("SELECT p FROM Experiment p WHERE p.user_name = :usr_name");
-            q.setParameter("user_name", userName);
-            List results = q.getResultList();
-            if (results.size() != 0) {
-                for (Object result : results) {
-                    Experiment experiment = (Experiment) result;
-                    ExperimentResource experimentResource = new ExperimentResource(experiment.getExperiment_ID());
-                    experimentResource.setProjectID(experiment.getProject().getProject_ID());
-                    experimentResource.setUserName(experiment.getUser().getUser_name());
-                    experimentResource.setSubmittedDate(experiment.getSubmitted_date());
-                    resourceList.add(experimentResource);
-                }
-            }
-        }
-        end();
         return resourceList;
     }
 
     public void save() {
         begin();
         Users user = new Users();
-
         user.setUser_name(userName);
         user.setPassword(password);
 
@@ -195,28 +87,7 @@ public class UserResource extends Abstra
         end();
     }
 
-    public void save(boolean isAppendable) {
-
-    }
-
     public boolean isExists(ResourceType type, Object name) {
-        begin();
-        if (type == ResourceType.USER_WORKFLOW) {
-            Query q = em.createQuery("SELECT p FROM User_Workflow p WHERE p.gateway_name =:gate_name and p.user_name = :usr_name and p.user_workflow_name =:usr_wf_name");
-            q.setParameter("gate_name", gatewayName);
-            q.setParameter("user_name", userName);
-            q.setParameter("usr_wf_name", name);
-            User_Workflow userWorkflow = (User_Workflow) q.getSingleResult();
-            return userWorkflow != null;
-        } else if (type == ResourceType.EXPERIMENT) {
-            Query q = em.createQuery("SELECT p FROM Experiment p WHERE p.gateway_name =:gate_name and p.user_name = :usr_name and p.experiment_ID =:experimentID");
-            q.setParameter("gate_name", gatewayName);
-            q.setParameter("user_name", userName);
-            q.setParameter("experimentID", name);
-            Experiment experiment = (Experiment) q.getSingleResult();
-            return experiment != null;
-        }
-        end();
         return false;
     }
 



Mime
View raw message