You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by ma...@apache.org on 2019/11/03 22:33:39 UTC

[airavata-php-gateway] 01/01: Merge remote-tracking branch 'origin/master' into dreg-gateway

This is an automated email from the ASF dual-hosted git repository.

machristie pushed a commit to branch dreg-gateway
in repository https://gitbox.apache.org/repos/asf/airavata-php-gateway.git

commit cf7a5bb229c105ce79cc104acbe68cc434d146b3
Merge: 4032a75 fd243bd
Author: Marcus Christie <ma...@iu.edu>
AuthorDate: Sun Nov 3 17:32:36 2019 -0500

    Merge remote-tracking branch 'origin/master' into dreg-gateway

 README                                             |     4 +
 app/config/app.php                                 |     1 +
 app/config/pga_config.php.template                 |    21 +-
 app/controllers/AccountController.php              |    57 +-
 app/controllers/AdminController.php                |    29 +-
 app/controllers/ExperimentController.php           |    34 +-
 app/controllers/ProjectController.php              |    19 +-
 app/libraries/AdminUtilities.php                   |    33 +-
 app/libraries/Airavata/API/Airavata.php            | 26792 ++++++++++++-------
 .../API/Sharing/SharingRegistryService.php         |   961 +-
 app/libraries/Airavata/API/Sharing/Types.php       |     8 +
 app/libraries/Airavata/API/Types.php               |     2 +-
 app/libraries/Airavata/Base/API/BaseAPI.php        |   218 +
 .../Airavata/{API/Sharing => Base/API}/Types.php   |     2 +-
 .../Airavata/Facades/GroupManagerServices.php      |    16 +
 .../Airavata/GroupManagerServiceProvider.php       |    83 +
 .../Model/AppCatalog/GatewayGroups/Types.php       |   164 +
 .../AppCatalog/GroupResourceProfile/Types.php      |  1405 +
 .../Airavata/Model/AppCatalog/Parser/Types.php     |  1407 +
 .../Model/AppCatalog/StorageResource/Types.php     |    46 +
 .../Model/AppCatalog/UserResourceProfile/Types.php |    26 -
 .../Airavata/Model/Application/Io/Types.php        |    23 +
 .../Airavata/Model/Credential/Store/Types.php      |    35 +-
 .../Airavata/Model/Data/Movement/Types.php         |    69 +
 app/libraries/Airavata/Model/Experiment/Types.php  |    55 +
 app/libraries/Airavata/Model/Group/Types.php       |    65 +-
 app/libraries/Airavata/Model/Process/Types.php     |   242 +-
 app/libraries/Airavata/Model/Sharing/Types.php     |    52 +
 app/libraries/Airavata/Model/Status/Types.php      |    92 +
 app/libraries/Airavata/Model/Task/Types.php        |    46 +
 app/libraries/Airavata/Model/Types.php             |  1111 -
 app/libraries/Airavata/Model/Workflow/Types.php    |  2176 ++
 .../Iam/Admin/Services/CPI/IamAdminServices.php    |  1804 +-
 .../Service/Iam/Admin/Services/CPI/Types.php       |     2 +-
 .../Groupmanager/CPI/GroupManagerService.php       |  1559 +-
 .../Service/Profile/Groupmanager/CPI/Types.php     |     2 +-
 .../Profile/Tenant/CPI/TenantProfileService.php    |   281 +-
 .../Airavata/Service/Profile/Tenant/CPI/Types.php  |     2 +-
 .../Airavata/Service/Profile/User/CPI/Types.php    |     2 +-
 .../Profile/User/CPI/UserProfileService.php        |   493 +-
 app/libraries/ExperimentUtilities.php              |   106 +-
 app/libraries/GrouperUtilities.php                 |    16 +-
 app/libraries/IamAdminServicesUtilities.php        |     4 +-
 app/libraries/ProjectUtilities.php                 |    13 +-
 app/libraries/SharingUtilities.php                 |    76 +-
 app/libraries/URPUtilities.php                     |    21 +-
 app/libraries/UserProfileUtilities.php             |     4 +
 app/routes.php                                     |    11 +-
 app/views/admin/manage-credentials.blade.php       |   370 +-
 app/views/admin/redirect-django.blade.php          |    39 +
 app/views/experiment/summary.blade.php             |     6 +-
 .../compute-resource-preferences.blade.php         |    10 +-
 app/views/partials/experiment-info.blade.php       |    16 +-
 .../partials/gateway-preferences-block.blade.php   |    22 +-
 .../storage-resource-preferences.blade.php         |    10 +-
 55 files changed, 28637 insertions(+), 11526 deletions(-)

