Tony CHEMIT pushed to branch develop at ultreiaio / ird-t3
Commits:
-
455478ec
by Tony CHEMIT at 2018-03-19T17:27:41Z
15 changed files:
- t3-actions/src/main/java/fr/ird/t3/actions/data/level0/ComputeRF1Action.java
- t3-actions/src/main/java/fr/ird/t3/actions/data/level0/ComputeRF1Configuration.java
- t3-actions/src/main/resources/ftl/fr/ird/t3/actions/data/level0/ComputeRF1Action.ftl
- t3-actions/src/main/resources/ftl/fr/ird/t3/actions/data/level0/ComputeRF1Action_en.ftl
- t3-web/src/main/java/fr/ird/t3/web/actions/T3ActionSupport.java
- t3-web/src/main/java/fr/ird/t3/web/actions/data/level0/AbstractLevel0ConfigureAction.java
- t3-web/src/main/java/fr/ird/t3/web/actions/data/level0/AbstractLevel0RunAction.java
- t3-web/src/main/java/fr/ird/t3/web/actions/data/level0/ComputeRF1ConfigureAction.java
- t3-web/src/main/java/fr/ird/t3/web/actions/data/level0/ComputeRF1RunAction.java
- t3-web/src/main/java/fr/ird/t3/web/actions/data/level0/ComputeRF2ConfigureAction.java
- t3-web/src/main/java/fr/ird/t3/web/actions/data/level0/ComputeRF2RunAction.java
- t3-web/src/main/resources/i18n/t3-web_en_GB.properties
- t3-web/src/main/resources/i18n/t3-web_fr_FR.properties
- t3-web/src/main/webapp/WEB-INF/jsp/data/level0/ComputeRF1Config.jsp
- t3-web/src/main/webapp/WEB-INF/jsp/data/level0/ComputeRF1ConfigResume.jsp
Changes:
| ... | ... | @@ -273,7 +273,8 @@ public class ComputeRF1Action extends AbstractLevel0Action<ComputeRF1Configurati |
| 273 | 273 |
// means there is so species for this complete trip so rf1 = 1.0
|
| 274 | 274 |
rf1 = 1.0f;
|
| 275 | 275 |
} else {
|
| 276 |
- rf1 = computeRF1ForCompleteTrip(completeTrip, species);
|
|
| 276 |
+ boolean useLegacyBehaviourForTripWithoutLanding = getConfiguration().isUseLegacyBehaviourForTripWithoutLanding();
|
|
| 277 |
+ rf1 = computeRF1ForCompleteTrip(useLegacyBehaviourForTripWithoutLanding, completeTrip, species);
|
|
| 277 | 278 |
if (rf1 < minimumRate) {
|
| 278 | 279 |
String warnMessage =
|
| 279 | 280 |
l(locale, "t3.level0.computeRF1.warning.too.low.rf1",
|
| ... | ... | @@ -333,24 +334,29 @@ public class ComputeRF1Action extends AbstractLevel0Action<ComputeRF1Configurati |
| 333 | 334 |
decorate(completeTrip.getLandingTrip()), totalCatchWeightRF1, totalLandingWeight));
|
| 334 | 335 |
}
|
| 335 | 336 |
|
| 336 |
- private float computeRF1ForCompleteTrip(Iterable<Trip> completeTrip, Collection<Species> speciesList) {
|
|
| 337 |
+ private float computeRF1ForCompleteTrip(boolean useLegacyBehaviourForTripWithoutLanding, CompleteTrip completeTrip, Collection<Species> speciesList) {
|
|
| 337 | 338 |
// do the computation of rf1 for all trips of the complete trip
|
| 338 | 339 |
float sumLanding = 0;
|
| 339 | 340 |
float sumCatch = 0;
|
| 340 | 341 |
float sumLocalMarket = 0;
|
| 341 | 342 |
float sumLocalMarketDetailled = 0;
|
| 343 |
+ int tripWithoutLanding = 0;
|
|
| 342 | 344 |
for (Trip trip : completeTrip) {
|
| 343 | 345 |
String tripStr = decorate(trip, DecoratorService.WITH_ID);
|
| 344 | 346 |
log.debug(String.format("Start count for trip %s", tripStr));
|
| 345 | 347 |
float elementaryLandingTotalWeight = trip.getElementaryLandingTotalWeight(speciesList);
|
| 346 | 348 |
float elementaryCatchTotalWeight = trip.getElementaryCatchTotalWeight(speciesList);
|
| 349 |
+ boolean noLanding = elementaryLandingTotalWeight == 0;
|
|
| 350 |
+ if (noLanding) {
|
|
| 351 |
+ tripWithoutLanding++;
|
|
| 352 |
+ }
|
|
| 347 | 353 |
if (elementaryCatchTotalWeight == 0 && elementaryLandingTotalWeight > 0) {
|
| 348 | 354 |
// Add a warning, seems not possible to have no catches and landing :
|
| 349 | 355 |
// the logBookAvailability flag should be setted to 0.
|
| 350 | 356 |
addWarningMessage(l(locale, "t3.level0.computeRF1.warning.no.catches.but.some.landings",
|
| 351 | 357 |
tripStr, elementaryLandingTotalWeight));
|
| 352 | 358 |
}
|
| 353 |
- if (elementaryCatchTotalWeight > 0 && elementaryLandingTotalWeight == 0) {
|
|
| 359 |
+ if (elementaryCatchTotalWeight > 0 && noLanding) {
|
|
| 354 | 360 |
// Special case : no landing: do not take account of the catch weight
|
| 355 | 361 |
// in fact (see https://gitlab.com/ultreiaio/ird-t3/issues/283), we do not want to loose this catches
|
| 356 | 362 |
//elementaryCatchTotalWeight = 0;
|
| ... | ... | @@ -372,7 +378,8 @@ public class ComputeRF1Action extends AbstractLevel0Action<ComputeRF1Configurati |
| 372 | 378 |
sumLocalMarketDetailled += localMarketTotalWeightDetailled;
|
| 373 | 379 |
}
|
| 374 | 380 |
float rf1 = 1;
|
| 375 |
- if (sumCatch > 0) {
|
|
| 381 |
+ boolean computeRF1 = sumCatch > 0 && (useLegacyBehaviourForTripWithoutLanding || tripWithoutLanding == 0);
|
|
| 382 |
+ if (computeRF1) {
|
|
| 376 | 383 |
rf1 = sumLanding / sumCatch;
|
| 377 | 384 |
}
|
| 378 | 385 |
log.debug(String.format("Computed rf1 %s", rf1));
|
| ... | ... | @@ -42,6 +42,8 @@ public class ComputeRF1Configuration extends AbstractLevel0Configuration { |
| 42 | 42 |
private float minimumRate;
|
| 43 | 43 |
/** Maximum rf1 rate acceptable. */
|
| 44 | 44 |
private float maximumRate;
|
| 45 |
+ /** Flag to use or not legacy behaviour when you treat trips without landings. */
|
|
| 46 |
+ private boolean useLegacyBehaviourForTripWithoutLanding;
|
|
| 45 | 47 |
|
| 46 | 48 |
public ComputeRF1Configuration() {
|
| 47 | 49 |
super(Level0Step.COMPUTE_RF1);
|
| ... | ... | @@ -62,4 +64,12 @@ public class ComputeRF1Configuration extends AbstractLevel0Configuration { |
| 62 | 64 |
public void setMaximumRate(float maximumRate) {
|
| 63 | 65 |
this.maximumRate = maximumRate;
|
| 64 | 66 |
}
|
| 67 |
+ |
|
| 68 |
+ public boolean isUseLegacyBehaviourForTripWithoutLanding() {
|
|
| 69 |
+ return useLegacyBehaviourForTripWithoutLanding;
|
|
| 70 |
+ }
|
|
| 71 |
+ |
|
| 72 |
+ public void setUseLegacyBehaviourForTripWithoutLanding(boolean useLegacyBehaviourForTripWithoutLanding) {
|
|
| 73 |
+ this.useLegacyBehaviourForTripWithoutLanding = useLegacyBehaviourForTripWithoutLanding;
|
|
| 74 |
+ }
|
|
| 65 | 75 |
}
|
| ... | ... | @@ -33,6 +33,13 @@ Type de navire sélectionné : ${vesselSimpleType} |
| 33 | 33 |
Flotte sélectionnée : ${fleet}
|
| 34 | 34 |
</#list>
|
| 35 | 35 |
|
| 36 |
+Gestion des marées sans débarquement :
|
|
| 37 |
+<#if !configuration.useLegacyBehaviourForTripWithoutLanding>
|
|
| 38 |
+Attribuer RF1=1 sur les marées composées avec défaut de débarquement
|
|
| 39 |
+<#else >
|
|
| 40 |
+Calculer un RF1 sur les marées composées avec défaut de débarquement
|
|
| 41 |
+</#if>
|
|
| 42 |
+ |
|
| 36 | 43 |
Indicateurs
|
| 37 | 44 |
-----------
|
| 38 | 45 |
|
| ... | ... | @@ -18,6 +18,7 @@ |
| 18 | 18 |
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
| 19 | 19 |
#L%
|
| 20 | 20 |
-->
|
| 21 |
+<#--#TODO-->
|
|
| 21 | 22 |
<#include "/ftl/header_en.ftl"/>
|
| 22 | 23 |
|
| 23 | 24 |
Begin date: ${configuration.beginDate}
|
| ... | ... | @@ -33,6 +34,13 @@ Selected simple vessel type: ${vesselSimpleType} |
| 33 | 34 |
Selected fleet: ${fleet}
|
| 34 | 35 |
</#list>
|
| 35 | 36 |
|
| 37 |
+Trip without landing management:
|
|
| 38 |
+<#if !configuration.useLegacyBehaviourForTripWithoutLanding>
|
|
| 39 |
+Attribuer RF1=1 sur les marées composées avec défaut de débarquement
|
|
| 40 |
+<#else >
|
|
| 41 |
+Calculer un RF1 sur les marées composées avec défaut de débarquement
|
|
| 42 |
+</#if>
|
|
| 43 |
+ |
|
| 36 | 44 |
Indicators
|
| 37 | 45 |
----------
|
| 38 | 46 |
|
| ... | ... | @@ -328,4 +328,11 @@ public class T3ActionSupport extends ActionSupport implements T3TopiaPersistence |
| 328 | 328 |
"false", t("t3.label.data.level1.configuration.useOnlyRfTot"));
|
| 329 | 329 |
}
|
| 330 | 330 |
|
| 331 |
+ |
|
| 332 |
+ protected ImmutableMap<String, String> createUseLegacyBehaviourForTripWithoutLandingOrNot() {
|
|
| 333 |
+ return ImmutableMap.of(
|
|
| 334 |
+ "false", t("t3.label.level0.configuration.rf1.useNewBehaviourForTripWithoutLanding"),
|
|
| 335 |
+ "true", t("t3.label.level0.configuration.rf1.useLegacyBehaviourForTripWithoutLanding"));
|
|
| 336 |
+ }
|
|
| 337 |
+ |
|
| 331 | 338 |
}
|
| ... | ... | @@ -8,12 +8,12 @@ |
| 8 | 8 |
* it under the terms of the GNU Affero General Public License as published by
|
| 9 | 9 |
* the Free Software Foundation, either version 3 of the License, or
|
| 10 | 10 |
* (at your option) any later version.
|
| 11 |
- *
|
|
| 11 |
+ *
|
|
| 12 | 12 |
* This program is distributed in the hope that it will be useful,
|
| 13 | 13 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 14 | 14 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 15 | 15 |
* GNU General Public License for more details.
|
| 16 |
- *
|
|
| 16 |
+ *
|
|
| 17 | 17 |
* You should have received a copy of the GNU Affero General Public License
|
| 18 | 18 |
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
| 19 | 19 |
* #L%
|
| ... | ... | @@ -25,18 +25,16 @@ import fr.ird.t3.entities.data.Trip; |
| 25 | 25 |
import fr.ird.t3.entities.data.TripTopiaDao;
|
| 26 | 26 |
import fr.ird.t3.entities.reference.Country;
|
| 27 | 27 |
import fr.ird.t3.entities.reference.CountryTopiaDao;
|
| 28 |
-import fr.ird.t3.entities.reference.Vessel;
|
|
| 29 | 28 |
import fr.ird.t3.entities.reference.VesselSimpleType;
|
| 30 | 29 |
import fr.ird.t3.entities.reference.VesselSimpleTypeTopiaDao;
|
| 31 |
-import fr.ird.t3.entities.reference.VesselTopiaDao;
|
|
| 32 | 30 |
import fr.ird.t3.entities.type.T3Date;
|
| 33 | 31 |
import fr.ird.t3.services.ioc.InjectDAO;
|
| 34 | 32 |
import fr.ird.t3.services.ioc.InjectDecoratedBeans;
|
| 35 | 33 |
import fr.ird.t3.web.actions.AbstractConfigureAction;
|
| 36 |
-import java.util.Map;
|
|
| 37 | 34 |
import org.apache.commons.logging.Log;
|
| 38 | 35 |
import org.apache.commons.logging.LogFactory;
|
| 39 |
-import org.nuiton.topia.persistence.TopiaException;
|
|
| 36 |
+ |
|
| 37 |
+import java.util.Map;
|
|
| 40 | 38 |
|
| 41 | 39 |
/**
|
| 42 | 40 |
* Abstract level 0 configuration action.
|
| ... | ... | @@ -48,34 +46,27 @@ public abstract class AbstractLevel0ConfigureAction<C extends AbstractLevel0Conf |
| 48 | 46 |
|
| 49 | 47 |
private static final long serialVersionUID = 1L;
|
| 50 | 48 |
|
| 51 |
- /** Logger. */
|
|
| 52 |
- private static final Log log =
|
|
| 53 |
- LogFactory.getLog(AbstractLevel0ConfigureAction.class);
|
|
| 49 |
+ private static final Log log = LogFactory.getLog(AbstractLevel0ConfigureAction.class);
|
|
| 54 | 50 |
|
| 55 | 51 |
@InjectDAO(entityType = Trip.class)
|
| 56 | 52 |
protected transient TripTopiaDao tripDAO;
|
| 57 |
- |
|
| 58 |
- @InjectDAO(entityType = Vessel.class)
|
|
| 59 |
- protected transient VesselTopiaDao vesselDAO;
|
|
| 60 |
- |
|
| 61 |
- @InjectDAO(entityType = Country.class)
|
|
| 62 |
- protected transient CountryTopiaDao countryDAO;
|
|
| 63 |
- |
|
| 64 |
- @InjectDAO(entityType = VesselSimpleType.class)
|
|
| 65 |
- protected transient VesselSimpleTypeTopiaDao vesselSimpleTypeDAO;
|
|
| 66 |
- |
|
| 53 |
+ // @InjectDAO(entityType = Vessel.class)
|
|
| 54 |
+// private transient VesselTopiaDao vesselDAO;
|
|
| 67 | 55 |
@InjectDecoratedBeans(beanType = VesselSimpleType.class)
|
| 68 | 56 |
protected Map<String, String> vesselSimpleTypes;
|
| 69 |
- |
|
| 70 | 57 |
@InjectDecoratedBeans(beanType = Country.class)
|
| 71 | 58 |
protected Map<String, String> fleets;
|
| 59 |
+ @InjectDAO(entityType = Country.class)
|
|
| 60 |
+ private transient CountryTopiaDao countryDAO;
|
|
| 61 |
+ @InjectDAO(entityType = VesselSimpleType.class)
|
|
| 62 |
+ private transient VesselSimpleTypeTopiaDao vesselSimpleTypeDAO;
|
|
| 72 | 63 |
|
| 73 |
- protected AbstractLevel0ConfigureAction(Class<C> configurationType) {
|
|
| 64 |
+ AbstractLevel0ConfigureAction(Class<C> configurationType) {
|
|
| 74 | 65 |
super(configurationType);
|
| 75 | 66 |
}
|
| 76 | 67 |
|
| 77 | 68 |
@Override
|
| 78 |
- public final void prepare() throws Exception {
|
|
| 69 |
+ public void prepare() throws Exception {
|
|
| 79 | 70 |
|
| 80 | 71 |
// always invalidate configuration status
|
| 81 | 72 |
setConfirm(false);
|
| ... | ... | @@ -132,9 +123,8 @@ public abstract class AbstractLevel0ConfigureAction<C extends AbstractLevel0Conf |
| 132 | 123 |
* Loads the default configuration.
|
| 133 | 124 |
*
|
| 134 | 125 |
* @param config the configuration to fill
|
| 135 |
- * @throws TopiaException if any error while loading data from T3 database
|
|
| 136 | 126 |
*/
|
| 137 |
- protected void loadDefaultConfiguration(C config) throws TopiaException {
|
|
| 127 |
+ protected void loadDefaultConfiguration(C config) {
|
|
| 138 | 128 |
|
| 139 | 129 |
T3Date minDate = tripDAO.getFirstLandingDate(false);
|
| 140 | 130 |
config.setMinDate(minDate);
|
| ... | ... | @@ -46,7 +46,7 @@ public abstract class AbstractLevel0RunAction<C extends AbstractLevel0Configurat |
| 46 | 46 |
@InjectDecoratedBeans(beanType = Country.class, filterById = true)
|
| 47 | 47 |
private Map<String, String> fleets;
|
| 48 | 48 |
|
| 49 |
- protected AbstractLevel0RunAction(Class<A> actionType) {
|
|
| 49 |
+ AbstractLevel0RunAction(Class<A> actionType) {
|
|
| 50 | 50 |
super(actionType);
|
| 51 | 51 |
}
|
| 52 | 52 |
|
| ... | ... | @@ -59,15 +59,8 @@ public abstract class AbstractLevel0RunAction<C extends AbstractLevel0Configurat |
| 59 | 59 |
}
|
| 60 | 60 |
|
| 61 | 61 |
@Override
|
| 62 |
- protected Map<String, Object> prepareResumeParameters(A action,
|
|
| 63 |
- Exception error,
|
|
| 64 |
- Date startDate,
|
|
| 65 |
- Date endDate) {
|
|
| 66 |
- Map<String, Object> map = super.prepareResumeParameters(action,
|
|
| 67 |
- error,
|
|
| 68 |
- startDate,
|
|
| 69 |
- endDate
|
|
| 70 |
- );
|
|
| 62 |
+ protected Map<String, Object> prepareResumeParameters(A action, Exception error, Date startDate, Date endDate) {
|
|
| 63 |
+ Map<String, Object> map = super.prepareResumeParameters(action, error, startDate, endDate);
|
|
| 71 | 64 |
map.put("vesselSimpleTypes", vesselSimpleTypes);
|
| 72 | 65 |
map.put("fleets", fleets);
|
| 73 | 66 |
return map;
|
| ... | ... | @@ -8,12 +8,12 @@ |
| 8 | 8 |
* it under the terms of the GNU Affero General Public License as published by
|
| 9 | 9 |
* the Free Software Foundation, either version 3 of the License, or
|
| 10 | 10 |
* (at your option) any later version.
|
| 11 |
- *
|
|
| 11 |
+ *
|
|
| 12 | 12 |
* This program is distributed in the hope that it will be useful,
|
| 13 | 13 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 14 | 14 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 15 | 15 |
* GNU General Public License for more details.
|
| 16 |
- *
|
|
| 16 |
+ *
|
|
| 17 | 17 |
* You should have received a copy of the GNU Affero General Public License
|
| 18 | 18 |
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
| 19 | 19 |
* #L%
|
| ... | ... | @@ -22,7 +22,8 @@ package fr.ird.t3.web.actions.data.level0; |
| 22 | 22 |
|
| 23 | 23 |
import fr.ird.t3.actions.data.level0.ComputeRF1Action;
|
| 24 | 24 |
import fr.ird.t3.actions.data.level0.ComputeRF1Configuration;
|
| 25 |
-import org.nuiton.topia.persistence.TopiaException;
|
|
| 25 |
+ |
|
| 26 |
+import java.util.Map;
|
|
| 26 | 27 |
|
| 27 | 28 |
/**
|
| 28 | 29 |
* To configure the Compute Raising factor 1 action.
|
| ... | ... | @@ -35,15 +36,27 @@ public class ComputeRF1ConfigureAction extends AbstractLevel0ConfigureAction<Com |
| 35 | 36 |
|
| 36 | 37 |
private static final long serialVersionUID = 1L;
|
| 37 | 38 |
|
| 39 |
+ private Map<String, String> useLegacyBehaviourForTripWithoutLandingOrNot;
|
|
| 40 |
+ |
|
| 38 | 41 |
public ComputeRF1ConfigureAction() {
|
| 39 | 42 |
super(ComputeRF1Configuration.class);
|
| 40 | 43 |
}
|
| 41 | 44 |
|
| 42 | 45 |
@Override
|
| 43 |
- protected void loadDefaultConfiguration(ComputeRF1Configuration config) throws TopiaException {
|
|
| 46 |
+ public void prepare() throws Exception {
|
|
| 47 |
+ useLegacyBehaviourForTripWithoutLandingOrNot = createUseLegacyBehaviourForTripWithoutLandingOrNot();
|
|
| 48 |
+ super.prepare();
|
|
| 49 |
+ }
|
|
| 44 | 50 |
|
| 51 |
+ @Override
|
|
| 52 |
+ protected void loadDefaultConfiguration(ComputeRF1Configuration config) {
|
|
| 45 | 53 |
super.loadDefaultConfiguration(config);
|
| 46 | 54 |
config.setMinimumRate(getApplicationConfig().getRf1MinimumRate());
|
| 47 | 55 |
config.setMaximumRate(getApplicationConfig().getRf1MaximumRate());
|
| 48 | 56 |
}
|
| 57 |
+ |
|
| 58 |
+ @SuppressWarnings("unused")
|
|
| 59 |
+ public Map<String, String> getUseLegacyBehaviourForTripWithoutLandingOrNot() {
|
|
| 60 |
+ return useLegacyBehaviourForTripWithoutLandingOrNot;
|
|
| 61 |
+ }
|
|
| 49 | 62 |
}
|
| ... | ... | @@ -8,12 +8,12 @@ |
| 8 | 8 |
* it under the terms of the GNU Affero General Public License as published by
|
| 9 | 9 |
* the Free Software Foundation, either version 3 of the License, or
|
| 10 | 10 |
* (at your option) any later version.
|
| 11 |
- *
|
|
| 11 |
+ *
|
|
| 12 | 12 |
* This program is distributed in the hope that it will be useful,
|
| 13 | 13 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 14 | 14 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 15 | 15 |
* GNU General Public License for more details.
|
| 16 |
- *
|
|
| 16 |
+ *
|
|
| 17 | 17 |
* You should have received a copy of the GNU Affero General Public License
|
| 18 | 18 |
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
| 19 | 19 |
* #L%
|
| ... | ... | @@ -23,6 +23,8 @@ package fr.ird.t3.web.actions.data.level0; |
| 23 | 23 |
import fr.ird.t3.actions.data.level0.ComputeRF1Action;
|
| 24 | 24 |
import fr.ird.t3.actions.data.level0.ComputeRF1Configuration;
|
| 25 | 25 |
|
| 26 |
+import java.util.Map;
|
|
| 27 |
+ |
|
| 26 | 28 |
/**
|
| 27 | 29 |
* Compute Raising factor 1 for some selected vessels.
|
| 28 | 30 |
*
|
| ... | ... | @@ -34,7 +36,21 @@ public class ComputeRF1RunAction extends AbstractLevel0RunAction<ComputeRF1Confi |
| 34 | 36 |
|
| 35 | 37 |
private static final long serialVersionUID = 1L;
|
| 36 | 38 |
|
| 39 |
+ private Map<String, String> useLegacyBehaviourForTripWithoutLandingOrNot;
|
|
| 40 |
+ |
|
| 37 | 41 |
public ComputeRF1RunAction() {
|
| 38 | 42 |
super(ComputeRF1Action.class);
|
| 39 | 43 |
}
|
| 44 |
+ |
|
| 45 |
+ |
|
| 46 |
+ @Override
|
|
| 47 |
+ public void prepare() throws Exception {
|
|
| 48 |
+ useLegacyBehaviourForTripWithoutLandingOrNot = createUseLegacyBehaviourForTripWithoutLandingOrNot();
|
|
| 49 |
+ super.prepare();
|
|
| 50 |
+ }
|
|
| 51 |
+ |
|
| 52 |
+ @SuppressWarnings("unused")
|
|
| 53 |
+ public Map<String, String> getUseLegacyBehaviourForTripWithoutLandingOrNot() {
|
|
| 54 |
+ return useLegacyBehaviourForTripWithoutLandingOrNot;
|
|
| 55 |
+ }
|
|
| 40 | 56 |
}
|
| ... | ... | @@ -8,12 +8,12 @@ |
| 8 | 8 |
* it under the terms of the GNU Affero General Public License as published by
|
| 9 | 9 |
* the Free Software Foundation, either version 3 of the License, or
|
| 10 | 10 |
* (at your option) any later version.
|
| 11 |
- *
|
|
| 11 |
+ *
|
|
| 12 | 12 |
* This program is distributed in the hope that it will be useful,
|
| 13 | 13 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 14 | 14 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 15 | 15 |
* GNU General Public License for more details.
|
| 16 |
- *
|
|
| 16 |
+ *
|
|
| 17 | 17 |
* You should have received a copy of the GNU Affero General Public License
|
| 18 | 18 |
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
| 19 | 19 |
* #L%
|
| ... | ... | @@ -26,8 +26,8 @@ import fr.ird.t3.entities.reference.Harbour; |
| 26 | 26 |
import fr.ird.t3.entities.reference.HarbourTopiaDao;
|
| 27 | 27 |
import fr.ird.t3.services.ioc.InjectDAO;
|
| 28 | 28 |
import fr.ird.t3.services.ioc.InjectDecoratedBeans;
|
| 29 |
+ |
|
| 29 | 30 |
import java.util.Map;
|
| 30 |
-import org.nuiton.topia.persistence.TopiaException;
|
|
| 31 | 31 |
|
| 32 | 32 |
/**
|
| 33 | 33 |
* To configure the Compute Raising factor 1 action.
|
| ... | ... | @@ -41,23 +41,23 @@ public class ComputeRF2ConfigureAction extends AbstractLevel0ConfigureAction<Com |
| 41 | 41 |
private static final long serialVersionUID = 1L;
|
| 42 | 42 |
|
| 43 | 43 |
@InjectDAO(entityType = Harbour.class)
|
| 44 |
- protected transient HarbourTopiaDao harbourDAO;
|
|
| 45 |
- |
|
| 44 |
+ private transient HarbourTopiaDao harbourDAO;
|
|
| 46 | 45 |
@InjectDecoratedBeans(beanType = Harbour.class)
|
| 47 |
- protected Map<String, String> landingHarbours;
|
|
| 46 |
+ private Map<String, String> landingHarbours;
|
|
| 48 | 47 |
|
| 49 | 48 |
public ComputeRF2ConfigureAction() {
|
| 50 | 49 |
super(ComputeRF2Configuration.class);
|
| 51 | 50 |
}
|
| 52 | 51 |
|
| 53 | 52 |
@Override
|
| 54 |
- protected void loadDefaultConfiguration(ComputeRF2Configuration config) throws TopiaException {
|
|
| 53 |
+ protected void loadDefaultConfiguration(ComputeRF2Configuration config) {
|
|
| 55 | 54 |
|
| 56 | 55 |
super.loadDefaultConfiguration(config);
|
| 57 | 56 |
|
| 58 | 57 |
config.setLandingHarbours(sortToList(harbourDAO.findAllUsedInLandingTrip(false)));
|
| 59 | 58 |
}
|
| 60 | 59 |
|
| 60 |
+ @SuppressWarnings("unused")
|
|
| 61 | 61 |
public Map<String, String> getLandingHarbours() {
|
| 62 | 62 |
return landingHarbours;
|
| 63 | 63 |
}
|
| ... | ... | @@ -8,12 +8,12 @@ |
| 8 | 8 |
* it under the terms of the GNU Affero General Public License as published by
|
| 9 | 9 |
* the Free Software Foundation, either version 3 of the License, or
|
| 10 | 10 |
* (at your option) any later version.
|
| 11 |
- *
|
|
| 11 |
+ *
|
|
| 12 | 12 |
* This program is distributed in the hope that it will be useful,
|
| 13 | 13 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 14 | 14 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 15 | 15 |
* GNU General Public License for more details.
|
| 16 |
- *
|
|
| 16 |
+ *
|
|
| 17 | 17 |
* You should have received a copy of the GNU Affero General Public License
|
| 18 | 18 |
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
| 19 | 19 |
* #L%
|
| ... | ... | @@ -40,26 +40,20 @@ public class ComputeRF2RunAction extends AbstractLevel0RunAction<ComputeRF2Confi |
| 40 | 40 |
private static final long serialVersionUID = 1L;
|
| 41 | 41 |
|
| 42 | 42 |
@InjectDecoratedBeans(beanType = Harbour.class, filterById = true)
|
| 43 |
- protected Map<String, String> landingHarbours;
|
|
| 43 |
+ private Map<String, String> landingHarbours;
|
|
| 44 | 44 |
|
| 45 | 45 |
public ComputeRF2RunAction() {
|
| 46 | 46 |
super(ComputeRF2Action.class);
|
| 47 | 47 |
}
|
| 48 | 48 |
|
| 49 |
+ @SuppressWarnings("unused")
|
|
| 49 | 50 |
public Map<String, String> getLandingHarbours() {
|
| 50 | 51 |
return landingHarbours;
|
| 51 | 52 |
}
|
| 52 | 53 |
|
| 53 | 54 |
@Override
|
| 54 |
- protected Map<String, Object> prepareResumeParameters(ComputeRF2Action action,
|
|
| 55 |
- Exception error,
|
|
| 56 |
- Date startDate,
|
|
| 57 |
- Date endDate) {
|
|
| 58 |
- Map<String, Object> map = super.prepareResumeParameters(action,
|
|
| 59 |
- error,
|
|
| 60 |
- startDate,
|
|
| 61 |
- endDate
|
|
| 62 |
- );
|
|
| 55 |
+ protected Map<String, Object> prepareResumeParameters(ComputeRF2Action action, Exception error, Date startDate, Date endDate) {
|
|
| 56 |
+ Map<String, Object> map = super.prepareResumeParameters(action, error, startDate, endDate);
|
|
| 63 | 57 |
map.put("landingHarbours", landingHarbours);
|
| 64 | 58 |
return map;
|
| 65 | 59 |
}
|
| ... | ... | @@ -87,6 +87,7 @@ t3.common.oceanFilter=Filter on oceans |
| 87 | 87 |
t3.common.reimported=réimporté
|
| 88 | 88 |
t3.common.replacementVessel=Replacement vessel
|
| 89 | 89 |
t3.common.rf0=Raising factor 0
|
| 90 |
+t3.common.rf1.useLegacyBehaviourForTripWithoutLandingOrNot=Trip without landing management
|
|
| 90 | 91 |
t3.common.rfMinus10Max=Rf Minus 10 maximum
|
| 91 | 92 |
t3.common.rfMinus10MinNumber=Minimum fish measured mandatory for -10kg
|
| 92 | 93 |
t3.common.rfPlus10Max=Rf Plus 10 maximum
|
| ... | ... | @@ -286,6 +287,8 @@ t3.label.importData.config.resume=Configuration resume of data import |
| 286 | 287 |
t3.label.info.changePassword=To change password, fill the both password fields
|
| 287 | 288 |
t3.label.inprogress=in progress...
|
| 288 | 289 |
t3.label.language=Langue
|
| 290 |
+t3.label.level0.configuration.rf1.useLegacyBehaviourForTripWithoutLanding=Calculer un RF1 sur les marées composées avec défaut de débarquement
|
|
| 291 |
+t3.label.level0.configuration.rf1.useNewBehaviourForTripWithoutLanding=Attribuer RF1\=1 sur les marées composées avec défaut de débarquement
|
|
| 289 | 292 |
t3.label.locale.english=English
|
| 290 | 293 |
t3.label.locale.french=French
|
| 291 | 294 |
t3.label.locale.spanish=spanish
|
| ... | ... | @@ -87,6 +87,7 @@ t3.common.oceanFilter=Filter les océans |
| 87 | 87 |
t3.common.reimported=réimporté
|
| 88 | 88 |
t3.common.replacementVessel=Navire de remplacement
|
| 89 | 89 |
t3.common.rf0=Raising factor 0
|
| 90 |
+t3.common.rf1.useLegacyBehaviourForTripWithoutLandingOrNot=Gestion des marées sans débarquement
|
|
| 90 | 91 |
t3.common.rfMinus10Max=Rf Minus 10 maximum
|
| 91 | 92 |
t3.common.rfMinus10MinNumber=Seuil minimum d'individus mesurés dans la catégorie -10kg
|
| 92 | 93 |
t3.common.rfPlus10Max=Rf Plus 10 maximum
|
| ... | ... | @@ -286,6 +287,8 @@ t3.label.importData.config.resume=Résumé de la configuration d'import de donn |
| 286 | 287 |
t3.label.info.changePassword=Pour changer de mot de passe, veuillez remplir les deux champs dédiés
|
| 287 | 288 |
t3.label.inprogress=en cours...
|
| 288 | 289 |
t3.label.language=Langue
|
| 290 |
+t3.label.level0.configuration.rf1.useLegacyBehaviourForTripWithoutLanding=Calculer un RF1 sur les marées composées avec défaut de débarquement
|
|
| 291 |
+t3.label.level0.configuration.rf1.useNewBehaviourForTripWithoutLanding=Attribuer RF1\=1 sur les marées composées avec défaut de débarquement
|
|
| 289 | 292 |
t3.label.locale.english=Anglais
|
| 290 | 293 |
t3.label.locale.french=Français
|
| 291 | 294 |
t3.label.locale.spanish=Espagnol
|
| ... | ... | @@ -27,16 +27,17 @@ |
| 27 | 27 |
.ui-datepicker-calendar {
|
| 28 | 28 |
display: none;
|
| 29 | 29 |
}
|
| 30 |
+ |
|
| 30 | 31 |
.wwlbl {
|
| 31 | 32 |
width: 500px;
|
| 32 | 33 |
}
|
| 33 | 34 |
</style>
|
| 34 | 35 |
|
| 35 | 36 |
<title><s:text name="t3.label.data.treatment.level0"/> : <s:text
|
| 36 |
- name="t3.label.data.level0.computeRF1"/></title>
|
|
| 37 |
+ name="t3.label.data.level0.computeRF1"/></title>
|
|
| 37 | 38 |
|
| 38 | 39 |
<h2><s:text name="t3.label.data.treatment.level0"/> : <s:text
|
| 39 |
- name="t3.label.data.level0.computeRF1"/></h2>
|
|
| 40 |
+ name="t3.label.data.level0.computeRF1"/></h2>
|
|
| 40 | 41 |
|
| 41 | 42 |
<s:if test="confirm">
|
| 42 | 43 |
|
| ... | ... | @@ -62,7 +63,7 @@ |
| 62 | 63 |
<s:text name="t3.label.configure"/>
|
| 63 | 64 |
</legend>
|
| 64 | 65 |
|
| 65 |
- <%-- begin date --%>
|
|
| 66 |
+ <%-- begin date --%>
|
|
| 66 | 67 |
<sj:datepicker key="configuration.beginDate" requiredLabel="true"
|
| 67 | 68 |
label='%{getText("t3.common.beginDate")}'
|
| 68 | 69 |
appendText=" (mm-yyyy)"/>
|
| ... | ... | @@ -89,6 +90,9 @@ |
| 89 | 90 |
label='%{getText("t3.common.fleetCountry")}'
|
| 90 | 91 |
requiredLabel="true" template="mycheckboxlist"/>
|
| 91 | 92 |
|
| 93 |
+ <s:radio key="configuration.useLegacyBehaviourForTripWithoutLanding" requiredLabel="true"
|
|
| 94 |
+ list="useLegacyBehaviourForTripWithoutLandingOrNot"
|
|
| 95 |
+ label='%{getText("t3.common.rf1.useLegacyBehaviourForTripWithoutLandingOrNot")}'/>
|
|
| 92 | 96 |
</fieldset>
|
| 93 | 97 |
|
| 94 | 98 |
<br/>
|
| ... | ... | @@ -100,13 +104,13 @@ |
| 100 | 104 |
|
| 101 | 105 |
<script type="text/javascript">
|
| 102 | 106 |
|
| 103 |
- jQuery(document).ready(function () {
|
|
| 107 |
+ jQuery(document).ready(function () {
|
|
| 104 | 108 |
|
| 105 |
- $.prepareMonthPickers(
|
|
| 106 |
- {
|
|
| 107 |
- minDateAsMonth:'<s:property value="configuration.minDate"/>',
|
|
| 108 |
- maxDateAsMonth:'<s:property value="configuration.maxDate"/>'
|
|
| 109 |
- });
|
|
| 109 |
+ $.prepareMonthPickers(
|
|
| 110 |
+ {
|
|
| 111 |
+ minDateAsMonth: '<s:property value="configuration.minDate"/>',
|
|
| 112 |
+ maxDateAsMonth: '<s:property value="configuration.maxDate"/>'
|
|
| 113 |
+ });
|
|
| 110 | 114 |
|
| 111 |
- });
|
|
| 115 |
+ });
|
|
| 112 | 116 |
</script>
|
| ... | ... | @@ -51,4 +51,8 @@ |
| 51 | 51 |
list="fleets" template="mycheckboxlist"
|
| 52 | 52 |
label='%{getText("t3.common.fleetCountry")}'/>
|
| 53 | 53 |
|
| 54 |
+ <s:radio key="configuration.useLegacyBehaviourForTripWithoutLanding" disabled="true"
|
|
| 55 |
+ list="useLegacyBehaviourForTripWithoutLandingOrNot"
|
|
| 56 |
+ label='%{getText("t3.common.rf1.useLegacyBehaviourForTripWithoutLandingOrNot")}'/>
|
|
| 57 |
+ |
|
| 54 | 58 |
</fieldset>
|