airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From samin...@apache.org
Subject svn commit: r1234155 - in /incubator/airavata/trunk/modules: commons/ commons/registry-api/src/main/java/org/apache/airavata/registry/api/ commons/registry-api/src/main/java/org/apache/airavata/registry/api/impl/ commons/registry-api/src/main/java/org/...
Date Fri, 20 Jan 2012 21:42:59 GMT
Author: samindaw
Date: Fri Jan 20 21:42:59 2012
New Revision: 1234155

URL: http://svn.apache.org/viewvc?rev=1234155&view=rev
Log:
Updating airavataregistry api etc.

Added:
    incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/WorkflowExecution.java
    incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/WorkflowExecutionStatus.java
    incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/impl/WorkflowExecutionImpl.java
    incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowServiceIOData.java
Modified:
    incubator/airavata/trunk/modules/commons/pom.xml
    incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/AiravataRegistry.java
    incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/impl/AiravataJCRRegistry.java
    incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowIOData.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/provenance/ProvenanceWrite.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/model/XBayaWorkflowExperiments.java

Modified: incubator/airavata/trunk/modules/commons/pom.xml
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/pom.xml?rev=1234155&r1=1234154&r2=1234155&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/commons/pom.xml (original)
+++ incubator/airavata/trunk/modules/commons/pom.xml Fri Jan 20 21:42:59 2012
@@ -90,7 +90,7 @@
 			</activation>
 			<modules>
 				<module>workflow-tracking</module>
-				<module>gfac-schema</module>
+				<!--module>gfac-schema</module-->
 				<module>utils</module>
 				<module>common-registry-api</module>
 				<module>registry-api</module>

Modified: incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/AiravataRegistry.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/AiravataRegistry.java?rev=1234155&r1=1234154&r2=1234155&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/AiravataRegistry.java
(original)
+++ incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/AiravataRegistry.java
Fri Jan 20 21:42:59 2012
@@ -37,6 +37,7 @@ import org.apache.airavata.registry.api.
 import org.apache.airavata.registry.api.exception.HostDescriptionRetrieveException;
 import org.apache.airavata.registry.api.exception.ServiceDescriptionRetrieveException;
 import org.apache.airavata.registry.api.workflow.WorkflowIOData;
