airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chath...@apache.org
Subject svn commit: r1435130 - in /airavata/trunk/modules: rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/ rest/mappings/src/main/java/org/apache/airavata/rest/mappings/utils/ xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui...
Date Fri, 18 Jan 2013 13:38:51 GMT
Author: chathuri
Date: Fri Jan 18 13:38:50 2013
New Revision: 1435130

URL: http://svn.apache.org/viewvc?rev=1435130&view=rev
Log:
fixing AIRAVATA-729

Modified:
    airavata/trunk/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/ApplicationDescriptor.java
    airavata/trunk/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/utils/DescriptorUtil.java
    airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/ApplicationDescriptionAdvancedOptionDialog.java

Modified: airavata/trunk/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/ApplicationDescriptor.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/ApplicationDescriptor.java?rev=1435130&r1=1435129&r2=1435130&view=diff
==============================================================================
--- airavata/trunk/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/ApplicationDescriptor.java
(original)
+++ airavata/trunk/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/ApplicationDescriptor.java
Fri Jan 18 13:38:50 2013
@@ -22,6 +22,7 @@
 package org.apache.airavata.rest.mappings.resourcemappings;
 
 import javax.xml.bind.annotation.XmlRootElement;
+import java.util.HashMap;
 
 @XmlRootElement(name = "application")
 public class ApplicationDescriptor {
@@ -42,6 +43,13 @@ public class ApplicationDescriptor {
     private int maxMemory;
     private String applicationDescType;
     private ServiceDescriptor serviceDescriptor;
+    private String inputDir;
+    private String outputDir;
+    private String stdIn;
+    private String stdOut;
+    private String stdError;
+    private String staticWorkigDir;
+    private HashMap<String, String> environmentVariables;
 
 
     public String getName() {
@@ -179,4 +187,60 @@ public class ApplicationDescriptor {
     public void setProjectDescription(String projectDescription) {
         this.projectDescription = projectDescription;
     }
+
+    public String getInputDir() {
+        return inputDir;
+    }
+
+    public String getOutputDir() {
+        return outputDir;
+    }
+
+    public String getStdIn() {
+        return stdIn;
+    }
+
+    public String getStdOut() {
+        return stdOut;
+    }
+
+    public String getStdError() {
+        return stdError;
+    }
+
+    public HashMap<String, String> getEnvironmentVariables() {
+        return environmentVariables;
+    }
+
+    public void setInputDir(String inputDir) {
+        this.inputDir = inputDir;
+    }
+
+    public void setOutputDir(String outputDir) {
+        this.outputDir = outputDir;
+    }
+
+    public void setStdIn(String stdIn) {
+        this.stdIn = stdIn;
+    }
+
+    public void setStdOut(String stdOut) {
+        this.stdOut = stdOut;
+    }
+
+    public void setStdError(String stdError) {
+        this.stdError = stdError;
+    }
+
+    public void setEnvironmentVariables(HashMap<String, String> environmentVariables)
{
+        this.environmentVariables = environmentVariables;
+    }
+
+    public String getStaticWorkigDir() {
+        return staticWorkigDir;
+    }
+
+    public void setStaticWorkigDir(String staticWorkigDir) {
+        this.staticWorkigDir = staticWorkigDir;
+    }
 }

Modified: airavata/trunk/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/utils/DescriptorUtil.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/utils/DescriptorUtil.java?rev=1435130&r1=1435129&r2=1435130&view=diff
==============================================================================
--- airavata/trunk/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/utils/DescriptorUtil.java
(original)
+++ airavata/trunk/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/utils/DescriptorUtil.java
Fri Jan 18 13:38:50 2013
@@ -31,6 +31,7 @@ import org.apache.airavata.rest.mappings
 import org.apache.airavata.schemas.gfac.*;
 
 import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
 
 public class DescriptorUtil {
@@ -271,6 +272,38 @@ public class DescriptorUtil {
         applicationDescription.getType().setExecutableLocation(applicationDescriptor.getExecutablePath());
         applicationDescription.getType().setScratchWorkingDirectory(applicationDescriptor.getWorkingDir());
 
+        if (applicationDescriptor.getInputDir() != null){
+            applicationDescription.getType().setInputDataDirectory(applicationDescriptor.getInputDir());
+        }
+        if (applicationDescriptor.getOutputDir() != null){
+            applicationDescription.getType().setOutputDataDirectory(applicationDescriptor.getOutputDir());
+        }
+        if (applicationDescriptor.getStdIn() != null){
+            applicationDescription.getType().setStandardInput(applicationDescriptor.getStdIn());
+        }
+        if (applicationDescriptor.getStdOut() != null){
+            applicationDescription.getType().setStandardOutput(applicationDescriptor.getStdOut());
+        }
+        if (applicationDescriptor.getStdError() != null){
+            applicationDescription.getType().setStandardError(applicationDescriptor.getStdError());
+        }
+        if (applicationDescriptor.getStaticWorkigDir() != null){
+            applicationDescription.getType().setStaticWorkingDirectory(applicationDescriptor.getStaticWorkigDir());
+        }
+        HashMap<String,String> environmentVariables = applicationDescriptor.getEnvironmentVariables();
+        if (environmentVariables != null && !environmentVariables.isEmpty()){
+            NameValuePairType[] appEnviVariablesArray = new NameValuePairType[environmentVariables.size()];
+            for(String key : environmentVariables.keySet()) {
+                int i = 0;
+                NameValuePairType nameValuePairType = applicationDescription.getType().addNewApplicationEnvironment();
+                nameValuePairType.setName(key);
+                nameValuePairType.setValue(environmentVariables.get(key));
+                appEnviVariablesArray[i] = nameValuePairType;
+                i++;
+            }
+            applicationDescription.getType().setApplicationEnvironmentArray(appEnviVariablesArray);
+        }
+
         //set advanced options according app desc type
         if(applicationDescriptor.getApplicationDescType() != null && !applicationDescriptor.getApplicationDescType().isEmpty()){
             if (applicationDescriptor.getApplicationDescType().equals(ApplicationDescriptorTypes.HPC_APP_DEP_DESC_TYPE)){
@@ -278,6 +311,39 @@ public class DescriptorUtil {
                 appDesc.getType().setApplicationName(name);
                 appDesc.getType().setExecutableLocation(applicationDescriptor.getExecutablePath());
                 appDesc.getType().setScratchWorkingDirectory(applicationDescriptor.getWorkingDir());
+
+                if (applicationDescriptor.getInputDir() != null){
+                    appDesc.getType().setInputDataDirectory(applicationDescriptor.getInputDir());
+                }
+                if (applicationDescriptor.getOutputDir() != null){
+                    appDesc.getType().setOutputDataDirectory(applicationDescriptor.getOutputDir());
+                }
+                if (applicationDescriptor.getStdIn() != null){
+                    appDesc.getType().setStandardInput(applicationDescriptor.getStdIn());
+                }
+                if (applicationDescriptor.getStdOut() != null){
+                    appDesc.getType().setStandardOutput(applicationDescriptor.getStdOut());
+                }
+                if (applicationDescriptor.getStdError() != null){
+                    appDesc.getType().setStandardError(applicationDescriptor.getStdError());
+                }
+                if (applicationDescriptor.getStaticWorkigDir() != null){
+                    appDesc.getType().setStaticWorkingDirectory(applicationDescriptor.getStaticWorkigDir());
+                }
+                HashMap<String,String> envVariables = applicationDescriptor.getEnvironmentVariables();
+                if (envVariables != null && !envVariables.isEmpty()){
+                    NameValuePairType[] appEnviVariablesArray = new NameValuePairType[envVariables.size()];
+                    for(String key : envVariables.keySet()) {
+                        int i = 0;
+                        NameValuePairType nameValuePairType = applicationDescription.getType().addNewApplicationEnvironment();
+                        nameValuePairType.setName(key);
+                        nameValuePairType.setValue(envVariables.get(key));
+                        appEnviVariablesArray[i] = nameValuePairType;
+                        i++;
+                    }
+                    appDesc.getType().setApplicationEnvironmentArray(appEnviVariablesArray);
+                }
+
                 HpcApplicationDeploymentType app = (HpcApplicationDeploymentType) appDesc.getType();
 
                 ProjectAccountType projectAccountType = app.addNewProjectAccount();
@@ -317,6 +383,34 @@ public class DescriptorUtil {
         applicationDescriptor.setName(applicationDescription.getType().getApplicationName().getStringValue());
         applicationDescriptor.setExecutablePath(applicationDescription.getType().getExecutableLocation());
         applicationDescriptor.setWorkingDir(applicationDescription.getType().getScratchWorkingDirectory());
+
+        if (applicationDescription.getType().getInputDataDirectory() != null && !applicationDescription.getType().getInputDataDirectory().equals("")
){
+            applicationDescriptor.setInputDir(applicationDescription.getType().getInputDataDirectory());
+        }
+        if (applicationDescription.getType().getOutputDataDirectory() != null &&
!applicationDescription.getType().getOutputDataDirectory().equals("")){
+            applicationDescriptor.setOutputDir(applicationDescription.getType().getOutputDataDirectory());
+        }
+        if (applicationDescription.getType().getStaticWorkingDirectory() != null &&
!applicationDescription.getType().getStaticWorkingDirectory().equals("")){
+            applicationDescriptor.setStaticWorkigDir(applicationDescription.getType().getStaticWorkingDirectory());
+        }
+        if (applicationDescription.getType().getStandardInput() != null && !applicationDescription.getType().getStandardInput().equals("")){
+            applicationDescriptor.setStdIn(applicationDescription.getType().getStandardInput());
+        }
+        if (applicationDescription.getType().getStandardOutput() != null && !applicationDescription.getType().getStandardOutput().equals("")){
+            applicationDescriptor.setStdOut(applicationDescription.getType().getStandardOutput());
+        }
+        if (applicationDescription.getType().getStandardError() != null && !applicationDescription.getType().getStandardError().equals("")){
+            applicationDescriptor.setStdError(applicationDescription.getType().getStandardError());
+        }
+        NameValuePairType[] environmentArray = applicationDescription.getType().getApplicationEnvironmentArray();
+        HashMap<String, String> environmentVariableMap = new HashMap<String, String>();
+        if (environmentArray != null && environmentArray.length != 0){
+            for (NameValuePairType nameValuePairType : environmentArray){
+                environmentVariableMap.put(nameValuePairType.getName(), nameValuePairType.getValue());
+            }
+            applicationDescriptor.setEnvironmentVariables(environmentVariableMap);
+        }
+
         if(applicationDescription.getType() != null){
             if(applicationDescription.getType() instanceof HpcApplicationDeploymentType){
                 applicationDescriptor.setApplicationDescType(ApplicationDescriptorTypes.HPC_APP_DEP_DESC_TYPE);

Modified: airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/ApplicationDescriptionAdvancedOptionDialog.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/ApplicationDescriptionAdvancedOptionDialog.java?rev=1435130&r1=1435129&r2=1435130&view=diff
==============================================================================
--- airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/ApplicationDescriptionAdvancedOptionDialog.java
(original)
+++ airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/ApplicationDescriptionAdvancedOptionDialog.java
Fri Jan 18 13:38:50 2013
@@ -338,7 +338,7 @@ public class ApplicationDescriptionAdvan
     	}
         NameValuePairType[] envParams = getShellApplicationDescriptionType().getApplicationEnvironmentArray();
     	for (NameValuePairType envParam : envParams) {
-    		defaultTableModel.addRow(new Object[] { envParam.getName(),envParam.getName()});	
+    		defaultTableModel.addRow(new Object[] { envParam.getName(),envParam.getValue()});
 		}
     	addNewRowIfLastIsNotEmpty();
         tableModelChanging = false;



Mime
View raw message