Author: samindaw
Date: Wed Aug  7 13:59:44 2013
New Revision: 1511318

URL: http://svn.apache.org/r1511318
Log:
initial dump for execution rest service

Added:
    
airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/AiravataAPIUtils.java
   (contents, props changed)
      - copied, changed from r1509101, 
airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/AiravataClientUtils.java
    
airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/experiment/
    
airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/experiment/ExperimentExecutionService.java
   (with props)
    
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/ExperimentTemplate.java
   (with props)
    
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowExecutionTemplate.java
   (with props)
Removed:
    
airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/AiravataClientUtils.java
Modified:
    
airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/ExecutionManagerImpl.java
    
airavata/trunk/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/utils/ResourcePathConstants.java
    airavata/trunk/modules/rest/service/pom.xml
    airavata/trunk/modules/rest/webapp/src/main/webapp/WEB-INF/web.xml
    
airavata/trunk/modules/server/src/main/java/org/apache/airavata/server/ServerMain.java
    
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorSkeleton.java

Copied: 
airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/AiravataAPIUtils.java
 (from r1509101, 
airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/AiravataClientUtils.java)
URL: 
http://svn.apache.org/viewvc/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/AiravataAPIUtils.java?p2=airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/AiravataAPIUtils.java&p1=airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/AiravataClientUtils.java&r1=1509101&r2=1511318&rev=1511318&view=diff
==============================================================================
--- 
airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/AiravataClientUtils.java
 (original)
+++ 
airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/AiravataAPIUtils.java
 Wed Aug  7 13:59:44 2013
@@ -21,7 +21,62 @@
 
 package org.apache.airavata.client;
 
