You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by sc...@apache.org on 2016/03/30 21:35:13 UTC

[1/2] airavata-php-gateway git commit: fixing AIRAVATA-1942

Repository: airavata-php-gateway
Updated Branches:
  refs/heads/develop 58c1d2bda -> e410f776e


fixing AIRAVATA-1942


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/29e1020b
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/29e1020b
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/29e1020b

Branch: refs/heads/develop
Commit: 29e1020b68dec59a297628eb37ec886f2b0d0b79
Parents: f7900df
Author: scnakandala <su...@gmail.com>
Authored: Wed Mar 30 15:35:03 2016 -0400
Committer: scnakandala <su...@gmail.com>
Committed: Wed Mar 30 15:35:03 2016 -0400

----------------------------------------------------------------------
 app/controllers/ExperimentController.php     |  3 -
 app/libraries/ExperimentUtilities.php        | 68 +++++++++++++++++++----
 app/views/partials/experiment-info.blade.php |  4 +-
 3 files changed, 59 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/29e1020b/app/controllers/ExperimentController.php
----------------------------------------------------------------------
diff --git a/app/controllers/ExperimentController.php b/app/controllers/ExperimentController.php
index dca8d53..07a3366 100755
--- a/app/controllers/ExperimentController.php
+++ b/app/controllers/ExperimentController.php
@@ -86,9 +86,6 @@ class ExperimentController extends BaseController
             $autoRefresh = false;
         }
         if ($experiment != null) {
-             $data = array(
-                "autoRefresh"=> $autoRefresh,
-            );
             //viewing experiments of other gateways is not allowed if user is not super admin
             if( $experiment->gatewayId != Session::get("gateway_id") && !Session::has("super-admin")){
                 Session::put("permissionDenied", true);

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/29e1020b/app/libraries/ExperimentUtilities.php
----------------------------------------------------------------------
diff --git a/app/libraries/ExperimentUtilities.php b/app/libraries/ExperimentUtilities.php
index d2b7298..ae5a94e 100644
--- a/app/libraries/ExperimentUtilities.php
+++ b/app/libraries/ExperimentUtilities.php
@@ -89,14 +89,68 @@ class ExperimentUtilities
                 if(!ExperimentUtilities::endsWith($dataRoot, "/"))
                     $dataRoot = $dataRoot . "/";
                 $filePath = str_replace($dataRoot, "", parse_url($currentInputPath, PHP_URL_PATH));
-                echo '<p>' . $input->name . '&nbsp;<a target="_blank" href="' . URL::to("/") . '/download/?path=' . $filePath . '">' . basename($filePath) . ' <span class="glyphicon glyphicon-new-window"></span></a></p>';
+                echo '<p>' . $input->name . ':&nbsp;<a target="_blank" href="' . URL::to("/") . '/download/?path=' . $filePath . '">' . basename($filePath) . ' <span class="glyphicon glyphicon-new-window"></span></a></p>';
             } elseif ($input->type == DataType::STRING || $input->type == DataType::INTEGER
                 || $input->type == DataType::FLOAT) {
+                echo '<p>' . $input->name . ':&nbsp;' . $input->value . '</p>';
+            }
+        }
+    }
+
+    /**
+     * List the process's input files
+     * @param $experiment
+     */
+    public static function list_process_input_files($processInputs)
+    {
+        $order = array();
+        foreach ($processInputs as $index => $input) {
+            $order[$index] = $input->inputOrder;
+        }
+        array_multisort($order, SORT_ASC, $processInputs);
+
+        foreach ($processInputs as $input) {
+            $matchingAppInput = null;
+
+            if ($input->type == DataType::URI) {
+                $dataRoot = Config::get("pga_config.airavata")["experiment-data-absolute-path"];
+                if(!ExperimentUtilities::endsWith($dataRoot, "/"))
+                    $dataRoot = $dataRoot . "/";
+                $filePath = str_replace($dataRoot, "", parse_url($input->value, PHP_URL_PATH));
+                echo '<p>' . $input->name . ':&nbsp;<a target="_blank" href="' . URL::to("/")
+                    . '/download/?path=' . $filePath . '">' . basename($filePath) . ' <span class="glyphicon glyphicon-new-window"></span></a></p>';
+            }elseif ($input->type == DataType::STRING || $input->type == DataType::INTEGER
+                || $input->type == DataType::FLOAT) {
                 echo '<p>' . $input->name . ': ' . $input->value . '</p>';
             }
         }
     }
 