diff --cc app/libraries/ExperimentUtilities.php
index 84703dd,dde5f97..3395336
--- a/app/libraries/ExperimentUtilities.php
+++ b/app/libraries/ExperimentUtilities.php
@@@ -145,6 -120,38 +120,38 @@@ class ExperimentUtilitie
          }
      }
  
+     private static function get_uri_collection_value_display($value) {
+ 
+         $displayHtml = "";
+         $uriList = $value;
+         $uriList = preg_split('/,/', $uriList);
+ 
+         foreach($uriList as $uri){
+             $currentInputPath = "";
+             if (strpos($uri, "airavata-dp") === 0) {
+                 $dataProductModel = Airavata::getDataProduct(Session::get('authz-token'), $uri);
+                 foreach ($dataProductModel->replicaLocations as $rp) {
+                     if ($rp->replicaLocationCategory == ReplicaLocationCategory::GATEWAY_DATA_STORE) {
+                         $currentInputPath = $rp->filePath;
+                         break;
+                     }
+                 }
+                 $fileName = basename($currentInputPath);
+             } else {
+                 $fileName = basename($value);
+             }
+ 
+             $path = parse_url($currentInputPath)['path'];
+             if(file_exists($path)){
+                 $displayHtml = $displayHtml . '<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;';
+             } else {
+                 $displayHtml = $displayHtml . $fileName . self::FILE_UNAVAILABLE_ICON_TOOLTIP;
+             }
+         }
+         return $displayHtml;
+     }
+ 
      /**
       * List the process's input files
       * @param $experiment
@@@ -917,29 -911,22 +932,31 @@@
                              </div>';
                          break;
                      }else{
 +                        $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';
 +
 +//change file-upload by Tus in the dREG gateway
                          echo '<div class="form-group">
                              <label for="experiment-input">' . $input->name . '</label>
 -                            <div data-file-id="' . $input->sanitizedFormName . '" class="readBytesButtons btn btn-default btn-xs"
 -                             data-toggle="modal" style="float: right">view file</div>
 +                             <div data-file-id="' . $input->sanitizedFormName . '" class="readBytesButtons btn btn-default btn-xs"
 +                                    data-toggle="modal" style="float: right">view file</div>
                               <div class="file-upload-container">
 -                                <input class="file-input" type="file" name="' . $input->sanitizedFormName .
 -                                        '" id="' . $input->sanitizedFormName . '" ' . $required . '>
 -                                    <div class="file-upload-max-size">Max Upload Size: ' . $allowedFileSize .'M</div>
 +                                <input class="file-input" type="file" name="file-' . $input->sanitizedFormName .'" id="file-' . $input->sanitizedFormName . '" ' . $required . '>
 +                                <input type="hidden" class="urlpath" id="' . $input->sanitizedFormName . '" name="' . $input->sanitizedFormName . '" "'. $required .'" value="">
 +                                <!--<div class="file-upload-max-size">Max Upload Size: ' . $allowedFileSize .'M</div>-->
                               </div>
                              <p class="help-block">' . $input->userFriendlyDescription . '</p>
 +                            <div class="progress fadeIn animated" style="display:none">
 +                               <div id="progressBar" class="progress-bar progress-bar-striped progress-success"  data-file-id="' . $input->sanitizedFormName . '" style="width: 0%;"></div>
 +                            </div>
                              </div>';
 +//End of change
                          break;
                      }
- 
+                 case DataType::URI_COLLECTION:
+                     // Support for URI_COLLECTION is not implemented in PGA, just ignore
+                     break;
                  default:
                      CommonUtilities::print_error_message('Input data type not supported!
                      Please file a bug report using the link in the Help menu.');
diff --cc app/views/partials/experiment-info.blade.php
index 867aeca,93768dd..e119489
--- a/app/views/partials/experiment-info.blade.php
+++ b/app/views/partials/experiment-info.blade.php
@@@ -194,93 -184,8 +194,93 @@@ If the job is failed, please refer <A h
          </tr>
          <tr>
              <td><strong>Outputs</strong></td>
 +{{-- Commented by dREG
-             <td>{{ ExperimentUtilities::list_output_files($experiment->experimentOutputs, $experiment->experimentStatus[0]->state, false) }}</td>
+             <td>{{ ExperimentUtilities::list_output_files($experiment->experimentOutputs, ExperimentUtilities::latestStatus($experiment->experimentStatus)->state, false) }}</td>
          </tr>
 +--}}
 +
 +{{-- Added by dREG --}}
 +<?php
 +    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;
 +    }
 +
 +    $dataRoot = Config::get("pga_config.airavata")["experiment-data-absolute-path"];
 +
 +
 +    $param_prefix = "out";
 +    if( count( $experiment->experimentInputs) > 0 ) 
 +       foreach( $experiment->experimentInputs as $input)
 +       {
 +          if ($input->applicationArgument == "prefix") {
 +              $param_prefix = $input->value;
 +          }
 +       } 
 +?>
 +            <td>
 +
 +@if(  $expVal["applicationInterface"]->applicationName !== "dTOX prediction"  ) 
 +                <select id="download">
 +                    <option value=''>Select results</option>
 +@if(file_exists($dataRoot . '/' . $expDataDir. '/ARCHIVE/'.$param_prefix.'.tar.gz') )
 +                    <option value=<?php echo $param_prefix.".tar.gz" ?>>Full results</option>  
 +@endif
 +@if(file_exists($dataRoot . '/' . $expDataDir. '/ARCHIVE/'.$param_prefix.'.dREG.infp.bed.gz') )
 +                    <option value=<?php echo $param_prefix.".dREG.infp.bed.gz"?>>dREG informative sites</option>
 +@endif
 +@if(file_exists($dataRoot . '/' . $expDataDir. '/ARCHIVE/'.$param_prefix.'.dREG.peak.full.bed.gz') )
 +                    <option value=<?php echo $param_prefix.".dREG.peak.full.bed.gz"?>>dREG peaks </option> 
 +@endif
 +@if(file_exists($dataRoot . '/' . $expDataDir. '/ARCHIVE/'.$param_prefix.'.dREG.peak.score.bed.gz') )
 +                    <option value=<?php echo $param_prefix.".dREG.peak.score.bed.gz"?>>dREG peak(only with scores)</option>
 +@endif
 +                </select> &nbsp;&nbsp;
 +@else
 +                <select id="download">
 +                    <option value=''>Select results</option>
 +@if(file_exists($dataRoot . '/' . $expDataDir. '/ARCHIVE/'.$param_prefix.'.tar.gz') )
 +                    <option value=<?php echo $param_prefix.".tar.gz" ?>>Full results</option>
 +@endif
 +@if(file_exists($dataRoot . '/' . $expDataDir. '/ARCHIVE/'.$param_prefix.'.dTOX.bound.bed.gz') )
 +                    <option value=<?php echo $param_prefix.".dTOX.bound.bed.gz"?>>dTOX bound regions </option>
 +@endif
 +                </select> &nbsp;&nbsp;
 +
 +
 +@endif
 +
 +
 +<button id="retLinks" style="color: #fff; background-color: #3e5a43; border-color: #46b8da; border: 1px solid transparent;" >Download&nbsp;<span class="glyphicon glyphicon-save"  style="width:20px"></span></button>
 +            </td>
 +        </tr>
 +        <tr>
 +            <td><strong>Genome Browser</strong></td>
 +            <td>
 +
 +@if(  $expVal["applicationInterface"]->applicationName !== "dTOX prediction"  )
 +                <select id="genomebuilder">
 +                    <option value="">Select genome </option>
 +                    <option value="hg19">hg19</option>
 +                    <option value="hg38">hg38</option>  
 +                    <option value="mm10">mm10</option>
 +                </select>
 +@else
 +                <select id="genomebuilder">
 +                    <option value="">Select genome </option>
 +                    <option value="hg19">hg19</option>
 +                    <option value="mm10">mm10</option>
 +                </select>
 +@endif
 + 
 +                &nbsp;or input&nbsp;&nbsp;&nbsp;&nbsp;
 +                <input type="text" id="customeGB" style="width:40px"/> &nbsp;&nbsp; 
 +<!--  	        <a href="#1" target="_blank" id="gbLinks">Switch to genome browser&nbsp;<span class="glyphicon glyphicon-new-window"  style="width:20px"></span></a> -->
 +<button id="gbLinks" style="color: #fff; background-color: #3e5a43; border-color: #46b8da; border: 1px solid transparent;">Switch to genome browser&nbsp;<span class="glyphicon glyphicon-new-window" style="width:20px"></span></button>
 +            </td>
 +        </tr>
 +{{-- dREG --}}
          <tr>
              <td><strong>Storage Directory</strong></td>
              <?php