You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sdap.apache.org by le...@apache.org on 2017/10/27 22:34:48 UTC
[07/21] incubator-sdap-mudrod git commit: SDAP-1 Import all code
under the SDAP SGA
http://git-wip-us.apache.org/repos/asf/incubator-sdap-mudrod/blob/7b76fa16/web/META-INF/resources/fonts/glyphicons-halflings-regular.woff
----------------------------------------------------------------------
diff --git a/web/META-INF/resources/fonts/glyphicons-halflings-regular.woff b/web/META-INF/resources/fonts/glyphicons-halflings-regular.woff
new file mode 100644
index 0000000..9e61285
Binary files /dev/null and b/web/META-INF/resources/fonts/glyphicons-halflings-regular.woff differ
http://git-wip-us.apache.org/repos/asf/incubator-sdap-mudrod/blob/7b76fa16/web/META-INF/resources/fonts/glyphicons-halflings-regular.woff2
----------------------------------------------------------------------
diff --git a/web/META-INF/resources/fonts/glyphicons-halflings-regular.woff2 b/web/META-INF/resources/fonts/glyphicons-halflings-regular.woff2
new file mode 100644
index 0000000..64539b5
Binary files /dev/null and b/web/META-INF/resources/fonts/glyphicons-halflings-regular.woff2 differ
http://git-wip-us.apache.org/repos/asf/incubator-sdap-mudrod/blob/7b76fa16/web/META-INF/resources/images/OceanWave.jpg
----------------------------------------------------------------------
diff --git a/web/META-INF/resources/images/OceanWave.jpg b/web/META-INF/resources/images/OceanWave.jpg
new file mode 100644
index 0000000..15ee197
Binary files /dev/null and b/web/META-INF/resources/images/OceanWave.jpg differ
http://git-wip-us.apache.org/repos/asf/incubator-sdap-mudrod/blob/7b76fa16/web/META-INF/resources/images/searching.png
----------------------------------------------------------------------
diff --git a/web/META-INF/resources/images/searching.png b/web/META-INF/resources/images/searching.png
new file mode 100644
index 0000000..8f2595b
Binary files /dev/null and b/web/META-INF/resources/images/searching.png differ
http://git-wip-us.apache.org/repos/asf/incubator-sdap-mudrod/blob/7b76fa16/web/META-INF/resources/images/spinner.gif
----------------------------------------------------------------------
diff --git a/web/META-INF/resources/images/spinner.gif b/web/META-INF/resources/images/spinner.gif
new file mode 100644
index 0000000..0cac9fd
Binary files /dev/null and b/web/META-INF/resources/images/spinner.gif differ
http://git-wip-us.apache.org/repos/asf/incubator-sdap-mudrod/blob/7b76fa16/web/META-INF/resources/images/sprite.png
----------------------------------------------------------------------
diff --git a/web/META-INF/resources/images/sprite.png b/web/META-INF/resources/images/sprite.png
new file mode 100644
index 0000000..d151860
Binary files /dev/null and b/web/META-INF/resources/images/sprite.png differ
http://git-wip-us.apache.org/repos/asf/incubator-sdap-mudrod/blob/7b76fa16/web/META-INF/resources/index.html
----------------------------------------------------------------------
diff --git a/web/META-INF/resources/index.html b/web/META-INF/resources/index.html
new file mode 100755
index 0000000..cbcc30a
--- /dev/null
+++ b/web/META-INF/resources/index.html
@@ -0,0 +1,60 @@
+<!DOCTYPE html>
+<!--
+ Licensed 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.
+ -->
+<html lang="en" ng-app="mudrodApp">
+<head>
+ <title>JPL | MUDROD</title>
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
+ <link href="css/index.css" rel="stylesheet">
+ <link href="css/main-header.css" rel="stylesheet">
+ <link href="css/footer.css" rel="stylesheet">
+ <link href="images/logo.png" rel="icon">
+
+ <script src="js/libs/jquery-1.10.2.min.js"></script>
+ <script src="js/libs/angular.min.js"></script>
+ <script src="js/libs/angular-route.min.js"></script>
+ <script src="js/libs/angular-resource.min.js"></script>
+ <script src="js/libs/angular-cookies.min.js"></script>
+ <script src="js/libs/underscore-min.js"></script>
+ <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.0/jquery.min.js"></script>
+ <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
+
+ <script src="js/app.js"></script>
+ <script src="js/controllers.js"></script>
+ <script src="js/services.js"></script>
+
+
+</head>
+<body>
+
+<!-- main header -->
+<div ng-include src="'partials/main-header.html'"></div>
+
+<div ng-view></div>
+<footer class="mudrod-footer">
+ <p>
+ <a href="https://mudrod.github.io/"
+ target="_blank">Mining and Utilizing Dataset Relevancy from Oceanographic Datasets (MUDROD)</a>
+ is funded by NASA AIST Program(NNX15AM85G), developed by <a
+ href="http://stcenter.net/stc/">NSF Spatiotemporal
+ Innovation Center</a> in collaboration with <a
+ href="http://www.jpl.nasa.gov/">NASA JPL</a>
+ </p>
+</footer>
+<div ng-include src="'partials/footer.html'"></div>
+
+</body>
+</html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-sdap-mudrod/blob/7b76fa16/web/META-INF/resources/js/app.js
----------------------------------------------------------------------
diff --git a/web/META-INF/resources/js/app.js b/web/META-INF/resources/js/app.js
new file mode 100755
index 0000000..5901b80
--- /dev/null
+++ b/web/META-INF/resources/js/app.js
@@ -0,0 +1,49 @@
+/*
+ * Licensed 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';
+
+/* App Module */
+
+var mudrod = angular.module('mudrodApp', [
+ 'ngRoute',
+ 'mudrodControllers',
+ 'mudrodServices'
+]);
+
+mudrod.filter('urlencode', function() {
+ return function(input) {
+ if(input) {
+ return window.encodeURIComponent(input);
+ }
+ return "";
+ }
+});
+
+
+mudrod.config(['$routeProvider',
+ function ($routeProvider) {
+ $routeProvider.when('/', {
+ templateUrl: 'partials/search.html'
+ }).when('/metadataView/', {
+ templateUrl: 'partials/metadataResults.html',
+ controller: 'metadataViewCtrl',
+ reloadOnSearch: false
+ }).when('/datasetView/', {
+ templateUrl: 'partials/datasetResults.html',
+ controller: 'datasetViewCtrl'
+ }).otherwise({
+ redirectTo: '/',
+ templateUrl: 'partials/search.html'});
+ }]);
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-sdap-mudrod/blob/7b76fa16/web/META-INF/resources/js/controllers.js
----------------------------------------------------------------------
diff --git a/web/META-INF/resources/js/controllers.js b/web/META-INF/resources/js/controllers.js
new file mode 100755
index 0000000..8ff196f
--- /dev/null
+++ b/web/META-INF/resources/js/controllers.js
@@ -0,0 +1,210 @@
+/*
+ * Licensed 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';
+
+/* Controllers */
+var mudrodControllers = angular.module('mudrodControllers', []);
+
+mudrodControllers.controller('searchCtrl', ['$scope', '$rootScope', '$location', '$route', 'Autocomplete', 'SearchOptions',
+ function ($scope, $rootScope, $location, $route, Autocomplete, SearchOptions) {
+
+ $scope.hidethis = true;
+ $scope.options = {
+ opt: 'Or'
+ };
+
+ $scope.complete = function (string) {
+ Autocomplete.get({term: string},
+ function success(response) {
+ $scope.filterSearch = response;
+ $scope.hidethis = false;
+ },
+ function error(errorResponse) {
+ console.log("Error:" + JSON.stringify(errorResponse));
+ }
+ );
+ };
+
+ $scope.fillTextbox = function (string) {
+ $scope.options.query = string;
+ $scope.hidethis = true;
+ document.getElementById("search-btn").focus();
+ };
+
+ $scope.search = function (options) {
+ $scope.hidethis = true;
+ $rootScope.searchOptions = angular.copy(options);
+ $location.path("/metadataView/").search({'query': options.query, 'opt': options.opt});
+ $route.reload();
+ };
+
+ $scope.$watch(function () {
+ return SearchOptions.getSearchOptions();
+ }, function (newValue, oldValue) {
+ if (newValue !== null) {
+ $scope.options.query = newValue.query;
+ $scope.options.opt = newValue.opt;
+ }
+ }, true);
+ }]);
+
+mudrodControllers.controller('vocabularyCtrl', ['$scope', '$rootScope', 'VocabList',
+ function vocabularyCtrl($scope, $rootScope, VocabList) {
+
+ var word = $rootScope.searchOptions.query;
+ VocabList.get({query: word},
+ function success(response) {
+ $scope.ontologyList = response.graph.ontology;
+
+ },
+ function error(errorResponse) {
+ console.log("Error:" + JSON.stringify(errorResponse));
+ }
+ );
+ }]);
+
+mudrodControllers.controller('metadataViewCtrl', ['$rootScope', '$scope', '$location', '$routeParams', 'MetaData', 'PagerService', 'SearchOptions',
+ function metadataViewCtrl($rootScope, $scope, $location, $routeParams, MetaData, PagerService, SearchOptions) {
+
+ $scope.searchComplete = false;
+
+ var vm = this;
+ vm.PDItems = [];
+ vm.pager = {};
+ vm.setPage = setPage;
+ vm.rankData = rankData;
+ vm.totalMatches = 0;
+ vm.rankopt = $routeParams.rankopt ? $routeParams.rankopt : 'Rank-SVM';
+
+ var word = String();
+ var opt = String();
+ var rankopt = vm.rankopt;
+
+ if (!$routeParams.query) {
+ if(!$rootScope.searchOptions){
+ $location.path('/').search({});
+ }
+ word = $rootScope.searchOptions.query;
+ opt = $rootScope.searchOptions.opt;
+ SearchOptions.setSearchOptions({'query': word, 'opt': opt});
+ } else {
+ word = $routeParams.query;
+ if($routeParams.opt){
+ opt = $routeParams.opt;
+ }else if ($rootScope.searchOptions && $rootScope.searchOptions.opt){
+ opt = $rootScope.searchOptions.opt;
+ upsertQueryParam('opt', opt);
+ }else{
+ opt = 'Or';
+ upsertQueryParam('opt', opt);
+ }
+
+ word = word.replace(/,/g , " ");
+ word = word.replace(/\//g , " ");
+
+ SearchOptions.setSearchOptions({'query': word, 'opt': opt});
+ }
+ $rootScope.searchOptions = SearchOptions.getSearchOptions();
+ searchMetadata();
+
+ function initController() {
+ vm.setPage(1);
+ }
+
+ function setPage(page) {
+ if (page < 1 || page > vm.pager.totalPages) {
+ return;
+ }
+
+ // get pager object from service
+ vm.pager = PagerService.GetPager(vm.PDItems.length, page);
+
+ // get current page of items
+ vm.items = vm.PDItems.slice(vm.pager.startIndex, vm.pager.endIndex + 1);
+ }
+
+ function rankData(opt) {
+ rankopt = opt;
+ upsertQueryParam('rankopt', opt);
+ searchMetadata();
+ }
+
+ function upsertQueryParam(paramName, paramValue){
+ var qParams = $location.search();
+ qParams[paramName] = paramValue;
+ $location.search(qParams);
+ }
+
+ function searchMetadata() {
+ MetaData.get({query: word, operator: opt, rankoption: rankopt},
+ function success(response) {
+ vm.PDItems = response.PDResults;
+ vm.totalMatches = vm.PDItems.length;
+ vm.query = word;
+ vm.opt = opt;
+ initController();
+ $scope.searchComplete = true;
+ },
+ function error(errorResponse) {
+ $scope.searchComplete = true;
+ vm.searchError = {"status": errorResponse.status, "message": errorResponse.data};
+ }
+ );
+ }
+ }]);
+
+mudrodControllers.controller('datasetViewCtrl', ['$rootScope', '$scope', '$routeParams', 'DatasetDetail', 'SearchOptions',
+ function datasetViewCtrl($rootScope, $scope, $routeParams, DatasetDetail, SearchOptions) {
+ var shortname = $routeParams.shortname;
+
+ var query = String();
+ var opt = String();
+ if ($rootScope.searchOptions) {
+ query = $rootScope.searchOptions.query;
+ opt = $rootScope.searchOptions.opt;
+ SearchOptions.setSearchOptions({'query': query, 'opt': opt});
+ } else if ($routeParams.query && $routeParams.opt) {
+ query = $routeParams.query;
+ opt = $routeParams.opt;
+ SearchOptions.setSearchOptions({'query': query, 'opt': opt});
+ $rootScope.searchOptions = SearchOptions.getSearchOptions();
+ }
+
+ DatasetDetail.get({shortname: shortname},
+ function success(response) {
+ $scope.dataset = response.PDResults[0];
+ },
+ function error(errorResponse) {
+ console.log("Error:" + JSON.stringify(errorResponse));
+ }
+ );
+ }]);
+
+mudrodControllers.controller('hRecommendationCtrl', ['$scope', '$routeParams', 'HRecommendation',
+ function hRecommendationCtrl($scope, $routeParams, HRecommendation) {
+ var shortname = $routeParams.shortname;
+ HRecommendation.get({shortname: shortname},
+ function success(response) {
+ $scope.recommendationList = response.HybridRecommendationData.linked;
+
+ },
+ function error(errorResponse) {
+ console.log("Error:" + JSON.stringify(errorResponse));
+ }
+ );
+ }]);
+
+
+
http://git-wip-us.apache.org/repos/asf/incubator-sdap-mudrod/blob/7b76fa16/web/META-INF/resources/js/libs/angular-cookies.min.js
----------------------------------------------------------------------
diff --git a/web/META-INF/resources/js/libs/angular-cookies.min.js b/web/META-INF/resources/js/libs/angular-cookies.min.js
new file mode 100755
index 0000000..09020c7
--- /dev/null
+++ b/web/META-INF/resources/js/libs/angular-cookies.min.js
@@ -0,0 +1,8 @@
+/*
+ AngularJS v1.3.7
+ (c) 2010-2014 Google, Inc. http://angularjs.org
+ License: MIT
+*/
+(function(p,f,n){'use strict';f.module("ngCookies",["ng"]).factory("$cookies",["$rootScope","$browser",function(e,b){var c={},g={},h,k=!1,l=f.copy,m=f.isUndefined;b.addPollFn(function(){var a=b.cookies();h!=a&&(h=a,l(a,g),l(a,c),k&&e.$apply())})();k=!0;e.$watch(function(){var a,d,e;for(a in g)m(c[a])&&b.cookies(a,n);for(a in c)d=c[a],f.isString(d)||(d=""+d,c[a]=d),d!==g[a]&&(b.cookies(a,d),e=!0);if(e)for(a in d=b.cookies(),c)c[a]!==d[a]&&(m(d[a])?delete c[a]:c[a]=d[a])});return c}]).factory("$cookieStore",
+["$cookies",function(e){return{get:function(b){return(b=e[b])?f.fromJson(b):b},put:function(b,c){e[b]=f.toJson(c)},remove:function(b){delete e[b]}}}])})(window,window.angular);
+//# sourceMappingURL=angular-cookies.min.js.map