You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by sc...@apache.org on 2015/06/05 00:33:40 UTC

airavata-php-gateway git commit: Manually reverting Airavata-1703 to be compatible with Airavata 0.15 release branch

Repository: airavata-php-gateway
Updated Branches:
  refs/heads/airavata-php-gateway-0.15-release [created] b2ca8f73d


Manually reverting Airavata-1703 to be compatible with Airavata 0.15 release branch


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

Branch: refs/heads/airavata-php-gateway-0.15-release
Commit: b2ca8f73d84677f2f272d00adb5274e4790b6333
Parents: 2fbd928
Author: Supun Nakandala <sc...@apache.org>
Authored: Fri Jun 5 04:02:34 2015 +0530
Committer: Supun Nakandala <sc...@apache.org>
Committed: Fri Jun 5 04:02:34 2015 +0530

----------------------------------------------------------------------
 app/controllers/ExperimentController.php |  2 +-
 app/libraries/ExperimentUtilities.php    | 30 ++++-----
 app/views/experiment/search.blade.php    | 96 +++++++++++++--------------
 3 files changed, 62 insertions(+), 66 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/b2ca8f73/app/controllers/ExperimentController.php
----------------------------------------------------------------------
diff --git a/app/controllers/ExperimentController.php b/app/controllers/ExperimentController.php
index 60561de..9639716 100755
--- a/app/controllers/ExperimentController.php
+++ b/app/controllers/ExperimentController.php
@@ -243,7 +243,7 @@ class ExperimentController extends BaseController
         $expContainer = ExperimentUtilities::get_expsearch_results_with_pagination(Input::all(), $this->limit,
             ($pageNo - 1) * $this->limit);
 