+import org.apache.airavata.registry.api.workflow.WorkflowServiceIOData;
 
 public interface AiravataRegistry extends Registry{
     /**
@@ -213,30 +214,32 @@ public interface AiravataRegistry extend
 
     public void deleteHostDescription(String hostId) throws RegistryException;
 
-    public boolean saveWorkflowExecutionServiceInput(WorkflowIOData workflowInputData) throws
RegistryException;
+    public boolean saveWorkflowExecutionServiceInput(WorkflowServiceIOData workflowInputData)
throws RegistryException;
 
-    public boolean saveWorkflowExecutionServiceOutput(WorkflowIOData workflowOutputData)throws
RegistryException;
+    public boolean saveWorkflowExecutionServiceOutput(WorkflowServiceIOData workflowOutputData)throws
RegistryException;
     
-    public List<WorkflowIOData> searchWorkflowExecutionServiceInput(String experimentIdRegEx,
String workflowNameRegEx, String nodeNameRegEx)throws RegistryException;
+    public List<WorkflowServiceIOData> searchWorkflowExecutionServiceInput(String experimentIdRegEx,
String workflowNameRegEx, String nodeNameRegEx)throws RegistryException;
 
-    public List<WorkflowIOData> searchWorkflowExecutionServiceOutput(String experimentIdRegEx,
String workflowNameRegEx, String nodeNameRegEx)throws RegistryException;
+    public List<WorkflowServiceIOData> searchWorkflowExecutionServiceOutput(String
experimentIdRegEx, String workflowNameRegEx, String nodeNameRegEx)throws RegistryException;
 
     public boolean saveWorkflowExecutionStatus(String experimentId,String status)throws RegistryException;
 
-    public String getWorkflowExecutionStatus(String experimentId)throws RegistryException;
-
-    public Map<String,String> getWorkflowExecutionStatusWithRegex(String regex) throws
RegistryException;
+    public WorkflowExecutionStatus getWorkflowExecutionStatus(String experimentId)throws
RegistryException;
 
     public boolean saveWorkflowExecutionOutput(String experimentId,String outputNodeName,String
output) throws RegistryException;
+    
+    public boolean saveWorkflowExecutionOutput(String experimentId, WorkflowIOData data)
throws RegistryException;
 
-    public String getWorkflowExecutionOutput(String experimentId,String outputNodeName) throws
RegistryException;
-
-    public Map<String,String> getWorkflowExecutionOutputWithRegex(String experimentIdRegex,String
outputName)throws  RegistryException;
+    public WorkflowIOData getWorkflowExecutionOutput(String experimentId,String outputNodeName)
throws RegistryException;
+    
+    public List<WorkflowIOData> getWorkflowExecutionOutput(String experimentId) throws
RegistryException;
 
     public String[] getWorkflowExecutionOutputNames(String exeperimentId) throws RegistryException;
 
-    public Map<String,String[]> getWorkflowExecutionOutputNamesWithRegex(String experiementId)
throws  RegistryException;
-    
     public boolean saveWorkflowExecutionUser(String experimentId, String user) throws RegistryException;
+    
+    public String getWorkflowExecutionUser(String experimentId) throws RegistryException;
+    
+    public WorkflowExecution getWorkflowExection(String experimentId) throws RegistryException;
 
 }

Added: incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/WorkflowExecution.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/WorkflowExecution.java?rev=1234155&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/WorkflowExecution.java
(added)
+++ incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/WorkflowExecution.java
Fri Jan 20 21:42:59 2012
@@ -0,0 +1,51 @@
+/*
+ *
+ * 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;
+
+import java.util.List;
+
+import org.apache.airavata.registry.api.workflow.WorkflowIOData;
+import org.apache.airavata.registry.api.workflow.WorkflowServiceIOData;
+
+public interface WorkflowExecution {
+	public String getExperimentId();
+	public String getTopic();
+	public WorkflowExecutionStatus getExecutionStatus();
+	public String getUser();
+	public List<WorkflowServiceIOData> getServiceInput();
+	public List<WorkflowServiceIOData> getServiceOutput();
+	public List<WorkflowIOData> getOutput();
+	public WorkflowServiceIOData getServiceInput(String nodeId);
+	public WorkflowServiceIOData getServiceOutput(String nodeId);
+	public WorkflowIOData getOutput(String nodeId);
+
+	public void setExperimentId(String experimentId);
+	public void setTopic(String topic);
+	public void setExecutionStatus(WorkflowExecutionStatus executionStatus);
+	public void setUser(String user);
+	public void setServiceInput(List<WorkflowServiceIOData> serviceInputs);
+	public void setServiceOutput(List<WorkflowServiceIOData> serviceOutputs);
+	public void setOutput(List<WorkflowIOData> outputs);
+	public void addServiceInput(WorkflowServiceIOData serviceInput);
+	public void addServiceOutput(WorkflowServiceIOData serviceOutput);
+	public void addOutput(WorkflowIOData output);
+}

Added: incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/WorkflowExecutionStatus.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/WorkflowExecutionStatus.java?rev=1234155&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/WorkflowExecutionStatus.java
(added)
+++ incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/WorkflowExecutionStatus.java
Fri Jan 20 21:42:59 2012
@@ -0,0 +1,62 @@
+/*
+ *
+ * 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;
+
+import java.util.Date;
+
+public class WorkflowExecutionStatus {
+	public enum ExecutionStatus {
+		STARTED,
+		RUNNING,
+		ERROR,
+		STOPPED,
+		UNKNOWN
+	}
+
+	private ExecutionStatus executionStatus;
+	private Date statusUpdateTime=null;
+	
+	public ExecutionStatus getExecutionStatus() {
+		return executionStatus;
+	}
+
+	public void setExecutionStatus(ExecutionStatus executionStatus) {
+		this.executionStatus = executionStatus;
+	}
+
+	public Date getStatusUpdateTime() {
+		return statusUpdateTime;
+	}
+
+	public void setStatusUpdateTime(Date statusUpdateTime) {
+		this.statusUpdateTime = statusUpdateTime;
+	}
+
+	public WorkflowExecutionStatus(ExecutionStatus executionStatus) {
+		this(executionStatus,null);
+	}
+	
+	public WorkflowExecutionStatus(ExecutionStatus executionStatus, Date statusUpdateTime) {
+		setExecutionStatus(executionStatus);
+		setStatusUpdateTime(statusUpdateTime);
+	}
+}

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=1234155&r1=1234154&r2=1234155&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
Fri Jan 20 21:42:59 2012
@@ -23,14 +23,15 @@ package org.apache.airavata.registry.api
 
 import java.net.URI;
 import java.sql.Timestamp;
+import java.text.DateFormat;
 import java.util.ArrayList;
 import java.util.Calendar;
+import java.util.Date;
 import java.util.HashMap;
 import java.util.Hashtable;
 import java.util.List;
 import java.util.Map;
 import java.util.TimeZone;
-import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
 import javax.jcr.Node;
@@ -53,10 +54,14 @@ import org.apache.airavata.commons.gfac.
 import org.apache.airavata.commons.gfac.wsdl.WSDLGenerator;
 import org.apache.airavata.registry.api.Axis2Registry;
 import org.apache.airavata.registry.api.DataRegistry;
+import org.apache.airavata.registry.api.WorkflowExecution;
+import org.apache.airavata.registry.api.WorkflowExecutionStatus;
+import org.apache.airavata.registry.api.WorkflowExecutionStatus.ExecutionStatus;
 import org.apache.airavata.registry.api.exception.DeploymentDescriptionRetrieveException;
 import org.apache.airavata.registry.api.exception.HostDescriptionRetrieveException;
 import org.apache.airavata.registry.api.exception.ServiceDescriptionRetrieveException;
 import org.apache.airavata.registry.api.workflow.WorkflowIOData;
+import org.apache.airavata.registry.api.workflow.WorkflowServiceIOData;
 import org.apache.airavata.schemas.gfac.MethodType;
 import org.apache.airavata.schemas.gfac.PortTypeType;
 import org.apache.airavata.schemas.gfac.ServiceType;
@@ -87,6 +92,8 @@ public class AiravataJCRRegistry extends
     public static final String OUTPUT = "Output";
     public static final String RESULT = "Result";
     public static final String WORKFLOW_STATUS_PROPERTY = "Status";
+    public static final String WORKFLOW_STATUS_TIME_PROPERTY = "Status_Time";
+    public static final String WORKFLOW_USER_PROPERTY = "User";
 
     private static Logger log = LoggerFactory.getLogger(AiravataJCRRegistry.class);
 
@@ -799,16 +806,16 @@ public class AiravataJCRRegistry extends
         return false;
     }
 
-    public boolean saveWorkflowExecutionServiceInput(WorkflowIOData workflowInputData) throws
RegistryException{
+    public boolean saveWorkflowExecutionServiceInput(WorkflowServiceIOData workflowInputData)
throws RegistryException{
         return saveWorkflowIO(workflowInputData, INPUT);
     }
 
-    public boolean saveWorkflowExecutionServiceOutput(WorkflowIOData workflowOutputData)
throws RegistryException{
+    public boolean saveWorkflowExecutionServiceOutput(WorkflowServiceIOData workflowOutputData)
throws RegistryException{
         return saveWorkflowIO(workflowOutputData, OUTPUT);
     }
 
 
-    private boolean saveWorkflowIO(WorkflowIOData workflowOutputData, String type) throws
RegistryException{
+    private boolean saveWorkflowIO(WorkflowServiceIOData workflowOutputData, String type)
throws RegistryException{
         Session session = null;
         boolean isSaved = true;
         try {
@@ -816,7 +823,7 @@ public class AiravataJCRRegistry extends
             Node workflowDataNode = getWorkflowExperimentDataNode(workflowOutputData.getExperimentId(),session);
             workflowDataNode.setProperty(PROPERTY_WORKFLOW_NAME, workflowOutputData.getWorkflowName());
             workflowDataNode = getOrAddNode(getOrAddNode(workflowDataNode, workflowOutputData.getNodeId()),
type);
-            workflowDataNode.setProperty(PROPERTY_WORKFLOW_IO_CONTENT, workflowOutputData.getData());
+            workflowDataNode.setProperty(PROPERTY_WORKFLOW_IO_CONTENT, workflowOutputData.getValue());
             session.save();
         } catch (Exception e) {
             isSaved = false;
@@ -827,19 +834,19 @@ public class AiravataJCRRegistry extends
         return isSaved;
     }
 
-    public List<WorkflowIOData> searchWorkflowExecutionServiceInput(String experimentIdRegEx,
String workflowNameRegEx,
+    public List<WorkflowServiceIOData> searchWorkflowExecutionServiceInput(String experimentIdRegEx,
String workflowNameRegEx,
             String nodeNameRegEx) throws RegistryException{
         return searchWorkflowIO(experimentIdRegEx, workflowNameRegEx, nodeNameRegEx, INPUT);
     }
 
-    public List<WorkflowIOData> searchWorkflowExecutionServiceOutput(String experimentIdRegEx,
String workflowNameRegEx,
+    public List<WorkflowServiceIOData> searchWorkflowExecutionServiceOutput(String
experimentIdRegEx, String workflowNameRegEx,
             String nodeNameRegEx) throws RegistryException{
         return searchWorkflowIO(experimentIdRegEx, workflowNameRegEx, nodeNameRegEx, OUTPUT);
     }
 
-    private List<WorkflowIOData> searchWorkflowIO(String experimentIdRegEx, String
workflowNameRegEx,
+    private List<WorkflowServiceIOData> searchWorkflowIO(String experimentIdRegEx,
String workflowNameRegEx,
             String nodeNameRegEx, String type) throws RegistryException{
-        List<WorkflowIOData> workflowIODataList = new ArrayList<WorkflowIOData>();
+        List<WorkflowServiceIOData> workflowIODataList = new ArrayList<WorkflowServiceIOData>();
         Session session = null;
         try {
             session = getSession();
@@ -864,12 +871,12 @@ public class AiravataJCRRegistry extends
                             continue;
                         }
                         Node ioNode = getOrAddNode(serviceNode, type);
-                        WorkflowIOData workflowIOData = new WorkflowIOData();
+                        WorkflowServiceIOData workflowIOData = new WorkflowServiceIOData();
                         workflowIOData.setExperimentId(experimentNode.getName());
                         workflowIOData.setWorkflowId(workflowNode.getName());
                         workflowIOData.setWorkflowName(workflowName);
                         workflowIOData.setNodeId(serviceNode.getName());
-                        workflowIOData.setData(ioNode.getProperty(PROPERTY_WORKFLOW_IO_CONTENT).getString());
+                        workflowIOData.setValue(ioNode.getProperty(PROPERTY_WORKFLOW_IO_CONTENT).getString());
                         workflowIODataList.add(workflowIOData);
                     }
                 }
@@ -899,16 +906,22 @@ public class AiravataJCRRegistry extends
         return isSaved;
     }
 
-    public String getWorkflowExecutionStatus(String experimentId)throws RegistryException{
-       Session session = null;
-        String property = null;
+    public WorkflowExecutionStatus getWorkflowExecutionStatus(String experimentId)throws
RegistryException{
+    	Session session = null;
+    	WorkflowExecutionStatus property = null;
         try {
             session = getSession();
             Node workflowDataNode = getWorkflowExperimentDataNode(experimentId, session);
-            property = workflowDataNode.getProperty(WORKFLOW_STATUS_PROPERTY).getString();
+            ExecutionStatus status = ExecutionStatus.valueOf(workflowDataNode.getProperty(WORKFLOW_STATUS_PROPERTY).getString());
+            String dateString = workflowDataNode.getProperty(WORKFLOW_STATUS_TIME_PROPERTY).getString();
+			Date date=null;
+			if (dateString!=null) {
+				date = DateFormat.getInstance().parse(dateString);
+			}
+			property=new WorkflowExecutionStatus(status, date);
             session.save();
         } catch (Exception e) {
-            e.printStackTrace();
+            throw new RegistryException("Error while retrieving workflow execution status!!!",
e);
         } finally {
             closeSession(session);
         }
@@ -938,7 +951,7 @@ public class AiravataJCRRegistry extends
 	    return true;
 	}
 
-    public String getWorkflowExecutionOutput(String experimentId,String outputNodeName) throws
RegistryException{
+    public WorkflowIOData getWorkflowExecutionOutput(String experimentId,String outputNodeName)
throws RegistryException{
 		Session session=null;
 		try {
 			session = getSession();
@@ -948,7 +961,7 @@ public class AiravataJCRRegistry extends
 			if (outputProperty==null){
 				return null;
 			}
-			return outputProperty.getString();
+			return new WorkflowIOData(outputNodeName,outputProperty.getString());
 		} catch (RepositoryException e) {
 			e.printStackTrace();
 			throw new RegistryException(e);
@@ -1000,14 +1013,14 @@ public class AiravataJCRRegistry extends
         }
         return matchList;
     }
-    public Map<String, String> getWorkflowExecutionStatusWithRegex(String regex) throws
RegistryException {
+    public Map<String, WorkflowExecutionStatus> getWorkflowExecutionStatusWithRegex(String
regex) throws RegistryException {
         Session session=null;
-        Map<String,String> workflowStatusMap = new HashMap<String, String>();
+        Map<String,WorkflowExecutionStatus> workflowStatusMap = new HashMap<String,
WorkflowExecutionStatus>();
         try {
             session = getSession();
             List<String> matchingExperimentIds = getMatchingExperimentIds(regex, session);
             for(String experimentId:matchingExperimentIds){
-                String workflowStatus = getWorkflowExecutionStatus(experimentId);
+                WorkflowExecutionStatus workflowStatus = getWorkflowExecutionStatus(experimentId);
                 workflowStatusMap.put(experimentId,workflowStatus);
             }
 		} catch (RepositoryException e) {
@@ -1019,14 +1032,14 @@ public class AiravataJCRRegistry extends
         return workflowStatusMap;
     }
 
-    public Map<String, String> getWorkflowExecutionOutputWithRegex(String regex, String
outputName) throws RegistryException {
+    public Map<String, WorkflowIOData> getWorkflowExecutionOutputWithRegex(String regex,
String outputName) throws RegistryException {
         Session session=null;
-        Map<String,String> workflowStatusMap = new HashMap<String, String>();
+        Map<String,WorkflowIOData> workflowStatusMap = new HashMap<String, WorkflowIOData>();
         try {
             session = getSession();
             List<String> matchingExperimentIds = getMatchingExperimentIds(regex, session);
             for(String experimentId:matchingExperimentIds){
-                String workflowOutputData = getWorkflowExecutionOutput(experimentId,outputName);
+            	WorkflowIOData workflowOutputData = getWorkflowExecutionOutput(experimentId,outputName);
                 workflowStatusMap.put(experimentId,workflowOutputData);
             }
 		} catch (RepositoryException e) {
@@ -1059,6 +1072,63 @@ public class AiravataJCRRegistry extends
 
 	public boolean saveWorkflowExecutionUser(String experimentId, String user)
 			throws RegistryException {
-		return false;
+		Session session = null;
+        boolean isSaved = true;
+        try {
+            session = getSession();
+            Node workflowDataNode = getWorkflowExperimentDataNode(experimentId, session);
+            workflowDataNode.setProperty(WORKFLOW_USER_PROPERTY,user);
+            session.save();
+        } catch (Exception e) {
+            isSaved = false;
+            e.printStackTrace();
+        } finally {
+            closeSession(session);
+        }
+        return isSaved;
+	}
+
+	public boolean saveWorkflowExecutionOutput(String experimentId,WorkflowIOData data)
+			throws RegistryException {
+		return saveWorkflowExecutionOutput(experimentId, data.getNodeId(), data.getValue());
+	}
+
+	public String getWorkflowExecutionUser(String experimentId)
+			throws RegistryException {
+		Session session = null;
+        String property = null;
+        try {
+            session = getSession();
+            Node workflowDataNode = getWorkflowExperimentDataNode(experimentId, session);
+            property = workflowDataNode.getProperty(WORKFLOW_USER_PROPERTY).getString();
+            session.save();
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+            closeSession(session);
+        }
+        return property;
+	}
+
+	public WorkflowExecution getWorkflowExection(String experimentId)
+			throws RegistryException {
+		WorkflowExecution workflowExecution = new WorkflowExecutionImpl();
+		workflowExecution.setExperimentId(experimentId);
+		workflowExecution.setExecutionStatus(getWorkflowExecutionStatus(experimentId));
+		workflowExecution.setUser(getWorkflowExecutionUser(experimentId));
+		workflowExecution.setOutput(getWorkflowExecutionOutput(experimentId));
+		workflowExecution.setServiceInput(searchWorkflowExecutionServiceInput(experimentId,".*",".*"));
+		workflowExecution.setServiceOutput(searchWorkflowExecutionServiceOutput(experimentId,".*",".*"));
+		return null;
+	}
+
+	public List<WorkflowIOData> getWorkflowExecutionOutput(String experimentId)
+			throws RegistryException {
+		List<WorkflowIOData> result=new ArrayList<WorkflowIOData>();
+		String[] workflowExecutionOutputNames = getWorkflowExecutionOutputNames(experimentId);
+		for (String workflowExecutionOutputName : workflowExecutionOutputNames) {
+			result.add(getWorkflowExecutionOutput(experimentId, workflowExecutionOutputName));
+		}
+		return result;
 	}
 }

Added: incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/impl/WorkflowExecutionImpl.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/impl/WorkflowExecutionImpl.java?rev=1234155&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/impl/WorkflowExecutionImpl.java
(added)
+++ incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/impl/WorkflowExecutionImpl.java
Fri Jan 20 21:42:59 2012
@@ -0,0 +1,121 @@
+/*
+ *
+ * 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.impl;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.airavata.registry.api.WorkflowExecution;
+import org.apache.airavata.registry.api.WorkflowExecutionStatus;
+import org.apache.airavata.registry.api.workflow.WorkflowIOData;
+import org.apache.airavata.registry.api.workflow.WorkflowServiceIOData;
+
+public class WorkflowExecutionImpl implements WorkflowExecution{
+	private WorkflowExecutionStatus executionStatus;
+	private String user;
+	private List<WorkflowServiceIOData> serviceInput;
+	private List<WorkflowServiceIOData> serviceOutput;
+	private List<WorkflowIOData> output;
+	private String experimentId;
+	
+	public String getExperimentId() {
+		return experimentId;
+	}
+	public void setExperimentId(String experimentId) {
+		this.experimentId = experimentId;
+	}
+	public String getTopic() {
+		return experimentId;
+	}
+	public void setTopic(String topic) {
+		this.experimentId = topic;
+	}
+	public WorkflowExecutionStatus getExecutionStatus() {
+		return executionStatus;
+	}
+	public void setExecutionStatus(WorkflowExecutionStatus executionStatus) {
+		this.executionStatus = executionStatus;
+	}
+	public String getUser() {
+		return user;
+	}
+	public void setUser(String user) {
+		this.user = user;
+	}
+	public List<WorkflowServiceIOData> getServiceInput() {
+		if (serviceInput==null){
+			serviceInput=new ArrayList<WorkflowServiceIOData>();
+		}
+		return serviceInput;
+	}
+	public void setServiceInput(List<WorkflowServiceIOData> serviceInput) {
+		this.serviceInput = serviceInput;
+	}
+	public List<WorkflowServiceIOData> getServiceOutput() {
+		if (serviceOutput==null){
+			serviceOutput=new ArrayList<WorkflowServiceIOData>();
+		}
+		return serviceOutput;
+	}
+	public void setServiceOutput(List<WorkflowServiceIOData> serviceOutput) {
+		this.serviceOutput = serviceOutput;
+	}
+	public List<WorkflowIOData> getOutput() {
+		if (output==null){
+			output=new ArrayList<WorkflowIOData>();
+		}
+		return output;
+	}
+	public void setOutput(List<WorkflowIOData> output) {
+		this.output = output;
+	}
+	
+	public void addServiceInput(WorkflowServiceIOData serviceInput) {
+		getServiceInput().add(serviceInput);
+	}
+	public void addServiceOutput(WorkflowServiceIOData serviceOutput) {
+		getServiceOutput().add(serviceOutput);
+	}
+	public void addOutput(WorkflowIOData output) {
+		getOutput().add(output);
+	}
+	
+	public WorkflowServiceIOData getServiceInput(String nodeId) {
+		return (WorkflowServiceIOData)getIOData(nodeId, getServiceInput());
+	}
+	public WorkflowServiceIOData getServiceOutput(String nodeId) {
+		return (WorkflowServiceIOData)getIOData(nodeId, getServiceOutput());
+	}
+	public WorkflowIOData getOutput(String nodeId) {
+		return (WorkflowServiceIOData)getIOData(nodeId, getOutput());
+	}
+
+	private WorkflowIOData getIOData(String nodeId, List<?> list) {
+		for (Object data : list) {
+			WorkflowIOData iodata=(WorkflowIOData)data;
+			if (iodata.getNodeId().equals(nodeId)){
+				return iodata;
+			}
+		}
+		return null;
+	}
+}

Modified: incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowIOData.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowIOData.java?rev=1234155&r1=1234154&r2=1234155&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowIOData.java
(original)
+++ incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowIOData.java
Fri Jan 20 21:42:59 2012
@@ -22,42 +22,23 @@
 package org.apache.airavata.registry.api.workflow;
 
 public class WorkflowIOData {
-	private String data; 
-	private String experimentId;
+	private String value; 
     private String nodeId;
-    private String workflowName;
-    private String workflowId;
     
     public WorkflowIOData() {
 	}
     
-	public WorkflowIOData(String data, String experimentId, String workflowId,
-            String nodeId,String workflowName) {
-		setData(data);
-		setExperimentId(experimentId);
-		setWorkflowId(workflowId);
+	public WorkflowIOData(String nodeId,String value) {
+		setValue(value);
 		setNodeId(nodeId);
-		setWorkflowName(workflowName);
 	}
 
-	public WorkflowIOData(String data, String experimentId,
-            String nodeId,String workflowName) {
-		this(data, experimentId, experimentId, nodeId, workflowName);
-	}
-	public String getData() {
-		return data;
-	}
-
-	public void setData(String data) {
-		this.data = data;
+	public String getValue() {
+		return value;
 	}
 
-	public String getExperimentId() {
-		return experimentId;
-	}
-
-	public void setExperimentId(String experimentId) {
-		this.experimentId = experimentId;
+	public void setValue(String value) {
+		this.value = value;
 	}
 
 	public String getNodeId() {
@@ -68,19 +49,4 @@ public class WorkflowIOData {
 		this.nodeId = nodeId;
 	}
 
-	public String getWorkflowName() {
-		return workflowName;
-	}
-
-	public void setWorkflowName(String workflowName) {
-		this.workflowName = workflowName;
-	}
-
-	public String getWorkflowId() {
-		return workflowId;
-	}
-
-	public void setWorkflowId(String workflowId) {
-		this.workflowId = workflowId;
-	}
 }

Added: incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowServiceIOData.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowServiceIOData.java?rev=1234155&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowServiceIOData.java
(added)
+++ incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowServiceIOData.java
Fri Jan 20 21:42:59 2012
@@ -0,0 +1,68 @@
+/*
+ *
+ * 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.workflow;
+
+public class WorkflowServiceIOData extends WorkflowIOData {
+	private String experimentId;
+    private String workflowName;
+    private String workflowId;
+    
+    public WorkflowServiceIOData() {
+	}
+    
+	public WorkflowServiceIOData(String data, String experimentId, String workflowId,
+            String nodeId,String workflowName) {
+		super(nodeId,data);
+		setExperimentId(experimentId);
+		setWorkflowId(workflowId);
+		setWorkflowName(workflowName);
+	}
+
+	public WorkflowServiceIOData(String data, String experimentId,
+            String nodeId,String workflowName) {
+		this(data, experimentId, experimentId, nodeId, workflowName);
+	}
+
+	public String getExperimentId() {
+		return experimentId;
+	}
+
+	public void setExperimentId(String experimentId) {
+		this.experimentId = experimentId;
+	}
+
+	public String getWorkflowName() {
+		return workflowName;
+	}
+
+	public void setWorkflowName(String workflowName) {
+		this.workflowName = workflowName;
+	}
+
+	public String getWorkflowId() {
+		return workflowId;
+	}
+
+	public void setWorkflowId(String workflowId) {
+		this.workflowId = workflowId;
+	}
+}

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/provenance/ProvenanceWrite.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/provenance/ProvenanceWrite.java?rev=1234155&r1=1234154&r2=1234155&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/provenance/ProvenanceWrite.java
(original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/provenance/ProvenanceWrite.java
Fri Jan 20 21:42:59 2012
@@ -27,7 +27,7 @@ import java.util.Map;
 import org.apache.airavata.common.registry.api.exception.RegistryException;
 import org.apache.airavata.common.utils.XMLUtil;
 import org.apache.airavata.registry.api.AiravataRegistry;
-import org.apache.airavata.registry.api.workflow.WorkflowIOData;
+import org.apache.airavata.registry.api.workflow.WorkflowServiceIOData;
 import org.apache.airavata.xbaya.XBayaException;
 import org.apache.airavata.xbaya.concurrent.PredicatedExecutable;
 import org.apache.airavata.xbaya.graph.DataPort;
@@ -174,7 +174,7 @@ public final class ProvenanceWrite imple
 			}
             if (inputs!=null) {
 				try {
-					this.registry.saveWorkflowExecutionServiceInput(new WorkflowIOData(
+					this.registry.saveWorkflowExecutionServiceInput(new WorkflowServiceIOData(
 							xsul5.XmlConstants.BUILDER.serializeToString(inputs),
 							experimentId, node.getID(), this.workflowName));
 				} catch (RegistryException e) {
@@ -206,7 +206,7 @@ public final class ProvenanceWrite imple
 				}
 			}
             try {
-				this.registry.saveWorkflowExecutionServiceOutput(new WorkflowIOData(xsul5.XmlConstants.BUILDER.serializeToString(outputs),
experimentId, node.getID(),this.workflowName));
+				this.registry.saveWorkflowExecutionServiceOutput(new WorkflowServiceIOData(xsul5.XmlConstants.BUILDER.serializeToString(outputs),
experimentId, node.getID(),this.workflowName));
             } catch (RegistryException e) {
 				throw new XBayaException(e);
 			}

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/model/XBayaWorkflowExperiments.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/model/XBayaWorkflowExperiments.java?rev=1234155&r1=1234154&r2=1234155&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/model/XBayaWorkflowExperiments.java
(original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/model/XBayaWorkflowExperiments.java
Fri Jan 20 21:42:59 2012
@@ -32,7 +32,7 @@ import javax.xml.parsers.ParserConfigura
 
 import org.apache.airavata.common.registry.api.exception.RegistryException;
 import org.apache.airavata.registry.api.AiravataRegistry;
-import org.apache.airavata.registry.api.workflow.WorkflowIOData;
+import org.apache.airavata.registry.api.workflow.WorkflowServiceIOData;
 import org.apache.airavata.schemas.gfac.Parameter;
 import org.apache.axis2.util.XMLUtils;
 import org.w3c.dom.Document;
@@ -50,8 +50,8 @@ public class XBayaWorkflowExperiments {
 	public List<XBayaWorkflowExperiment> getAllExperiments(){
 		Map<String, XBayaWorkflowExperiment> experiments=new HashMap<String,XBayaWorkflowExperiment>();
     	try {
-			List<WorkflowIOData> workflowInput = getRegistry().searchWorkflowExecutionServiceInput(null,
null, null);
-			List<WorkflowIOData> workflowOutput = getRegistry().searchWorkflowExecutionServiceOutput(null,
null, null);
+			List<WorkflowServiceIOData> workflowInput = getRegistry().searchWorkflowExecutionServiceInput(null,
null, null);
+			List<WorkflowServiceIOData> workflowOutput = getRegistry().searchWorkflowExecutionServiceOutput(null,
null, null);
 			createChildren(experiments, workflowInput, true);
 			createChildren(experiments, workflowOutput, false);
 		} catch (RegistryException e) {
@@ -61,8 +61,8 @@ public class XBayaWorkflowExperiments {
 	}
 	private void createChildren(
 			Map<String, XBayaWorkflowExperiment> experiments,
-			List<WorkflowIOData> workflowIO, boolean inputData) {
-		for (WorkflowIOData workflowIOData : workflowIO) {
+			List<WorkflowServiceIOData> workflowIO, boolean inputData) {
+		for (WorkflowServiceIOData workflowIOData : workflowIO) {
 			if (!experiments.containsKey(workflowIOData.getExperimentId())){
 				experiments.put(workflowIOData.getExperimentId(),new XBayaWorkflowExperiment(workflowIOData.getExperimentId(),
null));
 			}
@@ -92,7 +92,7 @@ public class XBayaWorkflowExperiments {
 				xbayaWorkflow.add(workflowService);
 			}
 			try {
-				Document parameterDocument = XMLUtils.newDocument(new ByteArrayInputStream(workflowIOData.getData().getBytes()));
+				Document parameterDocument = XMLUtils.newDocument(new ByteArrayInputStream(workflowIOData.getValue().getBytes()));
 				NodeList childNodes = parameterDocument.getDocumentElement().getChildNodes();
 				for(int i=0;i<childNodes.getLength();i++){
 					Node parameterNode = childNodes.item(i);



Mime
View raw message