From ed45487cdb117945ac392644d3efc346d754e31e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Carvalho?= Date: Fri, 2 May 2014 18:49:29 +0100 Subject: [PATCH 01/12] [DSI Releaser] prepare for next development iteration --- bennu-portal/pom.xml | 2 +- client/bennu-admin/pom.xml | 2 +- client/bennu-io-ui/pom.xml | 6 +----- client/bennu-scheduler-ui/pom.xml | 6 +----- client/bundle/pom.xml | 2 +- client/pom.xml | 2 +- maven/archetypes/bennu-project-archetype/pom.xml | 2 +- maven/archetypes/bennu-webapp-archetype/pom.xml | 2 +- maven/archetypes/pom.xml | 2 +- maven/bennu-maven-plugin/pom.xml | 2 +- maven/pom.xml | 2 +- pom.xml | 4 ++-- server/bennu-core-test/pom.xml | 2 +- server/bennu-core/pom.xml | 2 +- server/bennu-io/pom.xml | 2 +- server/bennu-scheduler/pom.xml | 2 +- server/bennu-search/pom.xml | 2 +- server/bundle/pom.xml | 2 +- server/pom.xml | 2 +- theme/default/pom.xml | 2 +- theme/pom.xml | 2 +- 21 files changed, 22 insertions(+), 30 deletions(-) diff --git a/bennu-portal/pom.xml b/bennu-portal/pom.xml index a0705afe7..04250ccf8 100644 --- a/bennu-portal/pom.xml +++ b/bennu-portal/pom.xml @@ -5,7 +5,7 @@ org.fenixedu bennu - 3.0.1 + 3.1.0-SNAPSHOT bennu-portal diff --git a/client/bennu-admin/pom.xml b/client/bennu-admin/pom.xml index 24140ba8e..2f11280bb 100644 --- a/client/bennu-admin/pom.xml +++ b/client/bennu-admin/pom.xml @@ -11,7 +11,7 @@ bennu-admin Bennu Admin - 3.0.1 + 3.1.0-SNAPSHOT diff --git a/client/bennu-io-ui/pom.xml b/client/bennu-io-ui/pom.xml index 60f3154f9..5d3ef736b 100644 --- a/client/bennu-io-ui/pom.xml +++ b/client/bennu-io-ui/pom.xml @@ -14,7 +14,7 @@ bennu-io-ui - 3.0.1 + 3.1.0-SNAPSHOT Bennu IO UI @@ -37,8 +37,4 @@ https://fenix-ashes.ist.utl.pt/nexus/content/groups/fenix-ashes-maven-repository - - - v3.0.1 - diff --git a/client/bennu-scheduler-ui/pom.xml b/client/bennu-scheduler-ui/pom.xml index 0f87c8a3b..cc926dbe4 100644 --- a/client/bennu-scheduler-ui/pom.xml +++ b/client/bennu-scheduler-ui/pom.xml @@ -14,7 +14,7 @@ bennu-scheduler-ui - 3.0.1 + 3.1.0-SNAPSHOT Bennu Scheduler UI @@ -23,8 +23,4 @@ https://fenix-ashes.ist.utl.pt/nexus/content/groups/fenix-ashes-maven-repository - - - v3.0.1 - diff --git a/client/bundle/pom.xml b/client/bundle/pom.xml index ae4b409a5..b53313c80 100644 --- a/client/bundle/pom.xml +++ b/client/bundle/pom.xml @@ -5,7 +5,7 @@ org.fenixedu bennu-client-aggregator - 3.0.1 + 3.1.0-SNAPSHOT bennu-client diff --git a/client/pom.xml b/client/pom.xml index e5691c02b..4b5515696 100644 --- a/client/pom.xml +++ b/client/pom.xml @@ -10,7 +10,7 @@ bennu-client-aggregator - 3.0.1 + 3.1.0-SNAPSHOT Bennu Framework Client Components Aggregating Pom pom diff --git a/maven/archetypes/bennu-project-archetype/pom.xml b/maven/archetypes/bennu-project-archetype/pom.xml index 41b185639..9573e2c02 100644 --- a/maven/archetypes/bennu-project-archetype/pom.xml +++ b/maven/archetypes/bennu-project-archetype/pom.xml @@ -5,7 +5,7 @@ org.fenixedu bennu-archetypes - 3.0.1 + 3.1.0-SNAPSHOT bennu-project-archetype diff --git a/maven/archetypes/bennu-webapp-archetype/pom.xml b/maven/archetypes/bennu-webapp-archetype/pom.xml index e88e9ae2b..380f42789 100644 --- a/maven/archetypes/bennu-webapp-archetype/pom.xml +++ b/maven/archetypes/bennu-webapp-archetype/pom.xml @@ -5,7 +5,7 @@ org.fenixedu bennu-archetypes - 3.0.1 + 3.1.0-SNAPSHOT bennu-webapp-archetype diff --git a/maven/archetypes/pom.xml b/maven/archetypes/pom.xml index 5341fcc49..4f2650c5d 100644 --- a/maven/archetypes/pom.xml +++ b/maven/archetypes/pom.xml @@ -5,7 +5,7 @@ org.fenixedu bennu-maven - 3.0.1 + 3.1.0-SNAPSHOT bennu-archetypes diff --git a/maven/bennu-maven-plugin/pom.xml b/maven/bennu-maven-plugin/pom.xml index c39286a39..9f7436026 100644 --- a/maven/bennu-maven-plugin/pom.xml +++ b/maven/bennu-maven-plugin/pom.xml @@ -4,7 +4,7 @@ org.fenixedu bennu-maven - 3.0.1 + 3.1.0-SNAPSHOT bennu-maven-plugin diff --git a/maven/pom.xml b/maven/pom.xml index abf03b691..369481b97 100644 --- a/maven/pom.xml +++ b/maven/pom.xml @@ -10,7 +10,7 @@ bennu-maven - 3.0.1 + 3.1.0-SNAPSHOT pom Bennu Maven Tools diff --git a/pom.xml b/pom.xml index fd38fe13d..f81b4553d 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ bennu Bennu Framework - 3.0.1 + 3.1.0-SNAPSHOT pom @@ -41,7 +41,7 @@ scm:git:git@github.com:fenixedu/bennu.git scm:git:git@github.com:fenixedu/bennu.git http://fenixedu.github.io/bennu - v3.0.1 + HEAD diff --git a/server/bennu-core-test/pom.xml b/server/bennu-core-test/pom.xml index 72c084612..4528059cb 100644 --- a/server/bennu-core-test/pom.xml +++ b/server/bennu-core-test/pom.xml @@ -9,7 +9,7 @@ bennu-core-test - 3.0.1 + 3.1.0-SNAPSHOT pt.ist.fenixframework.backend.jvstm.JVSTMCodeGenerator diff --git a/server/bennu-core/pom.xml b/server/bennu-core/pom.xml index 4b1dbd74a..bc0ef3542 100644 --- a/server/bennu-core/pom.xml +++ b/server/bennu-core/pom.xml @@ -5,7 +5,7 @@ org.fenixedu bennu-server-aggregator - 3.0.1 + 3.1.0-SNAPSHOT bennu-core diff --git a/server/bennu-io/pom.xml b/server/bennu-io/pom.xml index 333c5d18c..ffed9a01f 100644 --- a/server/bennu-io/pom.xml +++ b/server/bennu-io/pom.xml @@ -5,7 +5,7 @@ org.fenixedu bennu-server-aggregator - 3.0.1 + 3.1.0-SNAPSHOT bennu-io diff --git a/server/bennu-scheduler/pom.xml b/server/bennu-scheduler/pom.xml index c92c84ebc..57c0bbd45 100644 --- a/server/bennu-scheduler/pom.xml +++ b/server/bennu-scheduler/pom.xml @@ -4,7 +4,7 @@ org.fenixedu bennu-server-aggregator - 3.0.1 + 3.1.0-SNAPSHOT bennu-scheduler diff --git a/server/bennu-search/pom.xml b/server/bennu-search/pom.xml index 5969e1d05..f75d65406 100644 --- a/server/bennu-search/pom.xml +++ b/server/bennu-search/pom.xml @@ -5,7 +5,7 @@ org.fenixedu bennu-server-aggregator - 3.0.1 + 3.1.0-SNAPSHOT bennu-search diff --git a/server/bundle/pom.xml b/server/bundle/pom.xml index 2314adb9a..178815444 100644 --- a/server/bundle/pom.xml +++ b/server/bundle/pom.xml @@ -5,7 +5,7 @@ org.fenixedu bennu-server-aggregator - 3.0.1 + 3.1.0-SNAPSHOT bennu-server diff --git a/server/pom.xml b/server/pom.xml index 451444198..2371159ae 100644 --- a/server/pom.xml +++ b/server/pom.xml @@ -5,7 +5,7 @@ org.fenixedu bennu - 3.0.1 + 3.1.0-SNAPSHOT bennu-server-aggregator diff --git a/theme/default/pom.xml b/theme/default/pom.xml index 5780ad07f..2bd6e9109 100644 --- a/theme/default/pom.xml +++ b/theme/default/pom.xml @@ -4,7 +4,7 @@ org.fenixedu bennu-theme-aggregator - 3.0.1 + 3.1.0-SNAPSHOT default-theme diff --git a/theme/pom.xml b/theme/pom.xml index d353a7578..fa283ab3c 100644 --- a/theme/pom.xml +++ b/theme/pom.xml @@ -10,7 +10,7 @@ bennu-theme-aggregator - 3.0.1 + 3.1.0-SNAPSHOT Bennu Default Themes Aggregating Pom pom From f26adc2ebff72695cf26585e481459cbe58d682d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Carvalho?= Date: Tue, 20 May 2014 17:52:03 +0100 Subject: [PATCH 02/12] [default-theme] Bug Fix: Invoke theme scripts on DOM ready --- theme/default/src/main/webapp/themes/default/js/scripts.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/theme/default/src/main/webapp/themes/default/js/scripts.js b/theme/default/src/main/webapp/themes/default/js/scripts.js index ec17744da..d7c3d23b9 100644 --- a/theme/default/src/main/webapp/themes/default/js/scripts.js +++ b/theme/default/src/main/webapp/themes/default/js/scripts.js @@ -1,4 +1,4 @@ -(function() { +$(function() { $("input[name=password]").keypress(function(e) { if (e.which == 13) { e.preventDefault(); @@ -21,4 +21,4 @@ location.reload(); }); }); -}()); +}); From 12236b88314e5bd0d3b7f016638f1d5e9fe2da6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Carvalho?= Date: Fri, 23 May 2014 15:29:10 +0100 Subject: [PATCH 03/12] [bennu-portal] Improved fallback LocalizedStrings in portal.js --- bennu-portal/src/main/webapp/bennu-portal/portal.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/bennu-portal/src/main/webapp/bennu-portal/portal.js b/bennu-portal/src/main/webapp/bennu-portal/portal.js index 875bd4afa..262c906e3 100644 --- a/bennu-portal/src/main/webapp/bennu-portal/portal.js +++ b/bennu-portal/src/main/webapp/bennu-portal/portal.js @@ -63,8 +63,13 @@ if (val[currentLanguage]) { return val[currentLanguage]; } - + //search for other specific currentLanguage + for (var lang in val) { + if(lang.indexOf(currentLanguage) === 0) { + return val[lang]; + } + } var fallbackLanguage = undefined; $(langs).each(function() { var eachlang = this.tag; @@ -76,6 +81,8 @@ if (fallbackLanguage != undefined && val[fallbackLanguage] != undefined) { return val[fallbackLanguage]; } + // Fallback, return the first key in the object... + return val[Object.keys(val)[0]]; } return "_mls!!" + val + "!!"; }; From 0903052e97b4a902f13590308ffebf8cf8586ff5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Carvalho?= Date: Mon, 26 May 2014 16:45:15 +0100 Subject: [PATCH 04/12] [bennu-admin] Report system uptime, start time and hostname --- .../src/main/webapp/bennu-admin/js/app.js | 5 +++++ .../webapp/bennu-admin/template/SystemInfo.html | 4 ++++ .../bennu/core/rest/SystemResource.java | 17 +++++++++++++++++ 3 files changed, 26 insertions(+) diff --git a/client/bennu-admin/src/main/webapp/bennu-admin/js/app.js b/client/bennu-admin/src/main/webapp/bennu-admin/js/app.js index b508281e1..2a4ea3b93 100644 --- a/client/bennu-admin/src/main/webapp/bennu-admin/js/app.js +++ b/client/bennu-admin/src/main/webapp/bennu-admin/js/app.js @@ -23,6 +23,11 @@ bennuAdmin.filter('i18n', function () { return i18n; }); +bennuAdmin.filter('uptime', function () { + return function(value) { return Math.round(value/(24*60*60)) + 'd ' + (Math.round(value/(60*60)) % 24) + 'h ' + + (Math.round(value/60) % 60) + 'm ' + (value % 60)+ 's'; }; +}); + bennuAdmin.config(['$routeProvider', function($routeProvider) { $routeProvider. diff --git a/client/bennu-admin/src/main/webapp/bennu-admin/template/SystemInfo.html b/client/bennu-admin/src/main/webapp/bennu-admin/template/SystemInfo.html index 807d1db68..1484c49a9 100644 --- a/client/bennu-admin/src/main/webapp/bennu-admin/template/SystemInfo.html +++ b/client/bennu-admin/src/main/webapp/bennu-admin/template/SystemInfo.html @@ -107,6 +107,8 @@ + + {{data.metrics.hostname}}
@@ -148,6 +150,8 @@