-        $experimentStates = CommonUtilities::getExpStates();
+        $experimentStates = ExperimentUtilities::getExpStates();
         return View::make('experiment/search', array(
             'input' => Input::all(),
             'pageNo' => $pageNo,

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/b2ca8f73/app/libraries/ExperimentUtilities.php
----------------------------------------------------------------------
diff --git a/app/libraries/ExperimentUtilities.php b/app/libraries/ExperimentUtilities.php
index 6a5f0b4..ad41762 100644
--- a/app/libraries/ExperimentUtilities.php
+++ b/app/libraries/ExperimentUtilities.php
@@ -702,44 +702,42 @@ class ExperimentUtilities
         $experiments = array();
 
         try {
-            $filters = array();
-            if ($inputs["status-type"] != "ALL") {
-                $filters[\Airavata\Model\Workspace\Experiment\ExperimentSearchFields::STATUS] = $inputs["status-type"];
-            }
             switch ($inputs["search-key"]) {
                 case 'experiment-name':
-                    $filters[\Airavata\Model\Workspace\Experiment\ExperimentSearchFields::EXPERIMENT_NAME] = $inputs["search-value"];
+                    $experiments = Airavata::searchExperimentsByNameWithPagination(
+                        Session::get('gateway_id'), Session::get('username'), $inputs["search-value"], $limit, $offset);
                     break;
                 case 'experiment-description':
-                    $filters[\Airavata\Model\Workspace\Experiment\ExperimentSearchFields::EXPERIMENT_DESC] = $inputs["search-value"];
+                    $experiments = Airavata::searchExperimentsByDescWithPagination(
+                        Session::get('gateway_id'), Session::get('username'), $inputs["search-value"], $limit, $offset);
                     break;
                 case 'application':
-                    $filters[\Airavata\Model\Workspace\Experiment\ExperimentSearchFields::APPLICATION_ID] = $inputs["search-value"];
+                    $experiments = Airavata::searchExperimentsByApplicationWithPagination(
+                        Session::get('gateway_id'), Session::get('username'), $inputs["search-value"], $limit, $offset);
                     break;
                 case 'creation-time':
-                    $filters[\Airavata\Model\Workspace\Experiment\ExperimentSearchFields::FROM_DATE] = strtotime($inputs["from-date"]) * 1000;
-                    $filters[\Airavata\Model\Workspace\Experiment\ExperimentSearchFields::TO_DATE] = strtotime($inputs["to-date"]) * 1000;
+                    $experiments = Airavata::searchExperimentsByCreationTimeWithPagination(
+                        Session::get('gateway_id'), Session::get('username'), strtotime($inputs["from-date"]) * 1000,
+                        strtotime($inputs["to-date"]) * 1000, $limit, $offset);
                     break;
                 case '':
             }
-            $experiments = Airavata::searchExperiments(
-                Session::get('gateway_id'), Session::get('username'), $filters, $limit, $offset);
         } catch (InvalidRequestException $ire) {
-            CommonUtilities::print_error_message('InvalidRequestException!<br><br>' . $ire->getMessage());
+            Utilities::print_error_message('InvalidRequestException!<br><br>' . $ire->getMessage());
         } catch (AiravataClientException $ace) {
-            CommonUtilities::print_error_message('AiravataClientException!<br><br>' . $ace->getMessage());
+            Utilities::print_error_message('AiravataClientException!<br><br>' . $ace->getMessage());
         } catch (AiravataSystemException $ase) {
             if ($ase->airavataErrorType == 2) // 2 = INTERNAL_ERROR
             {
-                CommonUtilities::print_info_message('<p>You have not created any experiments yet, so no results will be returned!</p>
+                Utilities::print_info_message('<p>You have not created any experiments yet, so no results will be returned!</p>
                                 <p>Click <a href="create_experiment.php">here</a> to create an experiment, or
                                 <a href="create_project.php">here</a> to create a new project.</p>');
             } else {
-                CommonUtilities::print_error_message('There was a problem with Airavata. Please try again later or report a bug using the link in the Help menu.');
+                Utilities::print_error_message('There was a problem with Airavata. Please try again later or report a bug using the link in the Help menu.');
                 //print_error_message('AiravataSystemException!<br><br>' . $ase->airavataErrorType . ': ' . $ase->getMessage());
             }
         } catch (TTransportException $tte) {
-            CommonUtilities::print_error_message('TTransportException!<br><br>' . $tte->getMessage());
+            Utilities::print_error_message('TTransportException!<br><br>' . $tte->getMessage());
         }
 
         //get values of all experiments

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/b2ca8f73/app/views/experiment/search.blade.php
----------------------------------------------------------------------
diff --git a/app/views/experiment/search.blade.php b/app/views/experiment/search.blade.php
index 926268e..0acca01 100755
--- a/app/views/experiment/search.blade.php
+++ b/app/views/experiment/search.blade.php
@@ -34,18 +34,19 @@
                    value="<?php if (isset($_POST['search-value'])) echo $_POST['search-value'] ?>">
         </div>
 
-        <select name="status-type" class="form-control select-status">
-            <option value="ALL">Status</option>
-            <?php
-            foreach ($expStates as $index => $state) {
-                if (isset($input) && $state == $input["status-type"]) {
-                    echo '<option value="' . $state . '" selected>' . $state . '</option>';
-                } else {
-                    echo '<option value="' . $state . '">' . $state . '</option>';
-                }
-            }
-            ?>
-        </select>
+        <!--        <select name="status-type" class="form-control select-status">-->
+        <!--            <option value="ALL">Status</option>-->
+        <!--            --><?php
+        //            foreach ($expStates as $index => $state) {
+        //                if (isset($input) && $state == $input["status-type"]) {
+        //                    echo '<option value="' . $state . '" selected>' . $state . '</option>';
+        //                } else {
+        //                    echo '<option value="' . $state . '">' . $state . '</option>';
+        //                }
+        //            }
+        //
+        ?>
+        <!--        </select>-->
 
         <div class="container select-dates hide">
             <div class="col-md-12">
@@ -133,14 +134,15 @@
                 <th>Description</th>
                 <!--<th>Resource</th>-->
                 <th>Creation Time</th>
-                <th>Status</th>
-                <!--                    <select class="form-control select-status">-->
-                <!--                        <option value="ALL">Status</option>-->
-                <!--                    @foreach( $expStates as $index => $state)-->
-                <!--                        <option value="{{ $state }}">{{ $state }}</option>-->
-                <!--                    @endforeach-->
-                <!--                    </select>-->
-                <!--                </th>-->
+                <!--                <th>Status</th>-->
+                <th>
+                    <select class="form-control select-status">
+                        <option value="ALL">Status</option>
+                        @foreach( $expStates as $index => $state)
+                        <option value="{{ $state }}">{{ $state }}</option>
+                        @endforeach
+                    </select>
+                </th>
             </tr>
 
 
@@ -215,35 +217,31 @@
 
     $(document).ready(function () {
 
-//------------------------Commenting Client Side filtering--------------------------------------
-//            /* script to make status select work on the UI side itself. */
-//
-//            $(".select-status").on("change", function(){
-//                selectedStatus = this.value;
-//
-//                if( selectedStatus == "ALL")
-//                {
-//                    $("table tr").slideDown();
-//                }
-//                else
-//                {
-//                    $("table tr").each(function(index) {
-//                        if (index != 0) {
-//
-//                            $row = $(this);
-//
-//                            var status = $.trim( $row.find("td:last").text() );
-//                            if (status == selectedStatus )
-//                            {
-//                                $(this).slideDown();
-//                            }
-//                            else {
-//                                $(this).slideUp();
-//                            }
-//                        }
-//                    });
-//                }
-//            });
+        /* script to make status select work on the UI side itself. */
+
+        $(".select-status").on("change", function () {
+            selectedStatus = this.value;
+
+            if (selectedStatus == "ALL") {
+                $("table tr").slideDown();
+            }
+            else {
+                $("table tr").each(function (index) {
+                    if (index != 0) {
+
+                        $row = $(this);
+
+                        var status = $.trim($row.find("td:last").text());
+                        if (status == selectedStatus) {
+                            $(this).slideDown();
+                        }
+                        else {
+                            $(this).slideUp();
+                        }
+                    }
+                });
+            }
+        });
 
         /* making datetimepicker work for exp search */