[Git][ultreiaio/ird-t3][develop] 3 commits: Revert removed method
Tony CHEMIT pushed to branch develop at ultreiaio / ird-t3 Commits: b1ffee7e by Tony CHEMIT at 2018-02-21T14:06:48+01:00 Revert removed method - - - - - 89e03ab7 by Tony CHEMIT at 2018-02-21T15:48:15+01:00 Sur la page 'Gérer les marées', la mise en page déborde de l'écran à droite. Voir la PJ. Cela génère un ascenseur horizontal, pourtant inutile. (Closes #232) - - - - - 5ce68d04 by Tony CHEMIT at 2018-02-21T15:50:10+01:00 [UI][N2][N3] Changer la sélection de la flotte d'une sélection unique vers une sélection multiple (Closes #243) - - - - - 16 changed files: - t3-actions/src/main/java/fr/ird/t3/actions/data/level2/Level2Action.java - t3-actions/src/main/java/fr/ird/t3/actions/data/level3/Level3Action.java - t3-domain/src/main/java/fr/ird/t3/actions/stratum/LevelConfigurationWithStratum.java - t3-domain/src/main/java/fr/ird/t3/entities/data/AbstractTripTopiaDao.java - t3-domain/src/main/java/fr/ird/t3/entities/reference/AbstractCountryTopiaDao.java - t3-domain/src/main/java/fr/ird/t3/entities/reference/AbstractVesselTopiaDao.java - t3-web/src/main/java/fr/ird/t3/web/actions/T3ActionSupport.java - t3-web/src/main/java/fr/ird/t3/web/actions/data/level2/ConfigureLevel2Step1Action.java - t3-web/src/main/java/fr/ird/t3/web/actions/data/level2/Level2ConfigureAction.java - t3-web/src/main/java/fr/ird/t3/web/actions/data/level2/Level2RunAction.java - t3-web/src/main/java/fr/ird/t3/web/actions/data/level3/ConfigureLevel3Step1Action.java - t3-web/src/main/java/fr/ird/t3/web/actions/data/level3/Level3ConfigureAction.java - t3-web/src/main/java/fr/ird/t3/web/actions/data/level3/Level3RunAction.java - t3-web/src/main/webapp/WEB-INF/jsp/admin/tripList.jsp - t3-web/src/main/webapp/WEB-INF/jsp/data/level2/level2ConfigurationStep1.jsp - t3-web/src/main/webapp/WEB-INF/jsp/data/level3/level3ConfigurationStep1.jsp Changes: ===================================== t3-actions/src/main/java/fr/ird/t3/actions/data/level2/Level2Action.java ===================================== --- a/t3-actions/src/main/java/fr/ird/t3/actions/data/level2/Level2Action.java +++ b/t3-actions/src/main/java/fr/ird/t3/actions/data/level2/Level2Action.java @@ -52,7 +52,6 @@ import fr.ird.t3.services.DecoratorService; import fr.ird.t3.services.ZoneStratumService; import fr.ird.t3.services.ioc.InjectDAO; import fr.ird.t3.services.ioc.InjectEntitiesById; -import fr.ird.t3.services.ioc.InjectEntityById; import fr.ird.t3.services.ioc.InjectFromDAO; import org.apache.commons.io.IOUtils; import org.apache.commons.logging.Log; @@ -83,8 +82,7 @@ import static org.nuiton.i18n.I18n.l; */ public class Level2Action extends T3Action<Level2Configuration> { - public static final String PARAM_LEVEL_CONFIGURATION = "levelConfiguration"; - /** Logger. */ + // public static final String PARAM_LEVEL_CONFIGURATION = "levelConfiguration"; private static final Log log = LogFactory.getLog(Level2Action.class); /** * Cache of activity (to avoid to reload them for catch and sample stratum). @@ -93,6 +91,28 @@ public class Level2Action extends T3Action<Level2Configuration> { */ private final LoadingCache<String, Activity> activityCache; private final Map<String, OceanContext> oceanContext; + /** + * Input Weight composition + * (based on {@link CorrectedElementaryCatch#getCatchWeight()}) for all + * species found in catches. + * + * @since 1.3 + */ + WeightCompositionAggregateModel inputCatchModelForAllSpecies; + /** + * Output Weight composition + * (based on {@link CorrectedElementaryCatch#getCorrectedCatchWeight()}) for all + * species found in catches. + * + * @since 1.3 + */ + WeightCompositionAggregateModel outputCatchModelForAllSpecies; + /** + * For each stratum gets his result. + * + * @since 1.3 + */ + Collection<L2StratumResult> stratumsResult; @InjectDAO(entityType = Activity.class) private ActivityTopiaDao activityDAO; @InjectDAO(entityType = WeightCategoryTreatment.class) @@ -105,8 +125,8 @@ public class Level2Action extends T3Action<Level2Configuration> { private ZoneVersion zoneVersion; @InjectFromDAO(entityType = SchoolType.class, method = "findAllForStratum") private Set<SchoolType> schoolTypes; - @InjectEntityById(entityType = Country.class) - private Country catchFleet; + @InjectEntitiesById(entityType = Country.class) + private Set<Country> catchFleets; @InjectEntitiesById(entityType = Ocean.class) private Set<Ocean> oceans; @InjectEntitiesById(entityType = Species.class, path = "configuration.speciesIds") @@ -116,8 +136,6 @@ public class Level2Action extends T3Action<Level2Configuration> { @InjectEntitiesById(entityType = Country.class) private Collection<Country> sampleFlags; private Set<T3Date> startDates; - // private Multimap<SchoolType, WeightCategoryTreatment> weightCategoriesBySchoolType; -// private Multimap<SchoolType, ZoneStratumAware> zoneBySchoolType; private Set<Vessel> possibleCatchVessels; private Set<Vessel> possibleSampleVessels; private int nbStratums; @@ -125,28 +143,6 @@ public class Level2Action extends T3Action<Level2Configuration> { private long totalCatchWeight; private long totalCatchActivities; private long totalCatchActivitiesWithSample; - /** - * Input Weight composition - * (based on {@link CorrectedElementaryCatch#getCatchWeight()}) for all - * species found in catches. - * - * @since 1.3 - */ - WeightCompositionAggregateModel inputCatchModelForAllSpecies; - /** - * Output Weight composition - * (based on {@link CorrectedElementaryCatch#getCorrectedCatchWeight()}) for all - * species found in catches. - * - * @since 1.3 - */ - WeightCompositionAggregateModel outputCatchModelForAllSpecies; - /** - * For each stratum gets his result. - * - * @since 1.3 - */ - Collection<L2StratumResult> stratumsResult; public Level2Action() { activityCache = CacheBuilder.newBuilder().build( @@ -189,7 +185,7 @@ public class Level2Action extends T3Action<Level2Configuration> { setStartDates(T3Date.getStartDates(configuration.getBeginDate(), configuration.getEndDate(), configuration.getTimeStep())); // get possible vessels for catch stratum - setPossibleCatchVessels(vesselDAO.getPossibleCatchVessels(catchFleet)); + setPossibleCatchVessels(vesselDAO.getPossibleCatchVessels(catchFleets)); // get possible vessels for sample stratum setPossibleSampleVessels(vesselDAO.getPossibleSampleVessels(sampleFleets, sampleFlags)); ===================================== t3-actions/src/main/java/fr/ird/t3/actions/data/level3/Level3Action.java ===================================== --- a/t3-actions/src/main/java/fr/ird/t3/actions/data/level3/Level3Action.java +++ b/t3-actions/src/main/java/fr/ird/t3/actions/data/level3/Level3Action.java @@ -102,13 +102,12 @@ import static org.nuiton.i18n.I18n.n; */ public class Level3Action extends T3Action<Level3Configuration> { - public static final String BEFORE_LEVEL3 = n("t3.level3.nbFishesBeforeLevel3"); - public static final String AFTER_LEVEL3 = n("t3.level3.nbFishesAfterLevel3"); - public static final String INSERT_QUERY = + private static final String BEFORE_LEVEL3 = n("t3.level3.nbFishesBeforeLevel3"); + private static final String AFTER_LEVEL3 = n("t3.level3.nbFishesAfterLevel3"); + private static final String INSERT_QUERY = "INSERT INTO ExtrapolatedAllSetSpeciesFrequency(TOPIAID, TOPIAVERSION, TOPIACREATEDATE, ACTIVITY, SPECIES, LFLENGTHCLASS, NUMBER) VALUES ('%s', 0, TIMESTAMP '%s 00:00:00.0', '%s','%s', %s, %s);\n"; - public static final String UPDATE_QUERY = + private static final String UPDATE_QUERY = "UPDATE ExtrapolatedAllSetSpeciesFrequency SET NUMBER = NUMBER + %s WHERE TOPIAID = '%s';\n"; - /** Logger. */ private static final Log log = LogFactory.getLog(Level3Action.class); /** * Cache of activity (to avoid to reload them for catch and smaple stratum). @@ -117,7 +116,25 @@ public class Level3Action extends T3Action<Level3Configuration> { */ private final LoadingCache<String, Activity> activityCache; private final Map<String, OceanContext> oceanContext; - Map<String, Map<String, String>> activityWithMultiZones = new TreeMap<>(); + /** + * Global total fishes count for all stratums. + * <p/> + * We store two count here : + * <ul> + * <li>{@link #BEFORE_LEVEL3} : total fishes count before level 3</li> + * <li>{@link #AFTER_LEVEL3} : total fishes count after level 3</li> + * </ul> + * + * @since 1.3.1 + */ + SpeciesCountAggregateModel totalFishesCount; + /** + * For each stratum gets his result. + * + * @since 1.3.1 + */ + Collection<L3StratumResult> stratumsResult; + private Map<String, Map<String, String>> activityWithMultiZones; @InjectDAO(entityType = Activity.class) private ActivityTopiaDao activityDAO; @InjectDAO(entityType = LengthWeightConversion.class) @@ -136,12 +153,10 @@ public class Level3Action extends T3Action<Level3Configuration> { private ZoneVersion zoneVersion; @InjectFromDAO(entityType = SchoolType.class, method = "findAllForStratum") private Set<SchoolType> schoolTypes; - // private Multimap<SchoolType, ZoneStratumAware> zoneBySchoolType; @InjectEntityById(entityType = Ocean.class) private Ocean ocean; - @InjectEntityById(entityType = Country.class) - private Country catchFleet; - // private Multimap<SchoolType, WeightCategoryTreatment> weightCategoriesBySchoolType; + @InjectEntitiesById(entityType = Country.class) + private Set<Country> catchFleets; @InjectEntitiesById(entityType = Species.class, path = "configuration.speciesIds") private Collection<Species> species; @InjectEntitiesById(entityType = Country.class) @@ -153,30 +168,11 @@ public class Level3Action extends T3Action<Level3Configuration> { private Set<T3Date> startDates; private Set<Vessel> possibleCatchVessels; private Set<Vessel> possibleSampleVessels; - // private LengthWeightConversionHelper conversionHelper; private Map<SchoolType, Map<String, Integer>> stratumMinimumSampleCountBySchoolType; private int nbStratums; private long nbCatchActivities; private long nbCatchActivitiesWithSample; /** - * Global total fishes count for all stratums. - * <p/> - * We store two count here : - * <ul> - * <li>{@link #BEFORE_LEVEL3} : total fishes count before level 3</li> - * <li>{@link #AFTER_LEVEL3} : total fishes count after level 3</li> - * </ul> - * - * @since 1.3.1 - */ - SpeciesCountAggregateModel totalFishesCount; - /** - * For each stratum gets his result. - * - * @since 1.3.1 - */ - Collection<L3StratumResult> stratumsResult; - /** * Predicate to filter only species selected in configuration. * * @since 1.4 @@ -196,6 +192,7 @@ public class Level3Action extends T3Action<Level3Configuration> { } ); oceanContext = new TreeMap<>(); + activityWithMultiZones = new TreeMap<>(); } @Override @@ -249,7 +246,7 @@ public class Level3Action extends T3Action<Level3Configuration> { } // get possible vessels for catch stratum - setPossibleCatchVessels(vesselDAO.getPossibleCatchVessels(catchFleet)); + setPossibleCatchVessels(vesselDAO.getPossibleCatchVessels(catchFleets)); // get possible vessels for sample stratum setPossibleSampleVessels(vesselDAO.getPossibleSampleVessels(sampleFleets, sampleFlags)); ===================================== t3-domain/src/main/java/fr/ird/t3/actions/stratum/LevelConfigurationWithStratum.java ===================================== --- a/t3-domain/src/main/java/fr/ird/t3/actions/stratum/LevelConfigurationWithStratum.java +++ b/t3-domain/src/main/java/fr/ird/t3/actions/stratum/LevelConfigurationWithStratum.java @@ -51,8 +51,8 @@ public abstract class LevelConfigurationWithStratum implements T3ActionConfigura /** Id of selected version of ZoneImpl. */ private String zoneVersionId; - /** Selected fleet id (for catch filtering). */ - private String catchFleetId; + /** Selected fleet ids (for catch filtering). */ + private Set<String> catchFleetIds; /** Number of months to define a stratus. */ private int timeStep; @@ -172,12 +172,12 @@ public abstract class LevelConfigurationWithStratum implements T3ActionConfigura this.endDate = endDate; } - public String getCatchFleetId() { - return catchFleetId; + public Set<String> getCatchFleetIds() { + return catchFleetIds == null ? catchFleetIds = new LinkedHashSet<>() : catchFleetIds; } - public void setCatchFleetId(String catchFleetId) { - this.catchFleetId = catchFleetId; + public void setCatchFleetIds(Set<String> catchFleetIds) { + this.catchFleetIds = catchFleetIds; } public Set<String> getSampleFleetIds() { ===================================== t3-domain/src/main/java/fr/ird/t3/entities/data/AbstractTripTopiaDao.java ===================================== --- a/t3-domain/src/main/java/fr/ird/t3/entities/data/AbstractTripTopiaDao.java +++ b/t3-domain/src/main/java/fr/ird/t3/entities/data/AbstractTripTopiaDao.java @@ -143,6 +143,9 @@ public class AbstractTripTopiaDao<E extends Trip> extends GeneratedTripTopiaDao< } public static final Ocean EMPTY_OCEAN = new OceanImpl(); + static { + EMPTY_OCEAN.setTopiaId("fr.ird.t3.entities.reference.Ocean#EMPTY#EMPTY"); + } public Multimap<Ocean, String> findAllIdsByOcean() throws TopiaException { ===================================== t3-domain/src/main/java/fr/ird/t3/entities/reference/AbstractCountryTopiaDao.java ===================================== --- a/t3-domain/src/main/java/fr/ird/t3/entities/reference/AbstractCountryTopiaDao.java +++ b/t3-domain/src/main/java/fr/ird/t3/entities/reference/AbstractCountryTopiaDao.java @@ -60,6 +60,11 @@ public class AbstractCountryTopiaDao<E extends Country> extends GeneratedCountry // return T3EntityHelper.querytoSet(hql, this); } + public Set<E> findAllFleetUsedInTrip() throws TopiaException { + return findAllFleetUsedInTrip(null); + } + + /** * Obtains all countries used as flag for any trip in the database. * ===================================== t3-domain/src/main/java/fr/ird/t3/entities/reference/AbstractVesselTopiaDao.java ===================================== --- a/t3-domain/src/main/java/fr/ird/t3/entities/reference/AbstractVesselTopiaDao.java +++ b/t3-domain/src/main/java/fr/ird/t3/entities/reference/AbstractVesselTopiaDao.java @@ -28,12 +28,12 @@ import com.google.common.collect.Sets; import fr.ird.t3.entities.T3Functions; import fr.ird.t3.entities.T3Predicates; import fr.ird.t3.entities.data.Trip; -import java.util.Arrays; +import org.nuiton.topia.persistence.TopiaException; + import java.util.Collection; import java.util.HashSet; import java.util.List; import java.util.Set; -import org.nuiton.topia.persistence.TopiaException; /** * {@link Vessel} user dao operations. @@ -62,8 +62,7 @@ public class AbstractVesselTopiaDao<E extends Vessel> extends GeneratedVesselTop } /** - * Obtain the set of possible vessels usable from the configuration to - * obtain catches of the catch stratum. + * Obtain the set of possible vessels usable from the configuration to obtain catches of the catch stratum. * <p/> * Vessels must verifiy two conditions : * <ul> @@ -71,23 +70,19 @@ public class AbstractVesselTopiaDao<E extends Vessel> extends GeneratedVesselTop * <li>Be in the selected fleet (from the configuration)</li> * </ul> * - * @param country level 2 configuration - * @return set of possible vessels usable for activity (so trips) of the - * catch stratum + * @param countries selected countries + * @return set of possible vessels usable for activity (so trips) of the catch stratum * @throws TopiaException if any problem while loading data */ - public Set<E> getPossibleCatchVessels(Country country) throws TopiaException { + public Set<E> getPossibleCatchVessels(Collection<Country> countries) throws TopiaException { List<E> vessels = forProperties( Vessel.PROPERTY_VESSEL_TYPE + "." + VesselType.PROPERTY_VESSEL_SIMPLE_TYPE + "." + VesselSimpleType.PROPERTY_CODE, 1).findAll(); - Predicate<Vessel> predicate = - T3Predicates.vesselUsingFleetCountry(Arrays.asList(country)); - - return Sets.newHashSet( - Collections2.filter(vessels, predicate)); + Predicate<Vessel> predicate = T3Predicates.vesselUsingFleetCountry(countries); + return Sets.newHashSet(Collections2.filter(vessels, predicate)); } /** ===================================== t3-web/src/main/java/fr/ird/t3/web/actions/T3ActionSupport.java ===================================== --- a/t3-web/src/main/java/fr/ird/t3/web/actions/T3ActionSupport.java +++ b/t3-web/src/main/java/fr/ird/t3/web/actions/T3ActionSupport.java @@ -51,24 +51,26 @@ import fr.ird.t3.web.T3InternalTransactionFilter; import fr.ird.t3.web.T3Session; import fr.ird.t3.web.T3UserTransactionFilter; import fr.ird.t3.web.actions.admin.TripListModel; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.struts2.StrutsStatics; +import org.nuiton.decorator.Decorator; +import org.nuiton.topia.persistence.TopiaEntity; +import org.nuiton.topia.persistence.TopiaException; +import org.nuiton.util.TimeLog; + +import javax.servlet.http.HttpServletRequest; import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.text.SimpleDateFormat; +import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.Date; import java.util.List; import java.util.Map; import java.util.function.Supplier; -import javax.servlet.http.HttpServletRequest; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.struts2.StrutsStatics; -import org.nuiton.decorator.Decorator; -import org.nuiton.topia.persistence.TopiaEntity; -import org.nuiton.topia.persistence.TopiaException; -import org.nuiton.util.TimeLog; @@ -353,29 +355,26 @@ public class T3ActionSupport extends ActionSupport implements T3TopiaPersistence result.setTripIdsByOcean(allByOcean); getT3Session().setTripListModel(result); - List<Ocean> allOceans = Lists.newArrayList(allByOcean.keySet()); + List<Ocean> allOceans = new ArrayList<>(allByOcean.keySet()); - if (allOceans.contains(null)) { + if (allOceans.contains(TripTopiaDao.EMPTY_OCEAN)) { // there is some trips with no oceans Ocean nullOcean = new OceanImpl(); nullOcean.setLabel1(t("t3.common.nullOcean")); nullOcean.setTopiaId("null"); + Collection<String> ids = allByOcean.get(TripTopiaDao.EMPTY_OCEAN); if (log.isInfoEnabled()) { - log.info("Add a nullOcean : " + nullOcean.getLabel1() + - " for " + allByOcean.get(null).size() + - " trip(s)."); + log.info(String.format("Add a nullOcean : %s for %d trip(s).", nullOcean.getLabel1(), ids.size())); } allOceans.remove(null); allOceans.add(nullOcean); - Collection<String> ids = allByOcean.get(null); allByOcean.putAll(nullOcean, ids); - allByOcean.removeAll(null); + allByOcean.removeAll(TripTopiaDao.EMPTY_OCEAN); } - TIME_LOG.log(t0, "loadTripListModel for " + result.getNbTrips() + - " trips."); + TIME_LOG.log(t0, String.format("loadTripListModel for %d trips.", result.getNbTrips())); allOceans = sortToList(allOceans); result.setOceans(allOceans); ===================================== t3-web/src/main/java/fr/ird/t3/web/actions/data/level2/ConfigureLevel2Step1Action.java ===================================== --- a/t3-web/src/main/java/fr/ird/t3/web/actions/data/level2/ConfigureLevel2Step1Action.java +++ b/t3-web/src/main/java/fr/ird/t3/web/actions/data/level2/ConfigureLevel2Step1Action.java @@ -139,7 +139,7 @@ public class ConfigureLevel2Step1Action extends AbstractConfigureAction<Level2Co injectOnly(InjectDecoratedBeans.class); if (CollectionUtils.isEmpty(conf.getCatchFleets())) { - addFieldError("configuration.catchFleetId", t("t3.error.no.catch.fleet.found")); + addFieldError("configuration.catchFleetIds", t("t3.error.no.catch.fleet.found")); missingDatas = true; } @@ -188,7 +188,7 @@ public class ConfigureLevel2Step1Action extends AbstractConfigureAction<Level2Co if (log.isInfoEnabled()) { log.info("Selected species : " + conf.getSpeciesIds()); - log.info("Selected catch fleet country : " + conf.getCatchFleetId()); + log.info("Selected catch fleets : " + conf.getCatchFleetIds()); log.info("Selected ocean : " + conf.getOceanIds()); log.info("Selected begin date : " + conf.getBeginDate()); log.info("Selected end date : " + conf.getEndDate()); @@ -217,8 +217,8 @@ public class ConfigureLevel2Step1Action extends AbstractConfigureAction<Level2Co addFieldError("zoneVersionId", t("t3.error.no.zoneVersion.selected")); } - if (StringUtils.isEmpty(config.getCatchFleetId())) { - addFieldError("configuration.catchFleetId", t("t3.error.no.catch.fleet.selected")); + if (CollectionUtils.isEmpty(config.getCatchFleetIds())) { + addFieldError("configuration.catchFleetIds", t("t3.error.no.catch.fleet.selected")); } boolean speciesOk = true; ===================================== t3-web/src/main/java/fr/ird/t3/web/actions/data/level2/Level2ConfigureAction.java ===================================== --- a/t3-web/src/main/java/fr/ird/t3/web/actions/data/level2/Level2ConfigureAction.java +++ b/t3-web/src/main/java/fr/ird/t3/web/actions/data/level2/Level2ConfigureAction.java @@ -43,15 +43,15 @@ public class Level2ConfigureAction extends AbstractConfigureAction<Level2Configu private final Map<String, String> timeSteps = createTimeSteps(); - @InjectDecoratedBeans(beanType = Country.class, filterById = true, filterBySingleId = true) - private Map<String, String> catchFleets; - @InjectDecoratedBeans(beanType = ZoneStratumAwareMeta.class) private Map<String, String> zoneTypes; @InjectDecoratedBeans(beanType = ZoneVersion.class) private Map<String, String> zoneVersions; + @InjectDecoratedBeans(beanType = Country.class, filterById = true) + private Map<String, String> catchFleets; + @InjectDecoratedBeans(beanType = Ocean.class, filterById = true) private Map<String, String> oceans; ===================================== t3-web/src/main/java/fr/ird/t3/web/actions/data/level2/Level2RunAction.java ===================================== --- a/t3-web/src/main/java/fr/ird/t3/web/actions/data/level2/Level2RunAction.java +++ b/t3-web/src/main/java/fr/ird/t3/web/actions/data/level2/Level2RunAction.java @@ -45,15 +45,15 @@ public class Level2RunAction extends AbstractRunAction<Level2Configuration, Leve private final Map<String, String> timeSteps = createTimeSteps(); - @InjectDecoratedBeans(beanType = Country.class, filterById = true, filterBySingleId = true) - private Map<String, String> catchFleets; - @InjectDecoratedBeans(beanType = ZoneStratumAwareMeta.class) private Map<String, String> zoneTypes; @InjectDecoratedBeans(beanType = ZoneVersion.class) private Map<String, String> zoneVersions; + @InjectDecoratedBeans(beanType = Country.class, filterById = true) + private Map<String, String> catchFleets; + @InjectDecoratedBeans(beanType = Ocean.class, filterById = true) private Map<String, String> oceans; ===================================== t3-web/src/main/java/fr/ird/t3/web/actions/data/level3/ConfigureLevel3Step1Action.java ===================================== --- a/t3-web/src/main/java/fr/ird/t3/web/actions/data/level3/ConfigureLevel3Step1Action.java +++ b/t3-web/src/main/java/fr/ird/t3/web/actions/data/level3/ConfigureLevel3Step1Action.java @@ -141,7 +141,7 @@ public class ConfigureLevel3Step1Action extends AbstractConfigureAction<Level3Co injectOnly(InjectDecoratedBeans.class); if (CollectionUtils.isEmpty(conf.getCatchFleets())) { - addFieldError("configuration.catchFleetId", t("t3.error.no.catch.fleet.found")); + addFieldError("configuration.catchFleetIds", t("t3.error.no.catch.fleet.found")); missingDatas = true; } @@ -187,13 +187,13 @@ public class ConfigureLevel3Step1Action extends AbstractConfigureAction<Level3Co if (log.isInfoEnabled()) { log.info("Selected species : " + conf.getSpeciesIds()); - log.info("Selected catch fleet country : " + conf.getCatchFleetId()); + log.info("Selected catch fleets : " + conf.getCatchFleetIds()); log.info("Selected ocean : " + conf.getOceanIds()); log.info("Selected begin date : " + conf.getBeginDate()); log.info("Selected end date : " + conf.getEndDate()); log.info("Selected time step : " + conf.getTimeStep()); log.info("Selected zone type : " + conf.getZoneTypeId()); - log.info("Selected zone version : " + conf.getZoneVersionId()); + log.info("Selected zone version : " + conf.getZoneVersionId()); } } @@ -217,8 +217,8 @@ public class ConfigureLevel3Step1Action extends AbstractConfigureAction<Level3Co addFieldError("zoneVersionId", t("t3.error.no.zoneVersion.selected")); } - if (StringUtils.isEmpty(config.getCatchFleetId())) { - addFieldError("configuration.catchFleetId", t("t3.error.no.catch.fleet.selected")); + if (CollectionUtils.isEmpty(config.getCatchFleetIds())) { + addFieldError("configuration.catchFleetIds", t("t3.error.no.catch.fleet.selected")); } T3Date beginDate = config.getBeginDate(); ===================================== t3-web/src/main/java/fr/ird/t3/web/actions/data/level3/Level3ConfigureAction.java ===================================== --- a/t3-web/src/main/java/fr/ird/t3/web/actions/data/level3/Level3ConfigureAction.java +++ b/t3-web/src/main/java/fr/ird/t3/web/actions/data/level3/Level3ConfigureAction.java @@ -48,10 +48,6 @@ public class Level3ConfigureAction extends AbstractConfigureAction<Level3Configu private final Map<String, String> timeSteps = createTimeSteps(); - /** all fleet Countries. */ - @InjectDecoratedBeans(beanType = Country.class, filterById = true, filterBySingleId = true) - private Map<String, String> catchFleets; - /** all zoneTypes. */ @InjectDecoratedBeans(beanType = ZoneStratumAwareMeta.class) private Map<String, String> zoneTypes; @@ -60,6 +56,10 @@ public class Level3ConfigureAction extends AbstractConfigureAction<Level3Configu @InjectDecoratedBeans(beanType = ZoneVersion.class) private Map<String, String> zoneVersions; + /** all fleet Countries. */ + @InjectDecoratedBeans(beanType = Country.class, filterById = true) + private Map<String, String> catchFleets; + /** all oceans. */ @InjectDecoratedBeans(beanType = Ocean.class, filterById = true) private Map<String, String> oceans; ===================================== t3-web/src/main/java/fr/ird/t3/web/actions/data/level3/Level3RunAction.java ===================================== --- a/t3-web/src/main/java/fr/ird/t3/web/actions/data/level3/Level3RunAction.java +++ b/t3-web/src/main/java/fr/ird/t3/web/actions/data/level3/Level3RunAction.java @@ -47,10 +47,6 @@ public class Level3RunAction extends AbstractRunAction<Level3Configuration, Leve private final Map<String, String> timeSteps = createTimeSteps(); - /** all fleet Countries. */ - @InjectDecoratedBeans(beanType = Country.class, filterById = true, filterBySingleId = true) - private Map<String, String> catchFleets; - /** all zoneTypes. */ @InjectDecoratedBeans(beanType = ZoneStratumAwareMeta.class) private Map<String, String> zoneTypes; @@ -59,8 +55,12 @@ public class Level3RunAction extends AbstractRunAction<Level3Configuration, Leve @InjectDecoratedBeans(beanType = ZoneVersion.class) private Map<String, String> zoneVersions; + /** all fleet Countries. */ + @InjectDecoratedBeans(beanType = Country.class, filterById = true) + private Map<String, String> catchFleets; + /** all oceans. */ - @InjectDecoratedBeans(beanType = Ocean.class, filterById = true, filterBySingleId = true) + @InjectDecoratedBeans(beanType = Ocean.class, filterById = true) private Map<String, String> oceans; /** all species. */ ===================================== t3-web/src/main/webapp/WEB-INF/jsp/admin/tripList.jsp ===================================== --- a/t3-web/src/main/webapp/WEB-INF/jsp/admin/tripList.jsp +++ b/t3-web/src/main/webapp/WEB-INF/jsp/admin/tripList.jsp @@ -26,6 +26,18 @@ <title><s:text name="t3.label.admin.trip.list"/></title> <s:set var="userIsAdmin" value="%{#session.t3Session.user.admin}"/> +<style type="text/css"> + .wwlbl { + width: auto; + } + .wwgrp { + width: auto; + } + .filterClass { + width:150px; + } +</style> + <script type="text/javascript"> jQuery(document).ready(function () { ===================================== t3-web/src/main/webapp/WEB-INF/jsp/data/level2/level2ConfigurationStep1.jsp ===================================== --- a/t3-web/src/main/webapp/WEB-INF/jsp/data/level2/level2ConfigurationStep1.jsp +++ b/t3-web/src/main/webapp/WEB-INF/jsp/data/level2/level2ConfigurationStep1.jsp @@ -84,10 +84,10 @@ <sj:select key="zoneVersionId" list="zoneVersions" href="%{jsonUrl}" label='%{getText("t3.common.zoneVersion")}' requiredLabel="true"/> - <%-- selected catch fleet --%> - <s:select key="configuration.catchFleetId" list="catchFleets" headerKey="" - headerValue="" label='%{getText("t3.common.catchFleet")}' - requiredLabel="true"/> + <%-- selected catch fleets --%> + <s:checkboxlist key="configuration.catchFleetIds" list="catchFleets" + label='%{getText("t3.common.catchFleet")}' requiredLabel="true" + template="mycheckboxlist"/> <%-- selected time step --%> <s:select key="configuration.timeStep" list="timeSteps" ===================================== t3-web/src/main/webapp/WEB-INF/jsp/data/level3/level3ConfigurationStep1.jsp ===================================== --- a/t3-web/src/main/webapp/WEB-INF/jsp/data/level3/level3ConfigurationStep1.jsp +++ b/t3-web/src/main/webapp/WEB-INF/jsp/data/level3/level3ConfigurationStep1.jsp @@ -84,10 +84,10 @@ <sj:select key="zoneVersionId" list="zoneVersions" href="%{jsonUrl}" label='%{getText("t3.common.zoneVersion")}' requiredLabel="true"/> - <%-- selected catch fleet --%> - <s:select key="configuration.catchFleetId" list="catchFleets" headerKey="" - headerValue="" label='%{getText("t3.common.catchFleet")}' - requiredLabel="true"/> + <%-- selected catch fleets --%> + <s:checkboxlist key="configuration.catchFleetIds" list="catchFleets" + label='%{getText("t3.common.catchFleet")}' requiredLabel="true" + template="mycheckboxlist"/> <%-- selected time step --%> <s:select key="configuration.timeStep" list="timeSteps" View it on GitLab: https://gitlab.com/ultreiaio/ird-t3/compare/b2092129c7170996af5c03ce4e4d8ad6... --- View it on GitLab: https://gitlab.com/ultreiaio/ird-t3/compare/b2092129c7170996af5c03ce4e4d8ad6... You're receiving this email because of your account on gitlab.com.
participants (1)
-
Tony CHEMIT