r2173 - in trunk: . wao-persistence wao-persistence/src/main/java/fr/ifremer/wao/entity wao-persistence/src/main/resources/db/migration wao-persistence/src/main/xmi wao-services wao-web
Author: bleny Date: 2014-07-29 11:12:24 +0200 (Tue, 29 Jul 2014) New Revision: 2173 Url: http://forge.codelutin.com/projects/wao/repository/revisions/2173 Log: use conventions for version Modified: trunk/pom.xml trunk/wao-persistence/pom.xml trunk/wao-persistence/src/main/java/fr/ifremer/wao/entity/ContactState.java trunk/wao-persistence/src/main/java/fr/ifremer/wao/entity/ObsProgram.java trunk/wao-persistence/src/main/java/fr/ifremer/wao/entity/SampleRowImpl.java trunk/wao-persistence/src/main/java/fr/ifremer/wao/entity/SampleRowLogImpl.java trunk/wao-persistence/src/main/java/fr/ifremer/wao/entity/UserRole.java trunk/wao-persistence/src/main/resources/db/migration/V4_1__clean_database.sql trunk/wao-persistence/src/main/xmi/wao-model.zargo trunk/wao-services/pom.xml trunk/wao-web/pom.xml Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2014-07-28 14:08:37 UTC (rev 2172) +++ trunk/pom.xml 2014-07-29 09:12:24 UTC (rev 2173) @@ -10,7 +10,7 @@ <groupId>fr.ifremer</groupId> <artifactId>wao</artifactId> - <version>4.1.SNAPSHOT</version> + <version>4.1-SNAPSHOT</version> <packaging>pom</packaging> <name>Wao</name> Modified: trunk/wao-persistence/pom.xml =================================================================== --- trunk/wao-persistence/pom.xml 2014-07-28 14:08:37 UTC (rev 2172) +++ trunk/wao-persistence/pom.xml 2014-07-29 09:12:24 UTC (rev 2173) @@ -5,7 +5,7 @@ <parent> <groupId>fr.ifremer</groupId> <artifactId>wao</artifactId> - <version>4.1.SNAPSHOT</version> + <version>4.1-SNAPSHOT</version> </parent> <artifactId>wao-persistence</artifactId> Modified: trunk/wao-persistence/src/main/java/fr/ifremer/wao/entity/ContactState.java =================================================================== --- trunk/wao-persistence/src/main/java/fr/ifremer/wao/entity/ContactState.java 2014-07-28 14:08:37 UTC (rev 2172) +++ trunk/wao-persistence/src/main/java/fr/ifremer/wao/entity/ContactState.java 2014-07-29 09:12:24 UTC (rev 2173) @@ -50,25 +50,25 @@ public enum ContactState implements I18nAble{ /** Usually, the first step, observer just contacted someone */ - CONTACT_START(n("ContactState.CONTACT_START"), false, false, false, true), + CONTACT_START(n("ContactState.CONTACT_START"), false, false, false), /** Observer has now someone to meet */ - OBSERVATION_EXPECTED(n("ContactState.OBSERVATION_EXPECTED"), false, false, true, true), + OBSERVATION_EXPECTED(n("ContactState.OBSERVATION_EXPECTED"), false, false, true), /** Observation was done, all data have been collected. Everything is fine */ - OBSERVATION_DONE(n("ContactState.OBSERVATION_DONE"), true, false, true, true), + OBSERVATION_DONE(n("ContactState.OBSERVATION_DONE"), true, false, true), /** Observer failed to collect data, weather or any other circumstances made data collection impossible */ - OBSERVATION_CANCELLED(n("ContactState.OBSERVATION_CANCELLED"), true, true, true, false), + OBSERVATION_CANCELLED(n("ContactState.OBSERVATION_CANCELLED"), true, true, true), /** After a contact start, people contacted refused the observation. Observer may try later. */ - CONTACT_REFUSED(n("ContactState.CONTACT_REFUSED"), true ,true, false, true), + CONTACT_REFUSED(n("ContactState.CONTACT_REFUSED"), true ,true, false), /** After a contact refused, people contacted still refuse the observation. Observer may not try later. */ - CONTACT_DEFINITELY_REFUSED(n("ContactState.CONTACT_DEFINITELY_REFUSED"), true, true, false, true), + CONTACT_DEFINITELY_REFUSED(n("ContactState.CONTACT_DEFINITELY_REFUSED"), true, true, false), /** On the work field, observer choose not to get in touch with the people from the boat */ - OBSERVATION_NOT_DONE(n("ContactState.OBSERVATION_NOT_DONE"), true, false, false, true); + OBSERVATION_NOT_DONE(n("ContactState.OBSERVATION_NOT_DONE"), true, false, false); private String i18nKey; @@ -81,16 +81,12 @@ /** true if this value can be used for a contact of program {@link fr.ifremer.wao.entity.ObsProgram#OBSVENTE} */ protected boolean allowedForObsVente; - /** true if this value can be used for a contact of program {@link fr.ifremer.wao.entity.ObsProgram#OBSDEB} */ - protected boolean allowedForObsDeb; - ContactState(String i18nKey, boolean finalState, boolean unfinishedState, - boolean allowedForObsVente, boolean allowedForObsDeb) { + boolean allowedForObsVente) { this.i18nKey = i18nKey; this.finalState = finalState; this.unfinishedState = unfinishedState; this.allowedForObsVente = allowedForObsVente; - this.allowedForObsDeb = allowedForObsDeb; } @Override @@ -128,7 +124,7 @@ } else if (obsProgram == ObsProgram.OBSVENTE) { allowed = allowedForObsVente; } else { - allowed = allowedForObsDeb; + throw new IllegalStateException(); } return allowed; } Modified: trunk/wao-persistence/src/main/java/fr/ifremer/wao/entity/ObsProgram.java =================================================================== --- trunk/wao-persistence/src/main/java/fr/ifremer/wao/entity/ObsProgram.java 2014-07-28 14:08:37 UTC (rev 2172) +++ trunk/wao-persistence/src/main/java/fr/ifremer/wao/entity/ObsProgram.java 2014-07-29 09:12:24 UTC (rev 2173) @@ -25,8 +25,7 @@ public enum ObsProgram implements I18nAble { OBSMER("M", n("ObsProgram.OBSMER")), - OBSVENTE("V", n("ObsProgram.OBSVENTE")), - OBSDEB("D", n("ObsProgram.OBSDEB")); + OBSVENTE("V", n("ObsProgram.OBSVENTE")); protected String i18nKey; @@ -58,10 +57,6 @@ return OBSVENTE == this; } - public boolean isObsDeb() { - return OBSDEB == this; - } - @Override public String getI18nKey() { return i18nKey; Modified: trunk/wao-persistence/src/main/java/fr/ifremer/wao/entity/SampleRowImpl.java =================================================================== --- trunk/wao-persistence/src/main/java/fr/ifremer/wao/entity/SampleRowImpl.java 2014-07-28 14:08:37 UTC (rev 2172) +++ trunk/wao-persistence/src/main/java/fr/ifremer/wao/entity/SampleRowImpl.java 2014-07-29 09:12:24 UTC (rev 2173) @@ -24,7 +24,6 @@ package fr.ifremer.wao.entity; -import com.google.common.base.Preconditions; import com.google.common.collect.Iterables; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; @@ -258,9 +257,6 @@ @Override public SampleMonth getSampleMonth(Date date) { - Preconditions.checkState( - !getObsProgram().equals(ObsProgram.OBSDEB), - "opération non prévue pour ObsDeb"); if (isSampleMonthNotEmpty()) { for (SampleMonth sampleMonth : getSampleMonth()) { if (sampleMonth.isPeriodDatesContains(date)) { Modified: trunk/wao-persistence/src/main/java/fr/ifremer/wao/entity/SampleRowLogImpl.java =================================================================== --- trunk/wao-persistence/src/main/java/fr/ifremer/wao/entity/SampleRowLogImpl.java 2014-07-28 14:08:37 UTC (rev 2172) +++ trunk/wao-persistence/src/main/java/fr/ifremer/wao/entity/SampleRowLogImpl.java 2014-07-29 09:12:24 UTC (rev 2173) @@ -25,7 +25,6 @@ package fr.ifremer.wao.entity; import com.google.common.collect.Maps; -import fr.ifremer.wao.WaoUtils; import org.apache.commons.lang3.StringUtils; import org.nuiton.topia.persistence.TopiaEntities; import org.nuiton.util.DateUtil; @@ -399,17 +398,6 @@ } } - protected void compareDays() { - if (oldRow == null) { - addChange("Le jour est " + WaoUtils.formatDate(newRow.getExpectedDate())); - } else { - if (DateUtil.getDifferenceInDays(oldRow.getExpectedDate(), newRow.getExpectedDate()) >= 1) { - addChange("L'observation est déplacée du " + WaoUtils.formatDate(oldRow.getExpectedDate()) - + " au " + WaoUtils.formatDate(newRow.getExpectedDate())); - } - } - } - protected void compareObservers() { Collection<WaoUser> oldObservers; @@ -525,17 +513,6 @@ compareFishingZones(); compareAverageObservationsCount(); } - if (ObsProgram.OBSDEB.equals(obsProgram)) { - compareDays(); - if (newRow.isPhoneCall()) { - compareBoats(); - compareTerrestrialLocations(); - } else { - compareObservationUnits(); - } - compareObservers(); - compareBlankRows(); - } compareCompanies(); this.oldRow = null; Modified: trunk/wao-persistence/src/main/java/fr/ifremer/wao/entity/UserRole.java =================================================================== --- trunk/wao-persistence/src/main/java/fr/ifremer/wao/entity/UserRole.java 2014-07-28 14:08:37 UTC (rev 2172) +++ trunk/wao-persistence/src/main/java/fr/ifremer/wao/entity/UserRole.java 2014-07-29 09:12:24 UTC (rev 2173) @@ -84,9 +84,6 @@ allowedRoles.add(UserRole.OBSERVER); if (userRole.equals(UserRole.ADMIN)) { allowedRoles.add(UserRole.ADMIN); - if ( ! obsProgram.equals(ObsProgram.OBSDEB)) { - allowedRoles.add(UserRole.GUEST); - } if (obsProgram.equals(ObsProgram.OBSMER)) { allowedRoles.add(UserRole.PROFESSIONAL); } Modified: trunk/wao-persistence/src/main/resources/db/migration/V4_1__clean_database.sql =================================================================== --- trunk/wao-persistence/src/main/resources/db/migration/V4_1__clean_database.sql 2014-07-28 14:08:37 UTC (rev 2172) +++ trunk/wao-persistence/src/main/resources/db/migration/V4_1__clean_database.sql 2014-07-29 09:12:24 UTC (rev 2173) @@ -21,3 +21,26 @@ -- we no longer user topia migration service drop table tms_version; + +-- ménage sur SampleRow + +ALTER TABLE samplerow DROP COLUMN expecteddate; +ALTER TABLE samplerow DROP COLUMN blankrow; +DROP TABLE observers_samplerow; +ALTER TABLE samplerow DROP COLUMN boat; +ALTER TABLE samplerow DROP COLUMN observationunit; +ALTER TABLE samplerow DROP COLUMN observationtypeordinal; +ALTER TABLE samplerow DROP COLUMN groupname; + +-- ménage sur Contact + +ALTER TABLE contact DROP COLUMN obsdebcode; +ALTER TABLE contact DROP COLUMN landingdate; +ALTER TABLE contact DROP COLUMN observationtypeordinal; + +-- Suprresion des référentiels obsolètes + +DROP TABLE terrestrialDivision; +DROP TABLE obsdebcodedetails; +DROP TABLE obsdebcode; + Modified: trunk/wao-persistence/src/main/xmi/wao-model.zargo =================================================================== (Binary files differ) Modified: trunk/wao-services/pom.xml =================================================================== --- trunk/wao-services/pom.xml 2014-07-28 14:08:37 UTC (rev 2172) +++ trunk/wao-services/pom.xml 2014-07-29 09:12:24 UTC (rev 2173) @@ -5,7 +5,7 @@ <parent> <groupId>fr.ifremer</groupId> <artifactId>wao</artifactId> - <version>4.1.SNAPSHOT</version> + <version>4.1-SNAPSHOT</version> </parent> <artifactId>wao-services</artifactId> Modified: trunk/wao-web/pom.xml =================================================================== --- trunk/wao-web/pom.xml 2014-07-28 14:08:37 UTC (rev 2172) +++ trunk/wao-web/pom.xml 2014-07-29 09:12:24 UTC (rev 2173) @@ -5,7 +5,7 @@ <parent> <groupId>fr.ifremer</groupId> <artifactId>wao</artifactId> - <version>4.1.SNAPSHOT</version> + <version>4.1-SNAPSHOT</version> </parent> <artifactId>wao-web</artifactId>
participants (1)
-
bleny@users.forge.codelutin.com