Return-Path: X-Original-To: apmail-climate-commits-archive@minotaur.apache.org Delivered-To: apmail-climate-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E03581075F for ; Fri, 28 Feb 2014 05:48:42 +0000 (UTC) Received: (qmail 65735 invoked by uid 500); 28 Feb 2014 05:48:42 -0000 Delivered-To: apmail-climate-commits-archive@climate.apache.org Received: (qmail 65706 invoked by uid 500); 28 Feb 2014 05:48:41 -0000 Mailing-List: contact commits-help@climate.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@climate.incubator.apache.org Delivered-To: mailing list commits@climate.incubator.apache.org Received: (qmail 65698 invoked by uid 99); 28 Feb 2014 05:48:41 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 28 Feb 2014 05:48:41 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 28 Feb 2014 05:48:40 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 1CF2B23889F1; Fri, 28 Feb 2014 05:48:20 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1572829 - /incubator/climate/trunk/ocw-ui/frontend/app/js/controllers/ObservationSelectCtrl.js Date: Fri, 28 Feb 2014 05:48:20 -0000 To: commits@climate.incubator.apache.org From: joyce@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20140228054820.1CF2B23889F1@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: joyce Date: Fri Feb 28 05:48:19 2014 New Revision: 1572829 URL: http://svn.apache.org/r1572829 Log: CLIMATE-333 - Update ObservationSelectCtrl - Update /dir/path_leader request with new endpoint name. - Update /lfme/list_vars request with new endpoint name. - Update /lfme/list_latlons request with new endpoint name. - Update /lfme/list_time request with new endpoint name. - Update handling of list_vars and list_times return with new backend variable naming convention. Modified: incubator/climate/trunk/ocw-ui/frontend/app/js/controllers/ObservationSelectCtrl.js Modified: incubator/climate/trunk/ocw-ui/frontend/app/js/controllers/ObservationSelectCtrl.js URL: http://svn.apache.org/viewvc/incubator/climate/trunk/ocw-ui/frontend/app/js/controllers/ObservationSelectCtrl.js?rev=1572829&r1=1572828&r2=1572829&view=diff ============================================================================== --- incubator/climate/trunk/ocw-ui/frontend/app/js/controllers/ObservationSelectCtrl.js (original) +++ incubator/climate/trunk/ocw-ui/frontend/app/js/controllers/ObservationSelectCtrl.js Fri Feb 28 05:48:19 2014 @@ -35,7 +35,7 @@ function($rootScope, $scope, $http, $q, // Grab the path leader information that the webserver is using to limit directory access. $scope.pathLeader = 'False'; - $http.jsonp($rootScope.baseURL + '/getPathLeader/?callback=JSON_CALLBACK'). + $http.jsonp($rootScope.baseURL + '/dir/path_leader/?callback=JSON_CALLBACK'). success(function(data) { $scope.pathLeader = data.leader; }); @@ -71,11 +71,11 @@ function($rootScope, $scope, $http, $q, // Should check for fails and allow the user to make changes. // // Get model variables - var varsPromise = $http.jsonp($rootScope.baseURL + '/list/vars/"' + input + '"?callback=JSON_CALLBACK'); + var varsPromise = $http.jsonp($rootScope.baseURL + '/lfme/list_vars/' + input + '?callback=JSON_CALLBACK'); // Get Lat and Lon variables - var latlonPromise = $http.jsonp($rootScope.baseURL + '/list/latlon/"' + input + '"?callback=JSON_CALLBACK'); + var latlonPromise = $http.jsonp($rootScope.baseURL + '/lfme/list_latlon/' + input + '?callback=JSON_CALLBACK'); // Get Time variables - var timesPromise = $http.jsonp($rootScope.baseURL + '/list/time/"' + input + '"?callback=JSON_CALLBACK'); + var timesPromise = $http.jsonp($rootScope.baseURL + '/lfme/list_time/' + input + '?callback=JSON_CALLBACK'); $q.all([varsPromise, latlonPromise, timesPromise]).then( // Handle success fetches! @@ -84,9 +84,9 @@ function($rootScope, $scope, $http, $q, // Handle lat/lon results var data = arrayOfResults[1].data; - $scope.lats = [data.latname]; - $scope.lons = [data.lonname]; - $scope.latLonVals = [data.latMin, data.latMax, data.lonMin, data.lonMax]; + $scope.lats = [data.lat_name]; + $scope.lons = [data.lon_name]; + $scope.latLonVals = [data.lat_min, data.lat_max, data.lon_min, data.lon_max]; // If there is more than one option for the user, tell them they need to pick one! if ($scope.lats.length > 1) $scope.lats.splice(0, 0, "Please select an option"); @@ -97,7 +97,7 @@ function($rootScope, $scope, $http, $q, // Handle time results var data = arrayOfResults[2].data - $scope.times = [data.timename]; + $scope.times = [data.time_name]; $scope.timeVals = [data.start_time, data.end_time]; if ($scope.times.length > 1) $scope.times.splice(0, 0, "Please select an option");