From 185d952ae7855b5efdd0d1c6a8ce631fe519cf1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Prunayre?= Date: Tue, 2 Sep 2014 09:11:27 +0200 Subject: [PATCH 01/11] Harvester results are not saved #626. --- .../fao/geonet/kernel/harvest/harvester/AbstractHarvester.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/harvesters/src/main/java/org/fao/geonet/kernel/harvest/harvester/AbstractHarvester.java b/harvesters/src/main/java/org/fao/geonet/kernel/harvest/harvester/AbstractHarvester.java index 13f4913424c..1b20b20b273 100644 --- a/harvesters/src/main/java/org/fao/geonet/kernel/harvest/harvester/AbstractHarvester.java +++ b/harvesters/src/main/java/org/fao/geonet/kernel/harvest/harvester/AbstractHarvester.java @@ -562,7 +562,8 @@ private void logHarvest(String logfile, Logger logger, String nodeName, String l .setHarvesterUuid(getParams().uuid) .setElapsedTime((int) elapsedTime) .setHarvestDate(new ISODate(lastRun)) - .setParams(getParams().node); + .setParams(getParams().node) + .setInfo(result); historyRepository.save(history); From 0e3c13c42b9ad31a356b5bd7055335dd35af8570 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Prunayre?= Date: Tue, 2 Sep 2014 09:41:17 +0200 Subject: [PATCH 02/11] Harvester / Display vertical timeline for history. Improve layout in case of errors. Restore link to log file. --- .../resources/catalog/locales/en-admin.json | 3 +- .../resources/catalog/locales/fr-admin.json | 2 + .../resources/catalog/style/gn_admin.less | 1 + .../resources/catalog/style/timeline.less | 206 ++++++++++++ .../templates/admin/harvest/harvest.html | 318 ++++++++++-------- 5 files changed, 382 insertions(+), 148 deletions(-) create mode 100644 web-ui/src/main/resources/catalog/style/timeline.less diff --git a/web-ui/src/main/resources/catalog/locales/en-admin.json b/web-ui/src/main/resources/catalog/locales/en-admin.json index 726f152ecbc..c7644aa3e7c 100644 --- a/web-ui/src/main/resources/catalog/locales/en-admin.json +++ b/web-ui/src/main/resources/catalog/locales/en-admin.json @@ -18,7 +18,8 @@ "cron-0 0/5 14 * * ?": "Fire every 5 minutes starting at 2pm and ending at 2:55pm, every day", "cron-0 15 10 ? * MON-FRI": "Fire at 10:15am every Monday, Tuesday, Wednesday, Thursday and Friday", "cron-0 15 10 15 * ?": "Fire at 10:15am on the 15th day of every month", - + "recordsHarvestedIn": " record(s) harvested in ", + "seconds": "seconds", "totalNumberOfRecords": "records in the catalog", "totalNumberOfRecordsHelp": "Total number of records visible to you.", diff --git a/web-ui/src/main/resources/catalog/locales/fr-admin.json b/web-ui/src/main/resources/catalog/locales/fr-admin.json index 404e4294a62..42546f3d89e 100644 --- a/web-ui/src/main/resources/catalog/locales/fr-admin.json +++ b/web-ui/src/main/resources/catalog/locales/fr-admin.json @@ -16,6 +16,8 @@ "tools": "Outils", "totalNumberOfRecords": " fiches dans le catalogue", "totalNumberOfRecordsHelp": "Nombre totale de fiches que vous pouvez consulter.", + "recordsHarvestedIn": " fiche(s) moissonnée(s) en", + "seconds": "secondes", "status": "Statut", "information": "Information", "dbUrl": "Base de données", diff --git a/web-ui/src/main/resources/catalog/style/gn_admin.less b/web-ui/src/main/resources/catalog/style/gn_admin.less index 9d186a5451a..1b4ec4fba36 100644 --- a/web-ui/src/main/resources/catalog/style/gn_admin.less +++ b/web-ui/src/main/resources/catalog/style/gn_admin.less @@ -1,4 +1,5 @@ @import "gn.less"; +@import "timeline.less"; .gn-chart{ height:500px; diff --git a/web-ui/src/main/resources/catalog/style/timeline.less b/web-ui/src/main/resources/catalog/style/timeline.less new file mode 100644 index 00000000000..2b668f4666d --- /dev/null +++ b/web-ui/src/main/resources/catalog/style/timeline.less @@ -0,0 +1,206 @@ +.timeline { + list-style: none; + padding: 20px 0 20px; + position: relative; +} + +.timeline-1-col { + :before { + left: 2%; + } + + li > .timeline-badge { + left: 2%; + } + li > .timeline-panel { + width: 92%; + } +} +.timeline-2-col { + :before { + left: 50%; + } + li > .timeline-badge { + left: 50%; + } + li > .timeline-panel { + width: 46%; + } +} + +.timeline:before { + top: 0; + bottom: 0; + position: absolute; + content: " "; + width: 3px; + background-color: #eeeeee; + margin-left: -1.5px; +} + +.timeline > li { + margin-bottom: 20px; + position: relative; +} + +.timeline > li:before, +.timeline > li:after { + content: " "; + display: table; +} + +.timeline > li:after { + clear: both; +} + +.timeline > li:before, +.timeline > li:after { + content: " "; + display: table; +} + +.timeline > li:after { + clear: both; +} + +.timeline > li > .timeline-panel { +// width: 46%; + float: left; + border: 1px solid #d4d4d4; + border-radius: 2px; + padding: 20px; + position: relative; + -webkit-box-shadow: 0 1px 6px rgba(0, 0, 0, 0.175); + box-shadow: 0 1px 6px rgba(0, 0, 0, 0.175); +} + +.timeline > li > .timeline-panel:before { + position: absolute; + top: 26px; + right: -15px; + display: inline-block; + border-top: 15px solid transparent; + border-left: 15px solid #ccc; + border-right: 0 solid #ccc; + border-bottom: 15px solid transparent; + content: " "; +} + +.timeline > li > .timeline-panel:after { + position: absolute; + top: 27px; + right: -14px; + display: inline-block; + border-top: 14px solid transparent; + border-left: 14px solid #fff; + border-right: 0 solid #fff; + border-bottom: 14px solid transparent; + content: " "; +} + +.timeline > li > .timeline-badge { + color: #fff; + width: 50px; + height: 50px; + line-height: 50px; + padding-top: 15px; + font-size: 1.4em; + text-align: center; + position: absolute; + top: 16px; + margin-left: -25px; + background-color: #999999; + z-index: 100; + border-top-right-radius: 50%; + border-top-left-radius: 50%; + border-bottom-right-radius: 50%; + border-bottom-left-radius: 50%; +} + +.timeline > li.timeline-inverted > .timeline-panel { + float: right; +} + +.timeline > li.timeline-inverted > .timeline-panel:before { + border-left-width: 0; + border-right-width: 15px; + left: -15px; + right: auto; +} + +.timeline > li.timeline-inverted > .timeline-panel:after { + border-left-width: 0; + border-right-width: 14px; + left: -14px; + right: auto; +} + +.timeline-badge.primary { + background-color: #2e6da4 !important; +} + +.timeline-badge.success { + background-color: #3f903f !important; +} + +.timeline-badge.warning { + background-color: #f0ad4e !important; +} + +.timeline-badge.danger { + background-color: #d9534f !important; +} + +.timeline-badge.info { + background-color: #5bc0de !important; +} + +.timeline-title { + margin-top: 0; + color: inherit; +} + +.timeline-body > p, +.timeline-body > ul { + margin-bottom: 0; +} + +.timeline-body > p + p { + margin-top: 5px; +} + +@media (max-width: 767px) { + ul.timeline:before { + left: 40px; + } + + ul.timeline > li > .timeline-panel { + width: calc(100% - 90px); + width: -moz-calc(100% - 90px); + width: -webkit-calc(100% - 90px); + } + + ul.timeline > li > .timeline-badge { + left: 15px; + margin-left: 0; + top: 16px; + } + + ul.timeline > li > .timeline-panel { + float: right; + } + + ul.timeline > li > .timeline-panel:before { + border-left-width: 0; + border-right-width: 15px; + left: -15px; + right: auto; + } + + ul.timeline > li > .timeline-panel:after { + border-left-width: 0; + border-right-width: 14px; + left: -14px; + right: auto; + } +} \ No newline at end of file diff --git a/web-ui/src/main/resources/catalog/templates/admin/harvest/harvest.html b/web-ui/src/main/resources/catalog/templates/admin/harvest/harvest.html index f7e488a95ac..dfd1c0dbbbb 100644 --- a/web-ui/src/main/resources/catalog/templates/admin/harvest/harvest.html +++ b/web-ui/src/main/resources/catalog/templates/admin/harvest/harvest.html @@ -1,179 +1,203 @@
- -
-
-
- updateHarvester - newHarvester - {{harvesterSelected.site.name}} +
+
+
+ updateHarvester + newHarvester + {{harvesterSelected.site.name}} -
- - - - -
+ +
+
+
+
+ harvesterIsRunning
-
-
- harvesterIsRunning -
-
- harvesterError - {{harvesterSelected.error['@id']}} +
+ harvesterError + {{harvesterSelected.error['@id']}}
           {{harvesterSelected.error.message}}
           
