Repository: airavata-php-gateway
Updated Branches:
  refs/heads/dreg-gateway e11970022 -> cbd43e133


bug in json file for genome browser


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

Branch: refs/heads/dreg-gateway
Commit: cbd43e133203d0403d2486715fc18ab6ebe585f7
Parents: e119700
Author: root <root@osboxes>
Authored: Mon Feb 6 16:02:23 2017 +0000
Committer: root <root@osboxes>
Committed: Mon Feb 6 16:02:23 2017 +0000

----------------------------------------------------------------------
 app/libraries/ExperimentUtilities.php           |   4 +-
 app/routes.php                                  |  73 +++++--------------
 app/views/partials/experiment-info.blade.php    |  40 +++++++++-
 public/themes/dreg/assets/img/cornell-logo.png  | Bin 23327 -> 23321 bytes
 public/themes/dreg/assets/img/dankolab-logo.png | Bin 228884 -> 56271 bytes
 5 files changed, 56 insertions(+), 61 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/cbd43e13/app/libraries/ExperimentUtilities.php
----------------------------------------------------------------------
diff --git a/app/libraries/ExperimentUtilities.php 
b/app/libraries/ExperimentUtilities.php
index 12718f1..d3a900b 100755
--- a/app/libraries/ExperimentUtilities.php
+++ b/app/libraries/ExperimentUtilities.php
@@ -100,7 +100,7 @@ class ExperimentUtilities
                     }
 
                     echo '<p>' . $input->name . ':&nbsp;<a target="_blank" 
href="' . URL::to("/") . '/download/?id='
-                        . $input->value . '">' . $fileName . ' <span 
class="glyphicon glyphicon-new-window"></span></a></p>';
+                        . $input->value . '">' . $fileName . ' <span 
class="glyphicon glyphicon-save"></span></a></p>';
 
                 }else if($input->type == DataType::URI_COLLECTION) {
                     $uriList = $input->value;
@@ -122,7 +122,7 @@ class ExperimentUtilities
                         }
 
                         $optFilesHtml = $optFilesHtml . '<a target="_blank" 
