Tony CHEMIT pushed to branch develop-7.x at ultreiaio / ird-observe Commits: b30b6807 by Tony CHEMIT at 2018-10-01T13:23:36Z Petit renommage de libellé - Closes #1099 - - - - - 2be32d42 by Tony CHEMIT at 2018-10-01T13:24:53Z Fix some memory leaks (some content were not closed properly - - - - - d097f87a by Tony CHEMIT at 2018-10-01T13:28:26Z Extension de fichier du rapport de validation - Closes #1102 - - - - - d09a03ea by Tony CHEMIT at 2018-10-01T13:31:29Z up to version 7.0.0-SNAPSHOT - - - - - 6490f483 by Tony CHEMIT at 2018-10-01T13:37:43Z Widget température °C/°F : message de validation perfectible - Closes #960 (il restait une validation de température au niveau des routes) - - - - - 3ef955bb by Tony CHEMIT at 2018-10-01T14:13:46Z Le calcul des vitesses a eu un raté après avoir fait usage de la fonction "Voulez-vous créer l'activité de fin de veille ?" - See #1100 - - - - - 26 changed files: - client-configuration/pom.xml - client/pom.xml - client/src/main/java/fr/ird/observe/client/ui/admin/validate/ValidateModel.java - client/src/main/java/fr/ird/observe/client/ui/content/ContentUIHandler.java - client/src/main/java/fr/ird/observe/client/ui/content/data/longline/CatchLonglineUIHandler.java - client/src/main/java/fr/ird/observe/client/ui/content/data/longline/GearUseFeaturesLonglineUIHandler.java - client/src/main/java/fr/ird/observe/client/ui/content/data/longline/SetLonglineUIHandler.java - client/src/main/java/fr/ird/observe/client/ui/content/data/longline/TdrUIHandler.java - client/src/main/java/fr/ird/observe/client/ui/content/data/seine/GearUseFeaturesSeineUIHandler.java - client/src/main/java/fr/ird/observe/client/ui/tree/navigation/NavigationTree.java - client/src/main/resources/i18n/client_en_GB.properties - client/src/main/resources/i18n/client_es_ES.properties - client/src/main/resources/i18n/client_fr_FR.properties - dto/pom.xml - observe/pom.xml - persistence/pom.xml - pom.xml - server-configuration/pom.xml - server/pom.xml - services-client/pom.xml - services-local/pom.xml - services/pom.xml - services/src/main/java/fr/ird/observe/services/validation/validators/ActivitySimpleSpeedDtoValidator.java - test/pom.xml - validation/pom.xml - validation/src/main/resources/fr/ird/observe/dto/data/seine/RouteDto-update-error-validation.xml Changes: ===================================== client-configuration/pom.xml ===================================== @@ -26,7 +26,7 @@ <parent> <groupId>fr.ird.observe</groupId> <artifactId>ird-observe</artifactId> - <version>7.0-RC-23-SNAPSHOT</version> + <version>7.0.0-SNAPSHOT</version> </parent> <artifactId>client-configuration</artifactId> ===================================== client/pom.xml ===================================== @@ -26,7 +26,7 @@ <parent> <groupId>fr.ird.observe</groupId> <artifactId>ird-observe</artifactId> - <version>7.0-RC-23-SNAPSHOT</version> + <version>7.0.0-SNAPSHOT</version> </parent> <artifactId>client</artifactId> ===================================== client/src/main/java/fr/ird/observe/client/ui/admin/validate/ValidateModel.java ===================================== @@ -41,8 +41,8 @@ import fr.ird.observe.services.service.actions.validate.ValidationResultDto; import fr.ird.observe.services.service.actions.validate.ValidationResultDtoMessage; import fr.ird.observe.services.validation.ValidatorDto; import org.apache.commons.lang3.mutable.MutableInt; -import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.nuiton.jaxx.runtime.swing.wizard.ext.WizardState; import org.nuiton.validator.NuitonValidatorScope; @@ -75,7 +75,7 @@ public class ValidateModel extends AdminActionModel { static final String PROPERTY_VALIDATION_RESULT = "validationResult"; /** le pattern du fichier de rapport après validation */ - private static final String REPORT_PATTERN = "report-%1$tF--%1$tk-%1$tM-%1$tS.txt"; + private static final String REPORT_PATTERN = "report-%1$tF--%1$tk-%1$tM-%1$tS.html"; /** Logger */ private static final Logger log = LogManager.getLogger(ValidateModel.class); ===================================== client/src/main/java/fr/ird/observe/client/ui/content/ContentUIHandler.java ===================================== @@ -791,11 +791,11 @@ public abstract class ContentUIHandler<E extends IdDto, U extends ContentUI<E, U SwingValidatorUtil.setValidatorChanged(ui, false); } - protected void closeSafeUI() { + public void closeSafeUI() { removeAllMessages(ui); ContentUIModel<E> model = getModel(); - + getUi().getErrorTableModel().clearValidators(); boolean create = model.isCreatingMode(); if (create && model.isEditable()) { // remove node ===================================== client/src/main/java/fr/ird/observe/client/ui/content/data/longline/CatchLonglineUIHandler.java ===================================== @@ -62,8 +62,8 @@ import fr.ird.observe.dto.referential.longline.HealthnessReference; import fr.ird.observe.dto.result.SaveResultDto; import fr.ird.observe.spi.DtoModelHelper; import org.apache.commons.lang3.BooleanUtils; -import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.nuiton.jaxx.runtime.context.JAXXContextEntryDef; import org.nuiton.jaxx.runtime.spi.UIHandler; import org.nuiton.jaxx.validator.swing.SwingValidator; @@ -72,7 +72,10 @@ import org.nuiton.jaxx.validator.swing.SwingValidatorMessageTableModel; import org.nuiton.util.DateUtil; import org.nuiton.validator.NuitonValidatorScope; -import javax.swing.*; +import javax.swing.JComponent; +import javax.swing.JOptionPane; +import javax.swing.JTable; +import javax.swing.SwingUtilities; import javax.swing.event.TableModelListener; import javax.swing.table.DefaultTableCellRenderer; import java.awt.Component; @@ -709,7 +712,7 @@ public class CatchLonglineUIHandler extends ContentTableUIHandler<SetLonglineCat } @Override - protected void closeSafeUI() { + public void closeSafeUI() { if (log.isInfoEnabled()) { log.info("CloseUI: " + getModel()); ===================================== client/src/main/java/fr/ird/observe/client/ui/content/data/longline/GearUseFeaturesLonglineUIHandler.java ===================================== @@ -49,8 +49,8 @@ import fr.ird.observe.dto.referential.GearReference; import fr.ird.observe.dto.result.SaveResultDto; import fr.ird.observe.services.service.referential.ReferentialService; import org.apache.commons.lang3.StringUtils; -import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.nuiton.jaxx.runtime.spi.UIHandler; import org.nuiton.jaxx.runtime.swing.JTables; import org.nuiton.jaxx.validator.swing.SwingValidatorMessage; @@ -417,7 +417,7 @@ public class GearUseFeaturesLonglineUIHandler extends ContentTableUIHandler<Trip } @Override - protected void closeSafeUI() { + public void closeSafeUI() { if (log.isInfoEnabled()) { log.info("CloseUI: " + getModel()); ===================================== client/src/main/java/fr/ird/observe/client/ui/content/data/longline/SetLonglineUIHandler.java ===================================== @@ -258,7 +258,7 @@ public class SetLonglineUIHandler extends ContentUIHandler<SetLonglineDto, SetLo } @Override - protected void closeSafeUI() { + public void closeSafeUI() { if (log.isInfoEnabled()) { log.info("CloseUI: " + getModel()); ===================================== client/src/main/java/fr/ird/observe/client/ui/content/data/longline/TdrUIHandler.java ===================================== @@ -41,8 +41,8 @@ import fr.ird.observe.dto.referential.SpeciesDto; import fr.ird.observe.dto.referential.SpeciesReference; import fr.ird.observe.dto.referential.longline.SensorBrandReference; import fr.ird.observe.dto.result.SaveResultDto; -import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.nuiton.jaxx.runtime.context.JAXXContextEntryDef; import org.nuiton.jaxx.runtime.spi.UIHandler; import org.nuiton.jaxx.validator.swing.SwingValidatorMessage; @@ -233,7 +233,7 @@ public class TdrUIHandler extends ContentTableUIHandler<SetLonglineTdrDto, TdrDt } @Override - protected void closeSafeUI() { + public void closeSafeUI() { if (log.isInfoEnabled()) { log.info("CloseUI: " + getModel()); } ===================================== client/src/main/java/fr/ird/observe/client/ui/content/data/seine/GearUseFeaturesSeineUIHandler.java ===================================== @@ -49,8 +49,8 @@ import fr.ird.observe.dto.referential.GearReference; import fr.ird.observe.dto.result.SaveResultDto; import fr.ird.observe.services.service.referential.ReferentialService; import org.apache.commons.lang3.StringUtils; -import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.nuiton.jaxx.runtime.spi.UIHandler; import org.nuiton.jaxx.runtime.swing.JTables; import org.nuiton.jaxx.validator.swing.SwingValidatorMessage; @@ -417,7 +417,7 @@ public class GearUseFeaturesSeineUIHandler extends ContentTableUIHandler<TripSei } @Override - protected void closeSafeUI() { + public void closeSafeUI() { if (log.isInfoEnabled()) { log.info("CloseUI: " + getModel()); ===================================== client/src/main/java/fr/ird/observe/client/ui/tree/navigation/NavigationTree.java ===================================== @@ -25,6 +25,7 @@ package fr.ird.observe.client.ui.tree.navigation; import fr.ird.observe.client.ObserveSwingApplicationContext; import fr.ird.observe.client.db.ClientDataContext; import fr.ird.observe.client.db.ObserveSwingDataSource; +import fr.ird.observe.client.ui.content.ContentUI; import fr.ird.observe.client.ui.tree.navigation.nodes.NavigationTreeNodeSupport; import fr.ird.observe.client.ui.tree.navigation.nodes.ReferenceNavigationTreeNodeSupport; import fr.ird.observe.client.ui.tree.navigation.nodes.RootNavigationTreeNode; @@ -96,14 +97,42 @@ public class NavigationTree extends JXTree { public NavigationTree() { super(new NavigationTreeModel()); setSelectionModel(new DefaultTreeSelectionModel() { +// @Override +// public void setSelectionPath(TreePath path) { +// boolean canChange = skipCheckPreviousContent || (!Objects.equals(path, getSelectionPath()) && ObserveSwingApplicationContext.get().getContentUIManager().closeSelectedContentUI()); +// if (!canChange) { +// // cancel the change of node +// log.warn(String.format("Do not change selection path: %s against: %s", path, getSelectionPath())); +// return; +// } +// if (skipCheckPreviousContent) { +// ContentUI selectedContentUI = ObserveSwingApplicationContext.get().getContentUIManager().getSelectedContentUI(); +// if (selectedContentUI != null) { +// selectedContentUI.getHandler().closeSafeUI(); +// } +// } +// super.setSelectionPath(path); +// } + @Override - public void setSelectionPath(TreePath path) { + public void setSelectionPaths(TreePath[] pPaths) { + if (pPaths.length > 1) { + return; + } + TreePath path = pPaths[0]; boolean canChange = skipCheckPreviousContent || (!Objects.equals(path, getSelectionPath()) && ObserveSwingApplicationContext.get().getContentUIManager().closeSelectedContentUI()); if (!canChange) { // cancel the change of node + log.warn(String.format("Do not change selection path: %s against: %s", path, getSelectionPath())); return; } - super.setSelectionPath(path); + if (skipCheckPreviousContent) { + ContentUI selectedContentUI = ObserveSwingApplicationContext.get().getContentUIManager().getSelectedContentUI(); + if (selectedContentUI != null) { + selectedContentUI.getHandler().closeSafeUI(); + } + } + super.setSelectionPaths(pPaths); } }); setLargeModel(true); ===================================== client/src/main/resources/i18n/client_en_GB.properties ===================================== @@ -1508,7 +1508,7 @@ observe.ui.tree.seine.nonTargetCatch=Non target catch observe.ui.tree.seine.nonTargetCatchRelease=Non target released catches observe.ui.tree.seine.nonTargetSample=Non target samples observe.ui.tree.seine.objectObservedSpecies=Object observed species -observe.ui.tree.seine.objectOperation=Object operations +observe.ui.tree.seine.objectOperation=Beacon observe.ui.tree.seine.objectSchoolEstimate=Object school estimates observe.ui.tree.seine.routes=Routes observe.ui.tree.seine.schoolEstimate=School estimates ===================================== client/src/main/resources/i18n/client_es_ES.properties ===================================== @@ -1508,7 +1508,7 @@ observe.ui.tree.seine.nonTargetCatch=Fauna accesoria conservada o descartada observe.ui.tree.seine.nonTargetCatchRelease=Faunes accessoires libérées \#TODO observe.ui.tree.seine.nonTargetSample=Muestreos de fauna accesoria observe.ui.tree.seine.objectObservedSpecies=Fauna observada -observe.ui.tree.seine.objectOperation=Operaciones sobre el objeto +observe.ui.tree.seine.objectOperation=Baliza observe.ui.tree.seine.objectSchoolEstimate=Estimaciones banco de objetos observe.ui.tree.seine.routes=Rutas observe.ui.tree.seine.schoolEstimate=Estimaciones banco ===================================== client/src/main/resources/i18n/client_fr_FR.properties ===================================== @@ -1508,7 +1508,7 @@ observe.ui.tree.seine.nonTargetCatch=Espèces accessoires conservées ou rejeté observe.ui.tree.seine.nonTargetCatchRelease=Espèces accessoires libérées observe.ui.tree.seine.nonTargetSample=Échantillons espèces accessoires observe.ui.tree.seine.objectObservedSpecies=Faune observée -observe.ui.tree.seine.objectOperation=Opérations sur l'objet +observe.ui.tree.seine.objectOperation=Balise observe.ui.tree.seine.objectSchoolEstimate=Estimations banc objet observe.ui.tree.seine.routes=Routes observe.ui.tree.seine.schoolEstimate=Estimation banc ===================================== dto/pom.xml ===================================== @@ -27,7 +27,7 @@ <parent> <groupId>fr.ird.observe</groupId> <artifactId>ird-observe</artifactId> - <version>7.0-RC-23-SNAPSHOT</version> + <version>7.0.0-SNAPSHOT</version> </parent> <artifactId>dto</artifactId> ===================================== observe/pom.xml ===================================== @@ -26,7 +26,7 @@ <parent> <groupId>fr.ird.observe</groupId> <artifactId>ird-observe</artifactId> - <version>7.0-RC-23-SNAPSHOT</version> + <version>7.0.0-SNAPSHOT</version> </parent> <artifactId>observe</artifactId> ===================================== persistence/pom.xml ===================================== @@ -26,7 +26,7 @@ <parent> <groupId>fr.ird.observe</groupId> <artifactId>ird-observe</artifactId> - <version>7.0-RC-23-SNAPSHOT</version> + <version>7.0.0-SNAPSHOT</version> </parent> <artifactId>persistence</artifactId> ===================================== pom.xml ===================================== @@ -31,7 +31,7 @@ <groupId>fr.ird.observe</groupId> <artifactId>ird-observe</artifactId> - <version>7.0-RC-23-SNAPSHOT</version> + <version>7.0.0-SNAPSHOT</version> <packaging>pom</packaging> <name>ObServe :: Pom</name> ===================================== server-configuration/pom.xml ===================================== @@ -26,7 +26,7 @@ <parent> <groupId>fr.ird.observe</groupId> <artifactId>ird-observe</artifactId> - <version>7.0-RC-23-SNAPSHOT</version> + <version>7.0.0-SNAPSHOT</version> </parent> <artifactId>server-configuration</artifactId> ===================================== server/pom.xml ===================================== @@ -27,7 +27,7 @@ <parent> <groupId>fr.ird.observe</groupId> <artifactId>ird-observe</artifactId> - <version>7.0-RC-23-SNAPSHOT</version> + <version>7.0.0-SNAPSHOT</version> </parent> <artifactId>server</artifactId> ===================================== services-client/pom.xml ===================================== @@ -27,7 +27,7 @@ <parent> <groupId>fr.ird.observe</groupId> <artifactId>ird-observe</artifactId> - <version>7.0-RC-23-SNAPSHOT</version> + <version>7.0.0-SNAPSHOT</version> </parent> <artifactId>services-client</artifactId> ===================================== services-local/pom.xml ===================================== @@ -27,7 +27,7 @@ <parent> <groupId>fr.ird.observe</groupId> <artifactId>ird-observe</artifactId> - <version>7.0-RC-23-SNAPSHOT</version> + <version>7.0.0-SNAPSHOT</version> </parent> <artifactId>services-local</artifactId> ===================================== services/pom.xml ===================================== @@ -27,7 +27,7 @@ <parent> <groupId>fr.ird.observe</groupId> <artifactId>ird-observe</artifactId> - <version>7.0-RC-23-SNAPSHOT</version> + <version>7.0.0-SNAPSHOT</version> </parent> <artifactId>services</artifactId> ===================================== services/src/main/java/fr/ird/observe/services/validation/validators/ActivitySimpleSpeedDtoValidator.java ===================================== @@ -29,9 +29,12 @@ import fr.ird.observe.dto.data.seine.ActivitySeineDto; import fr.ird.observe.dto.data.seine.ActivitySeineStubDto; import fr.ird.observe.dto.data.seine.RouteDto; import fr.ird.observe.dto.decoration.DecoratorService; -import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import java.util.Comparator; +import java.util.LinkedList; +import java.util.List; import java.util.Objects; /** @@ -146,8 +149,24 @@ public class ActivitySimpleSpeedDtoValidator extends FieldValidatorSupport { Objects.requireNonNull(route, " could not find currentRoute in valueStack"); - ActivitySeineStubDto previousActivity = route.getPreviousActivity(activity.getId()); - + ActivitySeineStubDto previousActivity; + + if (activity.isNotPersisted()) { + // since there is no id, can't use the later method, must find out by our self previous activity + List<ActivitySeineStubDto> activitySeine = new LinkedList<>(route.getActivitySeine()); + ActivitySeineStubDto activityStub = new ActivitySeineStubDto(); + activityStub.setTime(activity.getTime()); + activitySeine.add(activityStub); + activitySeine.sort(Comparator.comparing(ActivitySeineStubDto::getTimeSecond)); + int index = activitySeine.indexOf(activityStub); + if (index > 0) { + previousActivity = activitySeine.get(index - 1); + } else { + previousActivity = null; + } + } else { + previousActivity = route.getPreviousActivity(activity.getId()); + } if (previousActivity == null) { // pas d'activity avant, rien à valider ===================================== test/pom.xml ===================================== @@ -26,7 +26,7 @@ <parent> <groupId>fr.ird.observe</groupId> <artifactId>ird-observe</artifactId> - <version>7.0-RC-23-SNAPSHOT</version> + <version>7.0.0-SNAPSHOT</version> </parent> <artifactId>test</artifactId> ===================================== validation/pom.xml ===================================== @@ -26,7 +26,7 @@ <parent> <groupId>fr.ird.observe</groupId> <artifactId>ird-observe</artifactId> - <version>7.0-RC-23-SNAPSHOT</version> + <version>7.0.0-SNAPSHOT</version> </parent> <artifactId>validation</artifactId> ===================================== validation/src/main/resources/fr/ird/observe/dto/data/seine/RouteDto-update-error-validation.xml ===================================== @@ -66,21 +66,6 @@ <message>observe.validation.route.invalid.time##${index}</message> </field-validator> - <!-- coherence seaSurfaceTemperature des activitys (moins de 12 de delta) --> - <field-validator type="collectionFieldExpression"> - <param name="mode">ALL</param> - <param name="useSensitiveContext">true</param> - <param name="expression"><![CDATA[ - previous == null || previous.seaSurfaceTemperature == null || current.seaSurfaceTemperature == null - || (previous.seaSurfaceTemperature > current.seaSurfaceTemperature ? - previous.seaSurfaceTemperature - current.seaSurfaceTemperature <= 12.0 - : current.seaSurfaceTemperature - previous.seaSurfaceTemperature <= 12.0 - ) - ]]> - </param> - <message>observe.validation.route.invalid.seaSurfaceTemperature##${index}</message> - </field-validator> - <!-- coherence quadrant des activitys --> <field-validator type="collectionFieldExpression"> <param name="mode">ALL</param> View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/compare/1ca1414b0a5f060e0c11aa959a8... -- View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/compare/1ca1414b0a5f060e0c11aa959a8... You're receiving this email because of your account on gitlab.com.
participants (1)
-
Tony CHEMIT