-
- -
+ +
+
-
-
- harvesterHistory -
- -
+
+
+ harvesterHistory +
+ +
+
+
+
+ noHarvesterHistory
-
-
- noHarvesterHistory -
- - - - - - - - - - - - -
lastRuntimedetails
{{ h.harvestdate | gnFromNow }}{{h.elapsedtime}} -

- - {{key}}: {{value}} - - - - - - - - {{key}}: {{value}} - +

    +
  • +
    + +
    +
    +
    +

    + {{h.info[0]['@id']}} +

    +

    + + + {{ h.harvestdate | gnFromNow }} +

    +
    + {{h.info[0]['message']}} + +
    {{line['@class']}} {{line['@file']}} ({{line['@line']}}) #{{line['@method']}}
    +
    +
    +
    + +
    +

    + {{h.info[0].total}} + recordsHarvestedIn + {{h.elapsedtime}} + seconds. +

    +

    + + + {{ h.harvestdate | gnFromNow }} + +

    +
    +
    +

    +

      +
    • + {{k}}: {{v}} +
    • +
    logFile -
-
+ href="admin.harvester.log?file={{h.info[0].logfile}}" target="_blank" + data-translate="">logFile +

+
+
+ +
+
-
-
harvesterRecords
+
+
harvesterRecords
-
- +
+ -
-
+
+
\ No newline at end of file From 9901415ba40850c1d3c685611c5cc81cc69f84d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Prunayre?= Date: Tue, 2 Sep 2014 10:07:38 +0200 Subject: [PATCH 03/11] Harvester admin / Add spinner while loading information. --- .../main/resources/catalog/js/admin/HarvestController.js | 9 +++++++++ web-ui/src/main/resources/catalog/locales/fr-admin.json | 2 +- .../catalog/templates/admin/harvest/harvest.html | 9 +++++++-- .../catalog/templates/admin/harvest/type/ogcwxs.js | 6 +++--- 4 files changed, 20 insertions(+), 6 deletions(-) diff --git a/web-ui/src/main/resources/catalog/js/admin/HarvestController.js b/web-ui/src/main/resources/catalog/js/admin/HarvestController.js index 09cc9354d50..a9c6ed4a3ef 100644 --- a/web-ui/src/main/resources/catalog/js/admin/HarvestController.js +++ b/web-ui/src/main/resources/catalog/js/admin/HarvestController.js @@ -33,30 +33,39 @@ $scope.harvesterUpdated = false; $scope.harvesterNew = false; $scope.harvesterHistory = {}; + $scope.isLoadingHarvester = false; + $scope.isLoadingHarvesterHistory = false; var unbindStatusListener = null; function loadHarvesters() { + $scope.isLoadingHarvester = true; + $scope.harvesters = {}; return $http.get('admin.harvester.list@json').success(function(data) { if (data != 'null') { $scope.harvesters = data; gnUtilityService.parseBoolean($scope.harvesters); + $scope.isLoadingHarvester = false; } }).error(function(data) { // TODO + $scope.isLoadingHarvester = false; }); } function loadHistory() { + $scope.isLoadingHarvesterHistory = true; $scope.harvesterHistory = undefined; $http.get('admin.harvester.history@json?uuid=' + $scope.harvesterSelected.site.uuid).success(function(data) { $scope.harvesterHistory = data.harvesthistory; + $scope.isLoadingHarvesterHistory = false; }).error(function(data) { // TODO + $scope.isLoadingHarvesterHistory = false; }); } diff --git a/web-ui/src/main/resources/catalog/locales/fr-admin.json b/web-ui/src/main/resources/catalog/locales/fr-admin.json index 42546f3d89e..1d42ccf64cb 100644 --- a/web-ui/src/main/resources/catalog/locales/fr-admin.json +++ b/web-ui/src/main/resources/catalog/locales/fr-admin.json @@ -345,7 +345,7 @@ "deleteCriteriaGroup" : "Delete Criteria Group", "deleteCriteria" : "Delete Criteria", - "harvester": "noeuds distants", + "harvester": "Noeuds distants", "newHarvester": "Moissonner ", "deleteHarvester": "Supprimer", "deleteHarvesterHelp": "Supprimer le noeud et tous les fiches associées", diff --git a/web-ui/src/main/resources/catalog/templates/admin/harvest/harvest.html b/web-ui/src/main/resources/catalog/templates/admin/harvest/harvest.html index dfd1c0dbbbb..079727ddc57 100644 --- a/web-ui/src/main/resources/catalog/templates/admin/harvest/harvest.html +++ b/web-ui/src/main/resources/catalog/templates/admin/harvest/harvest.html @@ -1,11 +1,15 @@
-
harvester
+
+ harvester + +
+
harvesterHistory +
- -
+
From 2f9de4a9932e565490b9df0dbf0c8bb566730cc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Prunayre?= Date: Tue, 2 Sep 2014 11:47:03 +0200 Subject: [PATCH 05/11] Add pagination for users, groups, virtual csw, categories, thesaurus. Focus on proper input while selecting/creating an item. --- .../catalog/js/admin/CSWVirtualController.js | 14 +++++++++++--- .../catalog/js/admin/CategoriesController.js | 12 ++++++++++-- .../catalog/js/admin/ThesaurusController.js | 2 ++ .../catalog/js/admin/UserGroupController.js | 14 +++++++++++++- .../templates/admin/classification/categories.html | 12 +++++++++--- .../templates/admin/classification/thesaurus.html | 9 +++++++-- .../catalog/templates/admin/harvest/harvest.html | 3 ++- .../templates/admin/settings/csw-virtual.html | 12 +++++++++--- .../catalog/templates/admin/usergroup/groups.html | 14 ++++++++++---- .../catalog/templates/admin/usergroup/users.html | 13 +++++++++---- 10 files changed, 82 insertions(+), 23 deletions(-) diff --git a/web-ui/src/main/resources/catalog/js/admin/CSWVirtualController.js b/web-ui/src/main/resources/catalog/js/admin/CSWVirtualController.js index 05f900c9ae4..6ba70e58daf 100644 --- a/web-ui/src/main/resources/catalog/js/admin/CSWVirtualController.js +++ b/web-ui/src/main/resources/catalog/js/admin/CSWVirtualController.js @@ -12,13 +12,13 @@ * */ module.controller('GnCSWVirtualController', [ - '$scope', '$http', '$rootScope', '$translate', - function($scope, $http, $rootScope, $translate) { + '$scope', '$http', '$rootScope', '$translate', '$timeout', + function($scope, $http, $rootScope, $translate, $timeout) { /** * CSW virtual */ - $scope.cswVirtual = {}; + $scope.cswVirtual = null; $scope.virtualCSWSelected = null; $scope.virtualCSWUpdated = false; $scope.virtualCSWSearch = ''; @@ -74,6 +74,10 @@ serviceParameters[param['@name']] = param['#text']; }); $scope.virtualCSWUpdated = false; + + $timeout(function() { + $('#servicename').focus(); + }, 100); }).error(function(data) { // TODO }); @@ -97,6 +101,10 @@ 'type': '' } }; + + $timeout(function() { + $('#servicename').focus(); + }, 100); }; $scope.saveVirtualCSW = function(formId) { diff --git a/web-ui/src/main/resources/catalog/js/admin/CategoriesController.js b/web-ui/src/main/resources/catalog/js/admin/CategoriesController.js index 90655f737a5..484b79ea933 100644 --- a/web-ui/src/main/resources/catalog/js/admin/CategoriesController.js +++ b/web-ui/src/main/resources/catalog/js/admin/CategoriesController.js @@ -10,8 +10,10 @@ * to manage category. */ module.controller('GnCategoriesController', [ - '$scope', '$routeParams', '$http', '$rootScope', '$translate', - function($scope, $routeParams, $http, $rootScope, $translate) { + '$scope', '$routeParams', '$http', '$rootScope', + '$translate', '$timeout', + function($scope, $routeParams, $http, $rootScope, + $translate, $timeout) { $scope.categories = null; $scope.categorySelected = {id: $routeParams.categoryId}; @@ -21,6 +23,9 @@ $scope.selectCategory = function(c) { $scope.cateroryUpdated = false; $scope.categorySelected = c; + $timeout(function() { + $('#categoryname').focus(); + }, 100); }; @@ -71,6 +76,9 @@ '@id': '', name: '' }; + $timeout(function() { + $('#categoryname').focus(); + }, 100); }; $scope.unselectCategory = function() { diff --git a/web-ui/src/main/resources/catalog/js/admin/ThesaurusController.js b/web-ui/src/main/resources/catalog/js/admin/ThesaurusController.js index e0907b51ba3..0d88f3ee8ff 100644 --- a/web-ui/src/main/resources/catalog/js/admin/ThesaurusController.js +++ b/web-ui/src/main/resources/catalog/js/admin/ThesaurusController.js @@ -95,6 +95,8 @@ creatingThesaurus = false; $scope.thesaurusSelected = t; $scope.thesaurusSelectedActivated = t.activated == 'y'; + + $('#keywordFilter').focus(); searchThesaurusKeyword(); }; diff --git a/web-ui/src/main/resources/catalog/js/admin/UserGroupController.js b/web-ui/src/main/resources/catalog/js/admin/UserGroupController.js index b116864e1ce..b1aa3dd5997 100644 --- a/web-ui/src/main/resources/catalog/js/admin/UserGroupController.js +++ b/web-ui/src/main/resources/catalog/js/admin/UserGroupController.js @@ -132,7 +132,8 @@ $scope.userIsAdmin = false; $timeout(function() { $scope.setUserProfile(); - }); + $('#username').focus(); + }, 100); }; /** @@ -184,6 +185,10 @@ }); $scope.userUpdated = false; + + $timeout(function() { + $('#username').focus(); + }, 100); }; @@ -346,6 +351,9 @@ description: '', email: '' }; + $timeout(function() { + $('#groupname').focus(); + }, 100); }; $scope.saveGroup = function(formId) { @@ -402,6 +410,10 @@ sortBy: 'title' }); $scope.groupUpdated = false; + + $timeout(function() { + $('#groupname').focus(); + }); }; $scope.updatingGroup = function() { diff --git a/web-ui/src/main/resources/catalog/templates/admin/classification/categories.html b/web-ui/src/main/resources/catalog/templates/admin/classification/categories.html index 8cfd69050d2..c054f158808 100644 --- a/web-ui/src/main/resources/catalog/templates/admin/classification/categories.html +++ b/web-ui/src/main/resources/catalog/templates/admin/classification/categories.html @@ -5,14 +5,20 @@
-