You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by sm...@apache.org on 2016/03/11 08:00:17 UTC

[01/21] airavata-php-gateway git commit: appending project dir to pga experiment dir path

Repository: airavata-php-gateway
Updated Branches:
  refs/heads/master 8ae672d2e -> ffe3b4e53


appending project dir to pga experiment dir path


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

Branch: refs/heads/master
Commit: bfa3b39f684bb42dedfcee8c7e6b8b17ea706a35
Parents: 3d99c1d
Author: scnakandala <su...@gmail.com>
Authored: Mon Mar 7 10:57:58 2016 -0500
Committer: scnakandala <su...@gmail.com>
Committed: Mon Mar 7 10:57:58 2016 -0500

----------------------------------------------------------------------
 app/libraries/ExperimentUtilities.php | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/bfa3b39f/app/libraries/ExperimentUtilities.php
----------------------------------------------------------------------
diff --git a/app/libraries/ExperimentUtilities.php b/app/libraries/ExperimentUtilities.php
index acd6822..e85a180 100644
--- a/app/libraries/ExperimentUtilities.php
+++ b/app/libraries/ExperimentUtilities.php
@@ -181,10 +181,10 @@ class ExperimentUtilities
         }
 
         $applicationInputs = AppUtilities::get_application_inputs($_POST['application']);
-        $experimentInputs = ExperimentUtilities::process_inputs($applicationInputs, $experimentInputs);
+        $experimentInputs = ExperimentUtilities::process_inputs($_POST['project'], $_POST['experiment-name'], $applicationInputs, $experimentInputs);
 
         if (ExperimentUtilities::$experimentPath == null) {
-            ExperimentUtilities::create_experiment_folder_path();
+            ExperimentUtilities::create_experiment_folder_path($_POST['project'], $_POST['experiment-name']);
         }
         $userConfigData->experimentDataDir = ExperimentUtilities::$relativeExperimentDataDir;
 
@@ -221,7 +221,7 @@ class ExperimentUtilities
      * @internal param $environmentPath
      * @return array
      */