-@Deprecated
-public class AiravataClientUtils extends AiravataAPIFactory {
+import java.util.List;
 
+import org.apache.airavata.client.api.ExperimentAdvanceOptions;
+import org.apache.airavata.client.api.NodeSettings;
+import org.apache.airavata.client.api.OutputDataSettings;
+import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
+import org.apache.airavata.client.tools.NameValuePairType;
+import 
org.apache.airavata.common.workflow.execution.context.WorkflowContextHeaderBuilder;
+
+public class AiravataAPIUtils {
+
+       //------------------Deprecated Functions---------------------//
+       
+       public static WorkflowContextHeaderBuilder createWorkflowContextHeader()
+                       throws AiravataAPIInvocationException {
+               try {
+                       return new WorkflowContextHeaderBuilder(null,
+                                       null,null,null,null,null);
+               } catch (Exception e) {
+                       throw new AiravataAPIInvocationException(e);
+               }
+       }
+       
+       //------------------End of Deprecated Functions---------------------//
+
+       public static WorkflowContextHeaderBuilder 
createWorkflowContextHeaderBuilder(
+                       ExperimentAdvanceOptions options, String submissionUser)
+                       throws AiravataAPIInvocationException {
+               WorkflowContextHeaderBuilder 
builder=createWorkflowContextHeader();
+               builder.setUserIdentifier(submissionUser);
+               NodeSettings[] nodeSettingsList = 
options.getCustomWorkflowSchedulingSettings().getNodeSettingsList();
+               for (NodeSettings nodeSettings : nodeSettingsList) {
+                       List<NameValuePairType> nameValuePairTypes = 
nodeSettings.getNameValuePair();
+                       for (NameValuePairType nameValuePairType : 
nameValuePairTypes) {
+                               
builder.addApplicationSchedulingKeyPair(nodeSettings.getNodeId(),nameValuePairType.getName(),
 nameValuePairType.getValue(), nameValuePairType.getDescription());
+                       }
+                       
builder.addApplicationSchedulingContext(nodeSettings.getNodeId(), 
nodeSettings.getServiceId(), nodeSettings.getHostSettings().getHostId(), 
nodeSettings.getHostSettings().isWSGRAMPreffered(), 
nodeSettings.getHostSettings().getGatekeeperEPR(), 
nodeSettings.getHPCSettings().getJobManager(), 
nodeSettings.getHPCSettings().getCPUCount(), 
nodeSettings.getHPCSettings().getNodeCount(), 
nodeSettings.getHPCSettings().getQueueName(), 
nodeSettings.getHPCSettings().getMaxWallTime());
+               
+               }
+               OutputDataSettings[] outputDataSettingsList = 
options.getCustomWorkflowOutputDataSettings().getOutputDataSettingsList();
+               for (OutputDataSettings outputDataSettings : 
outputDataSettingsList) {
+                       
builder.addApplicationOutputDataHandling(outputDataSettings.getNodeId(),outputDataSettings.getOutputDataDirectory(),
 outputDataSettings.getDataRegistryUrl(), 
outputDataSettings.isDataPersistent());
+               }
+
+        if 
(options.getCustomSecuritySettings().getAmazonWSSettings().getAccessKeyId() != 
null) {
+            
builder.setAmazonWebServices(options.getCustomSecuritySettings().getAmazonWSSettings().getAccessKeyId(),
+                    
options.getCustomSecuritySettings().getAmazonWSSettings().getSecretAccessKey());
+        }
+
+        if 
(options.getCustomSecuritySettings().getCredentialStoreSecuritySettings() != 
null) {
+            
builder.setCredentialManagementService(options.getCustomSecuritySettings().
+                    getCredentialStoreSecuritySettings().getTokenId(),
+                    submissionUser);
+        }
+
+
+               return builder;
+       }
 }

Propchange: 
airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/AiravataAPIUtils.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: 
airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/ExecutionManagerImpl.java
URL: 
http://svn.apache.org/viewvc/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/ExecutionManagerImpl.java?rev=1511318&r1=1511317&r2=1511318&view=diff
==============================================================================
--- 
airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/ExecutionManagerImpl.java
 (original)
+++ 
airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/ExecutionManagerImpl.java
 Wed Aug  7 13:59:44 2013
@@ -30,21 +30,19 @@ import java.util.UUID;
 
 import javax.xml.stream.XMLStreamException;
 
+import org.apache.airavata.client.AiravataAPIUtils;
 import org.apache.airavata.client.AiravataClient;
 import org.apache.airavata.client.api.ExecutionManager;
 import org.apache.airavata.client.api.ExperimentAdvanceOptions;
-import org.apache.airavata.client.api.NodeSettings;
-import org.apache.airavata.client.api.OutputDataSettings;
 import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
 import org.apache.airavata.client.stub.interpretor.NameValue;
 import org.apache.airavata.client.stub.interpretor.WorkflowInterpretorStub;
-import org.apache.airavata.client.tools.NameValuePairType;
 import org.apache.airavata.common.utils.XMLUtil;
 import 
org.apache.airavata.common.workflow.execution.context.WorkflowContextHeaderBuilder;
 import org.apache.airavata.registry.api.ExecutionErrors.Source;
+import org.apache.airavata.registry.api.workflow.ApplicationJobExecutionError;
 import org.apache.airavata.registry.api.workflow.ExecutionError;
 import org.apache.airavata.registry.api.workflow.ExperimentExecutionError;
-import org.apache.airavata.registry.api.workflow.ApplicationJobExecutionError;
 import org.apache.airavata.registry.api.workflow.NodeExecutionError;
 import org.apache.airavata.registry.api.workflow.WorkflowExecutionError;
 import org.apache.airavata.registry.api.workflow.WorkflowExecutionStatus;
@@ -219,7 +217,7 @@ public class ExecutionManagerImpl implem
                        if (executionUser==null){
                                executionUser=submissionUser;
                        }
-                       WorkflowContextHeaderBuilder builder = 
createWorkflowContextHeaderBuilder(options, submissionUser);
+                       WorkflowContextHeaderBuilder builder = 
AiravataAPIUtils.createWorkflowContextHeaderBuilder(options, submissionUser);
                        runPreWorkflowExecutionTasks(experimentID, 
executionUser, options.getExperimentMetadata(), options.getExperimentName());
                        NameValue[] inputVals = inputValues.toArray(new 
NameValue[] {});
                        if (listener!=null){
@@ -236,40 +234,6 @@ public class ExecutionManagerImpl implem
            }
        }
 