href="' . URL::to("/") . '/download/?id='
-                            . $uri . '">' . $fileName . ' <span 
class="glyphicon glyphicon-new-window"></span></a>&nbsp;';
+                            . $uri . '">' . $fileName . ' <span 
class="glyphicon glyphicon-save"></span></a>&nbsp;';
 
                     }
 

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/cbd43e13/app/routes.php
----------------------------------------------------------------------
diff --git a/app/routes.php b/app/routes.php
index 05bec1e..b1a18d6 100755
--- a/app/routes.php
+++ b/app/routes.php
@@ -162,59 +162,20 @@ Route::get("files/get","FilemanagerController@get");
 
 // Added by dREG 
 Route::get("gbrowser", function(){
-
-    $experiment = ExperimentUtilities::get_experiment(Input::get('expId'));
-
-    if(0 === strpos($experiment->userConfigurationData->experimentDataDir, 
Config::get("pga_config.airavata")['experiment-data-absolute-path'])){
-        $expDataDir = 
str_replace(Config::get("pga_config.airavata")['experiment-data-absolute-path'],
 "", $experiment->userConfigurationData->experimentDataDir);
-    }else{
-        $expDataDir = $experiment->userConfigurationData->experimentDataDir;
-    }
-
-    $folder_path = $expDataDir . 'ARCHIVE';
-    if(strpos($folder_path, "/")==0)
-        $folder_path = substr($folder_path, 1);
-
-    ob_start();
-    ExperimentUtilities::list_input_files($experiment->experimentInputs);
-    $html = ob_get_contents();
-    ob_end_clean();
- 
-    $DOM = new DOMDocument;
-    $DOM->loadHTML( $html . "<H1>A</H1>");
-
-    $content = "[\n";
-    $items = $DOM->getElementsByTagName('a');
-    for ($i = 0; $i < $items->length; $i++)
-    {
-         $fname = $items->item($i)->nodeValue ;
-          $fhref = $items->item($i)->getAttribute("href") ;
-          if(strpos($fhref, 'airavata-dp:')===false)
-          {
-          }
-          else
-          {
-               $id= substr($fhref, strpos($fhref, 'airavata-dp:') );
-          } 
-       
-          $dataProductModel = 
Airavata::getDataProduct(Session::get('authz-token'), $id);
-          $currentOutputPath = "";
-          foreach ($dataProductModel->replicaLocations as $rp) {
-              if($rp->replicaLocationCategory == 
Airavata\Model\Data\Replica\ReplicaLocationCategory::GATEWAY_DATA_STORE){
-                  $currentOutputPath = $rp->filePath;
-                  break;
-              }
-          }
- 
-         $dataRoot = 
Config::get("pga_config.airavata")["experiment-data-absolute-path"];
-         $fpath = str_replace($dataRoot, "", parse_url($currentOutputPath, 
PHP_URL_PATH));
-         if(strpos($fpath, "/")==0)
-            $fpath = substr($fpath, 1);
-         
+    $protocol = 'http';
+    if ( isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] == 'on' || 
$_SERVER['HTTPS'] == 1) || isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && 
$_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') 
+        $protocol = 'https';
+
+    $dataRoot = 
Config::get("pga_config.airavata")["experiment-data-absolute-path"];
+    $filelist = explode("\n", urldecode( Input::get('filelist') ) );
+    $folder_path=$filelist[0]. "ARCHIVE" ;
+    $content = "";
+    
+    for($i=1; $i<3; $i++){    
          $content = $content . ' {
          type:"bigwig",
-         url:"http://'. $_SERVER['HTTP_HOST'] .'/download?path='. $fpath . '",
-         name: "'. $fname.'",
+         url:"'.$protocol.'://'. $_SERVER['HTTP_HOST'] .'/download?path='. 
$filelist[$i*2] . '",
+         name: "'. $filelist[$i*2-1] .'",
          fixedscale:{min:0,max:20},
          colorpositive:"rgb(197,0,11)",
          height:50,
@@ -224,7 +185,7 @@ Route::get("gbrowser", function(){
 
     $content = $content . '{
        type:"bedgraph",
-         url:"http://'. $_SERVER['HTTP_HOST'] .'/gbfile?path='. $folder_path . 
'/out.dREG.pred.gz",
+         url:"'.$protocol.'://'. $_SERVER['HTTP_HOST'] .'/download?path='. 
$folder_path . '/out.dREG.pred.gz",
          name: "dREG informative pos.:",
          mode: "show",
          colorpositive:"#0000e5/#B30086",
@@ -235,7 +196,7 @@ Route::get("gbrowser", function(){
 
     $content = $content . '{
        type:"bedgraph",
-         url:"http://'. $_SERVER['HTTP_HOST'] .'/gbfile?path='. $folder_path . 
'/out.dREG.peak.gz",
+         url:"'.$protocol.'://'. $_SERVER['HTTP_HOST'] .'/download?path='. 
$folder_path . '/out.dREG.peak.gz",
          name: "dREG Peak Calling:",
          mode: "show",
          colorpositive:"#0000e5/#B30086",
@@ -246,7 +207,7 @@ Route::get("gbrowser", function(){
 
     $content = $content . '{
        type:"bigwig",
-         url:"http://'. $_SERVER['HTTP_HOST'] .'/gbfile?path='. $folder_path . 
'/out.dREG.HD.imputedDnase.bw",
+         url:"'.$protocol.'://'. $_SERVER['HTTP_HOST'] .'/download?path='. 
$folder_path . '/out.dREG.HD.imputedDnase.bw",
          name: "imputed DNase-I signal:",
          fixedscale:{min:0,max:20},
          colorpositive:"rgb(197,0,11)",
@@ -256,7 +217,7 @@ Route::get("gbrowser", function(){
 
     $content = $content . '{
        type:"bedgraph",
-         url:"http://'. $_SERVER['HTTP_HOST'] .'/gbfile?path='. $folder_path . 
'/out.dREG.HD.relaxed.bed",
+         url:"'.$protocol.'://'. $_SERVER['HTTP_HOST'] .'/download?path='. 
$folder_path . '/out.dREG.HD.relaxed.bed",
          name: "dREG.HD relaxed peaks:",
          mode: "show",
          colorpositive:"#0000e5/#B30086",
@@ -267,7 +228,7 @@ Route::get("gbrowser", function(){
 
     $content = $content . '{
        type:"bedgraph",
-         url:"http://'. $_SERVER['HTTP_HOST'] .'/gbfile?path='. $folder_path . 
'/out.dREG.HD.stringent.bed",
+         url:"'.$protocol.'://'. $_SERVER['HTTP_HOST'] .'/download?path='. 
$folder_path . '/out.dREG.HD.stringent.bed",
          name: "dREG.HD stringent peaks:",
          mode: "show",
          colorpositive:"#0000e5/#B30086",

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/cbd43e13/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
old mode 100644
new mode 100755
index 2144873..5a4e4a5
--- a/app/views/partials/experiment-info.blade.php
+++ b/app/views/partials/experiment-info.blade.php
@@ -204,7 +204,7 @@
 <script type="text/javascript">
 function download(d) {
         if (d == 'Download one result') return;
-        
window.open('https://{{$_SERVER['HTTP_HOST']}}/download?path={{$expDataDir}}/ARCHIVE/'
 + d);
+        window.open('/download?path={{$expDataDir}}/ARCHIVE/' + d);
 }
 </script>
  
@@ -218,10 +218,44 @@ function download(d) {
 </select>
 &nbsp;&nbsp;&nbsp;&nbsp;
 
-<a href="/download?path={{$expDataDir}}/ARCHIVE/out.dREG.tar.gz" 
target="_blank"><span class="glyphicon glyphicon-save"  
style="width:20px"></span>Download All Results</a>
+<a href="/download?path={{$expDataDir}}/ARCHIVE/out.dREG.tar.gz" 
target="_blank">Download All Results&nbsp;<span class="glyphicon 
glyphicon-save"  style="width:20px"></span></a>
 &nbsp;&nbsp;&nbsp;&nbsp;
 
-<a 
href="http://epigenomegateway.wustl.edu/browser/?genome=hg19&datahub=https://{{$_SERVER['HTTP_HOST']}}/gbrowser?expId={{$_GET['expId']}}"
 target="_blank"><span class="glyphicon glyphicon-new-window"  
style="width:20px"></span>Genome Browser</a>
+<?php
+       $filelist="";
+        $dataRoot = 
Config::get("pga_config.airavata")["experiment-data-absolute-path"];
+
+        if( count( $experiment->experimentInputs) > 0 ) 
+            foreach( $experiment->experimentInputs as $input)
+                if ($input->type == 
Airavata\Model\Application\Io\DataType::URI) {
+               
+                    $dataProductModel = 
Airavata::getDataProduct(Session::get('authz-token'), $input->value);
+                    $currentOutputPath = "";
+                    foreach ($dataProductModel->replicaLocations as $rp) 
+                      if($rp->replicaLocationCategory == 
Airavata\Model\Data\Replica\ReplicaLocationCategory::GATEWAY_DATA_STORE){
+                        $currentOutputPath = $rp->filePath;
+                      break;
+                    }
+                   
+                    $path = str_replace($dataRoot, "", 
parse_url($currentOutputPath, PHP_URL_PATH));
+                    $filelist = $filelist . $input->name . "\n". $path. "\n";
+                }
+
+    $protocol = 'http';
+    if ( isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] == 'on' || 
$_SERVER['HTTPS'] == 1) || isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && 
$_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') 
+        $protocol = 'https';
+
+    if(0 === strpos($experiment->userConfigurationData->experimentDataDir, 
Config::get("pga_config.airavata")['experiment-data-absolute-path'])){
+        $expDataDir = 
str_replace(Config::get("pga_config.airavata")['experiment-data-absolute-path'],
 "", $experiment->userConfigurationData->experimentDataDir);
+    }else{
+        $expDataDir = $experiment->userConfigurationData->experimentDataDir;
+    }
+    
+    $filelist=$expDataDir ."\n". $filelist;
+?>
+
+<a 
href="http://epigenomegateway.wustl.edu/browser/?genome=hg19&datahub={{$protocol}}://{{$_SERVER['HTTP_HOST']}}/gbrowser?filelist={{urlencode($filelist)}}"
 target="_blank">
+Genome Browser&nbsp;<span class="glyphicon glyphicon-new-window" 
style="width:20px"></span></a>
         </td>
         </tr>
 {{-- dREG --}}

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/cbd43e13/public/themes/dreg/assets/img/cornell-logo.png
----------------------------------------------------------------------
diff --git a/public/themes/dreg/assets/img/cornell-logo.png 
b/public/themes/dreg/assets/img/cornell-logo.png
index b47e640..b567aa1 100755
Binary files a/public/themes/dreg/assets/img/cornell-logo.png and 
b/public/themes/dreg/assets/img/cornell-logo.png differ

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/cbd43e13/public/themes/dreg/assets/img/dankolab-logo.png
----------------------------------------------------------------------
diff --git a/public/themes/dreg/assets/img/dankolab-logo.png 
b/public/themes/dreg/assets/img/dankolab-logo.png
index 9210291..b12ce4e 100755
Binary files a/public/themes/dreg/assets/img/dankolab-logo.png and 
b/public/themes/dreg/assets/img/dankolab-logo.png differ

Reply via email to