-    public static function process_inputs($applicationInputs, $experimentInputs)
+    public static function process_inputs($projectId, $experimentName, $applicationInputs, $experimentInputs)
     {
         $experimentAssemblySuccessful = true;
         $newExperimentInputs = array();
@@ -231,7 +231,7 @@ class ExperimentUtilities
         if (sizeof($_FILES) > 0) {
             if (ExperimentUtilities::file_upload_successful()) {
                 // construct unique path
-                ExperimentUtilities::create_experiment_folder_path();
+                ExperimentUtilities::create_experiment_folder_path($projectId, $experimentName);
             } else {
                 $experimentAssemblySuccessful = false;
             }
@@ -348,10 +348,14 @@ class ExperimentUtilities
     }
 
 
-    public static function create_experiment_folder_path()
+    public static function create_experiment_folder_path($projectId, $experimentName)
     {
         do {
-            ExperimentUtilities::$relativeExperimentDataDir = "/" . Session::get('username') . "/" . md5(rand() * time()) . '/';
+            $projectId = substr($projectId, 0, -37);
+            $experimentName = preg_replace('/[^a-zA-Z0-9]+/', '_', $experimentName);
+
+            ExperimentUtilities::$relativeExperimentDataDir = "/" . Session::get('username') . "/" . $projectId . "/"
+                        . $experimentName . time() . '/';
             ExperimentUtilities::$experimentPath = Config::get('pga_config.airavata')['experiment-data-absolute-path'] .
                 ExperimentUtilities::$relativeExperimentDataDir;
         } while (is_dir(ExperimentUtilities::$experimentPath)); // if dir already exists, try again
@@ -432,7 +436,7 @@ class ExperimentUtilities
             //updating the experiment inputs and output path
             $experiment = Airavata::getExperiment(Session::get('authz-token'), $cloneId);
             $experimentInputs = $experiment->experimentInputs;
-            ExperimentUtilities::create_experiment_folder_path();
+            ExperimentUtilities::create_experiment_folder_path($experiment->projectId, $experiment->name);
             $hostName = $_SERVER['SERVER_NAME'];
 
             foreach ($experimentInputs as $experimentInput) {
@@ -1101,7 +1105,7 @@ class ExperimentUtilities
         $applicationInputs = AppUtilities::get_application_inputs($experiment->executionId);
 
         $experimentInputs = $experiment->experimentInputs; // get current inputs
-        $experimentInputs = ExperimentUtilities::process_inputs($applicationInputs, $experimentInputs); // get new inputs
+        $experimentInputs = ExperimentUtilities::process_inputs($input['project'], $input['experiment-name'], $applicationInputs, $experimentInputs); // get new inputs
 
         if ($experimentInputs) {
             $experiment->experimentInputs = $experimentInputs;


[15/21] airavata-php-gateway git commit: dir browse working with dir parameter

Posted by sm...@apache.org.
dir browse working with dir parameter


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

Branch: refs/heads/master
Commit: 7a6686545aa33616f26dc7c128284d6cf6f524a4
Parents: 37f7e61
Author: scnakandala <su...@gmail.com>
Authored: Tue Mar 8 13:30:49 2016 -0500
Committer: scnakandala <su...@gmail.com>
Committed: Tue Mar 8 13:30:49 2016 -0500

----------------------------------------------------------------------
 app/controllers/FilemanagerController.php |  6 +++++-
 app/routes.php                            | 11 +++--------
 2 files changed, 8 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/7a668654/app/controllers/FilemanagerController.php
----------------------------------------------------------------------
diff --git a/app/controllers/FilemanagerController.php b/app/controllers/FilemanagerController.php
index 226a92e..45e8bd4 100644
--- a/app/controllers/FilemanagerController.php
+++ b/app/controllers/FilemanagerController.php
@@ -11,8 +11,12 @@ class FilemanagerController extends BaseController
 
     public function browse(){
 		//FIXME check for no ../ paths
-		if(Input::has("path") && (0 === strpos(Input::get("path"), Session::get('username')))){
+		if(Input::has("path") && (0 == strpos(Input::get("path"), Session::get('username'))
+				|| 0 == strpos(Input::get("path"), "/" . Session::get('username')))){
 			$path = Input::get("path");
+			if(0 === strpos($path, '/')){
+				$path = substr($path, 1);
+			}
 		}else{
 			$path = Session::get("username");
 		}

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/7a668654/app/routes.php
----------------------------------------------------------------------
diff --git a/app/routes.php b/app/routes.php
index bdaba7b..2e74b92 100644
--- a/app/routes.php
+++ b/app/routes.php
@@ -98,20 +98,15 @@ Route::get("experiment/browse", "ExperimentController@browseView");
 Route::post("experiment/browse", "ExperimentController@browseView");
 
 
-Route::get("download/{username}/{exp_data_dir}/{exp_folder}/{exp_file}", function( $username, $exp_data_dir, $exp_folder, $exp_file){
+Route::get("download/{username}/{proj_folder}/{exp_folder}/{exp_file}", function( $username, $proj_folder, $exp_folder, $exp_file){
     //FIXME check for no ../ paths
     if( $username == Session::get("username")){
-        $downloadLink = Config::get('pga_config.airavata')['experiment-data-absolute-path'] . '/' . $username . '/' . $exp_data_dir . "/" . $exp_folder . '/' . $exp_file;
+        $downloadLink = Config::get('pga_config.airavata')['experiment-data-absolute-path'] . '/' . $username
+            . '/' . $proj_folder . "/" . $exp_folder . '/' . $exp_file;
         return Response::download( $downloadLink);
     }
 });
 
-Route::get("download/{exp_data_dir}/{proj_folder}/{exp_file}", function($exp_data_dir, $proj_folder, $exp_file){
-    $downloadLink = Config::get('pga_config.airavata')['experiment-data-absolute-path'] . '/' . Session::get('username')
-        . '/' . $exp_data_dir . '/' . '/' . $proj_folder . '/' . $exp_file;
-    return Response::download( $downloadLink);
-});
-
 Route::get("files/browse", "FilemanagerController@browse");
 
 Route::get("files/get","FilemanagerController@get");


[10/21] airavata-php-gateway git commit: Merge branch 'develop' of https://git-wip-us.apache.org/repos/asf/airavata-php-gateway into develop

Posted by sm...@apache.org.
Merge branch 'develop' of https://git-wip-us.apache.org/repos/asf/airavata-php-gateway into develop

# Conflicts:
#	app/libraries/ExperimentUtilities.php
#	app/routes.php


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

Branch: refs/heads/master
Commit: 5677e06000004ba1fe9579075de8b08cf20c8b28
Parents: e873f1e e1eca29
Author: Nipurn Doshi <ni...@gmail.com>
Authored: Tue Mar 8 12:44:08 2016 -0500
Committer: Nipurn Doshi <ni...@gmail.com>
Committed: Tue Mar 8 12:44:08 2016 -0500

----------------------------------------------------------------------
 .../Model/AppCatalog/AppInterface/Types.php     | 23 +++++++++++
 .../Airavata/Model/Experiment/Types.php         | 23 +++++++++++
 app/libraries/Airavata/Model/Process/Types.php  | 23 +++++++++++
 app/libraries/Airavata/Model/Task/Types.php     |  2 +
 app/libraries/ExperimentUtilities.php           | 40 +++++++++++++-------
 app/routes.php                                  |  7 ++--
 6 files changed, 101 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/5677e060/app/libraries/ExperimentUtilities.php
----------------------------------------------------------------------
diff --cc app/libraries/ExperimentUtilities.php
index 1350193,39acdb1..3423d95
--- a/app/libraries/ExperimentUtilities.php
+++ b/app/libraries/ExperimentUtilities.php
@@@ -76,9 -76,10 +76,12 @@@ class ExperimentUtilitie
              if ($input->type == DataType::URI && empty($input->metaData)) {
                  $inputArray = explode('/', $input->value);
                  echo '<p><a target="_blank"
-                         href="' . URL::to("/") . '/download/' . $inputArray[ count($inputArray)-3] . '/' . $inputArray[ count($inputArray)-2] . '/' . $inputArray[ count($inputArray)-1] . '">' .
 -                        href="' . URL::to("/") . '/download/' . $inputArray[ count($inputArray)-3] . '/' .$inputArray[ count($inputArray)-2] . '/' .
 -                $inputArray[ count($inputArray)-1] . '">' .
--                    $inputArray[ count($inputArray)-1] . '
--                <span class="glyphicon glyphicon-new-window"></span></a></p>';
++                        href="' . URL::to("/") . '/download/' . 
++                                    $inputArray[ count($inputArray)-4] . "/" .
++                                    $inputArray[ count($inputArray)-3] . '/' . 
++                                    $inputArray[ count($inputArray)-2] . '/' . 
++                                    $inputArray[ count($inputArray)-1] . '">' .
++                '<span class="glyphicon glyphicon-new-window"></span></a></p>';
              }elseif($input->type == DataType::URI && !empty($input->metaData)
                  && json_decode($input->metaData)->location=="remote"){
                  echo '<p>' . $input->name . ': ' . $input->value . '</p>';
@@@ -650,9 -656,10 +658,13 @@@
                      $outputPathArray = explode("/", $output->value);
  
                      echo '<p>' . $output->name . ' : ' . '<a target="_blank"
-                             href="' . URL::to("/") . '/download/' . $outputPathArray[ count($outputPathArray)-4] . "/" . $outputPathArray[ count($outputPathArray)-3] . "/" . $outputPathArray[ count($outputPathArray)-2] . '/' .
 -                            href="' . URL::to("/") . '/download/' . $outputPathArray[ count($outputPathArray)-4]
 -                        . "/" . $outputPathArray[ count($outputPathArray)-3] . "/" . $outputPathArray[ count($outputPathArray)-2] . '/' .
--            $outputPathArray[ count($outputPathArray)-1] . '">' .
--                        $outputPathArray[sizeof($outputPathArray) - 1] . ' <span class="glyphicon glyphicon-new-window"></span></a></p>';
++                            href="' . URL::to("/") . '/download/' . 
++                                                $outputPathArray[ count($outputPathArray)-5] . "/" .
++                                                $outputPathArray[ count($outputPathArray)-4] . "/" . 
++                                                $outputPathArray[ count($outputPathArray)-3] . "/" . 
++                                                $outputPathArray[ count($outputPathArray)-2] . '/' . 
++                                                $outputPathArray[ count($outputPathArray)-1] . '">' .
++                        ' <span class="glyphicon glyphicon-new-window"></span></a></p>';
                  }
  //                else
  //                    echo 'Output paths are not correctly defined for : <br/>' . $output->name . '<br/><br/> Please report this issue to the admin<br/><br/>';

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/5677e060/app/routes.php
----------------------------------------------------------------------
diff --cc app/routes.php
index 3ba4afa,f91a454..8472021
mode 100755,100755..100644
--- a/app/routes.php
+++ b/app/routes.php
@@@ -97,17 -97,15 +97,18 @@@ Route::get("experiment/browse", "Experi
  
  Route::post("experiment/browse", "ExperimentController@browseView");
  
 -Route::get("download/{exp_data_dir}/{proj_folder}/{exp_folder}/{exp_file}", function($exp_data_dir, $proj_folder, $exp_folder, $exp_file){
 -    $downloadLink = Config::get('pga_config.airavata')['experiment-data-absolute-path'] . '/' . Session::get('username')
 -        . '/' . $exp_data_dir . "/" . $proj_folder . "/" . $exp_folder . '/' . $exp_file;
 -    return Response::download( $downloadLink);
 -});
++
 +Route::get("download/{username}/{exp_data_dir}/{exp_folder}/{exp_file}", function( $username, $exp_data_dir, $exp_folder, $exp_file){
 +
 +    if( $username == Session::get("username")){
 +        $downloadLink = Config::get('pga_config.airavata')['experiment-data-absolute-path'] . '/' . $username . '/' . $exp_data_dir . "/" . $exp_folder . '/' . $exp_file;
 +        return Response::download( $downloadLink);
 +    }
- });
++}
  
- Route::get("download/{exp_data_dir}/{exp_file}", function($exp_data_dir, $exp_file){
+ Route::get("download/{exp_data_dir}/{proj_folder}/{exp_file}", function($exp_data_dir, $proj_folder, $exp_file){
      $downloadLink = Config::get('pga_config.airavata')['experiment-data-absolute-path'] . '/' . Session::get('username')
-         . '/' . $exp_data_dir . '/' . $exp_file;
+         . '/' . $exp_data_dir . '/' . '/' . $proj_folder . '/' . $exp_file;
      return Response::download( $downloadLink);
  });
  


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

Posted by sm...@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/19e4e661
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/19e4e661
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/19e4e661

Branch: refs/heads/master
Commit: 19e4e66136a0310694ccee6c21978696d497c90e
Parents: 4e85723 0a54650
Author: scnakandala <su...@gmail.com>
Authored: Mon Mar 7 14:59:39 2016 -0500
Committer: scnakandala <su...@gmail.com>
Committed: Mon Mar 7 14:59:39 2016 -0500

----------------------------------------------------------------------
 .../Model/AppCatalog/AppInterface/Types.php     | 23 ++++++++++++++++++++
 .../Airavata/Model/Experiment/Types.php         | 23 ++++++++++++++++++++
 app/libraries/Airavata/Model/Process/Types.php  | 23 ++++++++++++++++++++
 app/libraries/Airavata/Model/Task/Types.php     |  2 ++
 4 files changed, 71 insertions(+)
----------------------------------------------------------------------



[19/21] airavata-php-gateway git commit: Addition of Archiving Working Directory check to Application Interface.

Posted by sm...@apache.org.
Addition of Archiving Working Directory check to Application Interface.


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

Branch: refs/heads/master
Commit: f56256de79a070c939dd55f7fdc6dc849d99bceb
Parents: 38248a2
Author: Nipurn Doshi <ni...@gmail.com>
Authored: Wed Mar 9 15:12:28 2016 -0500
Committer: Nipurn Doshi <ni...@gmail.com>
Committed: Wed Mar 9 15:12:28 2016 -0500

----------------------------------------------------------------------
 app/libraries/AppUtilities.php               |  3 ++-
 app/views/partials/interface-block.blade.php | 11 +++++++++++
 app/views/resource/edit.blade.php            |  2 +-
 public/css/bootstrap.min.css                 |  2 +-
 4 files changed, 15 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


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

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/f56256de/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 1511c22..3f539a9 100644
--- a/app/views/partials/interface-block.blade.php
+++ b/app/views/partials/interface-block.blade.php
@@ -34,6 +34,17 @@
         </div>
         <button type="button" class="hide btn btn-default add-app-module">Add Application Module</button>
     </div>
+    
+    <div class="form-group">
+        <label class="control-label">Enable Archiving Working Directory</label>
+        <select name="archiveWorkingDirectory" class="form-control" style="max-width: 200px" readonly>
+            <option value="0"
+             @if( isset( $interfaceObject) ) @if( false == $interfaceObject->archiveWorkingDirectory ) selected @endif @endif>False</option>
+            <option value="1"
+             @if( isset( $interfaceObject) ) @if( true == $interfaceObject->archiveWorkingDirectory ) selected @endif @endif>True</option>
+        </select>
+    </div>
+
     <div class="form-group form-horizontal">
         @if( isset( $interfaceObject))
         @foreach( (array)$interfaceObject->applicationInputs as $index => $appInputs)

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/f56256de/app/views/resource/edit.blade.php
----------------------------------------------------------------------
diff --git a/app/views/resource/edit.blade.php b/app/views/resource/edit.blade.php
index 6b0c1d4..522e7e5 100644
--- a/app/views/resource/edit.blade.php
+++ b/app/views/resource/edit.blade.php
@@ -38,7 +38,7 @@
     </ul>
 </div>
 
-<div class="tab-content">
+<div class="tab-content col-md-12">
 
 <div class="tab-pane active" id="tab-desc">
 

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/f56256de/public/css/bootstrap.min.css
----------------------------------------------------------------------
diff --git a/public/css/bootstrap.min.css b/public/css/bootstrap.min.css
index a8e57c7..55f50ef 100644
--- a/public/css/bootstrap.min.css
+++ b/public/css/bootstrap.min.css
@@ -61,5 +61,5 @@ body{
 }
 
 .tab-content>.tab-pane {
-    margin-top: 5%;
+    margin-top: 20px;
  }
\ No newline at end of file


[08/21] airavata-php-gateway git commit: fixing issue in last commit

Posted by sm...@apache.org.
fixing issue in last commit


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

Branch: refs/heads/master
Commit: e1eca29714ba25b992d004144891c4d9ce698515
Parents: b231563
Author: scnakandala <su...@gmail.com>
Authored: Mon Mar 7 15:36:13 2016 -0500
Committer: scnakandala <su...@gmail.com>
Committed: Mon Mar 7 15:36:13 2016 -0500

----------------------------------------------------------------------
 app/routes.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/e1eca297/app/routes.php
----------------------------------------------------------------------
diff --git a/app/routes.php b/app/routes.php
index 46983b6..f91a454 100755
--- a/app/routes.php
+++ b/app/routes.php
@@ -103,9 +103,9 @@ Route::get("download/{exp_data_dir}/{proj_folder}/{exp_folder}/{exp_file}", func
     return Response::download( $downloadLink);
 });
 
-Route::get("download/{exp_data_dir}/{exp_file}", function($exp_data_dir, $exp_file){
+Route::get("download/{exp_data_dir}/{proj_folder}/{exp_file}", function($exp_data_dir, $proj_folder, $exp_file){
     $downloadLink = Config::get('pga_config.airavata')['experiment-data-absolute-path'] . '/' . Session::get('username')
-        . '/' . $exp_data_dir . '/' . $exp_file;
+        . '/' . $exp_data_dir . '/' . '/' . $proj_folder . '/' . $exp_file;
     return Response::download( $downloadLink);
 });
 


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

Posted by sm...@apache.org.
Merge remote-tracking branch 'origin/master' 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/ffe3b4e5
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/ffe3b4e5
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/ffe3b4e5

Branch: refs/heads/master
Commit: ffe3b4e53d47f033e3615fe5524b1ee922a5173a
Parents: 09a65f9 8ae672d
Author: Suresh Marru <sm...@apache.org>
Authored: Fri Mar 11 01:59:44 2016 -0500
Committer: Suresh Marru <sm...@apache.org>
Committed: Fri Mar 11 01:59:44 2016 -0500

----------------------------------------------------------------------
 .../Model/AppCatalog/GatewayProfile/Types.php   | 23 ++++++++++++++++++++
 1 file changed, 23 insertions(+)
----------------------------------------------------------------------



[12/21] airavata-php-gateway git commit: creating user directory if not exists

Posted by sm...@apache.org.
creating user directory if not exists


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

Branch: refs/heads/master
Commit: e3ef1269cd6ce6ff4ff894914f2578e4fc494431
Parents: 0592df7
Author: scnakandala <su...@gmail.com>
Authored: Tue Mar 8 13:00:43 2016 -0500
Committer: scnakandala <su...@gmail.com>
Committed: Tue Mar 8 13:00:43 2016 -0500

----------------------------------------------------------------------
 app/controllers/AccountController.php | 7 +++++++
 1 file changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/e3ef1269/app/controllers/AccountController.php
----------------------------------------------------------------------
diff --git a/app/controllers/AccountController.php b/app/controllers/AccountController.php
index 835d19d..0205d58 100755
--- a/app/controllers/AccountController.php
+++ b/app/controllers/AccountController.php
@@ -225,6 +225,13 @@ class AccountController extends BaseController
                 //creating a default project for user
                 ProjectUtilities::create_default_project($username);
             }
+
+            $dirPath = Config::get('pga_config.airavata')['experiment-data-absolute-path'] . "/" . Session::get('username');
+            if(!file_exists($dirPath)){
+                $old_umask = umask(0);
+                mkdir($dirPath, 0777, true);
+                umask($old_umask);
+            }
         }catch (Exception $ex){
             CommonUtilities::print_error_message("Unable to Connect to the Airavata Server Instance!");
             return View::make('home');


[17/21] airavata-php-gateway git commit: fixing file download

Posted by sm...@apache.org.
fixing file download


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

Branch: refs/heads/master
Commit: 338298789b34c2178acaa72c5058bfa51074e1d0
Parents: ce33ae9
Author: scnakandala <su...@gmail.com>
Authored: Tue Mar 8 14:12:52 2016 -0500
Committer: scnakandala <su...@gmail.com>
Committed: Tue Mar 8 14:12:52 2016 -0500

----------------------------------------------------------------------
 app/controllers/FilemanagerController.php |  2 +-
 app/libraries/ExperimentUtilities.php     |  4 ++--
 app/routes.php                            | 14 +++++++++-----
 public/js/filemanager.js                  |  2 +-
 4 files changed, 13 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/33829878/app/controllers/FilemanagerController.php
----------------------------------------------------------------------
diff --git a/app/controllers/FilemanagerController.php b/app/controllers/FilemanagerController.php
index 45e8bd4..127358f 100644
--- a/app/controllers/FilemanagerController.php
+++ b/app/controllers/FilemanagerController.php
@@ -10,7 +10,7 @@ class FilemanagerController extends BaseController
     }
 
     public function browse(){
-		//FIXME check for no ../ paths
+		//FIXME check for no ../ parts in the path
 		if(Input::has("path") && (0 == strpos(Input::get("path"), Session::get('username'))
 				|| 0 == strpos(Input::get("path"), "/" . Session::get('username')))){
 			$path = Input::get("path");

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/33829878/app/libraries/ExperimentUtilities.php
----------------------------------------------------------------------
diff --git a/app/libraries/ExperimentUtilities.php b/app/libraries/ExperimentUtilities.php
index 3a0952e..6b5016c 100644
--- a/app/libraries/ExperimentUtilities.php
+++ b/app/libraries/ExperimentUtilities.php
@@ -76,7 +76,7 @@ class ExperimentUtilities
             if ($input->type == DataType::URI && empty($input->metaData)) {
                 $inputArray = explode('/', $input->value);
                 echo '<p><a target="_blank"
-                        href="' . URL::to("/") . '/download/' . 
+                        href="' . URL::to("/") . '/download?path=' .
                                     $inputArray[ count($inputArray)-4] . "/" .
                                     $inputArray[ count($inputArray)-3] . '/' . 
                                     $inputArray[ count($inputArray)-2] . '/' . 
@@ -659,7 +659,7 @@ class ExperimentUtilities
                     $outputPathArray = explode("/", $output->value);
 
                     echo '<p>' . $output->name . ' : ' . '<a target="_blank"
-                            href="' . URL::to("/") . '/download/' . 
+                            href="' . URL::to("/") . '/download?path=' .
                                                 $outputPathArray[ count($outputPathArray)-5] . "/" .
                                                 $outputPathArray[ count($outputPathArray)-4] . "/" . 
                                                 $outputPathArray[ count($outputPathArray)-3] . "/" . 

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/33829878/app/routes.php
----------------------------------------------------------------------
diff --git a/app/routes.php b/app/routes.php
index 2e74b92..ac4c5a8 100644
--- a/app/routes.php
+++ b/app/routes.php
@@ -98,11 +98,15 @@ Route::get("experiment/browse", "ExperimentController@browseView");
 Route::post("experiment/browse", "ExperimentController@browseView");
 
 
-Route::get("download/{username}/{proj_folder}/{exp_folder}/{exp_file}", function( $username, $proj_folder, $exp_folder, $exp_file){
-    //FIXME check for no ../ paths
-    if( $username == Session::get("username")){
-        $downloadLink = Config::get('pga_config.airavata')['experiment-data-absolute-path'] . '/' . $username
-            . '/' . $proj_folder . "/" . $exp_folder . '/' . $exp_file;
+Route::get("download", function(){
+    //FIXME check for no ../ parts in the path
+    if(Input::has("path") && (0 == strpos(Input::get("path"), Session::get('username'))
+            || 0 == strpos(Input::get("path"), "/" . Session::get('username')))){
+        $path = Input::get("path");
+        if(0 === strpos($path, '/')){
+            $path = substr($path, 1);
+        }
+        $downloadLink = Config::get('pga_config.airavata')['experiment-data-absolute-path'] . '/' . $path;
         return Response::download( $downloadLink);
     }
 });

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/33829878/public/js/filemanager.js
----------------------------------------------------------------------
diff --git a/public/js/filemanager.js b/public/js/filemanager.js
index 35b99b0..7f241dc 100644
--- a/public/js/filemanager.js
+++ b/public/js/filemanager.js
@@ -97,7 +97,7 @@ function show_table(files){
             name_link = '<a href="#" onclick=dir_click("' + f.link + '")>&nbsp;' + f.name + "</a>";
         } else {
             icon_class = 'glyphicon glyphicon-save-file';
-            name_link = '<a href="../download/' + f.link + '">&nbsp;' + f.name + '</a>';
+            name_link = '<a href="../download?path=' + f.link + '">&nbsp;' + f.name + '</a>';
         }
 
         html += '<tr>'


[20/21] airavata-php-gateway git commit: fixing captcha issues to work with IS 5.1.0

Posted by sm...@apache.org.
fixing captcha issues to work with IS 5.1.0


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

Branch: refs/heads/master
Commit: 09a65f9c9f86e5e8c08951a5a3e5e21e73239779
Parents: f56256d
Author: scnakandala <su...@gmail.com>
Authored: Fri Mar 11 01:20:09 2016 -0500
Committer: scnakandala <su...@gmail.com>
Committed: Fri Mar 11 01:20:09 2016 -0500

----------------------------------------------------------------------
 app/config/pga_config.php.template              |  6 ++--
 app/controllers/AccountController.php           | 38 ++++----------------
 .../Stubs/UserInformationRecoveryManager.php    |  7 +++-
 app/libraries/Wsis/Wsis.php                     |  4 +--
 app/views/account/forgot-password.blade.php     | 16 +++++++--
 app/views/account/verify-human.blade.php        | 12 +++----
 6 files changed, 38 insertions(+), 45 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/09a65f9c/app/config/pga_config.php.template
----------------------------------------------------------------------
diff --git a/app/config/pga_config.php.template b/app/config/pga_config.php.template
index 8a65ce5..411a6d7 100644
--- a/app/config/pga_config.php.template
+++ b/app/config/pga_config.php.template
@@ -41,12 +41,12 @@ return array(
         /**
          * OAuth client key
          */
-        'oauth-client-key' => 'iGEREhSBLuGapdcXwMU0b8jEpA4a',
+        'oauth-client-key' => '5_GFR88Nzd4XvGthSMF1fnOJPuMa',
 
         /**
          * OAuth client secret
          */
-        'oauth-client-secret' => 'g4Lgp05JIJcNQryJkNKjXJYi8A8a',
+        'oauth-client-secret' => 'KNTf_LPLuGBDbRVZwkrP_fF5z2Ea',
 
         /**
          * Identity server domain
@@ -56,7 +56,7 @@ return array(
         /**
          * Identity server url
          */
-        'service-url' => 'https://idp.scigap.org:7443/',
+        'service-url' => 'https://idp.scigap.org:9443/',
 
         /**
          * Enable HTTPS server verification

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/09a65f9c/app/controllers/AccountController.php
----------------------------------------------------------------------
diff --git a/app/controllers/AccountController.php b/app/controllers/AccountController.php
index 0205d58..199c773 100755
--- a/app/controllers/AccountController.php
+++ b/app/controllers/AccountController.php
@@ -242,7 +242,9 @@ class AccountController extends BaseController
 
     public function forgotPassword()
     {
-        return View::make("account/forgot-password");
+        $capatcha = WSIS::getCapatcha()->return;
+        return View::make("account/forgot-password", array("imagePath"=>$capatcha->imagePath, "secretKey"=>$capatcha->secretKey,
+                "imageUrl"=> Config::get("pga_config.wsis")["service-url"] . $capatcha->imagePath));
     }
 
     public function forgotPasswordSubmit()
@@ -258,7 +260,7 @@ class AccountController extends BaseController
             else
                 $username = $username . "@" . $wsisConfig['tenant-domain'];
             try{
-                $key = WSIS::validateUser($username);
+                $key = WSIS::validateUser(Input::get("userAnswer"),Input::get("imagePath"),Input::get("secretKey"), $username);
                 if(!empty($key)){
                     $result = WSIS::sendPasswordResetNotification($username, $key);
                     if($result===true){
@@ -331,43 +333,17 @@ class AccountController extends BaseController
                     }
                 }else{
                     $capatcha = WSIS::getCapatcha()->return;
-                    //hack to work with wso2 IS 5.0.0
-                    if (is_array(getimagesize(Config::get('pga_config.wsis')['service-url'] . $capatcha->imagePath))){
-                        return View::make("account/verify-human", array("username"=>$username,"code"=>$confirmation,
-                            "imagePath"=>$capatcha->imagePath, "secretKey"=>$capatcha->secretKey,
-                            "imageUrl"=> Config::get("pga_config.wsis")["service-url"] . $capatcha->imagePath));
-                    }else{
-                        WSIS::confirmUserRegistration("123", $capatcha->imagePath,
-                            $capatcha->secretKey, $username, $confirmation, Config::get('pga_config.wsis')['tenant-domain']);
-                        return Redirect::to("login");
-                    }
+                    return View::make("account/verify-human", array("username"=>$username,"code"=>$confirmation,
+                        "imagePath"=>$capatcha->imagePath, "secretKey"=>$capatcha->secretKey,
+                        "imageUrl"=> Config::get("pga_config.wsis")["service-url"] . $capatcha->imagePath));
                 }
             }catch (Exception $e){
-                var_dump($e);exit;
                 CommonUtilities::print_error_message("Account confirmation failed!");
                 return View::make("home");
             }
         }
     }
 
-    private function checkRemoteFile($url)
-    {
-        $ch = curl_init();
-        curl_setopt($ch, CURLOPT_URL,$url);
-        // don't download content
-        curl_setopt($ch, CURLOPT_NOBODY, 1);
-        curl_setopt($ch, CURLOPT_FAILONERROR, 1);
-        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
-        if(curl_exec($ch)!==FALSE)
-        {
-            return true;
-        }
-        else
-        {
-            return false;
-        }
-    }
-
     private function sendAccountCreationNotification2Admin($username){
 
         $mail = new PHPMailer;

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/09a65f9c/app/libraries/Wsis/Stubs/UserInformationRecoveryManager.php
----------------------------------------------------------------------
diff --git a/app/libraries/Wsis/Stubs/UserInformationRecoveryManager.php b/app/libraries/Wsis/Stubs/UserInformationRecoveryManager.php
index 49490aa..f5535e1 100755
--- a/app/libraries/Wsis/Stubs/UserInformationRecoveryManager.php
+++ b/app/libraries/Wsis/Stubs/UserInformationRecoveryManager.php
@@ -36,9 +36,14 @@ class UserInformationRecoveryManager {
      * Method to validate username and get key which is to be used for the next call
      * @param $username
      */
-    public function validateUsername($username){
+    public function validateUsername($userAnswer, $imagePath, $secretKey, $username){
         $verifyUser = new verifyUser();
         $verifyUser->username = $username;
+        $captcha = new CaptchaInfoBean();
+        $captcha->userAnswer = $userAnswer;
+        $captcha->imagePath = $imagePath;
+        $captcha->secretKey = $secretKey;
+        $verifyUser->captcha = $captcha;
         $result = $this->serviceStub->verifyUser($verifyUser);
         if($result->return->verified){
             return $result->return->key;

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/09a65f9c/app/libraries/Wsis/Wsis.php
----------------------------------------------------------------------
diff --git a/app/libraries/Wsis/Wsis.php b/app/libraries/Wsis/Wsis.php
index 0573dcd..faba4e1 100755
--- a/app/libraries/Wsis/Wsis.php
+++ b/app/libraries/Wsis/Wsis.php
@@ -462,8 +462,8 @@ class Wsis {
      * Method to validate username
      * @param $username
      */
-    public function validateUser($username){
-        return $this->userInfoRecoveryManager->validateUsername($username);
+    public function validateUser($userAnswer, $imagePath, $secretKey, $username){
+        return $this->userInfoRecoveryManager->validateUsername($userAnswer, $imagePath, $secretKey, $username);
     }
 
 

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/09a65f9c/app/views/account/forgot-password.blade.php
----------------------------------------------------------------------
diff --git a/app/views/account/forgot-password.blade.php b/app/views/account/forgot-password.blade.php
index 8935035..f0fbfc4 100644
--- a/app/views/account/forgot-password.blade.php
+++ b/app/views/account/forgot-password.blade.php
@@ -12,8 +12,20 @@
     <h4> Please enter your username, you registered with.</h4>
     <form role="form" method="POST" action="{{ URL::to('/') }}/forgot-password">
         <div class="form-group form-horizontal">
-            <div class="col-md-8"><input name="username" type="username" value="" class="form-control" placeholder="username" required/></div>
-            <div class="col-md-2"><input type="submit" class="form-control btn btn-primary" value="Submit"/></div>
+            <img src="{{$imageUrl}}"/>
+            <div>
+                <input name="imagePath" type="hidden" value="{{$imagePath}}" class="form-control"/>
+                <input name="secretKey" type="hidden" value="{{$secretKey}}" class="form-control"/>
+                <br/>
+                <input class="form-control" id="userAnswer" name="userAnswer" placeholder="captcha text" required="required"/>
+                <br/>
+                <input name="username" type="username" value="" class="form-control" placeholder="username" required/>
+            </div>
+        </div>
+        <div class="form-group btn-toolbar">
+            <div class="btn-group">
+                <input type="submit" class="form-control btn btn-primary" value="Submit"/>
+            </div>
         </div>
     </form>
     @stop
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/09a65f9c/app/views/account/verify-human.blade.php
----------------------------------------------------------------------
diff --git a/app/views/account/verify-human.blade.php b/app/views/account/verify-human.blade.php
index 7c9ce1f..0ddc92f 100644
--- a/app/views/account/verify-human.blade.php
+++ b/app/views/account/verify-human.blade.php
@@ -23,14 +23,14 @@
                 <input name="username" type="hidden" value="{{$username}}" class="form-control"/>
                 <input name="imagePath" type="hidden" value="{{$imagePath}}" class="form-control"/>
                 <input name="secretKey" type="hidden" value="{{$secretKey}}" class="form-control"/>
-                <input class="form-control" id="userAnswer" name="userAnswer" required="required"/></div>
+                <input class="form-control" id="userAnswer" name="userAnswer" required="required"/>
             </div>
-            <div class="form-group btn-toolbar">
-                <div class="btn-group">
-                    <input type="submit" class="form-control btn btn-primary" value="Submit"/>
-                </div>
+        </div>
+        <div class="form-group btn-toolbar">
+            <div class="btn-group">
+                <input type="submit" class="form-control btn btn-primary" value="Submit"/>
             </div>
-
         </div>
     </form>
+</div>
 @stop
\ No newline at end of file


[14/21] airavata-php-gateway git commit: amending last commit

Posted by sm...@apache.org.
amending last commit


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

Branch: refs/heads/master
Commit: 37f7e61ef422a19e9e1d78eb1cbc1ddd9be02869
Parents: c7df5ff
Author: scnakandala <su...@gmail.com>
Authored: Tue Mar 8 13:11:00 2016 -0500
Committer: scnakandala <su...@gmail.com>
Committed: Tue Mar 8 13:11:00 2016 -0500

----------------------------------------------------------------------
 app/views/files/browse.blade.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/37f7e61e/app/views/files/browse.blade.php
----------------------------------------------------------------------
diff --git a/app/views/files/browse.blade.php b/app/views/files/browse.blade.php
index 4b0e7da..34db803 100644
--- a/app/views/files/browse.blade.php
+++ b/app/views/files/browse.blade.php
@@ -39,7 +39,7 @@
 <script type="text/javascript">
 
     $(document).ready(function () {
-        var PATH = "{{Session::get('username') }}";
+        var PATH = "{{$path}}";
         browse(PATH);
     });
 


[13/21] airavata-php-gateway git commit: browse with get parameter

Posted by sm...@apache.org.
browse with get parameter


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

Branch: refs/heads/master
Commit: c7df5ffc79177a64b2e1ee3d61ae84dcaf1b3111
Parents: e3ef126
Author: scnakandala <su...@gmail.com>
Authored: Tue Mar 8 13:09:36 2016 -0500
Committer: scnakandala <su...@gmail.com>
Committed: Tue Mar 8 13:09:36 2016 -0500

----------------------------------------------------------------------
 app/controllers/FilemanagerController.php | 8 +++++++-
 app/routes.php                            | 2 +-
 2 files changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/c7df5ffc/app/controllers/FilemanagerController.php
----------------------------------------------------------------------
diff --git a/app/controllers/FilemanagerController.php b/app/controllers/FilemanagerController.php
index a27ceb5..226a92e 100644
--- a/app/controllers/FilemanagerController.php
+++ b/app/controllers/FilemanagerController.php
@@ -10,7 +10,13 @@ class FilemanagerController extends BaseController
     }
 
     public function browse(){
-    	return View::make("files/browse");
+		//FIXME check for no ../ paths
+		if(Input::has("path") && (0 === strpos(Input::get("path"), Session::get('username')))){
+			$path = Input::get("path");
+		}else{
+			$path = Session::get("username");
+		}
+		return View::make("files/browse",array("path"=>$path));
     }
 
 	public function get(){

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/c7df5ffc/app/routes.php
----------------------------------------------------------------------
diff --git a/app/routes.php b/app/routes.php
index adfec7a..bdaba7b 100644
--- a/app/routes.php
+++ b/app/routes.php
@@ -99,7 +99,7 @@ Route::post("experiment/browse", "ExperimentController@browseView");
 
 
 Route::get("download/{username}/{exp_data_dir}/{exp_folder}/{exp_file}", function( $username, $exp_data_dir, $exp_folder, $exp_file){
-
+    //FIXME check for no ../ paths
     if( $username == Session::get("username")){
         $downloadLink = Config::get('pga_config.airavata')['experiment-data-absolute-path'] . '/' . $username . '/' . $exp_data_dir . "/" . $exp_folder . '/' . $exp_file;
         return Response::download( $downloadLink);


[05/21] airavata-php-gateway git commit: fixing file download link issue

Posted by sm...@apache.org.
fixing file download link issue


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

Branch: refs/heads/master
Commit: 4e8572398ad95fa85c6d238372ea4d15887ebb9e
Parents: be5c898
Author: scnakandala <su...@gmail.com>
Authored: Mon Mar 7 14:59:31 2016 -0500
Committer: scnakandala <su...@gmail.com>
Committed: Mon Mar 7 14:59:31 2016 -0500

----------------------------------------------------------------------
 app/routes.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/4e857239/app/routes.php
----------------------------------------------------------------------
diff --git a/app/routes.php b/app/routes.php
index b419c61..46983b6 100755
--- a/app/routes.php
+++ b/app/routes.php
@@ -97,9 +97,9 @@ Route::get("experiment/browse", "ExperimentController@browseView");
 
 Route::post("experiment/browse", "ExperimentController@browseView");
 
-Route::get("download/{exp_data_dir}/{exp_folder}/{exp_file}", function($exp_data_dir, $exp_folder, $exp_file){
+Route::get("download/{exp_data_dir}/{proj_folder}/{exp_folder}/{exp_file}", function($exp_data_dir, $proj_folder, $exp_folder, $exp_file){
     $downloadLink = Config::get('pga_config.airavata')['experiment-data-absolute-path'] . '/' . Session::get('username')
-        . '/' . $exp_data_dir . "/" . $exp_folder . '/' . $exp_file;
+        . '/' . $exp_data_dir . "/" . $proj_folder . "/" . $exp_folder . '/' . $exp_file;
     return Response::download( $downloadLink);
 });
 


[03/21] airavata-php-gateway git commit: fixing wrong variable name issue

Posted by sm...@apache.org.
fixing wrong variable name issue


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

Branch: refs/heads/master
Commit: be5c898200d34debe645231e5ec6d07eed9671d3
Parents: 298c5ea
Author: scnakandala <su...@gmail.com>
Authored: Mon Mar 7 11:07:46 2016 -0500
Committer: scnakandala <su...@gmail.com>
Committed: Mon Mar 7 11:07:46 2016 -0500

----------------------------------------------------------------------
 app/libraries/ExperimentUtilities.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/be5c8982/app/libraries/ExperimentUtilities.php
----------------------------------------------------------------------
diff --git a/app/libraries/ExperimentUtilities.php b/app/libraries/ExperimentUtilities.php
index e85a180..b8794e4 100644
--- a/app/libraries/ExperimentUtilities.php
+++ b/app/libraries/ExperimentUtilities.php
@@ -436,7 +436,7 @@ class ExperimentUtilities
             //updating the experiment inputs and output path
             $experiment = Airavata::getExperiment(Session::get('authz-token'), $cloneId);
             $experimentInputs = $experiment->experimentInputs;
-            ExperimentUtilities::create_experiment_folder_path($experiment->projectId, $experiment->name);
+            ExperimentUtilities::create_experiment_folder_path($experiment->projectId, $experiment->experimentName);
             $hostName = $_SERVER['SERVER_NAME'];
 
             foreach ($experimentInputs as $experimentInput) {


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

Posted by sm...@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/298c5ea6
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/298c5ea6
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/298c5ea6

Branch: refs/heads/master
Commit: 298c5ea6635eb1f8e0f3a24f5c6260359bb4c8e4
Parents: bfa3b39 43466f1
Author: scnakandala <su...@gmail.com>
Authored: Mon Mar 7 10:58:04 2016 -0500
Committer: scnakandala <su...@gmail.com>
Committed: Mon Mar 7 10:58:04 2016 -0500

----------------------------------------------------------------------
 app/views/partials/resource-job-manager.blade.php | 2 +-
 public/css/bootstrap.min.css                      | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------



[11/21] airavata-php-gateway git commit: fixing syntax error

Posted by sm...@apache.org.
fixing syntax error


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

Branch: refs/heads/master
Commit: 0592df7a3950bd0c5bf6af2c98874f10bdda778b
Parents: 5677e06
Author: scnakandala <su...@gmail.com>
Authored: Tue Mar 8 12:47:52 2016 -0500
Committer: scnakandala <su...@gmail.com>
Committed: Tue Mar 8 12:47:52 2016 -0500

----------------------------------------------------------------------
 app/routes.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/0592df7a/app/routes.php
----------------------------------------------------------------------
diff --git a/app/routes.php b/app/routes.php
index 8472021..adfec7a 100644
--- a/app/routes.php
+++ b/app/routes.php
@@ -104,7 +104,7 @@ Route::get("download/{username}/{exp_data_dir}/{exp_folder}/{exp_file}", functio
         $downloadLink = Config::get('pga_config.airavata')['experiment-data-absolute-path'] . '/' . $username . '/' . $exp_data_dir . "/" . $exp_folder . '/' . $exp_file;
         return Response::download( $downloadLink);
     }
-}
+});
 
 Route::get("download/{exp_data_dir}/{proj_folder}/{exp_file}", function($exp_data_dir, $proj_folder, $exp_file){
     $downloadLink = Config::get('pga_config.airavata')['experiment-data-absolute-path'] . '/' . Session::get('username')


[18/21] airavata-php-gateway git commit: Fixing Reset Password UI issue

Posted by sm...@apache.org.
Fixing Reset Password UI issue


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

Branch: refs/heads/master
Commit: 38248a228ba18036b0f7228e99c49991dcc1f1a1
Parents: 3382987
Author: Nipurn Doshi <ni...@gmail.com>
Authored: Tue Mar 8 14:53:38 2016 -0500
Committer: Nipurn Doshi <ni...@gmail.com>
Committed: Tue Mar 8 14:53:38 2016 -0500

----------------------------------------------------------------------
 app/controllers/ExperimentController.php     |  2 --
 app/views/account/reset-password.blade.php   |  1 +
 app/views/partials/experiment-info.blade.php | 16 ++++++++++------
 3 files changed, 11 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/38248a22/app/controllers/ExperimentController.php
----------------------------------------------------------------------
diff --git a/app/controllers/ExperimentController.php b/app/controllers/ExperimentController.php
index 6dead87..eca7421 100755
--- a/app/controllers/ExperimentController.php
+++ b/app/controllers/ExperimentController.php
@@ -116,7 +116,6 @@ class ExperimentController extends BaseController
                 }
             }
             $expVal["jobDetails"] = $jobDetails;
-
             
             $data = array(
                 "expId" => Input::get("expId"),
@@ -283,7 +282,6 @@ class ExperimentController extends BaseController
         $expContainer = ExperimentUtilities::get_expsearch_results_with_pagination(Input::all(), $this->limit,
             ($pageNo - 1) * $this->limit);
         $experimentStates = ExperimentUtilities::getExpStates();
-
         return View::make('experiment/browse', array(
             'input' => Input::all(),
             'pageNo' => $pageNo,

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/38248a22/app/views/account/reset-password.blade.php
----------------------------------------------------------------------
diff --git a/app/views/account/reset-password.blade.php b/app/views/account/reset-password.blade.php
index cfb9129..c830f06 100644
--- a/app/views/account/reset-password.blade.php
+++ b/app/views/account/reset-password.blade.php
@@ -36,4 +36,5 @@
 
         </div>
     </form>
+</div>
 @stop
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/38248a22/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 81ac668..79afcf4 100644
--- a/app/views/partials/experiment-info.blade.php
+++ b/app/views/partials/experiment-info.blade.php
@@ -129,27 +129,31 @@
         </tr>
         <tr>
             <td><strong>Wall time</strong></td>
-            <td><?php echo $experiment->userConfigurationData->computationalResourceScheduling->wallTimeLimit; ?></td>
+            <td>{{ $experiment->userConfigurationData->computationalResourceScheduling->wallTimeLimit }}</td>
         </tr>
         <tr>
             <td><strong>CPU count</strong></td>
-            <td><?php echo $experiment->userConfigurationData->computationalResourceScheduling->totalCPUCount; ?></td>
+            <td>{{ $experiment->userConfigurationData->computationalResourceScheduling->totalCPUCount }}</td>
         </tr>
         <tr>
             <td><strong>Node count</strong></td>
-            <td><?php echo $experiment->userConfigurationData->computationalResourceScheduling->nodeCount; ?></td>
+            <td>{{ $experiment->userConfigurationData->computationalResourceScheduling->nodeCount }}</td>
         </tr>
         <tr>
             <td><strong>Queue</strong></td>
-            <td><?php echo $experiment->userConfigurationData->computationalResourceScheduling->queueName; ?></td>
+            <td>{{ $experiment->userConfigurationData->computationalResourceScheduling->queueName }}</td>
         </tr>
         <tr>
             <td><strong>Inputs</strong></td>
-            <td><?php ExperimentUtilities::list_input_files($experiment->experimentInputs); ?></td>
+            <td>{{ ExperimentUtilities::list_input_files($experiment->experimentInputs) }}</td>
         </tr>
         <tr>
             <td><strong>Outputs</strong></td>
-            <td><?php ExperimentUtilities::list_output_files($experiment->experimentOutputs, $experiment->experimentStatus->state, false); ?></td>
+            <td>{{ ExperimentUtilities::list_output_files($experiment->experimentOutputs, $experiment->experimentStatus->state, false) }}</td>
+        </tr>
+        <tr>
+            <td><strong>Storage Directory</strong></td>
+            <td><a href="{{URL::to('/')}}/files/browse?path={{$experiment->userConfigurationData->experimentDataDir}}" target="_blank">Open</a></td>
         </tr>
         <!-- an experiment is editable only when it has not failed. otherwise, show errors. -->
 {{--        @if( $expVal["editable"] == false)--}}


[07/21] airavata-php-gateway git commit: fixing path generation issues

Posted by sm...@apache.org.
fixing path generation issues


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

Branch: refs/heads/master
Commit: b231563b9c80533ef1658a8e35b0ae19d1a60dd9
Parents: 19e4e66
Author: scnakandala <su...@gmail.com>
Authored: Mon Mar 7 15:14:19 2016 -0500
Committer: scnakandala <su...@gmail.com>
Committed: Mon Mar 7 15:14:19 2016 -0500

----------------------------------------------------------------------
 app/libraries/ExperimentUtilities.php | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/b231563b/app/libraries/ExperimentUtilities.php
----------------------------------------------------------------------
diff --git a/app/libraries/ExperimentUtilities.php b/app/libraries/ExperimentUtilities.php
index b8794e4..39acdb1 100644
--- a/app/libraries/ExperimentUtilities.php
+++ b/app/libraries/ExperimentUtilities.php
@@ -76,7 +76,7 @@ class ExperimentUtilities
             if ($input->type == DataType::URI && empty($input->metaData)) {
                 $inputArray = explode('/', $input->value);
                 echo '<p><a target="_blank"
-                        href="' . URL::to("/") . '/download/' . $inputArray[ count($inputArray)-2] . '/' . 
+                        href="' . URL::to("/") . '/download/' . $inputArray[ count($inputArray)-3] . '/' .$inputArray[ count($inputArray)-2] . '/' .
                 $inputArray[ count($inputArray)-1] . '">' .
                     $inputArray[ count($inputArray)-1] . '
                 <span class="glyphicon glyphicon-new-window"></span></a></p>';
@@ -352,6 +352,7 @@ class ExperimentUtilities
     {
         do {
             $projectId = substr($projectId, 0, -37);
+            $projectId = preg_replace('/[^a-zA-Z0-9]+/', '_', $projectId);
             $experimentName = preg_replace('/[^a-zA-Z0-9]+/', '_', $experimentName);
 
             ExperimentUtilities::$relativeExperimentDataDir = "/" . Session::get('username') . "/" . $projectId . "/"
@@ -655,7 +656,8 @@ class ExperimentUtilities
                     $outputPathArray = explode("/", $output->value);
 
                     echo '<p>' . $output->name . ' : ' . '<a target="_blank"
-                            href="' . URL::to("/") . '/download/' . $outputPathArray[ count($outputPathArray)-3] . "/" . $outputPathArray[ count($outputPathArray)-2] . '/' .
+                            href="' . URL::to("/") . '/download/' . $outputPathArray[ count($outputPathArray)-4]
+                        . "/" . $outputPathArray[ count($outputPathArray)-3] . "/" . $outputPathArray[ count($outputPathArray)-2] . '/' .
             $outputPathArray[ count($outputPathArray)-1] . '">' .
                         $outputPathArray[sizeof($outputPathArray) - 1] . ' <span class="glyphicon glyphicon-new-window"></span></a></p>';
                 }


[16/21] airavata-php-gateway git commit: Removing storage link visible to not logged in users

Posted by sm...@apache.org.
Removing storage link visible to not logged in users


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

Branch: refs/heads/master
Commit: ce33ae9b9ce4f51e6cfab555eb19bf1666de4c0f
Parents: 7a66865
Author: Nipurn Doshi <ni...@gmail.com>
Authored: Tue Mar 8 13:54:31 2016 -0500
Committer: Nipurn Doshi <ni...@gmail.com>
Committed: Tue Mar 8 13:54:31 2016 -0500

----------------------------------------------------------------------
 app/libraries/CommonUtilities.php     | 5 +++--
 app/libraries/ExperimentUtilities.php | 4 +++-
 2 files changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/ce33ae9b/app/libraries/CommonUtilities.php
----------------------------------------------------------------------
diff --git a/app/libraries/CommonUtilities.php b/app/libraries/CommonUtilities.php
index dc3e7a3..2dcddd8 100644
--- a/app/libraries/CommonUtilities.php
+++ b/app/libraries/CommonUtilities.php
@@ -194,10 +194,11 @@ class CommonUtilities
         }
 
         $active = "";
-        if( Session::has("nav-active"))
+        if( Session::has("nav-active") && Session::has('loggedin') ){
             if( Session::get("nav-active") == "storage")
                 $active = "active";
-        echo '<li class="' . $active . '"><a href="' . URL::to("/") . '/files/browse"><span class="glyphicon glyphicon-folder-close"></span> Storage</a></li>';
+            echo '<li class="' . $active . '"><a href="' . URL::to("/") . '/files/browse"><span class="glyphicon glyphicon-folder-close"></span> Storage</a></li>';
+        }
         echo '</ul>
 
         <ul class="nav navbar-nav navbar-right">';

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/ce33ae9b/app/libraries/ExperimentUtilities.php
----------------------------------------------------------------------
diff --git a/app/libraries/ExperimentUtilities.php b/app/libraries/ExperimentUtilities.php
index 3423d95..3a0952e 100644
--- a/app/libraries/ExperimentUtilities.php
+++ b/app/libraries/ExperimentUtilities.php
@@ -81,7 +81,8 @@ class ExperimentUtilities
                                     $inputArray[ count($inputArray)-3] . '/' . 
                                     $inputArray[ count($inputArray)-2] . '/' . 
                                     $inputArray[ count($inputArray)-1] . '">' .
-                '<span class="glyphicon glyphicon-new-window"></span></a></p>';
+                                        $inputArray[ count($inputArray)-1] . 
+                ' <span class="glyphicon glyphicon-new-window"></span></a></p>';
             }elseif($input->type == DataType::URI && !empty($input->metaData)
                 && json_decode($input->metaData)->location=="remote"){
                 echo '<p>' . $input->name . ': ' . $input->value . '</p>';
@@ -664,6 +665,7 @@ class ExperimentUtilities
                                                 $outputPathArray[ count($outputPathArray)-3] . "/" . 
                                                 $outputPathArray[ count($outputPathArray)-2] . '/' . 
                                                 $outputPathArray[ count($outputPathArray)-1] . '">' .
+                                                    $outputPathArray[sizeof($outputPathArray) - 1] . 
                         ' <span class="glyphicon glyphicon-new-window"></span></a></p>';
                 }
 //                else


[09/21] airavata-php-gateway git commit: Added File Storage Browse Capability. It will be required to run 'composer update' command after this update.

Posted by sm...@apache.org.
Added File Storage Browse Capability.  It will be required to run 'composer update' command after this update.


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

Branch: refs/heads/master
Commit: e873f1e15c9d8771b0c43e0ddcfc00bfc0aad3ce
Parents: 43466f1
Author: Nipurn Doshi <ni...@gmail.com>
Authored: Tue Mar 8 12:31:55 2016 -0500
Committer: Nipurn Doshi <ni...@gmail.com>
Committed: Tue Mar 8 12:31:55 2016 -0500

----------------------------------------------------------------------
 app/controllers/FilemanagerController.php |  35 ++++
 app/libraries/CommonUtilities.php         |   6 +-
 app/libraries/ExperimentUtilities.php     |   5 +-
 app/libraries/FileManager.php             | 262 +++++++++++++++++++++++++
 app/routes.php                            |  14 +-
 app/views/files/browse.blade.php          |  47 +++++
 public/css/filemanager.css                |  49 +++++
 public/js/filemanager.js                  | 137 +++++++++++++
 8 files changed, 547 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/e873f1e1/app/controllers/FilemanagerController.php
----------------------------------------------------------------------
diff --git a/app/controllers/FilemanagerController.php b/app/controllers/FilemanagerController.php
new file mode 100644
index 0000000..a27ceb5
--- /dev/null
+++ b/app/controllers/FilemanagerController.php
@@ -0,0 +1,35 @@
+<?php
+
+class FilemanagerController extends BaseController
+{
+	public function __construct()
+    {
+        $this->beforeFilter('verifylogin');
+        $this->beforeFilter('verifyauthorizeduser');
+        Session::put("nav-active", "storage");
+    }
+
+    public function browse(){
+    	return View::make("files/browse");
+    }
+
+	public function get(){
+		if(Session::has('username') ){
+
+			$path = Input::get('path');
+			/*
+			if( $path == null || (0 !== strpos($path, Session::get('username']))){
+			    header('HTTP/1.0 403 Forbidden');
+			}
+			*/
+			$DATA_ROOT = Config::get("pga_config.airavata")["experiment-data-absolute-path"];
+			$data_path = $DATA_ROOT . "/" . $path;
+			if (!file_exists( $data_path))
+			    echo FileManager::msg(False, "$path does not exist");
+			if (is_dir( $data_path))
+			    echo FileManager::get_content( $DATA_ROOT .  "/", $path);
+			else
+			    echo file_get_contents($data_path);
+		}
+	}
+}

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/e873f1e1/app/libraries/CommonUtilities.php
----------------------------------------------------------------------
diff --git a/app/libraries/CommonUtilities.php b/app/libraries/CommonUtilities.php
index 4c55d7b..dc3e7a3 100644
--- a/app/libraries/CommonUtilities.php
+++ b/app/libraries/CommonUtilities.php
@@ -193,7 +193,11 @@ class CommonUtilities
         </li>';
         }
 
-
+        $active = "";
+        if( Session::has("nav-active"))
+            if( Session::get("nav-active") == "storage")
+                $active = "active";
+        echo '<li class="' . $active . '"><a href="' . URL::to("/") . '/files/browse"><span class="glyphicon glyphicon-folder-close"></span> Storage</a></li>';
         echo '</ul>
 
         <ul class="nav navbar-nav navbar-right">';

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/e873f1e1/app/libraries/ExperimentUtilities.php
----------------------------------------------------------------------
diff --git a/app/libraries/ExperimentUtilities.php b/app/libraries/ExperimentUtilities.php
index acd6822..1350193 100644
--- a/app/libraries/ExperimentUtilities.php
+++ b/app/libraries/ExperimentUtilities.php
@@ -76,8 +76,7 @@ class ExperimentUtilities
             if ($input->type == DataType::URI && empty($input->metaData)) {
                 $inputArray = explode('/', $input->value);
                 echo '<p><a target="_blank"
-                        href="' . URL::to("/") . '/download/' . $inputArray[ count($inputArray)-2] . '/' . 
-                $inputArray[ count($inputArray)-1] . '">' .
+                        href="' . URL::to("/") . '/download/' . $inputArray[ count($inputArray)-3] . '/' . $inputArray[ count($inputArray)-2] . '/' . $inputArray[ count($inputArray)-1] . '">' .
                     $inputArray[ count($inputArray)-1] . '
                 <span class="glyphicon glyphicon-new-window"></span></a></p>';
             }elseif($input->type == DataType::URI && !empty($input->metaData)
@@ -651,7 +650,7 @@ class ExperimentUtilities
                     $outputPathArray = explode("/", $output->value);
 
                     echo '<p>' . $output->name . ' : ' . '<a target="_blank"
-                            href="' . URL::to("/") . '/download/' . $outputPathArray[ count($outputPathArray)-3] . "/" . $outputPathArray[ count($outputPathArray)-2] . '/' .
+                            href="' . URL::to("/") . '/download/' . $outputPathArray[ count($outputPathArray)-4] . "/" . $outputPathArray[ count($outputPathArray)-3] . "/" . $outputPathArray[ count($outputPathArray)-2] . '/' .
             $outputPathArray[ count($outputPathArray)-1] . '">' .
                         $outputPathArray[sizeof($outputPathArray) - 1] . ' <span class="glyphicon glyphicon-new-window"></span></a></p>';
                 }

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/e873f1e1/app/libraries/FileManager.php
----------------------------------------------------------------------
diff --git a/app/libraries/FileManager.php b/app/libraries/FileManager.php
new file mode 100644
index 0000000..f109b62
--- /dev/null
+++ b/app/libraries/FileManager.php
@@ -0,0 +1,262 @@
+<?php
+
+class FileManager {
+    /**
+     * returns a json message ether successful or failure.
+     */
+    public static function msg($status, $msg) {
+        return json_encode(array(
+            'status' => $status,
+            'msg' => $msg
+        ));
+    }
+
+    /**
+     * Takes a given path and prints the content in json format.
+     */
+    public static function get_content($dataRoot, $path) {
+        $path = $dataRoot . $path;
+        $path = rtrim($path, '/');
+
+        // get dir content
+        $files = array();
+        $folders = array();
+        FileManager::list_dir($path, $files, $folders);
+        $files = array_merge($folders, $files);
+
+        // get info
+        foreach ($files as $k => $v) {
+            $i = FileManager::get_file_info($v['path'], array(
+                'name',
+                'size',
+                'date',
+                'fileperms'
+            ));
+
+            if ($v['folder']) {
+                $files[$k] = array (
+                    'name' => $i['name'],
+                    'size' => '---',
+                    'date' => date('Y-m-d H:i:s', $i['date']),
+                    'perm' => FileManager::unix_perm_string($i['fileperms']),
+                    'folder' => True
+                );
+            } else {
+                $files[$k] = array(
+                    'name' => $i['name'],
+                    'size' => FileManager::human_filesize($i['size']),
+                    'date' => date('Y-m-d H:i:s', $i['date']),
+                    'perm' => FileManager::unix_perm_string($i['fileperms']),
+                    'folder' => False
+                );
+            }
+            $files[$k]['link'] = str_replace($dataRoot, '', $v['path']);
+        }
+
+        return json_encode(array('status' => 'ok', 'files' => $files));
+    }
+
+    /**
+     * returns html to build a breadcrumb based upon path.
+     * path should look like this: page/subdir/gfx
+     */
+    public static function breadcrumb($path) {
+        $parts = explode('/', $path);
+        $html = '';
+        $link = '';
+        for ($i = 0; $i < count($parts); $i++) {
+            if ($i != count($parts) - 1) {
+                $link .= $i == 0 ? $parts[$i] : '/'.$parts[$i];
+                $html .= "<li><a href=\"$link\">".$parts[$i].'</a></li>';
+            } else {
+                $html .= '<li class="active">'.$parts[$i].'</li>';
+            }
+        }
+
+        return "<ol class=\"breadcrumb\">$html</ol>";
+    }
+
+    /**
+     * stores files and folders of given directory in the provided arrays.
+     */
+    private static function list_dir($path, &$files, &$folders) {
+        foreach (scandir($path) as $f) {
+            if ($f == '.' || $f == '..') continue;
+
+            $file = array(
+                'name' => $f,
+                'path' => "$path/$f",
+            );
+
+            if (is_dir($file['path'])) {
+                $file['folder'] = true;
+                $folders[] = $file;
+            } else {
+                $file['folder'] = false;
+                $files[] = $file;
+            }
+        }
+    }
+
+    /**
+     * create thumbnail. will return false on failure.
+     */
+    private static function create_thumbnail($picture, $picture_thumb, $w) {
+        // get src image
+        if (pathinfo($picture, PATHINFO_EXTENSION) == "jpg")
+            $source_image = imagecreatefromjpeg($picture);
+        else if (pathinfo($picture, PATHINFO_EXTENSION) == "png")
+            $source_image = imagecreatefrompng($picture);
+        else
+            return false;
+
+        $width = imagesx($source_image);
+        $height = imagesy($source_image);
+
+        // calc height according to given width
+        $h = floor($height * ($w / $width));
+
+        // create virtual
+        $virtual_image = imagecreatetruecolor($w, $h);
+
+        // copy src image
+        imagecopyresized($virtual_image, $source_image, 0, 0, 0, 0, $w, $h, $width, $height);
+
+        // create thumbnail
+        if (pathinfo($picture, PATHINFO_EXTENSION) == 'jpg')
+            imagejpeg($virtual_image, $picture_thumb, 83);
+        elseif (pathinfo($picture, PATHINFO_EXTENSION) == 'png')
+            imagepng($virtual_image, $picture_thumb);
+
+        return true;
+    }
+
+    /**
+     * returns a password hash.
+     */
+    private static function generate_hash($pass, $salt) {
+        return hash('sha256', $pass.$salt);
+    }
+
+    /**
+     * returns a random salt.
+     */
+    private static function generate_salt() {
+        mt_srand(microtime(true) * 100000 + memory_get_usage(true));
+        return uniqid(mt_rand(), true);
+    }
+
+    /**
+     * Takes a file size in bytes and returns a human readable filesize.
+     */
+    private static function human_filesize($bytes, $decimals = 2) {
+        $sz = 'BKMGTP';
+        $factor = floor((strlen($bytes) - 1) / 3);
+        return sprintf("%.{$decimals}f", $bytes / pow(1024, $factor)) . @$sz[$factor];
+    }
+
+    /**
+     * Takes an permission value and builds a human readable unix style permission
+     * string.
+     * Taken from php.net.
+     */
+    private static function unix_perm_string($perms) {
+        if (($perms & 0xC000) == 0xC000) {
+            // Socket
+            $info = 's';
+        } elseif (($perms & 0xA000) == 0xA000) {
+            // Symbolic Link
+            $info = 'l';
+        } elseif (($perms & 0x8000) == 0x8000) {
+            // Regular
+            $info = '-';
+        } elseif (($perms & 0x6000) == 0x6000) {
+            // Block special
+            $info = 'b';
+        } elseif (($perms & 0x4000) == 0x4000) {
+            // Directory
+            $info = 'd';
+        } elseif (($perms & 0x2000) == 0x2000) {
+            // Character special
+            $info = 'c';
+        } elseif (($perms & 0x1000) == 0x1000) {
+            // FIFO pipe
+            $info = 'p';
+        } else {
+            // Unknown
+            $info = 'u';
+        }
+
+        // Owner
+        $info .= (($perms & 0x0100) ? 'r' : '-');
+        $info .= (($perms & 0x0080) ? 'w' : '-');
+        $info .= (($perms & 0x0040) ?
+            (($perms & 0x0800) ? 's' : 'x' ) :
+            (($perms & 0x0800) ? 'S' : '-'));
+
+        // Group
+        $info .= (($perms & 0x0020) ? 'r' : '-');
+        $info .= (($perms & 0x0010) ? 'w' : '-');
+        $info .= (($perms & 0x0008) ?
+            (($perms & 0x0400) ? 's' : 'x' ) :
+            (($perms & 0x0400) ? 'S' : '-'));
+
+        // World
+        $info .= (($perms & 0x0004) ? 'r' : '-');
+        $info .= (($perms & 0x0002) ? 'w' : '-');
+        $info .= (($perms & 0x0001) ?
+            (($perms & 0x0200) ? 't' : 'x' ) :
+            (($perms & 0x0200) ? 'T' : '-'));
+
+        return $info;
+    }
+
+    /**
+     * Returns information about a given file.
+     * Taken from code igniter.
+     */
+    private static function get_file_info($file, $returned_values = array('name', 'server_path', 'size', 'date')) {
+        if (!file_exists($file)) {
+            return FALSE;
+        }
+
+        if (is_string($returned_values)) {
+            $returned_values = explode(',', $returned_values);
+        }
+
+        foreach ($returned_values as $key) {
+            switch ($key) {
+                case 'name':
+                    $fileinfo['name'] = substr(strrchr($file, DIRECTORY_SEPARATOR), 1);
+                    if( $fileinfo['name'] == false)
+                        $fileinfo['name'] = substr(strrchr($file, "/"), 1);
+                    break;
+                case 'server_path':
+                    $fileinfo['server_path'] = $file;
+                    break;
+                case 'size':
+                    $fileinfo['size'] = filesize($file);
+                    break;
+                case 'date':
+                    $fileinfo['date'] = filemtime($file);
+                    break;
+                case 'readable':
+                    $fileinfo['readable'] = is_readable($file);
+                    break;
+                case 'writable':
+                    // There are known problems using is_weritable on IIS.  It may not be reliable - consider fileperms()
+                    $fileinfo['writable'] = is_writable($file);
+                    break;
+                case 'executable':
+                    $fileinfo['executable'] = is_executable($file);
+                    break;
+                case 'fileperms':
+                    $fileinfo['fileperms'] = fileperms($file);
+                    break;
+            }
+        }
+
+        return $fileinfo;
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/e873f1e1/app/routes.php
----------------------------------------------------------------------
diff --git a/app/routes.php b/app/routes.php
index b419c61..3ba4afa 100755
--- a/app/routes.php
+++ b/app/routes.php
@@ -97,10 +97,12 @@ Route::get("experiment/browse", "ExperimentController@browseView");
 
 Route::post("experiment/browse", "ExperimentController@browseView");
 
-Route::get("download/{exp_data_dir}/{exp_folder}/{exp_file}", function($exp_data_dir, $exp_folder, $exp_file){
-    $downloadLink = Config::get('pga_config.airavata')['experiment-data-absolute-path'] . '/' . Session::get('username')
-        . '/' . $exp_data_dir . "/" . $exp_folder . '/' . $exp_file;
-    return Response::download( $downloadLink);
+Route::get("download/{username}/{exp_data_dir}/{exp_folder}/{exp_file}", function( $username, $exp_data_dir, $exp_folder, $exp_file){
+
+    if( $username == Session::get("username")){
+        $downloadLink = Config::get('pga_config.airavata')['experiment-data-absolute-path'] . '/' . $username . '/' . $exp_data_dir . "/" . $exp_folder . '/' . $exp_file;
+        return Response::download( $downloadLink);
+    }
 });
 
 Route::get("download/{exp_data_dir}/{exp_file}", function($exp_data_dir, $exp_file){
@@ -109,6 +111,10 @@ Route::get("download/{exp_data_dir}/{exp_file}", function($exp_data_dir, $exp_fi
     return Response::download( $downloadLink);
 });
 
+Route::get("files/browse", "FilemanagerController@browse");
+
+Route::get("files/get","FilemanagerController@get");
+
 /*
  * Compute Resources Routes
 */

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/e873f1e1/app/views/files/browse.blade.php
----------------------------------------------------------------------
diff --git a/app/views/files/browse.blade.php b/app/views/files/browse.blade.php
new file mode 100644
index 0000000..4b0e7da
--- /dev/null
+++ b/app/views/files/browse.blade.php
@@ -0,0 +1,47 @@
+@extends('layout.basic')
+
+@section('page-header')
+@parent
+{{ HTML::style('css/filemanager.css')}}
+
+@stop
+
+@section('content')
+
+    <div class="container">
+        <div class="center-content">
+            <br><br><br>
+            <div class="well-sm" id="tools">
+                <a class="btn btn-default" id="refresh-button"><i class="icon-refresh"></i> Refresh</a>
+            </div>
+
+            <!-- breadcrumb -->
+            <ol class="breadcrumb" id="breadcrumb"></ol>
+            <!-- file manager view -->
+            <div class="input-group"> <span class="input-group-addon">Filter</span>
+                <input id="filter-text" type="text" class="form-control" placeholder="Search Here...">
+            </div>
+            <br/>
+            <table class="table table-hover table-condensed" id="filemanager"></table>
+
+            <!-- message box -->
+            <div id="msgbox"></div>
+
+        </div>
+    </div>
+
+@stop
+
+@section('scripts')
+@parent
+{{ HTML::script('js/filemanager.js')}}
+
+<script type="text/javascript">
+
+    $(document).ready(function () {
+        var PATH = "{{Session::get('username') }}";
+        browse(PATH);
+    });
+
+</script>
+@stop
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/e873f1e1/public/css/filemanager.css
----------------------------------------------------------------------
diff --git a/public/css/filemanager.css b/public/css/filemanager.css
new file mode 100644
index 0000000..19980c4
--- /dev/null
+++ b/public/css/filemanager.css
@@ -0,0 +1,49 @@
+@charset "UTF-8";
+
+/* -------------------------------------------------- MAIN */
+body {
+    background: #fff url(../img/bg.png);
+}
+
+#main > .content {
+    background-color: #fdfdfd;
+    border: solid thin #d4d4d4;
+    padding: 3px 10px;
+}
+
+/* -------------------------------------------------- LOGO */
+#main > .logo img {
+    display: block;
+    margin: 0px auto;
+}
+
+/* -------------------------------------------------- LINKS */
+#main > .links {
+    margin: 30px auto;
+    padding: 5px;
+    text-align: center;
+}
+
+#main > .links img {
+    border: none;
+    filter: alpha(opacity=40);
+    height: 16px;
+    margin: 0px 20px;
+    opacity: 0.4;
+    vertical-align: middle;
+    width: 16px;
+}
+
+#main > .links img:hover {
+    filter: alpha(opacity=100);
+    opacity: 1.0;
+}
+
+
+.icon-folder-close:before {
+    content: url(../img/folder-black-icon.png);
+}
+
+.icon-file:before {
+    content: url(../img/file-black-icon.png);
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/e873f1e1/public/js/filemanager.js
----------------------------------------------------------------------
diff --git a/public/js/filemanager.js b/public/js/filemanager.js
new file mode 100644
index 0000000..35b99b0
--- /dev/null
+++ b/public/js/filemanager.js
@@ -0,0 +1,137 @@
+var FILES;
+
+// -------------------------------------------------- MESSAGE BOX
+/**
+ * add a message to the message box. context and type can be omitted.
+ */
+function add_msg(msg, context, type) {
+    context = typeof context !== 'undefined' ? context : 'Info';
+    type = typeof type !== 'undefined' ? type : 'alert-info';
+
+    $('div#msgbox').html(
+        $('<div />').addClass('alert').addClass(type).append(
+            '<a class="close" data-dismiss="alert">&times;</a>',
+            '<strong>' + context + ':</strong> ' + msg
+        )
+    );
+}
+
+// -------------------------------------------------- BROWSE
+/**
+ * set breadcrumb according to PATH.
+ */
+function set_breadcrumb() {
+    // add parts
+    var parts = PATH.split('/');
+    var html = '';
+    var link = '';
+    for (var i = 0; i < parts.length; i++) {
+        if (i != parts.length - 1) {
+            link += i == 0 ? parts[i] : '/' + parts[i];
+            html += '<li><a href="' + link + '">' + parts[i] + '</a></li>';
+        } else {
+            html += '<li class="active">' + parts[i] + '</li>';
+        }
+    }
+    $('ol#breadcrumb').html(html);
+
+    // register click event
+    $('ol#breadcrumb a').click(function (e) {
+        e.preventDefault();
+        browse($(e.target).attr('href'));
+    });
+}
+
+/**
+ * do the ajax request for the new path.
+ */
+function browse(path) {
+    $.ajax({
+        url: "../files/get",
+        cache: false,
+        dataType: 'json',
+        data:{ path:path},
+        success: function (result) {
+            if (result.status)
+                show_content(path, result.files);
+            else
+                add_msg(result.msg, 'PHP', 'alert-danger');
+        },
+        error: function (jqXHR, status) {
+            add_msg(status, 'AJAX', 'alert-danger');
+        }
+    });
+}
+
+
+/**
+ * handles click on anchor to a directory
+ * @param e
+ * @param path
+ */
+function dir_click(path){
+    browse(path);
+    return false;
+}
+
+/**
+ * ajax success callback, set path and add content to table.
+ */
+function show_content(path, files) {
+    PATH = path;
+    set_breadcrumb();
+    $('#filter-text').val('');
+    FILES = files;
+    show_table(files);
+}
+
+function show_table(files){
+    $('table#filemanager').empty();
+
+    html = "";
+    for (var i = 0; i < files.length; i++) {
+        var f = files[i];
+        var icon_class, name_link;
+        if (f.folder) {
+            icon_class = 'glyphicon glyphicon-folder-open';
+            name_link = '<a href="#" onclick=dir_click("' + f.link + '")>&nbsp;' + f.name + "</a>";
+        } else {
+            icon_class = 'glyphicon glyphicon-save-file';
+            name_link = '<a href="../download/' + f.link + '">&nbsp;' + f.name + '</a>';
+        }
+
+        html += '<tr>'
+            + '<td><span class="' + icon_class + '"></span> ' + name_link + '</td>'
+            + '<td>' + f.size + '</td>'
+            + '<td>' + f.date + '</td>'
+            + '<td>' + f.perm + '</td>'
+            + '</tr>';
+    }
+    $('table#filemanager').html(html);
+}
+
+$('div#tools a#refresh-button').click(function (e) {
+    browse(PATH);
+    $('#filter-text').val('');
+});
+
+$('div#tools a#clear-msgbox-button').click(function (e) {
+    $('div#msgbox').empty();
+    $('#filter-text').val('');
+});
+
+function file_filter(file){
+    var text = $('#filter-text').val();
+    if(file.link.indexOf(text) !== -1){
+        return true;
+    }
+    return false;
+}
+
+$('#filter-text').on("keypress", function(e) {
+    if (e.keyCode == 13) {
+        var files = FILES.filter(file_filter);
+        show_table(files);
+        return false;
+    }
+});
\ No newline at end of file


[04/21] airavata-php-gateway git commit: adding working directory archive to pga

Posted by sm...@apache.org.
adding working directory archive to 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/0a54650e
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/0a54650e
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/0a54650e

Branch: refs/heads/master
Commit: 0a54650e964be78f44ea6535b37fe62d402a9eeb
Parents: be5c898
Author: Suresh Marru <sm...@apache.org>
Authored: Mon Mar 7 14:45:27 2016 -0500
Committer: Suresh Marru <sm...@apache.org>
Committed: Mon Mar 7 14:45:27 2016 -0500

----------------------------------------------------------------------
 .../Model/AppCatalog/AppInterface/Types.php     | 23 ++++++++++++++++++++
 .../Airavata/Model/Experiment/Types.php         | 23 ++++++++++++++++++++
 app/libraries/Airavata/Model/Process/Types.php  | 23 ++++++++++++++++++++
 app/libraries/Airavata/Model/Task/Types.php     |  2 ++
 4 files changed, 71 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/0a54650e/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 1d09112..e2143f0 100644
--- a/app/libraries/Airavata/Model/AppCatalog/AppInterface/Types.php
+++ b/app/libraries/Airavata/Model/AppCatalog/AppInterface/Types.php
@@ -57,6 +57,10 @@ class ApplicationInterfaceDescription {
    * @var \Airavata\Model\Application\Io\OutputDataObjectType[]
    */
   public $applicationOutputs = null;
+  /**
+   * @var bool
+   */
+  public $archiveWorkingDirectory = false;
 
   public function __construct($vals=null) {
     if (!isset(self::$_TSPEC)) {
@@ -99,6 +103,10 @@ class ApplicationInterfaceDescription {
             'class' => '\Airavata\Model\Application\Io\OutputDataObjectType',
             ),
           ),
+        7 => array(
+          'var' => 'archiveWorkingDirectory',
+          'type' => TType::BOOL,
+          ),
         );
     }
     if (is_array($vals)) {
@@ -120,6 +128,9 @@ class ApplicationInterfaceDescription {
       if (isset($vals['applicationOutputs'])) {
         $this->applicationOutputs = $vals['applicationOutputs'];
       }
+      if (isset($vals['archiveWorkingDirectory'])) {
+        $this->archiveWorkingDirectory = $vals['archiveWorkingDirectory'];
+      }
     }
   }
 
@@ -216,6 +227,13 @@ class ApplicationInterfaceDescription {
             $xfer += $input->skip($ftype);
           }
           break;
+        case 7:
+          if ($ftype == TType::BOOL) {
+            $xfer += $input->readBool($this->archiveWorkingDirectory);
+          } else {
+            $xfer += $input->skip($ftype);
+          }
+          break;
         default:
           $xfer += $input->skip($ftype);
           break;
@@ -295,6 +313,11 @@ class ApplicationInterfaceDescription {
       }
       $xfer += $output->writeFieldEnd();
     }
+    if ($this->archiveWorkingDirectory !== null) {
+      $xfer += $output->writeFieldBegin('archiveWorkingDirectory', TType::BOOL, 7);
+      $xfer += $output->writeBool($this->archiveWorkingDirectory);
+      $xfer += $output->writeFieldEnd();
+    }
     $xfer += $output->writeFieldStop();
     $xfer += $output->writeStructEnd();
     return $xfer;

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/0a54650e/app/libraries/Airavata/Model/Experiment/Types.php
----------------------------------------------------------------------
diff --git a/app/libraries/Airavata/Model/Experiment/Types.php b/app/libraries/Airavata/Model/Experiment/Types.php
index 20587b6..0335092 100644
--- a/app/libraries/Airavata/Model/Experiment/Types.php
+++ b/app/libraries/Airavata/Model/Experiment/Types.php
@@ -409,6 +409,10 @@ class ExperimentModel {
    * @var \Airavata\Model\Process\ProcessModel[]
    */
   public $processes = null;
+  /**
+   * @var bool
+   */
+  public $archive = null;
 
   public function __construct($vals=null) {
     if (!isset(self::$_TSPEC)) {
@@ -515,6 +519,10 @@ class ExperimentModel {
             'class' => '\Airavata\Model\Process\ProcessModel',
             ),
           ),
+        20 => array(
+          'var' => 'archive',
+          'type' => TType::BOOL,
+          ),
         );
     }
     if (is_array($vals)) {
@@ -575,6 +583,9 @@ class ExperimentModel {
       if (isset($vals['processes'])) {
         $this->processes = $vals['processes'];
       }
+      if (isset($vals['archive'])) {
+        $this->archive = $vals['archive'];
+      }
     }
   }
 
@@ -786,6 +797,13 @@ class ExperimentModel {
             $xfer += $input->skip($ftype);
           }
           break;
+        case 20:
+          if ($ftype == TType::BOOL) {
+            $xfer += $input->readBool($this->archive);
+          } else {
+            $xfer += $input->skip($ftype);
+          }
+          break;
         default:
           $xfer += $input->skip($ftype);
           break;
@@ -960,6 +978,11 @@ class ExperimentModel {
       }
       $xfer += $output->writeFieldEnd();
     }
+    if ($this->archive !== null) {
+      $xfer += $output->writeFieldBegin('archive', TType::BOOL, 20);
+      $xfer += $output->writeBool($this->archive);
+      $xfer += $output->writeFieldEnd();
+    }
     $xfer += $output->writeFieldStop();
     $xfer += $output->writeStructEnd();
     return $xfer;

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/0a54650e/app/libraries/Airavata/Model/Process/Types.php
----------------------------------------------------------------------
diff --git a/app/libraries/Airavata/Model/Process/Types.php b/app/libraries/Airavata/Model/Process/Types.php
index c0000d0..41187c5 100644
--- a/app/libraries/Airavata/Model/Process/Types.php
+++ b/app/libraries/Airavata/Model/Process/Types.php
@@ -117,6 +117,10 @@ class ProcessModel {
    * @var string
    */
   public $experimentDataDir = null;
+  /**
+   * @var bool
+   */
+  public $archive = null;
 
   public function __construct($vals=null) {
     if (!isset(self::$_TSPEC)) {
@@ -231,6 +235,10 @@ class ProcessModel {
           'var' => 'experimentDataDir',
           'type' => TType::STRING,
           ),
+        23 => array(
+          'var' => 'archive',
+          'type' => TType::BOOL,
+          ),
         );
     }
     if (is_array($vals)) {
@@ -300,6 +308,9 @@ class ProcessModel {
       if (isset($vals['experimentDataDir'])) {
         $this->experimentDataDir = $vals['experimentDataDir'];
       }
+      if (isset($vals['archive'])) {
+        $this->archive = $vals['archive'];
+      }
     }
   }
 
@@ -522,6 +533,13 @@ class ProcessModel {
             $xfer += $input->skip($ftype);
           }
           break;
+        case 23:
+          if ($ftype == TType::BOOL) {
+            $xfer += $input->readBool($this->archive);
+          } else {
+            $xfer += $input->skip($ftype);
+          }
+          break;
         default:
           $xfer += $input->skip($ftype);
           break;
@@ -702,6 +720,11 @@ class ProcessModel {
       $xfer += $output->writeString($this->experimentDataDir);
       $xfer += $output->writeFieldEnd();
     }
+    if ($this->archive !== null) {
+      $xfer += $output->writeFieldBegin('archive', TType::BOOL, 23);
+      $xfer += $output->writeBool($this->archive);
+      $xfer += $output->writeFieldEnd();
+    }
     $xfer += $output->writeFieldStop();
     $xfer += $output->writeStructEnd();
     return $xfer;

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/0a54650e/app/libraries/Airavata/Model/Task/Types.php
----------------------------------------------------------------------
diff --git a/app/libraries/Airavata/Model/Task/Types.php b/app/libraries/Airavata/Model/Task/Types.php
index fcf5994..2997652 100644
--- a/app/libraries/Airavata/Model/Task/Types.php
+++ b/app/libraries/Airavata/Model/Task/Types.php
@@ -48,9 +48,11 @@ final class TaskTypes {
 final class DataStageType {
   const INPUT = 0;
   const OUPUT = 1;
+  const ARCHIVE_OUTPUT = 2;
   static public $__names = array(
     0 => 'INPUT',
     1 => 'OUPUT',
+    2 => 'ARCHIVE_OUTPUT',
   );
 }