Author: tchemit Date: 2014-04-07 19:13:57 +0200 (Mon, 07 Apr 2014) New Revision: 1860 Url: http://forge.codelutin.com/projects/wao/repository/revisions/1860 Log: refs #4487 fix some exception names and api Added: trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/MissingContactNbObservantsException.java Removed: trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/InvalidContactMainObserverException.java trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/MissingContactNbObservantsForObservationDoneStateException.java Modified: trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ContactDataInputDateAfterTodayException.java trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/MismatchContactMainObserverCompanyException.java trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ObsMerContactsService.java trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/EditContactAction.java trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/ValidateContactJsonAction.java Modified: trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ContactDataInputDateAfterTodayException.java =================================================================== --- trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ContactDataInputDateAfterTodayException.java 2014-04-07 17:10:27 UTC (rev 1859) +++ trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ContactDataInputDateAfterTodayException.java 2014-04-07 17:13:57 UTC (rev 1860) @@ -14,14 +14,14 @@ private static final long serialVersionUID = 1L; - protected Date now; + protected Date today; - public ContactDataInputDateAfterTodayException(Contact contact, Date now) { + public ContactDataInputDateAfterTodayException(Contact contact, Date today) { super(contact); - this.now = now; + this.today = today; } - public Date getNow() { - return now; + public Date getToday() { + return today; } } Deleted: trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/InvalidContactMainObserverException.java =================================================================== --- trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/InvalidContactMainObserverException.java 2014-04-07 17:10:27 UTC (rev 1859) +++ trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/InvalidContactMainObserverException.java 2014-04-07 17:13:57 UTC (rev 1860) @@ -1,18 +0,0 @@ -package fr.ifremer.wao.services.service; - -import fr.ifremer.wao.entity.Contact; - -/** - * Created on 4/7/14. - * - * @author Tony Chemit <chemit@codelutin.com> - * @since 4.0 - */ -public class InvalidContactMainObserverException extends WaoContactValidationException { - - private static final long serialVersionUID = 1L; - - public InvalidContactMainObserverException(Contact contact, String message) { - super(contact); - } -} Modified: trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/MismatchContactMainObserverCompanyException.java =================================================================== --- trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/MismatchContactMainObserverCompanyException.java 2014-04-07 17:10:27 UTC (rev 1859) +++ trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/MismatchContactMainObserverCompanyException.java 2014-04-07 17:13:57 UTC (rev 1860) @@ -18,7 +18,7 @@ protected WaoUser observer; - public MismatchContactMainObserverCompanyException(Contact contact, Company company, WaoUser observer) { + public MismatchContactMainObserverCompanyException(Contact contact, WaoUser observer, Company company) { super(contact); this.company = company; this.observer = observer; Copied: trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/MissingContactNbObservantsException.java (from rev 1859, trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/MissingContactNbObservantsForObservationDoneStateException.java) =================================================================== --- trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/MissingContactNbObservantsException.java (rev 0) +++ trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/MissingContactNbObservantsException.java 2014-04-07 17:13:57 UTC (rev 1860) @@ -0,0 +1,40 @@ +package fr.ifremer.wao.services.service; + +/* + * #%L + * Wao :: Services + * %% + * Copyright (C) 2009 - 2014 Ifremer + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero 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 Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ + +import fr.ifremer.wao.entity.Contact; + +/** + * Created on 4/4/14. + * + * @author Tony Chemit <chemit@codelutin.com> + * @since 4.0 + */ +public class MissingContactNbObservantsException extends WaoContactValidationException { + + private static final long serialVersionUID = 1L; + + public MissingContactNbObservantsException(Contact contact) { + super(contact); + } + +} Deleted: trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/MissingContactNbObservantsForObservationDoneStateException.java =================================================================== --- trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/MissingContactNbObservantsForObservationDoneStateException.java 2014-04-07 17:10:27 UTC (rev 1859) +++ trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/MissingContactNbObservantsForObservationDoneStateException.java 2014-04-07 17:13:57 UTC (rev 1860) @@ -1,40 +0,0 @@ -package fr.ifremer.wao.services.service; - -/* - * #%L - * Wao :: Services - * %% - * Copyright (C) 2009 - 2014 Ifremer - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero 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 Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ - -import fr.ifremer.wao.entity.Contact; - -/** - * Created on 4/4/14. - * - * @author Tony Chemit <chemit@codelutin.com> - * @since 4.0 - */ -public class MissingContactNbObservantsForObservationDoneStateException extends WaoContactValidationException { - - private static final long serialVersionUID = 1L; - - public MissingContactNbObservantsForObservationDoneStateException(Contact contact) { - super(contact); - } - -} Modified: trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ObsMerContactsService.java =================================================================== --- trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ObsMerContactsService.java 2014-04-07 17:10:27 UTC (rev 1859) +++ trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ObsMerContactsService.java 2014-04-07 17:13:57 UTC (rev 1860) @@ -282,7 +282,7 @@ } catch (UnwantedContactContactStateMotifException e) { String message = l(l, "wao.import.contact.failure.unwantedContactStateMotif"); throw new ImportErrorException(message); - } catch (MissingContactNbObservantsForObservationDoneStateException e) { + } catch (MissingContactNbObservantsException e) { String state = WaoUtils.l(l, e.getContact().getContactState()); String message = l(l, "wao.import.contact.failure.missingObserver", state); throw new ImportErrorException(message); @@ -372,7 +372,7 @@ MissingContactCommentException, MissingContactObservationBeginDateException, MissingContactObservationEndDateException, - MissingContactNbObservantsForObservationDoneStateException, + MissingContactNbObservantsException, MissingContactStateMotifException, UnwantedContactContactStateMotifException, MissingContactObservedDataControlException, @@ -419,7 +419,7 @@ boolean observerWorksForCompanyInSampleRow = mainObserver.getCompany().equals(company); if (!observerWorksForCompanyInSampleRow) { - throw new MismatchContactMainObserverCompanyException(contact, company, mainObserver); + throw new MismatchContactMainObserverCompanyException(contact, mainObserver, company); } } @@ -532,7 +532,7 @@ throw new MissingContactObservationEndDateException(contact); } if (contact.getNbObservants() == 0) { - throw new MissingContactNbObservantsForObservationDoneStateException(contact); + throw new MissingContactNbObservantsException(contact); } break; Modified: trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/EditContactAction.java =================================================================== --- trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/EditContactAction.java 2014-04-07 17:10:27 UTC (rev 1859) +++ trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/EditContactAction.java 2014-04-07 17:13:57 UTC (rev 1860) @@ -41,7 +41,7 @@ import fr.ifremer.wao.services.service.MissingContactDataInputDateException; import fr.ifremer.wao.services.service.MissingContactDataReliabilityException; import fr.ifremer.wao.services.service.MissingContactMainObserverException; -import fr.ifremer.wao.services.service.MissingContactNbObservantsForObservationDoneStateException; +import fr.ifremer.wao.services.service.MissingContactNbObservantsException; import fr.ifremer.wao.services.service.MissingContactObservationBeginDateException; import fr.ifremer.wao.services.service.MissingContactObservationEndDateException; import fr.ifremer.wao.services.service.MissingContactObservedDataControlException; @@ -113,7 +113,7 @@ } catch (UnwantedContactContactStateMotifException e) { addFieldError("updateContactCommand.contact.", t("wao.import.contact.failure.unwantedContactStateMotif")); - } catch (MissingContactNbObservantsForObservationDoneStateException e) { + } catch (MissingContactNbObservantsException e) { String state = WaoUtils.l(getLocale(), e.getContact().getContactState()); addFieldError("updateContactCommand.contact.", t("wao.import.contact.failure.missingObserver", state)); Modified: trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/ValidateContactJsonAction.java =================================================================== --- trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/ValidateContactJsonAction.java 2014-04-07 17:10:27 UTC (rev 1859) +++ trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/ValidateContactJsonAction.java 2014-04-07 17:13:57 UTC (rev 1860) @@ -41,14 +41,13 @@ import fr.ifremer.wao.services.service.MissingContactDataInputDateException; import fr.ifremer.wao.services.service.MissingContactDataReliabilityException; import fr.ifremer.wao.services.service.MissingContactMainObserverException; -import fr.ifremer.wao.services.service.MissingContactNbObservantsForObservationDoneStateException; +import fr.ifremer.wao.services.service.MissingContactNbObservantsException; import fr.ifremer.wao.services.service.MissingContactObservationBeginDateException; import fr.ifremer.wao.services.service.MissingContactObservationEndDateException; import fr.ifremer.wao.services.service.MissingContactObservedDataControlException; import fr.ifremer.wao.services.service.MissingContactRestitutionException; import fr.ifremer.wao.services.service.MissingContactStateMotifException; import fr.ifremer.wao.services.service.UnwantedContactContactStateMotifException; -import fr.ifremer.wao.services.service.WaoContactValidationException; import fr.ifremer.wao.services.service.ObsMerContactsService; import fr.ifremer.wao.services.service.UpdateContactCommand; import fr.ifremer.wao.web.WaoJsonActionSupport; @@ -173,7 +172,7 @@ } catch (UnwantedContactContactStateMotifException e) { errorMessage = t("wao.import.contact.failure.unwantedContactStateMotif"); - } catch (MissingContactNbObservantsForObservationDoneStateException e) { + } catch (MissingContactNbObservantsException e) { String state = WaoUtils.l(getLocale(), e.getContact().getContactState()); errorMessage = t("wao.import.contact.failure.missingObserver", state);
participants (1)
-
tchemit@users.forge.codelutin.com