+    /**
+     * List the process's output files
+     * @param $experiment
+     */
+    public static function list_process_output_files($outputs, $status){
+        if ($status != ProcessState::COMPLETED)
+            echo "Process hasn't completed. Process Status is : " . ProcessState::$__names[ $status] . '<br/>';
+
+        foreach ((array)$outputs as $output) {
+            if ($output->type == DataType::URI || $output->type == DataType::STDOUT || $output->type == DataType::STDERR) {
+                $dataRoot = Config::get("pga_config.airavata")["experiment-data-absolute-path"];
+                if(!ExperimentUtilities::endsWith($dataRoot, "/"))
+                    $dataRoot = $dataRoot . "/";
+                $filePath = str_replace($dataRoot, "", parse_url($output->value, PHP_URL_PATH));
+                echo '<p>' . $output->name . ':&nbsp;<a target="_blank" href="' . URL::to("/")
+                    . '/download/?path=' . $filePath . '">' . basename($filePath) . ' <span class="glyphicon glyphicon-new-window"></span></a></p>';
+            }
+            elseif ($output->type == DataType::STRING) {
+                echo '<p>' . $output->value . '</p>';
+            }
+            else
+                echo 'output : '. $output;
+        }
+    }
+
     private  static function endsWith($haystack, $needle) {
         // search forward starting from end minus needle length characters
         return $needle === "" || (($temp = strlen($haystack) - strlen($needle)) >= 0 && strpos($haystack, $needle, $temp) !== false);
@@ -666,16 +720,8 @@ class ExperimentUtilities
 
     public static function list_output_files($outputs, $status, $process)
     {
-        if( $process)
-        {
-            if ($status != ProcessState::COMPLETED)
-                echo "Process hasn't completed. Process Status is : " . ProcessState::$__names[ $status] . '<br/>';
-        }
-        else
-        {
-            if ( $status != ExperimentState::COMPLETED)
-                echo "Experiment hasn't completed. Experiment Status is : " .  ExperimentState::$__names[ $status] . '<br/>';
-        }
+        if ( $status != ExperimentState::COMPLETED)
+            echo "Experiment hasn't completed. Experiment Status is : " .  ExperimentState::$__names[ $status] . '<br/>';
 
         foreach ((array)$outputs as $output) {
             if ($output->type == DataType::URI || $output->type == DataType::STDOUT || $output->type == DataType::STDERR) {

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/29e1020b/app/views/partials/experiment-info.blade.php
----------------------------------------------------------------------
diff --git a/app/views/partials/experiment-info.blade.php b/app/views/partials/experiment-info.blade.php
index 40bd84a..83b0197 100644
--- a/app/views/partials/experiment-info.blade.php
+++ b/app/views/partials/experiment-info.blade.php
@@ -248,7 +248,7 @@
                         <li>
                             <span class="alert"><i class="icon-time"></i>
                                 <p>Inputs<br/>
-                                {{ ExperimentUtilities::list_input_files( $process->processInputs) }}</p>
+                                {{ ExperimentUtilities::list_process_input_files( $process->processInputs) }}</p>
                             </span>
                         </li>
                         <li>
@@ -282,7 +282,7 @@
                         <li>
                             <span class="alert"><i class="icon-time"></i>
                                 <p>Outputs<hr/>
-                                {{ ExperimentUtilities::list_output_files( $process->processOutputs, $process->processStatus->state, true) }}</p>
+                                {{ ExperimentUtilities::list_process_output_files( $process->processOutputs, $process->processStatus->state) }}</p>
                             </span>
                         </li>
                     </ul>


[2/2] airavata-php-gateway git commit: Merge remote-tracking branch 'origin/develop' into develop

Posted by sc...@apache.org.
Merge remote-tracking branch 'origin/develop' into develop


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/e410f776
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/e410f776
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/e410f776

Branch: refs/heads/develop
Commit: e410f776e5ad6690828fe278275732b53e03b27b
Parents: 29e1020 58c1d2b
Author: scnakandala <su...@gmail.com>
Authored: Wed Mar 30 15:35:10 2016 -0400
Committer: scnakandala <su...@gmail.com>
Committed: Wed Mar 30 15:35:10 2016 -0400

----------------------------------------------------------------------
 app/controllers/GatewayprofileController.php    | 12 ++++-
 app/views/admin/manage-gateway.blade.php        | 52 ++++++++++++++++++++
 .../compute-resource-preferences.blade.php      | 10 +++-
 .../gateway-preferences-block.blade.php         |  4 +-
 .../storage-resource-preferences.blade.php      | 21 ++++----
 5 files changed, 83 insertions(+), 16 deletions(-)
----------------------------------------------------------------------