Repository: airavata-php-gateway
Updated Branches:
  refs/heads/develop a03f217a6 -> 7f39a4dc4


fixing showing experiment output values in PGA


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

Branch: refs/heads/develop
Commit: 7f39a4dc40894561ac058d70d29641ec936a99bc
Parents: a03f217
Author: scnakandala <[email protected]>
Authored: Fri Mar 25 16:09:49 2016 -0400
Committer: scnakandala <[email protected]>
Committed: Fri Mar 25 16:09:49 2016 -0400

----------------------------------------------------------------------
 app/libraries/ExperimentUtilities.php | 24 +++++++++++++-----------
 1 file changed, 13 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/7f39a4dc/app/libraries/ExperimentUtilities.php
----------------------------------------------------------------------
diff --git a/app/libraries/ExperimentUtilities.php 
b/app/libraries/ExperimentUtilities.php
index a687e51..03c8e51 100644
--- a/app/libraries/ExperimentUtilities.php
+++ b/app/libraries/ExperimentUtilities.php
@@ -681,19 +681,21 @@ class ExperimentUtilities
 
         foreach ((array)$outputs as $output) {
             if ($output->type == DataType::URI || $output->type == 
DataType::STDOUT || $output->type == DataType::STDERR) {
-                $dataProductModel = 
Airavata::getDataProduct(Session::get('authz-token'), $output->value);
-                $currentInputPath = "";
-                foreach ($dataProductModel->replicaLocations as $rp) {
-                    if ($rp->replicaLocationCategory == 
ReplicaLocationCategory::GATEWAY_DATA_STORE) {
-                        $currentInputPath = $rp->filePath;
-                        break;
+                if(!empty($output->value)){
+                    $dataProductModel = 
Airavata::getDataProduct(Session::get('authz-token'), $output->value);
+                    $currentInputPath = "";
+                    foreach ($dataProductModel->replicaLocations as $rp) {
+                        if ($rp->replicaLocationCategory == 
ReplicaLocationCategory::GATEWAY_DATA_STORE) {
+                            $currentInputPath = $rp->filePath;
+                            break;
+                        }
                     }
+                    $dataRoot = 
Config::get("pga_config.airavata")["experiment-data-absolute-path"];
+                    if (!ExperimentUtilities::endsWith($dataRoot, "/"))
+                        $dataRoot = $dataRoot . "/";
+                    $filePath = str_replace($dataRoot, "", 
parse_url($currentInputPath, PHP_URL_PATH));
+                    echo '<p><a target="_blank" href="' . URL::to("/") . 
'/download/?path=' . $filePath . '">' . basename($filePath) . ' <span 
class="glyphicon glyphicon-new-window"></span></a></p>';
                 }
-                $dataRoot = 
Config::get("pga_config.airavata")["experiment-data-absolute-path"];
-                if (!ExperimentUtilities::endsWith($dataRoot, "/"))
-                    $dataRoot = $dataRoot . "/";
-                $filePath = str_replace($dataRoot, "", $currentInputPath);
-                echo '<p><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

Reply via email to