-       private WorkflowContextHeaderBuilder createWorkflowContextHeaderBuilder(
-                       ExperimentAdvanceOptions options, String submissionUser)
-                       throws AiravataAPIInvocationException {
-               WorkflowContextHeaderBuilder 
builder=createWorkflowContextHeader();
-               builder.setUserIdentifier(submissionUser);
-               NodeSettings[] nodeSettingsList = 
options.getCustomWorkflowSchedulingSettings().getNodeSettingsList();
-               for (NodeSettings nodeSettings : nodeSettingsList) {
-                       List<NameValuePairType> nameValuePairTypes = 
nodeSettings.getNameValuePair();
-                       for (NameValuePairType nameValuePairType : 
nameValuePairTypes) {
-                               
builder.addApplicationSchedulingKeyPair(nodeSettings.getNodeId(),nameValuePairType.getName(),
 nameValuePairType.getValue(), nameValuePairType.getDescription());
-                       }
-                       
builder.addApplicationSchedulingContext(nodeSettings.getNodeId(), 
nodeSettings.getServiceId(), nodeSettings.getHostSettings().getHostId(), 
nodeSettings.getHostSettings().isWSGRAMPreffered(), 
nodeSettings.getHostSettings().getGatekeeperEPR(), 
nodeSettings.getHPCSettings().getJobManager(), 
nodeSettings.getHPCSettings().getCPUCount(), 
nodeSettings.getHPCSettings().getNodeCount(), 
nodeSettings.getHPCSettings().getQueueName(), 
nodeSettings.getHPCSettings().getMaxWallTime());
-               
-               }
-               OutputDataSettings[] outputDataSettingsList = 
options.getCustomWorkflowOutputDataSettings().getOutputDataSettingsList();
-               for (OutputDataSettings outputDataSettings : 
outputDataSettingsList) {
-                       
builder.addApplicationOutputDataHandling(outputDataSettings.getNodeId(),outputDataSettings.getOutputDataDirectory(),
 outputDataSettings.getDataRegistryUrl(), 
outputDataSettings.isDataPersistent());
-               }
-
-        if 
(options.getCustomSecuritySettings().getAmazonWSSettings().getAccessKeyId() != 
null) {
-            
builder.setAmazonWebServices(options.getCustomSecuritySettings().getAmazonWSSettings().getAccessKeyId(),
-                    
options.getCustomSecuritySettings().getAmazonWSSettings().getSecretAccessKey());
-        }
-
-        if 
(options.getCustomSecuritySettings().getCredentialStoreSecuritySettings() != 
null) {
-            
builder.setCredentialManagementService(options.getCustomSecuritySettings().
-                    getCredentialStoreSecuritySettings().getTokenId(),
-                    submissionUser);
-        }
-
-
-               return builder;
-       }
-
     private Workflow extractWorkflow(String workflowName) throws 
AiravataAPIInvocationException {
         Workflow workflowObj = null;
         //FIXME - There should be a better way to figure-out if the passed 
string is a name or an xml
@@ -334,27 +298,12 @@ public class ExecutionManagerImpl implem
                
getClient().getProvenanceManager().setExperimentName(experimentId, 
experimentName);
        }
 