JVM

Total Loaded Classes: {{data.metrics['jvm.classloading.loaded.total']}}

Loaded Classes: {{data.metrics['jvm.classloading.loaded']}}

Unloaded Classes: {{data.metrics['jvm.classloading.unloaded']}}

+

Start Time: {{data.metrics['jvm.runtime.start.time'] | date:'dd/MM/yyyy HH:mm:ss'}}

+

Uptime: {{data.metrics['jvm.runtime.uptime'] | uptime}}

diff --git a/server/bennu-core/src/main/java/org/fenixedu/bennu/core/rest/SystemResource.java b/server/bennu-core/src/main/java/org/fenixedu/bennu/core/rest/SystemResource.java index a0541bddf..0c7da2577 100644 --- a/server/bennu-core/src/main/java/org/fenixedu/bennu/core/rest/SystemResource.java +++ b/server/bennu-core/src/main/java/org/fenixedu/bennu/core/rest/SystemResource.java @@ -26,7 +26,10 @@ import java.lang.management.ClassLoadingMXBean; import java.lang.management.ManagementFactory; import java.lang.management.MemoryMXBean; +import java.lang.management.RuntimeMXBean; import java.lang.management.ThreadMXBean; +import java.net.InetAddress; +import java.net.UnknownHostException; import java.util.ArrayList; import java.util.Collection; import java.util.Enumeration; @@ -61,6 +64,14 @@ @Path("/bennu-core/system") public class SystemResource extends BennuRestResource { + private static String getHostName() { + try { + return InetAddress.getLocalHost().getHostName(); + } catch (UnknownHostException e) { + return ""; + } + } + @GET @Path("info") @Produces({ MediaType.APPLICATION_JSON }) @@ -124,6 +135,7 @@ public Response info(@Context HttpServletRequest request) { metrics.addProperty("cacheSize", SharedIdentityMap.getCache().size()); metrics.addProperty("project", FenixFramework.getProject().getName()); metrics.addProperty("version", FenixFramework.getProject().getVersion()); + metrics.addProperty("hostname", getHostName()); MemoryMXBean memoryBean = ManagementFactory.getMemoryMXBean(); @@ -146,6 +158,11 @@ public Response info(@Context HttpServletRequest request) { metrics.addProperty("jvm.classloading.loaded", classLoading.getLoadedClassCount()); metrics.addProperty("jvm.classloading.unloaded", classLoading.getUnloadedClassCount()); + RuntimeMXBean runtime = ManagementFactory.getRuntimeMXBean(); + + metrics.addProperty("jvm.runtime.uptime", runtime.getUptime() / 1000); + metrics.addProperty("jvm.runtime.start.time", runtime.getStartTime()); + json.add("metrics", metrics); return Response.ok(toJson(json)).build(); From c9c103dc2fa9cc09b47c1e6ad4b407e8f30f1c10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Carvalho?= Date: Fri, 23 May 2014 15:40:31 +0100 Subject: [PATCH 05/12] [bennu-admin] Bug Fix: Better handling of LocalizedStrings --- .../bennu-admin/src/main/webapp/bennu-admin/js/app.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/client/bennu-admin/src/main/webapp/bennu-admin/js/app.js b/client/bennu-admin/src/main/webapp/bennu-admin/js/app.js index 2a4ea3b93..964ddb663 100644 --- a/client/bennu-admin/src/main/webapp/bennu-admin/js/app.js +++ b/client/bennu-admin/src/main/webapp/bennu-admin/js/app.js @@ -7,11 +7,15 @@ bennuAdmin.config(['$compileProvider', function($compileProvider) { }]); var i18n = function(input) { + if(!input || typeof input === 'string') return input; var tag = BennuPortal.locale.tag; - if(input && input[tag]) { - return input[tag]; + if(input[tag]) { return input[tag]; } + tag = tag.split('-')[0]; + if(input[tag]) { return input[tag]; } + for (var lang in input) { + if(lang.indexOf(tag) === 0) { return input[lang]; } } - return '!!' + JSON.stringify(input) + '!!'; + return input[Object.keys(input)[0]]; } function chunk(arr, n) { From a5943932372e8985b96d39d3409e095359116b0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Carvalho?= Date: Mon, 26 May 2014 18:29:00 +0100 Subject: [PATCH 06/12] [bennu-admin] Improved uptime visualization --- client/bennu-admin/src/main/webapp/bennu-admin/js/app.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/client/bennu-admin/src/main/webapp/bennu-admin/js/app.js b/client/bennu-admin/src/main/webapp/bennu-admin/js/app.js index 964ddb663..51f3fbe9a 100644 --- a/client/bennu-admin/src/main/webapp/bennu-admin/js/app.js +++ b/client/bennu-admin/src/main/webapp/bennu-admin/js/app.js @@ -28,8 +28,10 @@ bennuAdmin.filter('i18n', function () { }); bennuAdmin.filter('uptime', function () { - return function(value) { return Math.round(value/(24*60*60)) + 'd ' + (Math.round(value/(60*60)) % 24) + 'h ' + - (Math.round(value/60) % 60) + 'm ' + (value % 60)+ 's'; }; + var n = function(n){ return n > 9 ? "" + n: "0" + n; }; + return function(value) { value = value || 0; + var days = Math.floor(value/(24*60*60)), hours = Math.floor(value/(60*60)) % 24, mins = Math.floor(value/60) % 60; + return (value >= 86400 ? n(days) + 'd ' : '') + (value >= 3600 ? n(hours) + 'h ' : '') + (value >= 60 ? n(mins) + 'm ' : '') + n(value % 60)+ 's'; }; }); bennuAdmin.config(['$routeProvider', From d40c68f178f24e0b2e5315b4051ec87fa9a3b293 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Carvalho?= Date: Mon, 26 May 2014 18:47:57 +0100 Subject: [PATCH 07/12] [bennu-scheduler] Tasks now log the hostname of the running instance --- .../bennu-scheduler-ui/templates/Log.html | 6 ++++++ .../bennu/scheduler/log/ExecutionLog.java | 20 +++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/client/bennu-scheduler-ui/src/main/webapp/bennu-scheduler-ui/templates/Log.html b/client/bennu-scheduler-ui/src/main/webapp/bennu-scheduler-ui/templates/Log.html index 62c2adf15..1f3f38235 100644 --- a/client/bennu-scheduler-ui/src/main/webapp/bennu-scheduler-ui/templates/Log.html +++ b/client/bennu-scheduler-ui/src/main/webapp/bennu-scheduler-ui/templates/Log.html @@ -22,6 +22,12 @@ {{username}} {{/username}} + {{#hostname}} + + Host + {{hostname}} + + {{/hostname}} Status diff --git a/server/bennu-scheduler/src/main/java/org/fenixedu/bennu/scheduler/log/ExecutionLog.java b/server/bennu-scheduler/src/main/java/org/fenixedu/bennu/scheduler/log/ExecutionLog.java index e965c4d41..073c2481f 100644 --- a/server/bennu-scheduler/src/main/java/org/fenixedu/bennu/scheduler/log/ExecutionLog.java +++ b/server/bennu-scheduler/src/main/java/org/fenixedu/bennu/scheduler/log/ExecutionLog.java @@ -6,6 +6,8 @@ import java.io.PrintWriter; import java.io.StringWriter; import java.lang.reflect.Type; +import java.net.InetAddress; +import java.net.UnknownHostException; import java.util.HashSet; import java.util.Set; @@ -38,6 +40,7 @@ public class ExecutionLog { private String taskName; private String stackTrace; private Set files; + private String hostname; private Boolean started = false; public static final String LOG_JSON_FILENAME = "executionLog.json"; @@ -84,6 +87,14 @@ public static Gson getGson() { return gson; } + private static String computeHostName() { + try { + return InetAddress.getLocalHost().getHostName(); + } catch (UnknownHostException e) { + return null; + } + } + private static final HashFunction hf = Hashing.md5(); public ExecutionLog(String taskName) { @@ -92,6 +103,7 @@ public ExecutionLog(String taskName) { setTaskName(taskName); setId(hf.newHasher().putString(taskName, Charsets.UTF_8).putLong(now.getMillis()).hash().toString()); setSuccess(false); + setHostname(computeHostName()); } public ExecutionLog(JsonObject obj) { @@ -142,6 +154,14 @@ public void setSuccess(boolean success) { this.success = success; } + public String getHostname() { + return hostname; + } + + public void setHostname(String hostname) { + this.hostname = hostname; + } + private void writeJson(String json) { if (Strings.isNullOrEmpty(json)) { return; From 3e2fd75a6f6ff8c245b934aead443625d439cd69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Carvalho?= Date: Tue, 27 May 2014 14:51:36 +0100 Subject: [PATCH 08/12] [bennu-admin] Allow filtering of applications on Install App view --- client/bennu-admin/src/main/webapp/bennu-admin/js/menu.js | 1 + .../bennu-admin/src/main/webapp/bennu-admin/template/Menu.html | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/client/bennu-admin/src/main/webapp/bennu-admin/js/menu.js b/client/bennu-admin/src/main/webapp/bennu-admin/js/menu.js index 7cb5cc8b7..a6fad720e 100644 --- a/client/bennu-admin/src/main/webapp/bennu-admin/js/menu.js +++ b/client/bennu-admin/src/main/webapp/bennu-admin/js/menu.js @@ -25,6 +25,7 @@ bennuAdmin.controller('MenuController', [ '$scope', '$routeParams', '$http', fun }); } $scope.loadApps = function() { + $scope.filter = null; if(!$scope.apps) { $http.get("../api/bennu-portal/menu/applications/").success(function (data) { $scope.apps = data; diff --git a/client/bennu-admin/src/main/webapp/bennu-admin/template/Menu.html b/client/bennu-admin/src/main/webapp/bennu-admin/template/Menu.html index 8e9b87a31..61fa57d86 100644 --- a/client/bennu-admin/src/main/webapp/bennu-admin/template/Menu.html +++ b/client/bennu-admin/src/main/webapp/bennu-admin/template/Menu.html @@ -95,9 +95,10 @@

Delete Item

Install Application

+
+ Error: {{error.message}}{{error.stacktrace}} +

{{ selected.title | i18n }} ({{ selected.fullPath }})