airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lah...@apache.org
Subject svn commit: r1188765 - in /incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api: Registry.java impl/JCRRegistry.java
Date Tue, 25 Oct 2011 16:34:24 GMT
Author: lahiru
Date: Tue Oct 25 16:34:24 2011
New Revision: 1188765

URL: http://svn.apache.org/viewvc?rev=1188765&view=rev
Log:
adding new methods to registry api to save inputs and outputs.

Modified:
    incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/Registry.java
    incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/impl/JCRRegistry.java

Modified: incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/Registry.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/Registry.java?rev=1188765&r1=1188764&r2=1188765&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/Registry.java
(original)
+++ incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/Registry.java
Tue Oct 25 16:34:24 2011
@@ -221,5 +221,7 @@ public interface Registry {
      */
     public String getName();
 
-    public boolean saveWorkflowData(String data,String experimentId,String nodeId);
+    public boolean saveWorkflowInput(String data, String experimentId, String nodeId,String
workflowName);
+
+    public boolean saveWorkflowOutput(String data,String experimentId,String nodeId,String
workflowName);
 }

Modified: incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/impl/JCRRegistry.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/impl/JCRRegistry.java?rev=1188765&r1=1188764&r2=1188765&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/impl/JCRRegistry.java
(original)
+++ incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/impl/JCRRegistry.java
Tue Oct 25 16:34:24 2011
@@ -78,9 +78,11 @@ public class JCRRegistry extends Observa
 	public static final String PUBLIC = "PUBLIC";
 	public static final String REGISTRY_TYPE_WORKFLOW = "workflow";
 	public static final int GFAC_URL_UPDATE_INTERVAL = 1000 * 60 * 60 * 3;
-	public static final String WORKFLOW_DATA = "WorkflowData";
+    public static final String WORKFLOW_DATA = "experiments";
+    public static final String INPUT = "Input";
+    public static final String OUTPUT = "Output";
 
-	private Repository repository;
+    private Repository repository;
 	private Credentials credentials;
 	private UserManager userManager;
 	private String username;
@@ -856,16 +858,39 @@ public class JCRRegistry extends Observa
 		return repository.getDescriptor(Repository.REP_NAME_DESC);
 	}
 
-	public boolean saveWorkflowData(String data, String experimentId,
-			String nodeId) {
+	public boolean saveWorkflowInput(String data, String experimentId,
+                                     String nodeId,String workflowName) {
+			Session session = null;
+		try {
+			session = getSession();
+			Node workflowDataNode =
+					getOrAddNode(getOrAddNode(
+							getOrAddNode(session.getRootNode(), WORKFLOW_DATA),
+							experimentId),experimentId);
+            workflowDataNode.setProperty("workflowName",workflowName);
+            workflowDataNode = getOrAddNode(getOrAddNode(workflowDataNode,nodeId), OUTPUT);
+            workflowDataNode.setProperty("content", data);
+            session.save();
+		} catch (Exception e) {
+			e.printStackTrace();
+		} finally {
+			closeSession(session);
+			return true;
+		}
+	}
+
+    public boolean saveWorkflowOutput(String data, String experimentId,
+                                     String nodeId,String workflowName) {
 		Session session = null;
 		try {
 			session = getSession();
-			Node workflowDataNode = getOrAddNode(
-					getOrAddNode(
+			Node workflowDataNode =
+					getOrAddNode(getOrAddNode(
 							getOrAddNode(session.getRootNode(), WORKFLOW_DATA),
-							experimentId), nodeId);
-			workflowDataNode.setProperty("content", data);
+							experimentId),experimentId);
+            workflowDataNode.setProperty("workflowName",workflowName);
+            workflowDataNode = getOrAddNode(getOrAddNode(workflowDataNode,nodeId), INPUT);
+            workflowDataNode.setProperty("content", data);
             session.save();
 		} catch (Exception e) {
 			e.printStackTrace();



Mime
View raw message