branch feature/2264 updated (cceafbe -> e491dea)
This is an automated email from the git hooks/post-receive script. New change to branch feature/2264 in repository wao. See http://git.codelutin.com/wao.git from cceafbe Filtres scléro pour l'onglet Contacts new e3d91c2 Correction filtre organisation de l'onglet contact new 166ecae Remaniement de la validation des contacts (séparation en méthodes du service) new 9e55adb Ajout d'une règle de validation pour le nombre d'individus échantilonnés new e491dea css pour le tableau des contacts The 4 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 e491dea4243fd4a6ab3d06859a8cb17defc014f1 Author: Brendan Le Ny <bleny@codelutin.com> Date: Fri Dec 26 16:34:25 2014 +0100 css pour le tableau des contacts commit 9e55adbaee72973770f08c5a2776ee0e5d9a3d3f Author: Brendan Le Ny <bleny@codelutin.com> Date: Fri Dec 26 16:33:20 2014 +0100 Ajout d'une règle de validation pour le nombre d'individus échantilonnés commit 166ecae2b55bb45e0173748e135a913e37528a82 Author: Brendan Le Ny <bleny@codelutin.com> Date: Fri Dec 26 16:13:07 2014 +0100 Remaniement de la validation des contacts (séparation en méthodes du service) commit e3d91c2b66fb6bf04f47cc15c730df08f48d34f8 Author: Brendan Le Ny <bleny@codelutin.com> Date: Fri Dec 26 14:37:53 2014 +0100 Correction filtre organisation de l'onglet contact Summary of changes: .../wao/services/service/ContactsService.java | 291 +++++++++++---------- .../service/IllegalSampleSizeException.java | 10 + .../service/MissingSampleSizeException.java | 10 + .../resources/i18n/wao-services_en_GB.properties | 2 + .../resources/i18n/wao-services_fr_FR.properties | 2 + .../ifremer/wao/web/action/EditContactAction.java | 30 +-- .../wao/web/action/ValidateContactJsonAction.java | 77 ++---- .../src/main/webapp/WEB-INF/content/contacts.jsp | 11 +- .../webapp/WEB-INF/content/edit-contact-input.jsp | 2 + 9 files changed, 227 insertions(+), 208 deletions(-) create mode 100644 wao-services/src/main/java/fr/ifremer/wao/services/service/IllegalSampleSizeException.java create mode 100644 wao-services/src/main/java/fr/ifremer/wao/services/service/MissingSampleSizeException.java -- 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 feature/2264 in repository wao. See http://git.codelutin.com/wao.git commit e3d91c2b66fb6bf04f47cc15c730df08f48d34f8 Author: Brendan Le Ny <bleny@codelutin.com> Date: Fri Dec 26 14:37:53 2014 +0100 Correction filtre organisation de l'onglet contact --- wao-web/src/main/webapp/WEB-INF/content/contacts.jsp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/wao-web/src/main/webapp/WEB-INF/content/contacts.jsp b/wao-web/src/main/webapp/WEB-INF/content/contacts.jsp index c62d67d..0b31a71 100644 --- a/wao-web/src/main/webapp/WEB-INF/content/contacts.jsp +++ b/wao-web/src/main/webapp/WEB-INF/content/contacts.jsp @@ -36,8 +36,13 @@ <s:if test="authenticatedWaoUser.authorizedToViewOtherCompanies"> { filterName: 'sampleRowFilter.organisationIds', - filterLabel: "<s:text name="wao.ui.entity.Organisation"/>", - filterValuesField: 'sampleRowsFilterValues.companies', + <s:if test="obsMer || obsVente"> + filterLabel: "<s:text name="wao.ui.entity.Company"/>", + </s:if> + <s:else> + filterLabel: "<s:text name="wao.ui.entity.Organisation"/>", + </s:else> + filterValuesField: 'sampleRowsFilterValues.organisations', }, </s:if> { -- 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 feature/2264 in repository wao. See http://git.codelutin.com/wao.git commit 166ecae2b55bb45e0173748e135a913e37528a82 Author: Brendan Le Ny <bleny@codelutin.com> Date: Fri Dec 26 16:13:07 2014 +0100 Remaniement de la validation des contacts (séparation en méthodes du service) --- .../wao/services/service/ContactsService.java | 278 +++++++++++---------- 1 file changed, 144 insertions(+), 134 deletions(-) diff --git a/wao-services/src/main/java/fr/ifremer/wao/services/service/ContactsService.java b/wao-services/src/main/java/fr/ifremer/wao/services/service/ContactsService.java index 798e593..cefdd93 100644 --- a/wao-services/src/main/java/fr/ifremer/wao/services/service/ContactsService.java +++ b/wao-services/src/main/java/fr/ifremer/wao/services/service/ContactsService.java @@ -594,7 +594,9 @@ public class ContactsService extends WaoServiceSupport { MissingContactDataInputDateException, ContactRestitutionDateBeforeDataInputDateException, MissingContactDataReliabilityException, - MissingContactCommentAdminException, MissingContactTerrestrialLocationException, IllegalAcceptationException { + MissingContactCommentAdminException, + MissingContactTerrestrialLocationException, + IllegalAcceptationException { // Check if contact can be updated boolean canUpdateContact = authenticatedWaoUser.isAuthorizedToEditContact(updateContactCommand.getContact()) @@ -607,35 +609,10 @@ public class ContactsService extends WaoServiceSupport { // Pass validation controls Contact contact = updateContactCommand.getContact(); - SampleRow sampleRow = contact.getSampleRow(); - - WaoUser mainObserver = contact.getMainObserver(); - - if (mainObserver == null) { - throw new MissingContactMainObserverException(contact); - } - - Set<WaoUser> possibleObservers = getPossibleObservers(sampleRow); - if ( ! possibleObservers.contains(mainObserver)) { - throw new MismatchContactMainObserverCompanyException(contact, mainObserver, sampleRow.getOrganisation()); - } - - if (contact.isSecondaryObserversNotEmpty()) { - - //--- - // secondaryObservers - //--- - - if (contact.getSecondaryObservers().contains(mainObserver)) { - throw new DuplicatedContactMainObserverInSecondaryObserversException(contact); - } - - for (WaoUser secondaryObserver : contact.getSecondaryObservers()) { - if ( ! possibleObservers.contains(secondaryObserver)) { - throw new MismatchContactSecondaryObserverCompanyException(contact, secondaryObserver, sampleRow.getOrganisation()); - } - } - } + validateObservers(contact); + validateChronology(contact); + validateContactStateMotif(contact); + validateComments(contact); Date observationBeginDate = contact.getObservationBeginDate(); Date observationEndDate = contact.getObservationEndDate(); @@ -643,11 +620,7 @@ public class ContactsService extends WaoServiceSupport { if (observationBeginDate != null) { - //--- - // observationBeginDate - //--- - - SampleMonth month = sampleRow.getSampleMonth(observationBeginDate); + SampleMonth month = contact.getSampleRow().getSampleMonth(observationBeginDate); boolean operationBeginDateIsValid = month != null; if (!operationBeginDateIsValid) { @@ -655,154 +628,191 @@ public class ContactsService extends WaoServiceSupport { } } - Date currentDate = serviceContext.getNow(); - - if (observationEndDate != null) { - - //--- - // observationEndDate - //--- + ContactState contactState = contact.getContactState(); - if (observationBeginDate != null - && observationEndDate.before(observationBeginDate)) { - throw new ContactObservationEndDateBeforeBeginDateException(contact); + if (ContactState.OBSERVATION_DONE.equals(contactState)) { // Observation réalisée + if (observationBeginDate == null) { + throw new MissingContactObservationBeginDateException(contact); } - - if (observationEndDate.after(currentDate)) { - throw new ContactObservationEndDateAfterTodayException(contact, currentDate); + if (observationEndDate == null) { + throw new MissingContactObservationEndDateException(contact); + } + if (contact.getObsProgram().isObsVente() && contact.getTerrestrialLocation() == null) { + throw new MissingContactTerrestrialLocationException(contact); } - } - if (dataInputDate != null) { + if (BooleanUtils.isTrue(contact.getValidationCompany())) { //--- - // dataInputDate + // validationCompany //--- - if (observationEndDate != null) { - - // Here, we check that the date input date is after the end of the - // observation. Since the first is a day (at 00:00) and the second - // is date-time, there may be a bug if the data input day is the same - // as the end of observation - boolean dataInputDateAfterObservationEndDate = - observationEndDate.after(DateUtil.setMaxTimeOfDay(dataInputDate)); - - if (dataInputDateAfterObservationEndDate) { - throw new ContactDataInputDateBeforeObservationEndDateException(contact); + if (ContactState.OBSERVATION_DONE.equals(contactState)) { + if (contact.getObsProgram().isObsMer() && contact.getObservedDataControl() == null) { + throw new MissingContactObservedDataControlException(contact); + } else if (ObservedDataControl.CORRECTION_ASKED.equals(contact.getObservedDataControl())) { + throw new ContactWithObservedDataControlToCorrectionAskedException(contact); } } - if (dataInputDate.after(currentDate)) { - throw new ContactDataInputDateAfterTodayException(contact, currentDate); + // Pour valider un contact société, il faut que le contact aie une date de transmission + Date restitution = contact.getRestitution(); + if (ObservedDataControl.ACCEPTED.equals(contact.getObservedDataControl()) && restitution == null) { + throw new MissingContactRestitutionException(contact); + } + if (dataInputDate == null && restitution != null) { + throw new MissingContactDataInputDateException(contact); + } + if (dataInputDate != null && restitution != null && restitution.before(dataInputDate)) { + throw new ContactRestitutionDateBeforeDataInputDateException(contact); } } - //--- - // contactState - //--- - - ContactState contactState = contact.getContactState(); + if (contact.getValidationProgram() != null && contact.getValidationCompany() == null) { + throw new IllegalAcceptationException(contact); + } - boolean contactMustHaveAMotif = false; - switch (contactState) { - case OBSERVATION_CANCELLED: + if (BooleanUtils.isTrue(contact.getValidationProgram())) { - // Non abouti + //--- + // validationProgram + //--- + if (contact.getObsProgram().isObsMer()) { - if (StringUtils.isBlank(contact.getComment())) { - throw new MissingContactCommentException(contact); + // it's an admin validation, data-reliability field must be filled + if (contact.getDataReliability() == null || DataReliability.UNKNOWN == contact.getDataReliability()) { + throw new MissingContactDataReliabilityException(contact); } - break; - case OBSERVATION_DONE: + } + } + } - // Observation réalisée + /** + * On vérifie que les différents commentaires complémentaires à une indication sont bien renseignés. + */ + protected void validateComments(Contact contact) throws + MissingContactCommentException, + MissingContactMammalsInfoException, + MissingContactCommentAdminException { - if (observationBeginDate == null) { - throw new MissingContactObservationBeginDateException(contact); - } - if (observationEndDate == null) { - throw new MissingContactObservationEndDateException(contact); - } - if (contact.getObsProgram().isObsVente() && contact.getTerrestrialLocation() == null) { - throw new MissingContactTerrestrialLocationException(contact); - } - break; + if (ContactState.OBSERVATION_CANCELLED.equals(contact.getContactState())) { + if (StringUtils.isBlank(contact.getComment())) { + throw new MissingContactCommentException(contact); + } + } - case CONTACT_REFUSED: - contactMustHaveAMotif = true; - break; - case CONTACT_DEFINITELY_REFUSED: - contactMustHaveAMotif = true; - break; + if (contact.isMammalsCapture() && StringUtils.isBlank(contact.getMammalsInfo())) { + throw new MissingContactMammalsInfoException(contact); + } + DataReliability dataReliability = contact.getDataReliability(); + if (dataReliability != null && dataReliability.isCommentRequired() && StringUtils.isBlank(contact.getCommentAdmin())) { + throw new MissingContactCommentAdminException(contact); } + } + + /** + * On s'assure que le champs {@link fr.ifremer.wao.entity.Contact#getContactStateMotif()} n'a + * été rempli que si nécessaire. + */ + protected void validateContactStateMotif(Contact contact) throws + MissingContactStateMotifException, + UnwantedContactContactStateMotifException { - //--- - // contactStateMotif - //--- + boolean contactMustHaveAMotif = ImmutableSet.of( + ContactState.CONTACT_REFUSED, + ContactState.CONTACT_DEFINITELY_REFUSED).contains(contact.getContactState()); if (contactMustHaveAMotif && contact.getContactStateMotif() == null) { throw new MissingContactStateMotifException(contact); } - if (!contactMustHaveAMotif && contact.getContactStateMotif() != null) { + if ( ! contactMustHaveAMotif && contact.getContactStateMotif() != null) { throw new UnwantedContactContactStateMotifException(contact); } - if (contact.isMammalsCapture() && StringUtils.isBlank(contact.getMammalsInfo())) { - throw new MissingContactMammalsInfoException(contact); - } + } - if (BooleanUtils.isTrue(contact.getValidationCompany())) { + /** + * Partie de la validation dans laquelle on s'intéresse à la chronologie des événement. + * + * On ne vérifie pas si les champs ont été renseignés mais que s'ils l'ont été, c'est + * de façon cohérente (champs entre eux et par rapport à la date courante. + */ + protected void validateChronology(Contact contact) throws + ContactObservationEndDateBeforeBeginDateException, + ContactObservationEndDateAfterTodayException, + ContactDataInputDateBeforeObservationEndDateException, + ContactDataInputDateAfterTodayException { - //--- - // validationCompany - //--- + Date observationBeginDate = contact.getObservationBeginDate(); + Date observationEndDate = contact.getObservationEndDate(); + Date dataInputDate = contact.getDataInputDate(); - if (ContactState.OBSERVATION_DONE == contactState) { - if (contact.getObsProgram().isObsMer() && contact.getObservedDataControl() == null) { - throw new MissingContactObservedDataControlException(contact); - } else if (ObservedDataControl.CORRECTION_ASKED.equals(contact.getObservedDataControl())) { - throw new ContactWithObservedDataControlToCorrectionAskedException(contact); - } - } + Date now = serviceContext.getNow(); - // Pour valider un contact société, il faut que le contact aie une date de transmission - Date restitution = contact.getRestitution(); - if (ObservedDataControl.ACCEPTED.equals(contact.getObservedDataControl()) && restitution == null) { - throw new MissingContactRestitutionException(contact); - } - if (dataInputDate == null && restitution != null) { - throw new MissingContactDataInputDateException(contact); + if (observationEndDate != null) { + + if (observationBeginDate != null && observationEndDate.before(observationBeginDate)) { + throw new ContactObservationEndDateBeforeBeginDateException(contact); } - if (dataInputDate != null && restitution != null && restitution.before(dataInputDate)) { - throw new ContactRestitutionDateBeforeDataInputDateException(contact); + + if (observationEndDate.after(now)) { + throw new ContactObservationEndDateAfterTodayException(contact, now); } + } - if (contact.getValidationProgram() != null && contact.getValidationCompany() == null) { + if (dataInputDate != null) { - throw new IllegalAcceptationException(contact); + if (observationEndDate != null) { + + // Here, we check that the date input date is after the end of the + // observation. Since the first is a day (at 00:00) and the second + // is date-time, there may be a bug if the data input day is the same + // as the end of observation + boolean dataInputDateAfterObservationEndDate = + observationEndDate.after(DateUtil.setMaxTimeOfDay(dataInputDate)); + + if (dataInputDateAfterObservationEndDate) { + throw new ContactDataInputDateBeforeObservationEndDateException(contact); + } + } + + if (dataInputDate.after(now)) { + throw new ContactDataInputDateAfterTodayException(contact, now); + } } - DataReliability dataReliability = contact.getDataReliability(); + } - if (dataReliability != null && dataReliability.isCommentRequired() && StringUtils.isBlank(contact.getCommentAdmin())) { - throw new MissingContactCommentAdminException(contact); + /** + * Partie de la validation d'un contact chargée de vérifier la cohérence des observateurs renseignés. + */ + protected void validateObservers(Contact contact) throws + MissingContactMainObserverException, MismatchContactMainObserverCompanyException, + DuplicatedContactMainObserverInSecondaryObserversException, + MismatchContactSecondaryObserverCompanyException { + WaoUser mainObserver = contact.getMainObserver(); + + if (mainObserver == null) { + throw new MissingContactMainObserverException(contact); } - if (BooleanUtils.isTrue(contact.getValidationProgram())) { + Set<WaoUser> possibleObservers = getPossibleObservers(contact.getSampleRow()); + if ( ! possibleObservers.contains(mainObserver)) { + throw new MismatchContactMainObserverCompanyException(contact, mainObserver, contact.getSampleRow().getOrganisation()); + } - //--- - // validationProgram - //--- - if (contact.getObsProgram().isObsMer()) { + if (contact.isSecondaryObserversNotEmpty()) { + if (contact.getSecondaryObservers().contains(mainObserver)) { + throw new DuplicatedContactMainObserverInSecondaryObserversException(contact); + } - // it's an admin validation, data-reliability field must be filled - if (dataReliability == null || DataReliability.UNKNOWN == dataReliability) { - throw new MissingContactDataReliabilityException(contact); + for (WaoUser secondaryObserver : contact.getSecondaryObservers()) { + if ( ! possibleObservers.contains(secondaryObserver)) { + throw new MismatchContactSecondaryObserverCompanyException(contact, secondaryObserver, contact.getSampleRow().getOrganisation()); } } } -- 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 feature/2264 in repository wao. See http://git.codelutin.com/wao.git commit 9e55adbaee72973770f08c5a2776ee0e5d9a3d3f Author: Brendan Le Ny <bleny@codelutin.com> Date: Fri Dec 26 16:33:20 2014 +0100 Ajout d'une règle de validation pour le nombre d'individus échantilonnés --- .../wao/services/service/ContactsService.java | 17 ++++- .../service/IllegalSampleSizeException.java | 10 +++ .../service/MissingSampleSizeException.java | 10 +++ .../resources/i18n/wao-services_en_GB.properties | 2 + .../resources/i18n/wao-services_fr_FR.properties | 2 + .../ifremer/wao/web/action/EditContactAction.java | 30 ++------- .../wao/web/action/ValidateContactJsonAction.java | 77 ++++++++-------------- .../webapp/WEB-INF/content/edit-contact-input.jsp | 2 + 8 files changed, 77 insertions(+), 73 deletions(-) diff --git a/wao-services/src/main/java/fr/ifremer/wao/services/service/ContactsService.java b/wao-services/src/main/java/fr/ifremer/wao/services/service/ContactsService.java index cefdd93..5e0a05e 100644 --- a/wao-services/src/main/java/fr/ifremer/wao/services/service/ContactsService.java +++ b/wao-services/src/main/java/fr/ifremer/wao/services/service/ContactsService.java @@ -528,6 +528,12 @@ public class ContactsService extends WaoServiceSupport { } catch (IllegalAcceptationException e) { String message = l(l, "wao.import.contact.failure.illegalAcceptation", lineNumber); throw new ImportErrorException(message); + } catch (MissingSampleSizeException e) { + String message = l(l, "wao.import.contact.failure.missingSampleSize", lineNumber); + throw new ImportErrorException(message); + } catch (IllegalSampleSizeException e) { + String message = l(l, "wao.import.contact.failure.illegalSampleSize", lineNumber); + throw new ImportErrorException(message); } save0(updateContactCommand); @@ -596,7 +602,9 @@ public class ContactsService extends WaoServiceSupport { MissingContactDataReliabilityException, MissingContactCommentAdminException, MissingContactTerrestrialLocationException, - IllegalAcceptationException { + IllegalAcceptationException, + MissingSampleSizeException, + IllegalSampleSizeException { // Check if contact can be updated boolean canUpdateContact = authenticatedWaoUser.isAuthorizedToEditContact(updateContactCommand.getContact()) @@ -640,6 +648,13 @@ public class ContactsService extends WaoServiceSupport { if (contact.getObsProgram().isObsVente() && contact.getTerrestrialLocation() == null) { throw new MissingContactTerrestrialLocationException(contact); } + if (contact.getObsProgram().isSclerochronology() && contact.getSampleSize() == null) { + throw new MissingSampleSizeException(contact); + } + } + + if (contact.getSampleSize() != null && contact.getSampleSize() <= 0) { + throw new IllegalSampleSizeException(contact); } if (BooleanUtils.isTrue(contact.getValidationCompany())) { diff --git a/wao-services/src/main/java/fr/ifremer/wao/services/service/IllegalSampleSizeException.java b/wao-services/src/main/java/fr/ifremer/wao/services/service/IllegalSampleSizeException.java new file mode 100644 index 0000000..59ba3ff --- /dev/null +++ b/wao-services/src/main/java/fr/ifremer/wao/services/service/IllegalSampleSizeException.java @@ -0,0 +1,10 @@ +package fr.ifremer.wao.services.service; + +import fr.ifremer.wao.entity.Contact; + +public class IllegalSampleSizeException extends ContactValidationException { + + public IllegalSampleSizeException(Contact contact) { + super(contact); + } +} diff --git a/wao-services/src/main/java/fr/ifremer/wao/services/service/MissingSampleSizeException.java b/wao-services/src/main/java/fr/ifremer/wao/services/service/MissingSampleSizeException.java new file mode 100644 index 0000000..fcbd2ca --- /dev/null +++ b/wao-services/src/main/java/fr/ifremer/wao/services/service/MissingSampleSizeException.java @@ -0,0 +1,10 @@ +package fr.ifremer.wao.services.service; + +import fr.ifremer.wao.entity.Contact; + +public class MissingSampleSizeException extends ContactValidationException { + + public MissingSampleSizeException(Contact contact) { + super(contact); + } +} diff --git a/wao-services/src/main/resources/i18n/wao-services_en_GB.properties b/wao-services/src/main/resources/i18n/wao-services_en_GB.properties index 47dcf3e..b5eb341 100644 --- a/wao-services/src/main/resources/i18n/wao-services_en_GB.properties +++ b/wao-services/src/main/resources/i18n/wao-services_en_GB.properties @@ -39,6 +39,7 @@ wao.import.contact.failure.dataInputDateBeforeToday=Data input date must be befo wao.import.contact.failure.districtMissing=You need to precise the boat district wao.import.contact.failure.duplicatedMainObserverInSecondaryObservers=Main observer can not be also a secondary observer wao.import.contact.failure.illegalAcceptation=Contact must be accepted by company before being accepted by program +wao.import.contact.failure.illegalSampleSize=The number of individuals must be positive wao.import.contact.failure.invalidObservationBeginDate=La date de début de la marée doit correspondre à un mois valide (non vide) de la ligne wao.import.contact.failure.locationTypeMissing=The type of the location must be filled wao.import.contact.failure.mismatchCompanyForObserver=Observer %s is not member of %s @@ -57,6 +58,7 @@ wao.import.contact.failure.missingObservationEndDate=Observation end date must b wao.import.contact.failure.missingObservedDataControl=You must provide a value for observed data control wao.import.contact.failure.missingObserver=There can't be no observer for state '%s' wao.import.contact.failure.missingRestitution=You must provide the restitution forward date +wao.import.contact.failure.missingSampleSize=You must provide de number of individuals wao.import.contact.failure.missingTerrestrialLocation=You must provide the terrestrial location wao.import.contact.failure.not.updatable=Insufficient credentials to update contact wao.import.contact.failure.observationEndDateAfterToday=La date de fin de la marée ne peut pas être postérieure à la date du jour diff --git a/wao-services/src/main/resources/i18n/wao-services_fr_FR.properties b/wao-services/src/main/resources/i18n/wao-services_fr_FR.properties index a89b1dc..e6c221d 100644 --- a/wao-services/src/main/resources/i18n/wao-services_fr_FR.properties +++ b/wao-services/src/main/resources/i18n/wao-services_fr_FR.properties @@ -37,6 +37,7 @@ wao.import.contact.failure.dataInputDateBeforeObservationEndDate=La date de sais wao.import.contact.failure.districtMissing=Il faut préciser le code d'un quartier maritime wao.import.contact.failure.duplicatedMainObserverInSecondaryObservers=L'utilisateur référant ne doit pas se trouver aussi parmi les observateurs secondaires wao.import.contact.failure.illegalAcceptation=Le contact doit être accepté par la société avant d'être accepté par le programme +wao.import.contact.failure.illegalSampleSize=Ligne %s \: Le nombre d'individus échantillonnés doit être strictement positif wao.import.contact.failure.invalidObservationBeginDate=Ligne %s \: La date de début de la marée doit correspondre à un mois valide (non vide) de la ligne wao.import.contact.failure.locationTypeMissing=Le type du lieu doit être renseigné wao.import.contact.failure.mismatchCompanyForObserver=Ligne %s \: L'observateur %s n'est pas membre de %s @@ -55,6 +56,7 @@ wao.import.contact.failure.missingObservationEndDate=Ligne %s \: La date de fin wao.import.contact.failure.missingObservedDataControl=Ligne %s \: Il faut préciser une valeur pour le contrôle des données observées wao.import.contact.failure.missingObserver=Ligne %s \: Il ne peut y avoir aucun observateur pour l'état '%s' wao.import.contact.failure.missingRestitution=Ligne %s \: Il faut préciser une date de transmission de la restitution de la donnée avant de valider +wao.import.contact.failure.missingSampleSize=Ligne %s \: Il faut préciser le nombre d'individus échantillonnés wao.import.contact.failure.missingTerrestrialLocation=Ligne %s \: Il faut préciser le lieu terrestre wao.import.contact.failure.not.updatable=Ligne %s \: Vous n'avez pas les droits suffisants pour modifier le contact wao.import.contact.failure.observationEndDateAfterToday=Ligne %s \: La date de fin de la marée doit être antérieure à la date du jour diff --git a/wao-web/src/main/java/fr/ifremer/wao/web/action/EditContactAction.java b/wao-web/src/main/java/fr/ifremer/wao/web/action/EditContactAction.java index 5ce9b9d..5be4b0e 100644 --- a/wao-web/src/main/java/fr/ifremer/wao/web/action/EditContactAction.java +++ b/wao-web/src/main/java/fr/ifremer/wao/web/action/EditContactAction.java @@ -45,6 +45,7 @@ import fr.ifremer.wao.services.service.ContactWithObservedDataControlToCorrectio import fr.ifremer.wao.services.service.ContactsService; import fr.ifremer.wao.services.service.DuplicatedContactMainObserverInSecondaryObserversException; import fr.ifremer.wao.services.service.IllegalAcceptationException; +import fr.ifremer.wao.services.service.IllegalSampleSizeException; import fr.ifremer.wao.services.service.InvalidContactObservationBeginDateException; import fr.ifremer.wao.services.service.MismatchContactMainObserverCompanyException; import fr.ifremer.wao.services.service.MismatchContactSecondaryObserverCompanyException; @@ -60,6 +61,7 @@ import fr.ifremer.wao.services.service.MissingContactObservedDataControlExceptio import fr.ifremer.wao.services.service.MissingContactRestitutionException; import fr.ifremer.wao.services.service.MissingContactStateMotifException; import fr.ifremer.wao.services.service.MissingContactTerrestrialLocationException; +import fr.ifremer.wao.services.service.MissingSampleSizeException; import fr.ifremer.wao.services.service.UnknownContactIdException; import fr.ifremer.wao.services.service.UnwantedContactContactStateMotifException; import fr.ifremer.wao.services.service.UpdateContactCommand; @@ -254,86 +256,66 @@ public class EditContactAction extends WaoJspActionSupport implements Preparable service.validate(authenticatedWaoUser, updateContactCommand); } catch (ContactNotUpdatableException e) { session.addErrorMessages(t("wao.ui.contacts.validation.failure.not.updatable")); - } catch (UnwantedContactContactStateMotifException e) { addFieldError("updateContactCommand.contact.contactStateMotif", t("wao.ui.form.Contact.error.unwantedContactStateMotif")); - } catch (MissingContactObservationEndDateException e) { String state = WaoUtils.l(getLocale(), e.getContact().getContactState().toI18Able(obsProgram)); addFieldError("updateContactCommand.contact.observationEndDate", t("wao.ui.form.Contact.error.missingObservationEndDate", state)); - } catch (ContactDataInputDateBeforeObservationEndDateException e) { addFieldError("updateContactCommand.contact.dataInputDate", t("wao.ui.form.Contact.error.dataInputDateBeforeObservationEndDate")); - } catch (InvalidContactObservationBeginDateException e) { addFieldError("updateContactCommand.contact.observationBeginDate", t("wao.ui.form.Contact.error.invalidObservationBeginDate")); - } catch (MissingContactRestitutionException e) { addFieldError("updateContactCommand.contact.restitution", t("wao.ui.form.Contact.error.missingRestitution")); - } catch (ContactDataInputDateAfterTodayException e) { addFieldError("updateContactCommand.contact.dataInputDate", t("wao.ui.form.Contact.error.dataInputDateAfterToday")); - } catch (MissingContactCommentException e) { String state = WaoUtils.l(getLocale(), e.getContact().getContactState().toI18Able(obsProgram)); addFieldError("updateContactCommand.contact.comment", t("wao.ui.form.Contact.error.missingComment", state)); - } catch (MismatchContactMainObserverCompanyException e) { String organisationName = e.getOrganisation().getName(); String observerLogin = e.getObserver().getLogin(); addFieldError("updateContactCommand.contact.mainObserver", t("wao.ui.form.Contact.error.mismatchCompanyForObserver", observerLogin, organisationName)); - } catch (ContactRestitutionDateBeforeDataInputDateException e) { addFieldError("updateContactCommand.contact.restitution", t("wao.ui.form.Contact.error.transmissionDateBeforeDataInputDate")); - } catch (ContactObservationEndDateBeforeBeginDateException e) { addFieldError("updateContactCommand.contact.observationEndDate", t("wao.ui.form.Contact.error.observationEndDateBeforeBeginDate")); - } catch (DuplicatedContactMainObserverInSecondaryObserversException e) { addFieldError("updateContactCommand.contact.secondaryObservers", t("wao.ui.form.Contact.error.duplicatedMainObserverInSecondaryObservers")); - } catch (MissingContactDataReliabilityException e) { addFieldError("updateContactCommand.contact.dataReliability", t("wao.ui.form.Contact.error.missingDataReliability")); - } catch (MismatchContactSecondaryObserverCompanyException e) { String organisationName = e.getOrganisation().getName(); String observerLogin = e.getObserver().getLogin(); addFieldError("updateContactCommand.contact.secondaryObservers", t("wao.ui.form.Contact.error.mismatchCompanyForObserver", observerLogin, organisationName)); - } catch (MissingContactObservedDataControlException e) { addFieldError("updateContactCommand.contact.observedDataControl", t("wao.ui.form.Contact.error.missingObservedDataControl")); - } catch (ContactWithObservedDataControlToCorrectionAskedException e) { addFieldError("updateContactCommand.contact.observedDataControl", t("wao.ui.form.Contact.error.observedDataControlToCorrectionAsked")); - } catch (MissingContactStateMotifException e) { addFieldError("updateContactCommand.contactStateMotifId", t("wao.ui.form.Contact.error.missingContactStateMotif")); - } catch (MissingContactDataInputDateException e) { addFieldError("updateContactCommand.contact.dataInputDate", t("wao.ui.form.Contact.error.missingDataInputDate")); - } catch (MissingContactMainObserverException e) { addFieldError("updateContactCommand.contact.mainObserver", t("wao.ui.form.Contact.error.missingMainObserver")); - } catch (MissingContactCommentAdminException e) { String dataReliability = WaoUtils.l(getLocale(), e.getContact().getDataReliability()); addFieldError("updateContactCommand.contact.commentAdmin", t("wao.ui.form.Contact.error.missingCommentAdmin", dataReliability)); - } catch (ContactObservationEndDateAfterTodayException e) { addFieldError("updateContactCommand.contact.observationEndDate", t("wao.ui.form.Contact.error.observationEndDateAfterToday")); - } catch (MissingContactObservationBeginDateException e) { String state = WaoUtils.l(getLocale(), e.getContact().getContactState().toI18Able(obsProgram)); addFieldError("updateContactCommand.contact.observationBeginDate", t("wao.ui.form.Contact.error.missingObservationBeginDate", state)); - } catch (MissingContactMammalsInfoException e) { addFieldError("updateContactCommand.contact.mammalsInfo", t("wao.ui.form.Contact.error.missingMammalsInfo")); - } catch (MissingContactTerrestrialLocationException e) { addFieldError("updateContactCommand.terrestrialLocationId", t("wao.ui.form.Contact.error.missingTerrestrialLocation")); - } catch (IllegalAcceptationException e) { throw new IllegalStateException("should never occur", e); + } catch (MissingSampleSizeException e) { + addFieldError("updateContactCommand.contact.sampleSize", t("wao.ui.form.Contact.error.missingSampleSize")); + } catch (IllegalSampleSizeException e) { + addFieldError("updateContactCommand.contact.sampleSize", t("wao.ui.form.Contact.error.illegalSampleSize")); } } diff --git a/wao-web/src/main/java/fr/ifremer/wao/web/action/ValidateContactJsonAction.java b/wao-web/src/main/java/fr/ifremer/wao/web/action/ValidateContactJsonAction.java index bd62216..875acf4 100644 --- a/wao-web/src/main/java/fr/ifremer/wao/web/action/ValidateContactJsonAction.java +++ b/wao-web/src/main/java/fr/ifremer/wao/web/action/ValidateContactJsonAction.java @@ -38,6 +38,7 @@ import fr.ifremer.wao.services.service.ContactWithObservedDataControlToCorrectio import fr.ifremer.wao.services.service.ContactsService; import fr.ifremer.wao.services.service.DuplicatedContactMainObserverInSecondaryObserversException; import fr.ifremer.wao.services.service.IllegalAcceptationException; +import fr.ifremer.wao.services.service.IllegalSampleSizeException; import fr.ifremer.wao.services.service.InvalidContactObservationBeginDateException; import fr.ifremer.wao.services.service.MismatchContactMainObserverCompanyException; import fr.ifremer.wao.services.service.MismatchContactSecondaryObserverCompanyException; @@ -53,6 +54,7 @@ import fr.ifremer.wao.services.service.MissingContactObservedDataControlExceptio import fr.ifremer.wao.services.service.MissingContactRestitutionException; import fr.ifremer.wao.services.service.MissingContactStateMotifException; import fr.ifremer.wao.services.service.MissingContactTerrestrialLocationException; +import fr.ifremer.wao.services.service.MissingSampleSizeException; import fr.ifremer.wao.services.service.UnknownContactIdException; import fr.ifremer.wao.services.service.UnwantedContactContactStateMotifException; import fr.ifremer.wao.services.service.UpdateContactCommand; @@ -171,87 +173,66 @@ public class ValidateContactJsonAction extends WaoJsonActionSupport implements P service.validate(authenticatedWaoUser, updateContactCommand); } catch (ContactNotUpdatableException e) { session.addErrorMessages(t("wao.ui.contacts.validation.failure.not.updatable")); - } catch (UnwantedContactContactStateMotifException e) { - errorMessage = t("wao.ui.form.Contact.error.unwantedContactStateMotif"); - + errorMessage = t("wao.ui.form.Contact.error.unwantedContactStateMotif"); } catch (MissingContactObservationEndDateException e) { String state = WaoUtils.l(getLocale(), e.getContact().getContactState().toI18Able(obsProgram)); - errorMessage = t("wao.ui.form.Contact.error.missingObservationEndDate", state); - + errorMessage = t("wao.ui.form.Contact.error.missingObservationEndDate", state); } catch (ContactDataInputDateBeforeObservationEndDateException e) { - errorMessage = t("wao.ui.form.Contact.error.dataInputDateBeforeObservationEndDate"); - + errorMessage = t("wao.ui.form.Contact.error.dataInputDateBeforeObservationEndDate"); } catch (InvalidContactObservationBeginDateException e) { - errorMessage = t("wao.ui.form.Contact.error.invalidObservationBeginDate"); - + errorMessage = t("wao.ui.form.Contact.error.invalidObservationBeginDate"); } catch (MissingContactRestitutionException e) { - errorMessage = t("wao.ui.form.Contact.error.missingRestitution"); - + errorMessage = t("wao.ui.form.Contact.error.missingRestitution"); } catch (ContactDataInputDateAfterTodayException e) { - errorMessage = t("wao.ui.form.Contact.error.dataInputDateAfterToday"); - + errorMessage = t("wao.ui.form.Contact.error.dataInputDateAfterToday"); } catch (MissingContactCommentException e) { String state = WaoUtils.l(getLocale(), e.getContact().getContactState().toI18Able(obsProgram)); - errorMessage = t("wao.ui.form.Contact.error.missingComment", state); - + errorMessage = t("wao.ui.form.Contact.error.missingComment", state); } catch (MismatchContactMainObserverCompanyException e) { String companyName = e.getOrganisation().getName(); String observerLogin = e.getObserver().getLogin(); - errorMessage = t("wao.ui.form.Contact.error.mismatchCompanyForObserver", observerLogin, companyName); - + errorMessage = t("wao.ui.form.Contact.error.mismatchCompanyForObserver", observerLogin, companyName); } catch (ContactRestitutionDateBeforeDataInputDateException e) { - errorMessage = t("wao.ui.form.Contact.error.transmissionDateBeforeDataInputDate"); - + errorMessage = t("wao.ui.form.Contact.error.transmissionDateBeforeDataInputDate"); } catch (ContactObservationEndDateBeforeBeginDateException e) { - errorMessage = t("wao.ui.form.Contact.error.observationEndDateBeforeBeginDate"); - + errorMessage = t("wao.ui.form.Contact.error.observationEndDateBeforeBeginDate"); } catch (DuplicatedContactMainObserverInSecondaryObserversException e) { - errorMessage = t("wao.ui.form.Contact.error.duplicatedMainObserverInSecondaryObservers"); - + errorMessage = t("wao.ui.form.Contact.error.duplicatedMainObserverInSecondaryObservers"); } catch (MissingContactDataReliabilityException e) { - errorMessage = t("wao.ui.form.Contact.error.missingDataReliability"); - + errorMessage = t("wao.ui.form.Contact.error.missingDataReliability"); } catch (MismatchContactSecondaryObserverCompanyException e) { String companyName = e.getOrganisation().getName(); String observerLogin = e.getObserver().getLogin(); - errorMessage = t("wao.ui.form.Contact.error.mismatchCompanyForObserver", observerLogin, companyName); - + errorMessage = t("wao.ui.form.Contact.error.mismatchCompanyForObserver", observerLogin, companyName); } catch (MissingContactObservedDataControlException e) { - errorMessage = t("wao.ui.form.Contact.error.missingObservedDataControl"); - + errorMessage = t("wao.ui.form.Contact.error.missingObservedDataControl"); } catch (ContactWithObservedDataControlToCorrectionAskedException e) { errorMessage = t("wao.ui.form.Contact.error.observedDataControlToCorrectionAsked"); - } catch (MissingContactStateMotifException e) { - errorMessage = t("wao.ui.form.Contact.error.missingContactStateMotif"); - + errorMessage = t("wao.ui.form.Contact.error.missingContactStateMotif"); } catch (MissingContactDataInputDateException e) { - errorMessage = t("wao.ui.form.Contact.error.missingDataInputDate"); - + errorMessage = t("wao.ui.form.Contact.error.missingDataInputDate"); } catch (MissingContactMainObserverException e) { - errorMessage = t("wao.ui.form.Contact.error.missingMainObserver"); - + errorMessage = t("wao.ui.form.Contact.error.missingMainObserver"); } catch (MissingContactCommentAdminException e) { String dataReliability = WaoUtils.l(getLocale(), e.getContact().getDataReliability()); - errorMessage = t("wao.ui.form.Contact.error.missingCommentAdmin", dataReliability); - + errorMessage = t("wao.ui.form.Contact.error.missingCommentAdmin", dataReliability); } catch (ContactObservationEndDateAfterTodayException e) { - errorMessage = t("wao.ui.form.Contact.error.observationEndDateAfterToday"); - + errorMessage = t("wao.ui.form.Contact.error.observationEndDateAfterToday"); } catch (MissingContactObservationBeginDateException e) { String state = WaoUtils.l(getLocale(), e.getContact().getContactState().toI18Able(obsProgram)); - errorMessage = t("wao.ui.form.Contact.error.missingObservationBeginDate", state); - + errorMessage = t("wao.ui.form.Contact.error.missingObservationBeginDate", state); } catch (MissingContactTerrestrialLocationException e) { - errorMessage = t("wao.ui.form.Contact.error.missingContactTerrestrialLocation"); - + errorMessage = t("wao.ui.form.Contact.error.missingContactTerrestrialLocation"); } catch (MissingContactMammalsInfoException e) { - errorMessage = t("wao.ui.form.Contact.error.missingContactMammalsInfo"); - + errorMessage = t("wao.ui.form.Contact.error.missingContactMammalsInfo"); } catch (IllegalAcceptationException e) { - errorMessage = t("wao.ui.form.Contact.error.illegalAcceptationException"); - + errorMessage = t("wao.ui.form.Contact.error.illegalAcceptationException"); + } catch (MissingSampleSizeException e) { + errorMessage = t("wao.ui.form.Contact.error.missingSampleSize"); + } catch (IllegalSampleSizeException e) { + errorMessage = t("wao.ui.form.Contact.error.illegalSampleSize"); } if (isSuccessful()) { diff --git a/wao-web/src/main/webapp/WEB-INF/content/edit-contact-input.jsp b/wao-web/src/main/webapp/WEB-INF/content/edit-contact-input.jsp index c4d603c..1793618 100644 --- a/wao-web/src/main/webapp/WEB-INF/content/edit-contact-input.jsp +++ b/wao-web/src/main/webapp/WEB-INF/content/edit-contact-input.jsp @@ -346,6 +346,8 @@ <s:textfield name="updateContactCommand.contact.sampleSize" label="%{getText('wao.ui.field.Contact.sampleSize')}" type="number" + min="1" + step="1" disabled="%{!#editObservationReport}" cssClass="input-small" inputAppend="%{getText('wao.ui.field.Contact.sampleSize.unit')}"/> -- 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 feature/2264 in repository wao. See http://git.codelutin.com/wao.git commit e491dea4243fd4a6ab3d06859a8cb17defc014f1 Author: Brendan Le Ny <bleny@codelutin.com> Date: Fri Dec 26 16:34:25 2014 +0100 css pour le tableau des contacts --- wao-web/src/main/webapp/WEB-INF/content/contacts.jsp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wao-web/src/main/webapp/WEB-INF/content/contacts.jsp b/wao-web/src/main/webapp/WEB-INF/content/contacts.jsp index 0b31a71..d34c5d8 100644 --- a/wao-web/src/main/webapp/WEB-INF/content/contacts.jsp +++ b/wao-web/src/main/webapp/WEB-INF/content/contacts.jsp @@ -579,7 +579,7 @@ </td> </s:if> <s:if test="sclerochronology"> - <td> + <td class="align-center"> <s:if test="sampleSize != null"> <s:property value="sampleSize"/> </s:if> -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
participants (1)
-
codelutin.com scm