airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scnakand...@apache.org
Subject [43/50] [abbrv] airavata-php-gateway git commit: adding conditional field to App Interface when adding application inputs
Date Thu, 07 Jul 2016 19:27:47 GMT
adding conditional field to App Interface when adding application inputs


Project: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/commit/683eeec4
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/683eeec4
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/683eeec4

Branch: refs/heads/master
Commit: 683eeec40f897e17cf923adfe14cf4863941a8ed
Parents: f10b730
Author: scnakandala <supun.nakandala@gmail.com>
Authored: Wed Jul 6 15:01:49 2016 -0400
Committer: scnakandala <supun.nakandala@gmail.com>
Committed: Wed Jul 6 15:01:49 2016 -0400

----------------------------------------------------------------------
 .../Model/AppCatalog/AppInterface/Types.php     | 23 ++++++++++++++++++++
 app/libraries/AppUtilities.php                  |  3 ++-
 app/libraries/ExperimentUtilities.php           |  5 ++++-
 app/views/partials/interface-block.blade.php    | 10 +++++++++
 4 files changed, 39 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/683eeec4/app/libraries/Airavata/Model/AppCatalog/AppInterface/Types.php
----------------------------------------------------------------------
diff --git a/app/libraries/Airavata/Model/AppCatalog/AppInterface/Types.php b/app/libraries/Airavata/Model/AppCatalog/AppInterface/Types.php
index e2143f0..2477b43 100644
--- a/app/libraries/Airavata/Model/AppCatalog/AppInterface/Types.php
+++ b/app/libraries/Airavata/Model/AppCatalog/AppInterface/Types.php
@@ -61,6 +61,10 @@ class ApplicationInterfaceDescription {
    * @var bool
    */
   public $archiveWorkingDirectory = false;
+  /**
+   * @var bool
+   */
+  public $hasOptionalFileInputs = null;
 
   public function __construct($vals=null) {
     if (!isset(self::$_TSPEC)) {
@@ -107,6 +111,10 @@ class ApplicationInterfaceDescription {
           'var' => 'archiveWorkingDirectory',
           'type' => TType::BOOL,
           ),
+        8 => array(
+          'var' => 'hasOptionalFileInputs',
+          'type' => TType::BOOL,
+          ),
         );
     }
     if (is_array($vals)) {
@@ -131,6 +139,9 @@ class ApplicationInterfaceDescription {
       if (isset($vals['archiveWorkingDirectory'])) {
         $this->archiveWorkingDirectory = $vals['archiveWorkingDirectory'];
       }
+      if (isset($vals['hasOptionalFileInputs'])) {
+        $this->hasOptionalFileInputs = $vals['hasOptionalFileInputs'];
+      }
     }
   }
 
@@ -234,6 +245,13 @@ class ApplicationInterfaceDescription {
             $xfer += $input->skip($ftype);
           }
           break;
+        case 8:
+          if ($ftype == TType::BOOL) {
+            $xfer += $input->readBool($this->hasOptionalFileInputs);
+          } else {
+            $xfer += $input->skip($ftype);
+          }
+          break;
         default:
           $xfer += $input->skip($ftype);
           break;
@@ -318,6 +336,11 @@ class ApplicationInterfaceDescription {
       $xfer += $output->writeBool($this->archiveWorkingDirectory);
       $xfer += $output->writeFieldEnd();
     }
+    if ($this->hasOptionalFileInputs !== null) {
+      $xfer += $output->writeFieldBegin('hasOptionalFileInputs', TType::BOOL, 8);
+      $xfer += $output->writeBool($this->hasOptionalFileInputs);
+      $xfer += $output->writeFieldEnd();
+    }
     $xfer += $output->writeFieldStop();
     $xfer += $output->writeStructEnd();
     return $xfer;

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/683eeec4/app/libraries/AppUtilities.php
----------------------------------------------------------------------
diff --git a/app/libraries/AppUtilities.php b/app/libraries/AppUtilities.php
index f8f87c4..de459e8 100644
--- a/app/libraries/AppUtilities.php
+++ b/app/libraries/AppUtilities.php
@@ -57,7 +57,8 @@ class AppUtilities
             "applicationName" => $appInterfaceValues["applicationName"],
             "applicationDescription" => $appInterfaceValues["applicationDescription"],
             "applicationModules" => $appInterfaceValues["applicationModules"],
-            "archiveWorkingDirectory" =>  intval( $appInterfaceValues["archiveWorkingDirectory"])
+            "archiveWorkingDirectory" =>  intval( $appInterfaceValues["archiveWorkingDirectory"]),
+            "hasOptionalFileInputs" =>  intval( $appInterfaceValues["hasOptionalFileInputs"])
         ));
 
         if (isset($appInterfaceValues["inputName"])) {

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/683eeec4/app/libraries/ExperimentUtilities.php
----------------------------------------------------------------------
diff --git a/app/libraries/ExperimentUtilities.php b/app/libraries/ExperimentUtilities.php
index 20d634c..da1a0d3 100644
--- a/app/libraries/ExperimentUtilities.php
+++ b/app/libraries/ExperimentUtilities.php
@@ -772,11 +772,14 @@ class ExperimentUtilities
             }
         }
 
-        echo '<div>
+        $appInterface = AppUtilities::get_application_interface($id);
+        if($appInterface->hasOptionalFileInputs){
+            echo '<div>
                 <label>Optional Input Files</label>
                 <input type="file" id="optInputFiles" name="optInputFiles[]" multiple
onchange="javascript:updateList()" >
                 <div id="optFileList"></div>
             </div>';
+        }
     }
 
 

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/683eeec4/app/views/partials/interface-block.blade.php
----------------------------------------------------------------------
diff --git a/app/views/partials/interface-block.blade.php b/app/views/partials/interface-block.blade.php
index 3f539a9..86a0d12 100644
--- a/app/views/partials/interface-block.blade.php
+++ b/app/views/partials/interface-block.blade.php
@@ -45,6 +45,16 @@
         </select>
     </div>
 
+    <div class="form-group">
+        <label class="control-label">Enable Optional File Inputs</label>
+        <select name="hasOptionalFileInputs" class="form-control" style="max-width: 200px"
readonly>
+            <option value="0"
+                    @if( isset( $interfaceObject) ) @if( false == $interfaceObject->hasOptionalFileInputs
) selected @endif @endif>False</option>
+            <option value="1"
+                    @if( isset( $interfaceObject) ) @if( true == $interfaceObject->hasOptionalFileInputs
) selected @endif @endif>True</option>
+        </select>
+    </div>
+
     <div class="form-group form-horizontal">
         @if( isset( $interfaceObject))
         @foreach( (array)$interfaceObject->applicationInputs as $index => $appInputs)


Mime
View raw message