branch develop updated (7dccd69 -> 8a38018)
This is an automated email from the git hooks/post-receive script. New change to branch develop in repository coselmar. See http://git.codelutin.com/coselmar.git from 7dccd69 Fix de la config des tests sur le dialect H2 new 564e909 fixes #7844 correction des chaines i18n pour le sujet de courriel de modification du mot de passe new c2960c3 fixes #7845 Add a health page to controle application status new 8a38018 upgrade d'angular dans la page health The 3 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit 8a38018d9bf1ea51ac139e44858e448bb1e374f1 Author: Yannick Martel <martel@©odelutin.com> Date: Fri Dec 18 18:03:06 2015 +0100 upgrade d'angular dans la page health commit c2960c394f8ce66c79782595b727b4085ea29829 Author: Yannick Martel <martel@©odelutin.com> Date: Fri Dec 18 17:22:04 2015 +0100 fixes #7845 Add a health page to controle application status commit 564e909d1953b6a614d383296c94aa5c5151b84a Author: Yannick Martel <martel@©odelutin.com> Date: Fri Dec 18 16:01:19 2015 +0100 fixes #7844 correction des chaines i18n pour le sujet de courriel de modification du mot de passe Summary of changes: .../coselmar/config/CoselmarServicesConfig.java | 4 ++ .../config/CoselmarServicesConfigOption.java | 5 ++ .../java/fr/ifremer/coselmar/beans/HealthBean.java | 49 ++++++++++++++++++++ .../coselmar/services/v1/HealthService.java | 54 ++++++++++++++++++++++ .../i18n/coselmar-services_en_GB.properties | 4 +- .../i18n/coselmar-services_fr_FR.properties | 3 +- coselmar-rest/src/main/resources/mapping | 6 ++- coselmar-ui/src/main/webapp/health.html | 30 ++++++++++++ .../{coselmar-constants.js => coselmar-health.js} | 18 ++++++-- 9 files changed, 164 insertions(+), 9 deletions(-) create mode 100644 coselmar-rest/src/main/java/fr/ifremer/coselmar/beans/HealthBean.java create mode 100644 coselmar-rest/src/main/java/fr/ifremer/coselmar/services/v1/HealthService.java create mode 100644 coselmar-ui/src/main/webapp/health.html copy coselmar-ui/src/main/webapp/js/{coselmar-constants.js => coselmar-health.js} (65%) -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository coselmar. See http://git.codelutin.com/coselmar.git commit 564e909d1953b6a614d383296c94aa5c5151b84a Author: Yannick Martel <martel@©odelutin.com> Date: Fri Dec 18 16:01:19 2015 +0100 fixes #7844 correction des chaines i18n pour le sujet de courriel de modification du mot de passe --- .../src/main/resources/i18n/coselmar-services_en_GB.properties | 4 ++-- .../src/main/resources/i18n/coselmar-services_fr_FR.properties | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/coselmar-rest/src/main/resources/i18n/coselmar-services_en_GB.properties b/coselmar-rest/src/main/resources/i18n/coselmar-services_en_GB.properties index 95fd07f..8068b56 100644 --- a/coselmar-rest/src/main/resources/i18n/coselmar-services_en_GB.properties +++ b/coselmar-rest/src/main/resources/i18n/coselmar-services_en_GB.properties @@ -20,7 +20,7 @@ # #L% ### coselmar.service.mail.UserAccountCreatedMail.subject=[Coselmar] Account creation %s -coselmar.service.mail.PasswordChangedMail.subject=[Coselmar] Password has been changed +coselmar.service.mail.UserPasswordChangedMail.subject=[Coselmar] Password has been changed coselmar.service.mail.LostPasswordMail.subject=[Coselmar] New password question.metadata.title=Title @@ -30,4 +30,4 @@ question.metadata.deadline=Deadline question.metadata.status=Status question.metadata.clients=Clients question.metadata.relatedDocuments=Related documents -question.metadata.participants=Participants \ No newline at end of file +question.metadata.participants=Participants diff --git a/coselmar-rest/src/main/resources/i18n/coselmar-services_fr_FR.properties b/coselmar-rest/src/main/resources/i18n/coselmar-services_fr_FR.properties index 1b4ace2..61d69b0 100644 --- a/coselmar-rest/src/main/resources/i18n/coselmar-services_fr_FR.properties +++ b/coselmar-rest/src/main/resources/i18n/coselmar-services_fr_FR.properties @@ -20,6 +20,7 @@ # #L% ### coselmar.service.mail.UserAccountCreatedMail.subject=[Coselmar] Création du compte %s +coselmar.service.mail.UserPasswordChangedMail.subject=[Coselmar] Mot de passe modifié coselmar.service.mail.PasswordChangedMail.subject=[Coselmar] Mot de passe modifié coselmar.service.mail.LostPasswordMail.subject=[Coselmar] Nouveau mot de passe @@ -30,4 +31,4 @@ question.metadata.deadline=Date limite question.metadata.status=Status question.metadata.clients=Clients question.metadata.relatedDocuments=Documents associés -question.metadata.participants=Participants \ No newline at end of file +question.metadata.participants=Participants -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository coselmar. See http://git.codelutin.com/coselmar.git commit c2960c394f8ce66c79782595b727b4085ea29829 Author: Yannick Martel <martel@©odelutin.com> Date: Fri Dec 18 17:22:04 2015 +0100 fixes #7845 Add a health page to controle application status --- .../coselmar/config/CoselmarServicesConfig.java | 4 ++ .../config/CoselmarServicesConfigOption.java | 5 ++ .../java/fr/ifremer/coselmar/beans/HealthBean.java | 49 ++++++++++++++++++++ .../coselmar/services/v1/HealthService.java | 54 ++++++++++++++++++++++ coselmar-rest/src/main/resources/mapping | 6 ++- coselmar-ui/src/main/webapp/health.html | 30 ++++++++++++ coselmar-ui/src/main/webapp/js/coselmar-health.js | 37 +++++++++++++++ 7 files changed, 184 insertions(+), 1 deletion(-) diff --git a/coselmar-persistence/src/main/java/fr/ifremer/coselmar/config/CoselmarServicesConfig.java b/coselmar-persistence/src/main/java/fr/ifremer/coselmar/config/CoselmarServicesConfig.java index d3fa398..8e72e04 100644 --- a/coselmar-persistence/src/main/java/fr/ifremer/coselmar/config/CoselmarServicesConfig.java +++ b/coselmar-persistence/src/main/java/fr/ifremer/coselmar/config/CoselmarServicesConfig.java @@ -158,4 +158,8 @@ public class CoselmarServicesConfig { public String getEncryptionAlgorithm() { return "SHA-256"; } + + public String getVersion() { + return applicationConfig.getOption(CoselmarServicesConfigOption.APPLICATION_VERSION.key); + } } diff --git a/coselmar-persistence/src/main/java/fr/ifremer/coselmar/config/CoselmarServicesConfigOption.java b/coselmar-persistence/src/main/java/fr/ifremer/coselmar/config/CoselmarServicesConfigOption.java index 8cd0a9f..97f6208 100644 --- a/coselmar-persistence/src/main/java/fr/ifremer/coselmar/config/CoselmarServicesConfigOption.java +++ b/coselmar-persistence/src/main/java/fr/ifremer/coselmar/config/CoselmarServicesConfigOption.java @@ -80,6 +80,11 @@ public enum CoselmarServicesConfigOption implements ConfigOptionDef { "coselmar.web.security.key", "Clef de sécurity permettant d'encoder les token d'authentication", "iamageek,r3477y", String.class), + + APPLICATION_VERSION( + "coselmar.version", + "Version de l'application", + "", String.class), ; protected final String key; diff --git a/coselmar-rest/src/main/java/fr/ifremer/coselmar/beans/HealthBean.java b/coselmar-rest/src/main/java/fr/ifremer/coselmar/beans/HealthBean.java new file mode 100644 index 0000000..fa90591 --- /dev/null +++ b/coselmar-rest/src/main/java/fr/ifremer/coselmar/beans/HealthBean.java @@ -0,0 +1,49 @@ +package fr.ifremer.coselmar.beans; + +import java.io.Serializable; + +/** + * @author ymartel (martel@codelutin.com) + */ +public class HealthBean implements Serializable { + + protected boolean dbUp; + + protected String version; + + protected boolean indexationUp; + + protected boolean devMode; + + public boolean isDbUp() { + return dbUp; + } + + public void setDbUp(boolean dbUp) { + this.dbUp = dbUp; + } + + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + + public boolean isIndexationUp() { + return indexationUp; + } + + public void setIndexationUp(boolean indexationUp) { + this.indexationUp = indexationUp; + } + + public boolean isDevMode() { + return devMode; + } + + public void setDevMode(boolean devMode) { + this.devMode = devMode; + } +} diff --git a/coselmar-rest/src/main/java/fr/ifremer/coselmar/services/v1/HealthService.java b/coselmar-rest/src/main/java/fr/ifremer/coselmar/services/v1/HealthService.java new file mode 100644 index 0000000..8415042 --- /dev/null +++ b/coselmar-rest/src/main/java/fr/ifremer/coselmar/services/v1/HealthService.java @@ -0,0 +1,54 @@ +package fr.ifremer.coselmar.services.v1; + +import fr.ifremer.coselmar.beans.HealthBean; +import fr.ifremer.coselmar.beans.QuestionSearchBean; +import fr.ifremer.coselmar.persistence.entity.Privacy; +import fr.ifremer.coselmar.services.CoselmarWebServiceSupport; +import fr.ifremer.coselmar.services.indexation.QuestionsIndexationService; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +/** + * @author ymartel (martel@codelutin.com) + */ +public class HealthService extends CoselmarWebServiceSupport { + + private static final Log log = LogFactory.getLog(HealthService.class); + + public HealthBean getHealth() { + String version = getCoselmarServicesConfig().getVersion(); + boolean devMode = getCoselmarServicesConfig().isDevMode(); + + boolean dbUp = false; + try { + getQuestionDao().count(); + dbUp = true; + + } catch (Exception e) { + if (log.isErrorEnabled()) { + log.error("Error during QuestionDao call", e); + } + } + + boolean indexationUp = false; + QuestionsIndexationService questionsIndexationService = getServicesContext().newService(QuestionsIndexationService.class); + try { + QuestionSearchBean searchBean = new QuestionSearchBean(); + searchBean.setPrivacy(Privacy.PUBLIC.name()); + questionsIndexationService.searchQuestion(searchBean); + indexationUp = true; + } catch (Exception e) { + if (log.isErrorEnabled()) { + log.error("Error during Indexation service call", e); + } + } + + HealthBean healthBean = new HealthBean(); + healthBean.setVersion(version); + healthBean.setDbUp(dbUp); + healthBean.setIndexationUp(indexationUp); + healthBean.setDevMode(devMode); + return healthBean; + } + +} diff --git a/coselmar-rest/src/main/resources/mapping b/coselmar-rest/src/main/resources/mapping index 2209eeb..3a50f5e 100644 --- a/coselmar-rest/src/main/resources/mapping +++ b/coselmar-rest/src/main/resources/mapping @@ -73,4 +73,8 @@ POST /v1/admin/lucene/index AdminWebService.refreshLuceneInd # Export -GET /v1/export/questions QuestionsWebService.exportQuestions \ No newline at end of file +GET /v1/export/questions QuestionsWebService.exportQuestions + +# Health + +GET /v1/health HealthService.getHealth diff --git a/coselmar-ui/src/main/webapp/health.html b/coselmar-ui/src/main/webapp/health.html new file mode 100644 index 0000000..235d109 --- /dev/null +++ b/coselmar-ui/src/main/webapp/health.html @@ -0,0 +1,30 @@ +<html ng-app="coselmarApp" ng-controller="HealthCtrl"> + +<head> + <meta charset="utf-8" /> + <title>Coselmar Health Page</title> + <script src="webjars/angularjs/1.3.13/angular.js"></script> + <script> + var coselmarApp = angular.module("coselmarApp", []); + </script> + <script src="js/coselmar-constants.js"></script> + <script src="js/coselmar-health.js"></script> +</head> + +<body> + + <div id="main-container"> + <h1>Health Page</h1> + <div> + <ul> + <li>Version : {{health.version}}</li> + <li>Database connexion : {{health.dbUp}}</li> + <li>Indexation connexion : {{health.indexationUp}}</li> + <li>Dev Mode : {{health.devMode}}</li> + </ul> + </div> + </div> + + +</body> +</html> \ No newline at end of file diff --git a/coselmar-ui/src/main/webapp/js/coselmar-health.js b/coselmar-ui/src/main/webapp/js/coselmar-health.js new file mode 100644 index 0000000..38abd75 --- /dev/null +++ b/coselmar-ui/src/main/webapp/js/coselmar-health.js @@ -0,0 +1,37 @@ +/* + * #%L + * Coselmar :: UI + * $Id:$ + * $HeadURL:$ + * %% + * Copyright (C) 2014 Ifremer, Code Lutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + +coselmarApp.controller("HealthCtrl", ['$scope', '$http', 'coselmar-config', function ($scope, $http, coselmarConfig) { + + $scope.health = {"dbUp": false, "version": "unknown", "indexationUp": false, "devMode": false}; + + var healthUrl = coselmarConfig.BASE_URL + "/health"; + + $http.get(healthUrl).then(function(result) { + console.log(result); + $scope.health = result.data; + }); + + +}]); \ No newline at end of file -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository coselmar. See http://git.codelutin.com/coselmar.git commit 8a38018d9bf1ea51ac139e44858e448bb1e374f1 Author: Yannick Martel <martel@©odelutin.com> Date: Fri Dec 18 18:03:06 2015 +0100 upgrade d'angular dans la page health --- coselmar-ui/src/main/webapp/health.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coselmar-ui/src/main/webapp/health.html b/coselmar-ui/src/main/webapp/health.html index 235d109..8a4a8e4 100644 --- a/coselmar-ui/src/main/webapp/health.html +++ b/coselmar-ui/src/main/webapp/health.html @@ -3,7 +3,7 @@ <head> <meta charset="utf-8" /> <title>Coselmar Health Page</title> - <script src="webjars/angularjs/1.3.13/angular.js"></script> + <script src="webjars/angularjs/1.4.8/angular.js"></script> <script> var coselmarApp = angular.module("coselmarApp", []); </script> -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
participants (1)
-
codelutin.com scm