Repository: climate Updated Branches: refs/heads/master ae0ade234 -> c025ecb88
CLIMATE-877 Adding PODAAC data source to OCW GUI Project: http://git-wip-us.apache.org/repos/asf/climate/repo Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/253b9973 Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/253b9973 Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/253b9973 Branch: refs/heads/master Commit: 253b9973a17167a8f32b61a36ed059dccc1c00c2 Parents: 386f7b9 Author: Omkar20895 <omkarreddy2...@gmail.com> Authored: Tue Oct 25 18:46:32 2016 +0530 Committer: Omkar20895 <omkarreddy2...@gmail.com> Committed: Tue Oct 25 18:46:32 2016 +0530 ---------------------------------------------------------------------- ocw-ui/backend/podaac_helpers.py | 31 +++++++++++++++ ocw-ui/backend/run_webservices.py | 2 + ocw-ui/frontend/app/index.html | 1 + .../app/scripts/controllers/datasetselect.js | 1 + .../app/scripts/controllers/podaacselection.js | 40 ++++++++++++++++++++ ocw-ui/frontend/app/views/selectpodaac.html | 29 ++++++++++++++ 6 files changed, 104 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/climate/blob/253b9973/ocw-ui/backend/podaac_helpers.py ---------------------------------------------------------------------- diff --git a/ocw-ui/backend/podaac_helpers.py b/ocw-ui/backend/podaac_helpers.py new file mode 100644 index 0000000..a17949d --- /dev/null +++ b/ocw-ui/backend/podaac_helpers.py @@ -0,0 +1,31 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +''' Services for interacting with NASA JPL's PODAAC Database. ''' + +from podaac.podaac_utils import PodaacUtils +from bottle import Bottle + +podaac_app = Bottle() +podaac_utils = PodaacUtils() + +@podaac_app.route('/datasets/', methods=['GET']) +def get_observation_dataset_data(): + ''' Return a list of dataset information from JPL's PODAAC. + ''' + r = podaac_utils.list_available_granule_search_level2_dataset_ids() + return r http://git-wip-us.apache.org/repos/asf/climate/blob/253b9973/ocw-ui/backend/run_webservices.py ---------------------------------------------------------------------- diff --git a/ocw-ui/backend/run_webservices.py b/ocw-ui/backend/run_webservices.py index dae2567..41587c6 100644 --- a/ocw-ui/backend/run_webservices.py +++ b/ocw-ui/backend/run_webservices.py @@ -20,12 +20,14 @@ from bottle import Bottle, response, static_file from local_file_metadata_extractors import lfme_app from directory_helpers import dir_app from rcmed_helpers import rcmed_app +from podaac_helpers import podaac_app from processing import processing_app app = Bottle() app.mount('/lfme/', lfme_app) app.mount('/dir/', dir_app) app.mount('/rcmed/', rcmed_app) +app.mount('/podaac/', podaac_app) app.mount('/processing/', processing_app) @app.route('/') http://git-wip-us.apache.org/repos/asf/climate/blob/253b9973/ocw-ui/frontend/app/index.html ---------------------------------------------------------------------- diff --git a/ocw-ui/frontend/app/index.html b/ocw-ui/frontend/app/index.html index fe3a4a4..4a2cf20 100644 --- a/ocw-ui/frontend/app/index.html +++ b/ocw-ui/frontend/app/index.html @@ -125,6 +125,7 @@ under the License. <script src="scripts/controllers/observationselect.js"></script> <script src="scripts/controllers/parameterselect.js"></script> <script src="scripts/controllers/rcmedselection.js"></script> + <script src="scripts/controllers/podaacselection.js"></script> <script src="scripts/controllers/result.js"></script> <script src="scripts/controllers/resultdetail.js"></script> <script src="scripts/controllers/settings.js"></script> http://git-wip-us.apache.org/repos/asf/climate/blob/253b9973/ocw-ui/frontend/app/scripts/controllers/datasetselect.js ---------------------------------------------------------------------- diff --git a/ocw-ui/frontend/app/scripts/controllers/datasetselect.js b/ocw-ui/frontend/app/scripts/controllers/datasetselect.js index b6b52ef..7a22500 100644 --- a/ocw-ui/frontend/app/scripts/controllers/datasetselect.js +++ b/ocw-ui/frontend/app/scripts/controllers/datasetselect.js @@ -56,6 +56,7 @@ angular.module('ocwUiApp') $scope.templates = [ {title:'Local File', url: 'views/selectobservation.html'}, {title:'RCMED', url: 'views/selectrcmed.html'}, + {title:'PODAAC', url: 'views/selectpodaac.html'}, {title:'ESG', disabled: true} ]; http://git-wip-us.apache.org/repos/asf/climate/blob/253b9973/ocw-ui/frontend/app/scripts/controllers/podaacselection.js ---------------------------------------------------------------------- diff --git a/ocw-ui/frontend/app/scripts/controllers/podaacselection.js b/ocw-ui/frontend/app/scripts/controllers/podaacselection.js new file mode 100644 index 0000000..181ab19 --- /dev/null +++ b/ocw-ui/frontend/app/scripts/controllers/podaacselection.js @@ -0,0 +1,40 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http: *www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +'use strict'; + +/** + * @ngdoc function + * @name ocwUiApp.controller:PodaacSelectionCtrl + * @description + * # PodaacSelectionCtrl + * Controller of the ocwUiApp + */ +angular.module('ocwUiApp') + .controller('PodaacSelectionCtrl', ['$rootScope', '$scope', '$http', '$timeout', 'selectedDatasetInformation', + function($rootScope, $scope, $http, $timeout, selectedDatasetInformation) { + $scope.datasetCount = selectedDatasetInformation.getDatasets(); + $scope.fileAdded = false; + $scope.datasetSelection = "Please select a dataset"; + + $scope.getObservations = function() { + + }; + } + ]); \ No newline at end of file http://git-wip-us.apache.org/repos/asf/climate/blob/253b9973/ocw-ui/frontend/app/views/selectpodaac.html ---------------------------------------------------------------------- diff --git a/ocw-ui/frontend/app/views/selectpodaac.html b/ocw-ui/frontend/app/views/selectpodaac.html new file mode 100644 index 0000000..c6e9a09 --- /dev/null +++ b/ocw-ui/frontend/app/views/selectpodaac.html @@ -0,0 +1,29 @@ +<!-- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +--> + +<div ng-controller="PodaacSelectionCtrl"> + <div class="row"> + <div class="col-md-10 col-md-offset-1"> + <div class="row top3">Select the PODAAC dataset that you would like to use.</div> + <div class="row top3"> + <select ng-change="dataSelectUpdated()" class="form-control" ng-model="datasetSelection"></select> + </div> + </div> + </div> +</div>