branch feature/7708 updated (13aed77 -> 048e828)
This is an automated email from the git hooks/post-receive script. New change to branch feature/7708 in repository observe. See http://git.codelutin.com/observe.git discards 13aed77 gestion des erreurs dans l'ecran de test de connexion au serveur distant (refs #7708) discards 3db4b22 Ajout de traductions (refs 7708) adds c207443 ajout des menus contextuels adds 01661cc ajout des actions sur les nouveaux menus (refs #7621) adds b3c0d58 - réordonnement des méthodes de service - ajout d'une méthode pour déplacer un trip dans un autre programme adds bbe8e59 suppression de l'ouverture du programme s'il n'y a que lui d'ouvert adds 58e70bc réactivation de l'action pour changer une marée de programme adds 6ebc9b9 extraction de la méthode de filtrage dans le dtos adds e11cad8 déplacement des marées longline sélectionnées dans un dossier aléatoire (refs #7621) adds 6eff58e refactoring adds f5ecc24 déplacement d'une marée seine dans un programme aléatoire (refs #7621) adds 0257b06 sélection du programme dans lequel déplacer les marées (refs #7621) adds bcde433 tri des programmes dans la popup + ajout d'une icône au bouton (fixes #7621) adds 837d7ac fixes #7621 Ajout de nouvelles fonctionnalités sur la liste des marées adds 0e66b12 fix layout adds 004ab5b verification que la route est déjà persistée avant de la récupérer en base (refs #7710) adds 51f9e80 fix test sur l'id du noeud de tripseine new e0fdd79 Ajout de traductions (refs 7708) new 048e828 gestion des erreurs dans l'ecran de test de connexion au serveur distant (refs #7708) This update added new revisions after undoing existing revisions. That is to say, some revisions that were in the old version of the branch are not in the new version. This situation occurs when a user --force pushes a change and generates a repository containing something like this: * -- * -- B -- O -- O -- O (13aed77) \ N -- N -- N refs/heads/feature/7708 (048e828) You should already have received notification emails for all of the O revisions, and so the following emails describe only the N revisions from the common base, B. Any revisions marked "omits" are not gone; other references still refer to them. Any revisions marked "discards" are gone forever. The 2 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 048e828b89636d164cac8607b17782ffe8ca26d2 Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Tue Nov 10 17:14:36 2015 +0100 gestion des erreurs dans l'ecran de test de connexion au serveur distant (refs #7708) commit e0fdd79381f1fe14e946047e6b5199389506c564 Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Tue Nov 10 12:29:45 2015 +0100 Ajout de traductions (refs 7708) Summary of changes: .../src/main/filters/observe-ui.properties | 1 + .../observe/ObserveSwingApplicationContext.java | 7 + .../fr/ird/observe/business/db/DataContext.java | 14 +- .../main/java/fr/ird/observe/ui/ObserveMainUI.css | 20 ++ .../main/java/fr/ird/observe/ui/ObserveMainUI.jaxx | 5 + .../actions/shared/MoveTripLonglinesUIAction.java | 69 +++++++ .../ui/actions/shared/MoveTripSeinesUIAction.java | 69 +++++++ .../ui/actions/shared/MoveTripsUIAction.java | 227 +++++++++++++++++++++ .../content/list/impl/longline/TripLonglinesUI.css | 12 ++ .../list/impl/longline/TripLonglinesUI.jaxx | 23 +++ .../list/impl/longline/TripLonglinesUIModel.java | 33 +++ .../ui/content/list/impl/seine/TripSeinesUI.css | 9 + .../ui/content/list/impl/seine/TripSeinesUI.jaxx | 23 +++ .../content/list/impl/seine/TripSeinesUIModel.java | 33 +++ .../tree/ObserveNavigationTreeShowPopupAction.java | 131 ++++++++---- .../fr/ird/observe/ui/tree/ObserveTreeHelper.java | 3 +- .../actions/ChangeTripProgramActionListener.java | 51 +++-- .../observe-application-swing_en_GB.properties | 11 + .../observe-application-swing_es_ES.properties | 11 + .../observe-application-swing_fr_FR.properties | 9 +- .../src/main/resources/icons/action-move-trips.png | Bin 0 -> 1036 bytes .../ActivityLonglineServiceController.java | 10 +- .../v1/longline/SetLonglineServiceController.java | 9 +- .../v1/longline/TripLonglineServiceController.java | 16 +- .../v1/seine/ActivitySeineServiceController.java | 9 +- .../v1/seine/FloatingObjectServiceController.java | 9 +- .../v1/seine/RouteServiceController.java | 9 +- .../v1/seine/SetSeineServiceController.java | 9 +- .../v1/seine/TripSeineServiceController.java | 16 +- .../observe/ObserveTopiaPersistenceContext.java | 4 + .../service/longline/ActivityLonglineService.java | 5 +- .../service/longline/SetLonglineService.java | 5 +- .../service/longline/TripLonglineService.java | 17 +- .../service/seine/ActivitySeineService.java | 5 +- .../service/seine/FloatingObjectService.java | 5 +- .../services/service/seine/RouteService.java | 5 +- .../services/service/seine/SetSeineService.java | 5 +- .../services/service/seine/TripSeineService.java | 16 +- .../services/dto/referential/ProgramDtos.java | 5 + .../longline/ActivityLonglineServiceTopia.java | 9 +- .../service/longline/SetLonglineServiceTopia.java | 10 +- .../service/longline/TripLonglineServiceTopia.java | 41 +++- .../service/seine/ActivitySeineServiceTopia.java | 9 +- .../service/seine/FloatingObjectServiceTopia.java | 9 +- .../services/service/seine/RouteServiceTopia.java | 22 +- .../service/seine/SetSeineServiceTopia.java | 9 +- .../service/seine/TripSeineServiceTopia.java | 36 +++- 47 files changed, 914 insertions(+), 151 deletions(-) create mode 100644 observe-application-swing/src/main/java/fr/ird/observe/ui/actions/shared/MoveTripLonglinesUIAction.java create mode 100644 observe-application-swing/src/main/java/fr/ird/observe/ui/actions/shared/MoveTripSeinesUIAction.java create mode 100644 observe-application-swing/src/main/java/fr/ird/observe/ui/actions/shared/MoveTripsUIAction.java create mode 100644 observe-application-swing/src/main/resources/icons/action-move-trips.png -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@list.forge.codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch feature/7708 in repository observe. See http://git.codelutin.com/observe.git commit e0fdd79381f1fe14e946047e6b5199389506c564 Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Tue Nov 10 12:29:45 2015 +0100 Ajout de traductions (refs 7708) --- .../main/resources/i18n/observe-application-swing_fr_FR.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/observe-application-swing/src/main/resources/i18n/observe-application-swing_fr_FR.properties b/observe-application-swing/src/main/resources/i18n/observe-application-swing_fr_FR.properties index c68b428..225a88f 100644 --- a/observe-application-swing/src/main/resources/i18n/observe-application-swing_fr_FR.properties +++ b/observe-application-swing/src/main/resources/i18n/observe-application-swing_fr_FR.properties @@ -1809,8 +1809,8 @@ observe.storage.importRemoteStorage.config=Sélection de la base distante à imp observe.storage.importRemoteStorage.description=Veuillez configurer la connexion vers une base distante.\nAvant de pouvoir poursuivre, vous devez valider la connexion. observe.storage.importRemoteStorageData.config=Choisir la base distante contenant les données à importer observe.storage.importRemoteStorageReferentiel.config=Choisir la base distante contenant le référentiel à importer -observe.storage.importServerStorage.config= -observe.storage.importServerStorage.description= +observe.storage.importServerStorage.config=Sélection du serveur distant à importer +observe.storage.importServerStorage.description=Veuillez configurer la connexion vers un serveur distant.\nAvant de pouvoir poursuivre, vous devez valider la connexion. observe.storage.internalDump.last.modified=(dernier import \: %1$td/%1$tm/%1$tY à %1$tH\:%1$tM) observe.storage.internalDump.not.exist=Pas de base embarquée. observe.storage.label.backup=Base temporaire pour backup -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@list.forge.codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch feature/7708 in repository observe. See http://git.codelutin.com/observe.git commit 048e828b89636d164cac8607b17782ffe8ca26d2 Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Tue Nov 10 17:14:36 2015 +0100 gestion des erreurs dans l'ecran de test de connexion au serveur distant (refs #7708) --- .../fr/ird/observe/ui/storage/StorageUIModel.java | 3 +- .../observe/services/ObserveHttpErrorAdapter.java | 37 +++++++++++++++++ .../services/ObserveServiceFactoryRest.java | 9 +---- .../services/ObserveServiceRestErrorException.java | 16 ++++++++ .../ObserveServiceRestNotAvailableException.java | 1 + .../observe/services/http/ObserveHttpError.java | 47 ++++++++++++++++++++++ .../services/http/ObserveResponseBuilder.java | 28 +++++++++++-- 7 files changed, 130 insertions(+), 11 deletions(-) diff --git a/observe-application-swing/src/main/java/fr/ird/observe/ui/storage/StorageUIModel.java b/observe-application-swing/src/main/java/fr/ird/observe/ui/storage/StorageUIModel.java index 3b6657e..ab8b3c8 100644 --- a/observe-application-swing/src/main/java/fr/ird/observe/ui/storage/StorageUIModel.java +++ b/observe-application-swing/src/main/java/fr/ird/observe/ui/storage/StorageUIModel.java @@ -1695,7 +1695,8 @@ public class StorageUIModel extends WizardModel<StorageStep> { try { - if (DbMode.USE_SERVER.equals(getDbMode())) { + if (DbMode.USE_SERVER.equals(getDbMode()) + || DbMode.CREATE_LOCAL.equals(getDbMode()) && CreationMode.IMPORT_SERVER_STORAGE.equals(creationMode)) { PingService pingService = dataSource.newService(PingService.class); diff --git a/observe-services-rest/src/main/java/fr/ird/observe/services/ObserveHttpErrorAdapter.java b/observe-services-rest/src/main/java/fr/ird/observe/services/ObserveHttpErrorAdapter.java new file mode 100644 index 0000000..79ffbc0 --- /dev/null +++ b/observe-services-rest/src/main/java/fr/ird/observe/services/ObserveHttpErrorAdapter.java @@ -0,0 +1,37 @@ +package fr.ird.observe.services; + +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import fr.ird.observe.services.http.ObserveHttpError; + +import java.lang.reflect.Type; + +/** + * @author Sylvain Bavencoff - bavencoff@codelutin.com + */ +public class ObserveHttpErrorAdapter implements JsonDeserializer<ObserveHttpError> { + @Override + public ObserveHttpError deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { + + JsonObject jsonObject = json.getAsJsonObject(); + + Integer httpCode = context.deserialize(jsonObject.get(ObserveHttpError.PROPERTY_HTTP_CODE), Integer.class); + + String message = context.deserialize(jsonObject.get(ObserveHttpError.PROPERTY_MESSAGE), String.class); + + Class exceptionType = context.deserialize(jsonObject.get(ObserveHttpError.PROPERTY_EXECPTION_TYPE), Class.class); + + Throwable exception = null; + + if (exceptionType != null) { + + exception = context.deserialize(jsonObject.get(ObserveHttpError.PROPERTY_EXCEPTION), exceptionType); + + } + + return new ObserveHttpError(httpCode, exceptionType, message, exception); + } +} diff --git a/observe-services-rest/src/main/java/fr/ird/observe/services/ObserveServiceFactoryRest.java b/observe-services-rest/src/main/java/fr/ird/observe/services/ObserveServiceFactoryRest.java index b3034ed..a695ff0 100644 --- a/observe-services-rest/src/main/java/fr/ird/observe/services/ObserveServiceFactoryRest.java +++ b/observe-services-rest/src/main/java/fr/ird/observe/services/ObserveServiceFactoryRest.java @@ -23,12 +23,9 @@ package fr.ird.observe.services; */ import com.google.common.base.Preconditions; -import com.google.common.base.Predicate; import com.google.common.base.Strings; import com.google.common.base.Supplier; import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Iterables; -import com.google.common.collect.Lists; import com.google.common.reflect.Reflection; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -40,6 +37,7 @@ import fr.ird.observe.services.configuration.ObserveDataSourceConfigurationRestC import fr.ird.observe.services.configuration.ObserveDataSourceConnection; import fr.ird.observe.services.configuration.ObserveDataSourceConnectionRest; import fr.ird.observe.services.dto.gson.ObserveDtoGsonSupplier; +import fr.ird.observe.services.http.ObserveHttpError; import fr.ird.observe.services.http.ObserveRequest; import fr.ird.observe.services.http.ObserveRequestBuilder; import fr.ird.observe.services.http.ObserveRequestMethod; @@ -54,11 +52,7 @@ import org.apache.commons.logging.LogFactory; import java.io.IOException; import java.lang.reflect.InvocationHandler; import java.lang.reflect.Method; -import java.lang.reflect.ParameterizedType; -import java.lang.reflect.Type; -import java.lang.reflect.TypeVariable; import java.util.Collection; -import java.util.List; /** * Created on 16/08/15. @@ -81,6 +75,7 @@ public class ObserveServiceFactoryRest extends ObserveServiceFactorySupport impl // Les ObserveDataSourceConnection sont obligatoirement de type ObserveDataSourceConnectionRest builder.registerTypeAdapter(ObserveDataSourceConnection.class, new ObserveDataSourceConnectionAdapter()); + builder.registerTypeAdapter(ObserveHttpError.class, new ObserveHttpErrorAdapter()); return builder; } diff --git a/observe-services-rest/src/main/java/fr/ird/observe/services/ObserveServiceRestErrorException.java b/observe-services-rest/src/main/java/fr/ird/observe/services/ObserveServiceRestErrorException.java new file mode 100644 index 0000000..e6c3033 --- /dev/null +++ b/observe-services-rest/src/main/java/fr/ird/observe/services/ObserveServiceRestErrorException.java @@ -0,0 +1,16 @@ +package fr.ird.observe.services; + +/** + * @author Sylvain Bavencoff - bavencoff@codelutin.com + */ +public class ObserveServiceRestErrorException extends RuntimeException { + + private static final long serialVersionUID = 1L; + + public ObserveServiceRestErrorException() { + } + + public ObserveServiceRestErrorException(String message) { + super(message); + } +} diff --git a/observe-services-rest/src/main/java/fr/ird/observe/services/ObserveServiceRestNotAvailableException.java b/observe-services-rest/src/main/java/fr/ird/observe/services/ObserveServiceRestNotAvailableException.java index f4e0112..1145be6 100644 --- a/observe-services-rest/src/main/java/fr/ird/observe/services/ObserveServiceRestNotAvailableException.java +++ b/observe-services-rest/src/main/java/fr/ird/observe/services/ObserveServiceRestNotAvailableException.java @@ -38,6 +38,7 @@ public class ObserveServiceRestNotAvailableException extends RuntimeException { private final URL serverUrl; public ObserveServiceRestNotAvailableException(URL serverUrl) { + super("Server " + serverUrl + " not available"); this.serverUrl = serverUrl; } diff --git a/observe-services-rest/src/main/java/fr/ird/observe/services/http/ObserveHttpError.java b/observe-services-rest/src/main/java/fr/ird/observe/services/http/ObserveHttpError.java new file mode 100644 index 0000000..224eb1e --- /dev/null +++ b/observe-services-rest/src/main/java/fr/ird/observe/services/http/ObserveHttpError.java @@ -0,0 +1,47 @@ +package fr.ird.observe.services.http; + +/** + * @author Sylvain Bavencoff - bavencoff@codelutin.com + */ +// TODO doublon avec fr.ird.observe.application.web.controller.v1.ObserveWebErrorController.Error +public class ObserveHttpError { + + public static final String PROPERTY_HTTP_CODE = "httpCode"; + + public static final String PROPERTY_EXECPTION_TYPE = "exceptionType"; + + public static final String PROPERTY_MESSAGE = "message"; + + public static final String PROPERTY_EXCEPTION = "exception"; + + protected final Integer httpCode; + + protected final Class<?> exceptionType; + + protected final String message; + + protected final Throwable exception; + + public ObserveHttpError(Integer httpCode, Class<?> exceptionType, String message, Throwable exception) { + this.httpCode = httpCode; + this.exceptionType = exceptionType; + this.message = message; + this.exception = exception; + } + + public Integer getHttpCode() { + return httpCode; + } + + public Class<?> getExceptionType() { + return exceptionType; + } + + public String getMessage() { + return message; + } + + public Throwable getException() { + return exception; + } +} diff --git a/observe-services-rest/src/main/java/fr/ird/observe/services/http/ObserveResponseBuilder.java b/observe-services-rest/src/main/java/fr/ird/observe/services/http/ObserveResponseBuilder.java index 563674a..4851de8 100644 --- a/observe-services-rest/src/main/java/fr/ird/observe/services/http/ObserveResponseBuilder.java +++ b/observe-services-rest/src/main/java/fr/ird/observe/services/http/ObserveResponseBuilder.java @@ -26,6 +26,7 @@ import com.google.common.base.MoreObjects; import com.google.common.base.Preconditions; import com.google.common.base.Supplier; import com.google.gson.Gson; +import fr.ird.observe.services.ObserveServiceRestErrorException; import fr.ird.observe.services.ObserveServiceRestNotAvailableException; import fr.ird.observe.services.dto.gson.ObserveDtoGsonSupplier; import org.apache.commons.io.Charsets; @@ -107,7 +108,7 @@ public class ObserveResponseBuilder { } - public <T> ObserveResponse<T> build(ObserveRequest request, Type resultType) throws IOException { + public <T> ObserveResponse<T> build(ObserveRequest request, Type resultType) throws Throwable { String baseUrl = request.getBaseUrl(); Preconditions.checkNotNull(baseUrl, "'baseUrl' can't be null"); @@ -117,8 +118,29 @@ public class ObserveResponseBuilder { ResponseContext responseContext = executeRequest(request); - if (responseContext.statusCode != 200 && log.isWarnEnabled()) { - log.warn(String.format("Unexpected status code for url: %s\n%s", baseUrl, responseContext.responseAsString)); + if (responseContext.statusCode != 200) { + if (log.isWarnEnabled()) { + log.warn(String.format("Unexpected status code for url: %s\n%s", baseUrl, responseContext.responseAsString)); + } + + ObserveHttpError error = convertJson(responseContext.responseAsString, ObserveHttpError.class); + + if (error != null) { + + throw new ObserveServiceRestErrorException("" + responseContext.statusCode); + + } else { + + if (error.getException() != null) { + + throw error.getException(); + + } else { + + throw new ObserveServiceRestErrorException(error.getHttpCode() + " : " + error.getMessage()); + + } + } } T resultObject = convertJson(responseContext.responseAsString, resultType); -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@list.forge.codelutin.com>.
participants (1)
-
codelutin.com scm