-       //------------------Deprecated Functions---------------------//
-       
-       private WorkflowContextHeaderBuilder createWorkflowContextHeader()
-                       throws AiravataAPIInvocationException {
-               try {
-                       return new WorkflowContextHeaderBuilder(null,
-                                       null,null,null,null,
-                                       null);
-               } catch (Exception e) {
-                       throw new AiravataAPIInvocationException(e);
-               }
-       }
-       
-       //------------------End of Deprecated Functions---------------------//
-
        public static void main(String[] args) {
                ExecutionManagerImpl a = new ExecutionManagerImpl(null);
                try {
                        ExperimentAdvanceOptions b = 
a.createExperimentAdvanceOptions();
                        
b.getCustomWorkflowOutputDataSettings().addNewOutputDataSettings("la", "di", 
"da", false);
-                       WorkflowContextHeaderBuilder c = 
a.createWorkflowContextHeaderBuilder(b, "meeee");
+                       WorkflowContextHeaderBuilder c = 
AiravataAPIUtils.createWorkflowContextHeaderBuilder(b, "meeee");
                        
System.out.println(XMLUtil.xmlElementToString(c.getXml()));
                } catch (AiravataAPIInvocationException e) {
                        e.printStackTrace();

Modified: 
airavata/trunk/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/utils/ResourcePathConstants.java
URL: 
http://svn.apache.org/viewvc/airavata/trunk/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/utils/ResourcePathConstants.java?rev=1511318&r1=1511317&r2=1511318&view=diff
==============================================================================
--- 
airavata/trunk/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/utils/ResourcePathConstants.java
 (original)
+++ 
airavata/trunk/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/utils/ResourcePathConstants.java
 Wed Aug  7 13:59:44 2013
@@ -201,5 +201,14 @@ public class ResourcePathConstants {
         public static final String GET_SERVICE_URL = "get/serviceURL";
         public static final String SET_SERVICE_URL = "set/serviceURL";
     }
-
+    public final class ExperimentExecutionConstants {
+        public static final String EXP_EXEC_PATH  =  "/execution/";
+        public static final String GET_HI= "get/hi";
+        public static final String EXEC_EXPERIMENT= "workflow";
+        public static final String CANCEL_EXPERIMENT = "cancel/experiment";
+        public static final String CANCEL_WORKFLOW = "cancel/workflow";
+        public static final String CANCEL_NODE = "cancel/node";
+        public static final String SUSPEND_EXPERIMENT = "suspend/experiment";
+        public static final String RESUME_EXPERIMENT = "resume/experiment";
+    }
     }

Modified: airavata/trunk/modules/rest/service/pom.xml
URL: 
http://svn.apache.org/viewvc/airavata/trunk/modules/rest/service/pom.xml?rev=1511318&r1=1511317&r2=1511318&view=diff
==============================================================================
--- airavata/trunk/modules/rest/service/pom.xml (original)
+++ airavata/trunk/modules/rest/service/pom.xml Wed Aug  7 13:59:44 2013
@@ -59,6 +59,16 @@
                        <artifactId>airavata-security</artifactId>
                        <version>${project.version}</version>
                </dependency>
+               <dependency>
+                       <groupId>org.apache.airavata</groupId>
+                       <artifactId>airavata-client-api</artifactId>
+                       <version>${project.version}</version>
+               </dependency>
+               <dependency>
+                       <groupId>org.apache.airavata</groupId>
+                       <artifactId>airavata-xbaya-gui</artifactId>
+                       <version>${project.version}</version>
+               </dependency>
                <!--dependency>
                        <groupId>org.apache.airavata</groupId>
                        <artifactId>airavata-jpa-registry</artifactId>

Added: 
airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/experiment/ExperimentExecutionService.java
URL: 
http://svn.apache.org/viewvc/airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/experiment/ExperimentExecutionService.java?rev=1511318&view=auto
==============================================================================
--- 
airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/experiment/ExperimentExecutionService.java
 (added)
+++ 
airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/experiment/ExperimentExecutionService.java
 Wed Aug  7 13:59:44 2013
@@ -0,0 +1,115 @@
+/*
+ *
+ * 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.services.experiment;
+
+import java.util.Map;
+
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
+import org.apache.airavata.client.AiravataAPIUtils;
+import org.apache.airavata.client.api.ExperimentAdvanceOptions;
+import org.apache.airavata.common.context.WorkflowContext;
+import org.apache.airavata.rest.mappings.utils.ResourcePathConstants;
+import org.apache.airavata.services.registry.rest.utils.WebAppUtil;
+import org.apache.airavata.xbaya.interpretor.WorkflowInterpretorSkeleton;
+
+@Path(ResourcePathConstants.ExperimentExecutionConstants.EXP_EXEC_PATH)
+public class ExperimentExecutionService {
+       private WorkflowInterpretorSkeleton interpreterService;
+       
+    @POST
+    @Path(ResourcePathConstants.ExperimentExecutionConstants.EXEC_EXPERIMENT)
+    @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
+    @Produces(MediaType.TEXT_PLAIN)
+    public Response runExperiment(@QueryParam("workflowTemplateName") String 
workflowTemplateName, Map<String, String> workflowInputs, 
ExperimentAdvanceOptions advanceOptions){
+       String user =  WorkflowContext.getRequestUser();
+        String gatewayId = WorkflowContext.getGatewayId();
+       try {
+                       String experimentId = 
getInterpreterService().setupAndLaunch(workflowTemplateName, 
advanceOptions.getCustomExperimentId(), gatewayId, user, workflowInputs, true, 
AiravataAPIUtils.createWorkflowContextHeaderBuilder(advanceOptions, user));
+               Response.ResponseBuilder builder = 
Response.status(Response.Status.OK);
+               builder.entity(experimentId);
+               return builder.build();
+               } catch (Exception e) {
+                       return 
WebAppUtil.reportInternalServerError(ResourcePathConstants.ExperimentExecutionConstants.EXEC_EXPERIMENT,
 e);
+               }
+
+    }
+
+    @DELETE
+    @Path(ResourcePathConstants.ExperimentExecutionConstants.CANCEL_EXPERIMENT)
+    @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
+    @Produces(MediaType.TEXT_PLAIN)
+    public Response cancelExperiment(@QueryParam("experimentId") String 
experimentId){
+       try {
+                       getInterpreterService().haltWorkflow(experimentId);
+               Response.ResponseBuilder builder = 
Response.status(Response.Status.OK);
+               return builder.build();
+               } catch (Exception e) {
+                       return 
WebAppUtil.reportInternalServerError(ResourcePathConstants.ExperimentExecutionConstants.CANCEL_EXPERIMENT,
 e);
+               }
+    }
+
+    @DELETE
+    
@Path(ResourcePathConstants.ExperimentExecutionConstants.SUSPEND_EXPERIMENT)
+    @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
+    @Produces(MediaType.TEXT_PLAIN)
+    public Response suspendExperiment(@QueryParam("experimentId") String 
experimentId){
+       try {
+                       getInterpreterService().suspendWorkflow(experimentId);
+               Response.ResponseBuilder builder = 
Response.status(Response.Status.OK);
+               return builder.build();
+               } catch (Exception e) {
+                       return 
WebAppUtil.reportInternalServerError(ResourcePathConstants.ExperimentExecutionConstants.SUSPEND_EXPERIMENT,
 e);
+               }
+    }
+
+    @GET
+    @Path(ResourcePathConstants.ExperimentExecutionConstants.RESUME_EXPERIMENT)
+    @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
+    @Produces(MediaType.TEXT_PLAIN)
+    public Response resumeExperiment(@QueryParam("experimentId") String 
experimentId){
+       try {
+                       getInterpreterService().resumeWorkflow(experimentId);
+               Response.ResponseBuilder builder = 
Response.status(Response.Status.OK);
+               return builder.build();
+               } catch (Exception e) {
+                       return 
WebAppUtil.reportInternalServerError(ResourcePathConstants.ExperimentExecutionConstants.RESUME_EXPERIMENT,
 e);
+               }
+    }
+    
+       public WorkflowInterpretorSkeleton getInterpreterService() {
+               if (interpreterService==null){
+                       interpreterService=new WorkflowInterpretorSkeleton();
+               }
+               return interpreterService;
+       }
+    
+
+}

Propchange: 
airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/experiment/ExperimentExecutionService.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: airavata/trunk/modules/rest/webapp/src/main/webapp/WEB-INF/web.xml
URL: 
http://svn.apache.org/viewvc/airavata/trunk/modules/rest/webapp/src/main/webapp/WEB-INF/web.xml?rev=1511318&r1=1511317&r2=1511318&view=diff
==============================================================================
--- airavata/trunk/modules/rest/webapp/src/main/webapp/WEB-INF/web.xml 
(original)
+++ airavata/trunk/modules/rest/webapp/src/main/webapp/WEB-INF/web.xml Wed Aug  
7 13:59:44 2013
@@ -61,7 +61,7 @@
         
<servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
         <init-param>
             <param-name>com.sun.jersey.config.property.packages</param-name>
-            
<param-value>org.apache.airavata.services.registry.rest;org.codehaus.jackson.jaxrs</param-value>
+            
<param-value>org.apache.airavata.services.registry.rest;org.apache.airavata.services.experiment;org.codehaus.jackson.jaxrs</param-value>
         </init-param>
         <load-on-startup>1</load-on-startup>
     </servlet>

Modified: 
airavata/trunk/modules/server/src/main/java/org/apache/airavata/server/ServerMain.java
URL: 
http://svn.apache.org/viewvc/airavata/trunk/modules/server/src/main/java/org/apache/airavata/server/ServerMain.java?rev=1511318&r1=1511317&r2=1511318&view=diff
==============================================================================
--- 
airavata/trunk/modules/server/src/main/java/org/apache/airavata/server/ServerMain.java
 (original)
+++ 
airavata/trunk/modules/server/src/main/java/org/apache/airavata/server/ServerMain.java
 Wed Aug  7 13:59:44 2013
@@ -59,7 +59,7 @@ public class ServerMain {
 
         StandardContext context = 
(StandardContext)tomcat.getTomcat().addContext("/airavata-registry", 
System.getenv("AIRAVATA_HOME"));
         Wrapper registryServlet = tomcat.addServlet("/airavata-registry", 
"Airavata Web Application", 
"com.sun.jersey.spi.container.servlet.ServletContainer");
-        
registryServlet.addInitParameter("com.sun.jersey.config.property.packages", 
"org.apache.airavata.services.registry.rest;org.codehaus.jackson.jaxrs");
+        
registryServlet.addInitParameter("com.sun.jersey.config.property.packages", 
"org.apache.airavata.services.registry.rest;org.apache.airavata.services.experiment;org.codehaus.jackson.jaxrs");
         registryServlet.setLoadOnStartup(1);
 
         FilterDef filter1definition = new FilterDef();

Added: 
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/ExperimentTemplate.java
URL: 
http://svn.apache.org/viewvc/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/ExperimentTemplate.java?rev=1511318&view=auto
==============================================================================
--- 
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/ExperimentTemplate.java
 (added)
+++ 
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/ExperimentTemplate.java
 Wed Aug  7 13:59:44 2013
@@ -0,0 +1,37 @@
+/*
+ *
+ * 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.xbaya.interpretor;
+
+import java.util.List;
+
+public class ExperimentTemplate {
+       private List<WorkflowExecutionTemplate> workflowExecutionTemplates;
+
+       public List<WorkflowExecutionTemplate> getWorkflowExecutionTemplates() {
+               return workflowExecutionTemplates;
+       }
+
+       public void setWorkflowExecutionTemplates(
+                       List<WorkflowExecutionTemplate> 
workflowExecutionTemplates) {
+               this.workflowExecutionTemplates = workflowExecutionTemplates;
+       }
+}

Propchange: 
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/ExperimentTemplate.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: 
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowExecutionTemplate.java
URL: 
http://svn.apache.org/viewvc/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowExecutionTemplate.java?rev=1511318&view=auto
==============================================================================
--- 
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowExecutionTemplate.java
 (added)
+++ 
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowExecutionTemplate.java
 Wed Aug  7 13:59:44 2013
@@ -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.xbaya.interpretor;
+
+import java.util.List;
+
+import org.apache.airavata.client.api.ExperimentAdvanceOptions;
+import org.apache.airavata.workflow.model.wf.WorkflowInput;
+
+public class WorkflowExecutionTemplate {
+       private String workflowTemplateName;
+       private List<WorkflowInput> input;
+       private ExperimentAdvanceOptions advanceOptions;
+       public String getWorkflowTemplateName() {
+               return workflowTemplateName;
+       }
+       public void setWorkflowTemplateName(String workflowTemplateName) {
+               this.workflowTemplateName = workflowTemplateName;
+       }
+       public List<WorkflowInput> getInput() {
+               return input;
+       }
+       public void setInput(List<WorkflowInput> input) {
+               this.input = input;
+       }
+       public ExperimentAdvanceOptions getAdvanceOptions() {
+               return advanceOptions;
+       }
+       public void setAdvanceOptions(ExperimentAdvanceOptions advanceOptions) {
+               this.advanceOptions = advanceOptions;
+       }
+}

Propchange: 
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowExecutionTemplate.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: 
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorSkeleton.java
URL: 
http://svn.apache.org/viewvc/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorSkeleton.java?rev=1511318&r1=1511317&r2=1511318&view=diff
==============================================================================
--- 
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorSkeleton.java
 (original)
+++ 
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorSkeleton.java
 Wed Aug  7 13:59:44 2013
@@ -22,7 +22,6 @@
 package org.apache.airavata.xbaya.interpretor;
 
 import java.io.IOException;
-import java.net.MalformedURLException;
 import java.net.URI;
 import java.net.URISyntaxException;
 import java.net.URL;
@@ -32,7 +31,6 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
-import javax.jcr.RepositoryException;
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLInputFactory;
 import javax.xml.stream.XMLStreamException;
@@ -50,7 +48,6 @@ import org.apache.airavata.common.utils.
 import org.apache.airavata.common.utils.ServiceUtils;
 import 
org.apache.airavata.common.workflow.execution.context.WorkflowContextHeaderBuilder;
 import org.apache.airavata.commons.gfac.type.HostDescription;
-import org.apache.airavata.registry.api.exception.RegistryException;
 import org.apache.airavata.schemas.gfac.GlobusHostType;
 import org.apache.airavata.schemas.gfac.HostDescriptionType;
 import org.apache.airavata.schemas.wec.ContextHeaderDocument;
@@ -290,14 +287,6 @@ public class WorkflowInterpretorSkeleton
         try {
              s = setupAndLaunch(workflowAsString, topic, 
ServerSettings.getDefaultGatewayId(),
                     user,inputs, configuration, runInThread, 
workflowContextHeaderBuilder);
-        } catch (XMLStreamException e) {
-            log.error(e.getMessage());
-        } catch (RepositoryException e) {
-            log.error(e.getMessage());
-        } catch (MalformedURLException e) {
-            log.error(e.getMessage());
-        } catch (RegistryException e) {
-            log.error(e.getMessage());
         } catch (AiravataAPIInvocationException e) {
             log.error(e.getMessage());
         } catch (ApplicationSettingsException e) {
@@ -343,10 +332,24 @@ public class WorkflowInterpretorSkeleton
         }
         return new WorkflowContextHeaderBuilder(parse.getContextHeader());
     }
-
+    public String setupAndLaunch(String workflowAsString, String experimentId, 
String gatewayId, String username,
+            Map<String,String> inputs,boolean 
inNewThread,WorkflowContextHeaderBuilder builder) throws 
AiravataAPIInvocationException{
+       List<NameValue> inputData=new ArrayList<NameValue>();
+       for (String inputName : inputs.keySet()) {
+                       NameValue input = new NameValue();
+                       input.setName(inputName);
+                       input.setValue(inputs.get(inputName));
+                       inputData.add(input);
+               }
+       Map<String, String> configuration = new HashMap<String, String>();
+       configuration.put(BROKER, 
getAiravataAPI().getAiravataManager().getEventingServiceURL().toASCIIString());
+        configuration.put(MSGBOX, 
getAiravataAPI().getAiravataManager().getMessageBoxServiceURL().toASCIIString());
+        
+       return setupAndLaunch(workflowAsString, experimentId, gatewayId, 
username, inputData.toArray(new NameValue[]{}), configuration, inNewThread, 
builder);
+    }
     private String setupAndLaunch(String workflowAsString, String topic, 
String gatewayId, String username,
                                   NameValue[] 
inputs,Map<String,String>configurations,boolean inNewThread,
-                                  WorkflowContextHeaderBuilder builder) throws 
XMLStreamException, MalformedURLException, RepositoryException, 
RegistryException, AiravataAPIInvocationException {
+                                  WorkflowContextHeaderBuilder builder) throws 
AiravataAPIInvocationException{
         log.debug("Launch is called for topic:"+topic);
 
         Workflow workflow = null;


Reply via email to