From scm@users.codelutin.com Sat May  2 13:17:52 2015
From: "codelutin.com scm" <scm@users.codelutin.com>
To: observe-commits@list.forge.codelutin.com
Subject: [Observe-commits] branch feature/7017 updated (7b6c125 -> 4f5f524)
Date: Sat, 02 May 2015 13:17:49 +0000
Message-ID: <20150502131749.18681.91646@bihar.codelutin.com>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============1262169976671988207=="

--===============1262169976671988207==
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable

This is an automated email from the git hooks/post-receive script.

New change to branch feature/7017 in repository observe.

See http://git.codelutin.com/observe.git

      from  7b6c125   - Suppression dans les handlers to code avec les transa=
ctions - Am=C3=A9lioration du code dans les services - faire fonctionner la s=
auvegarde de CatchLongine refs #7017
       new  4f5f524   - Am=C3=A9lioration de la validation des activit=C3=A9s=
 - Revue de la cin=C3=A9matiques pour les =C3=A9crans de type Open (ajout m=
=C3=A9thode onOpenUI) - implantation du service pour les TargetCatch - m=C3=
=A9nache!

The 1 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 4f5f524e255c453f96277b4ba1a8c0f91c03a8df
Author: Tony CHEMIT <chemit@codelutin.com>
Date:   Sat May 2 15:16:21 2015 +0200

    - Am=C3=A9lioration de la validation des activit=C3=A9s
    - Revue de la cin=C3=A9matiques pour les =C3=A9crans de type Open (ajout =
m=C3=A9thode onOpenUI)
    - implantation du service pour les TargetCatch
    - m=C3=A9nache!
   =20
    refs #7017

Summary of changes:
 .../main/java/fr/ird/observe/BinderService.java    | 128 ++---
 .../fr/ird/observe/ObserveApplicationContext.java  |   8 -
 .../java/fr/ird/observe/entities/Entities.java     |  14 +-
 .../observe/entities/seine/ActivitySeineImpl.java  |  38 +-
 .../ird/observe/entities/seine/ActivitySeines.java |   3 +-
 .../java/fr/ird/observe/entities/seine/Routes.java |  22 +
 .../ird/observe/entities/seine/TargetCatches.java  |  24 +
 .../observe/services/AbstractObserveService.java   |  31 --
 .../data/longline/ActivityLonglineService.java     |   2 -
 .../data/longline/ActivityLonglineServiceImpl.java |   7 +-
 .../services/data/longline/SetLonglineService.java |   2 +-
 .../data/longline/SetLonglineServiceImpl.java      |  34 +-
 .../services/data/seine/NonTargetCatchService.java |   2 +-
 .../data/seine/NonTargetCatchServiceImpl.java      |  13 +-
 .../data/seine/NonTargetSampleService.java         |  13 +-
 .../data/seine/NonTargetSampleServiceImpl.java     |  58 +--
 .../observe/services/data/seine/RouteService.java  |   2 -
 .../services/data/seine/RouteServiceImpl.java      |   8 +-
 .../services/data/seine/SetSeineServiceImpl.java   |   5 +-
 .../services/data/seine/TargetCatchService.java    |  28 ++
 .../data/seine/TargetCatchServiceImpl.java         | 164 +++++++
 .../services/data/seine/TargetSampleService.java   |  16 +-
 .../data/seine/TargetSampleServiceImpl.java        |  75 +--
 .../services/referential/ReferentialService.java   |   2 +
 .../referential/ReferentialServiceImpl.java        |   8 +
 .../ird/observe/ui/content/ContentUIHandler.java   |  69 +--
 .../fr/ird/observe/ui/content/ContentUIModel.java  |  26 --
 .../LonglineGlobalCompositionUIHandler.java        |   6 +-
 .../impl/longline/SetLonglineUIHandler.java        |  10 +-
 .../ActivitySeineObservedSystemUIHandler.java      |   1 +
 .../ui/content/impl/seine/SetSeineUIHandler.java   |   6 +-
 .../ui/content/open/ContentOpenableUIHandler.java  |  43 +-
 .../impl/longline/ActivityLonglineUIHandler.java   |  62 +--
 .../open/impl/longline/TripLonglineUIHandler.java  |  39 +-
 .../open/impl/seine/ActivitySeineUIHandler.java    |  79 ++--
 .../ui/content/open/impl/seine/RouteUIHandler.java | 139 ++----
 .../open/impl/seine/TripSeineUIHandler.java        |  38 +-
 .../ui/content/table/ContentTableUIHandler.java    | 450 ++++++------------
 .../ui/content/table/ContentTableUIModel.java      |   2 +-
 .../impl/longline/SizeMeasuresTableModel.java      |   3 +-
 .../impl/longline/WeightMeasuresTableModel.java    |   3 +-
 .../table/impl/seine/NonTargetCatchUIHandler.java  | 299 ++++++------
 .../table/impl/seine/NonTargetSampleUIHandler.java | 134 +++---
 .../impl/seine/ObjectObservedSpeciesUIHandler.java |   8 +-
 .../table/impl/seine/TargetCatchUIHandler.java     | 293 +++++-------
 .../impl/seine/TargetDiscardCatchUIHandler.java    | 514 +++++++++----------=
--
 .../table/impl/seine/TargetSampleUIHandler.java    |   2 +-
 .../fr/ird/observe/ui/tree/SetLonglineNode.java    |   2 +-
 .../field/VesselActivityFieldValidator.java        |  52 +--
 49 files changed, 1343 insertions(+), 1644 deletions(-)
 create mode 100644 observe-entities/src/main/java/fr/ird/observe/entities/se=
ine/TargetCatches.java
 create mode 100644 observe-services/src/main/java/fr/ird/observe/services/da=
ta/seine/TargetCatchService.java
 create mode 100644 observe-services/src/main/java/fr/ird/observe/services/da=
ta/seine/TargetCatchServiceImpl.java

--=20
To stop receiving notification emails like this one, please contact
codelutin.com SCM administrator <admin+scm@list.forge.codelutin.com>.

--===============1262169976671988207==--


From scm@users.codelutin.com Sat May  2 13:17:52 2015
From: "codelutin.com scm" <scm@users.codelutin.com>
To: observe-commits@list.forge.codelutin.com
Subject: [Observe-commits]  01/01: - =?utf-8?q?Am=C3=A9lioration?= de la
 validation des =?utf-8?q?activit=C3=A9s_-_Revue_de_la_cin=C3=A9matiques?=
 pour les =?utf-8?q?=C3=A9crans_de_type_Open_=28ajout_m=C3=A9thode?= onOpenUI)
 - implantation du service pour les TargetCatch - =?utf-8?q?m=C3=A9nache!?=
Date: Sat, 02 May 2015 13:17:50 +0000
Message-ID: <20150502131752.2311F5C62BE@goh.codelutin.com>
In-Reply-To: <20150502131749.18681.91646@bihar.codelutin.com>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============7732948896259298477=="

--===============7732948896259298477==
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable

This is an automated email from the git hooks/post-receive script.

New commit to branch feature/7017 in repository observe.

See http://git.codelutin.com/observe.git

commit 4f5f524e255c453f96277b4ba1a8c0f91c03a8df
Author: Tony CHEMIT <chemit@codelutin.com>
Date:   Sat May 2 15:16:21 2015 +0200

    - Am=C3=A9lioration de la validation des activit=C3=A9s
    - Revue de la cin=C3=A9matiques pour les =C3=A9crans de type Open (ajout =
m=C3=A9thode onOpenUI)
    - implantation du service pour les TargetCatch
    - m=C3=A9nache!
   =20
    refs #7017
---
 .../main/java/fr/ird/observe/BinderService.java    | 128 ++---
 .../fr/ird/observe/ObserveApplicationContext.java  |   8 -
 .../java/fr/ird/observe/entities/Entities.java     |  14 +-
 .../observe/entities/seine/ActivitySeineImpl.java  |  38 +-
 .../ird/observe/entities/seine/ActivitySeines.java |   3 +-
 .../java/fr/ird/observe/entities/seine/Routes.java |  22 +
 .../ird/observe/entities/seine/TargetCatches.java  |  24 +
 .../observe/services/AbstractObserveService.java   |  31 --
 .../data/longline/ActivityLonglineService.java     |   2 -
 .../data/longline/ActivityLonglineServiceImpl.java |   7 +-
 .../services/data/longline/SetLonglineService.java |   2 +-
 .../data/longline/SetLonglineServiceImpl.java      |  34 +-
 .../services/data/seine/NonTargetCatchService.java |   2 +-
 .../data/seine/NonTargetCatchServiceImpl.java      |  13 +-
 .../data/seine/NonTargetSampleService.java         |  13 +-
 .../data/seine/NonTargetSampleServiceImpl.java     |  58 +--
 .../observe/services/data/seine/RouteService.java  |   2 -
 .../services/data/seine/RouteServiceImpl.java      |   8 +-
 .../services/data/seine/SetSeineServiceImpl.java   |   5 +-
 .../services/data/seine/TargetCatchService.java    |  28 ++
 .../data/seine/TargetCatchServiceImpl.java         | 164 +++++++
 .../services/data/seine/TargetSampleService.java   |  16 +-
 .../data/seine/TargetSampleServiceImpl.java        |  75 +--
 .../services/referential/ReferentialService.java   |   2 +
 .../referential/ReferentialServiceImpl.java        |   8 +
 .../ird/observe/ui/content/ContentUIHandler.java   |  69 +--
 .../fr/ird/observe/ui/content/ContentUIModel.java  |  26 --
 .../LonglineGlobalCompositionUIHandler.java        |   6 +-
 .../impl/longline/SetLonglineUIHandler.java        |  10 +-
 .../ActivitySeineObservedSystemUIHandler.java      |   1 +
 .../ui/content/impl/seine/SetSeineUIHandler.java   |   6 +-
 .../ui/content/open/ContentOpenableUIHandler.java  |  43 +-
 .../impl/longline/ActivityLonglineUIHandler.java   |  62 +--
 .../open/impl/longline/TripLonglineUIHandler.java  |  39 +-
 .../open/impl/seine/ActivitySeineUIHandler.java    |  79 ++--
 .../ui/content/open/impl/seine/RouteUIHandler.java | 139 ++----
 .../open/impl/seine/TripSeineUIHandler.java        |  38 +-
 .../ui/content/table/ContentTableUIHandler.java    | 450 ++++++------------
 .../ui/content/table/ContentTableUIModel.java      |   2 +-
 .../impl/longline/SizeMeasuresTableModel.java      |   3 +-
 .../impl/longline/WeightMeasuresTableModel.java    |   3 +-
 .../table/impl/seine/NonTargetCatchUIHandler.java  | 299 ++++++------
 .../table/impl/seine/NonTargetSampleUIHandler.java | 134 +++---
 .../impl/seine/ObjectObservedSpeciesUIHandler.java |   8 +-
 .../table/impl/seine/TargetCatchUIHandler.java     | 293 +++++-------
 .../impl/seine/TargetDiscardCatchUIHandler.java    | 514 +++++++++----------=
--
 .../table/impl/seine/TargetSampleUIHandler.java    |   2 +-
 .../fr/ird/observe/ui/tree/SetLonglineNode.java    |   2 +-
 .../field/VesselActivityFieldValidator.java        |  52 +--
 49 files changed, 1343 insertions(+), 1644 deletions(-)

diff --git a/observe-business/src/main/java/fr/ird/observe/BinderService.java=
 b/observe-business/src/main/java/fr/ird/observe/BinderService.java
index 0874332..a0cfdba 100644
--- a/observe-business/src/main/java/fr/ird/observe/BinderService.java
+++ b/observe-business/src/main/java/fr/ird/observe/BinderService.java
@@ -21,6 +21,8 @@
  */
 package fr.ird.observe;
=20
+import com.google.common.base.Preconditions;
+import fr.ird.observe.entities.Entities;
 import fr.ird.observe.entities.longline.ActivityLongline;
 import fr.ird.observe.entities.longline.BaitsComposition;
 import fr.ird.observe.entities.longline.Basket;
@@ -122,7 +124,6 @@ import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.nuiton.topia.persistence.TopiaEntity;
 import org.nuiton.topia.persistence.util.TopiaEntityBinder;
-import org.nuiton.topia.persistence.util.TopiaEntityHelper;
 import org.nuiton.util.beans.Binder;
 import org.nuiton.util.beans.BinderModelBuilder;
=20
@@ -226,6 +227,8 @@ public class BinderService {
             I18nReferenceEntity.PROPERTY_LABEL8
     };
=20
+    public static final String SIMPLE =3D "Observe";
+
     static {
=20
         try {
@@ -253,7 +256,6 @@ public class BinderService {
=20
     }
=20
-
     public <E extends TopiaEntity> void copyExcluding(Class<E> type, String =
context, E source, E target, String... propertyNames) {
=20
         copyExcluding(type, context, source, target, true, propertyNames);
@@ -292,40 +294,41 @@ public class BinderService {
         return binder;
     }
=20
+    public <E extends TopiaEntity> void simpleCopy(E source, E target, boole=
an tech) {
+        Class<E> entityClass =3D Entities.getContract(target);
+        TopiaEntityBinder<E> binder =3D getBinder(entityClass, SIMPLE);
+        binder.load(source, target, tech);
+    }
=20
-    public static <E extends TopiaEntity> BinderModelBuilder<E, E> newBinder=
Builder(Class<E> type, String... properties) {
+    protected static <E extends TopiaEntity> BinderModelBuilder<E, E> newBin=
derBuilder(Class<E> type, String... properties) {
         BinderModelBuilder<E, E> builder =3D BinderModelBuilder.newEmptyBuil=
der(type);
         builder.addSimpleProperties(properties);
         return builder;
     }
=20
-    public <E extends TopiaEntity> TopiaEntityBinder<E> getTopiaBinder(Class=
<E> entityClass,
-                                                                       Strin=
g contextName) {
+    @SuppressWarnings("unchecked")
+    protected <E extends TopiaEntity> TopiaEntityBinder<E> getTopiaBinder(Cl=
ass<E> entityClass, String contextName) {
+
+        TopiaEntityBinder<E> binder;
         if (ObserveBinderHelper.getCachedBinderModel(entityClass, entityClas=
s, contextName) =3D=3D null) {
=20
             // we do not want to have auto created binder model by the facto=
ry
-            return null;
+            binder =3D null;
+        } else {
+
+            binder =3D (TopiaEntityBinder<E>)
+                    ObserveBinderHelper.newBinder(entityClass, entityClass, =
contextName, TopiaEntityBinder.class);
+
         }
-        return (TopiaEntityBinder<E>) ObserveBinderHelper.newBinder(entityCl=
ass, entityClass, contextName, TopiaEntityBinder.class);
+        return binder;
     }
=20
-    public static <E extends TopiaEntity> TopiaEntityBinder<E> registerTopia=
Binder(Class<E> entityClass,
+    protected static <E extends TopiaEntity> TopiaEntityBinder<E> registerTo=
piaBinder(Class<E> entityClass,
                                                                             =
       BinderModelBuilder<E, E> builder,
                                                                             =
       String contextName) {
-        return ObserveBinderHelper.registerTopiaBinder(entityClass, builder,=
 contextName);
-    }
-
-    public <E extends TopiaEntity> TopiaEntityBinder<E> getSimpleTopiaBinder=
(Class<E> entityClass) {
-        return getTopiaBinder(entityClass, "Observe");
-    }
=20
-    public <E extends TopiaEntity> void simpleCopy(E source, E target, boole=
an tech) {
-        Class<E> entityClass =3D (Class<E>) TopiaEntityHelper.getContractCla=
ss(ObserveDAOHelper.getContracts(), target.getClass());
-        TopiaEntityBinder<E> binder =3D getSimpleTopiaBinder(entityClass);
-        if (binder =3D=3D null) {
-            throw new NullPointerException("could not find a simple topia bi=
nder of type : " + target.getClass());
-        }
-        binder.load(source, target, tech);
+        Preconditions.checkArgument(ObserveBinderHelper.getCachedBinderModel=
(entityClass, entityClass, contextName) =3D=3D null, "there is already a bind=
ermodel resigtred for type " + entityClass + " and context " + contextName);
+        return ObserveBinderHelper.registerTopiaBinder(entityClass, builder,=
 contextName);
     }
=20
     protected static void registerSeineBinders() {
@@ -535,69 +538,6 @@ public class BinderService {
=20
         {
=20
-            BinderModelBuilder<ActivitySeine, ActivitySeine> builder =3D new=
BinderBuilder(
-                    ActivitySeine.class,
-                    ActivitySeine.PROPERTY_QUADRANT,
-                    ActivitySeine.PROPERTY_LATITUDE,
-                    ActivitySeine.PROPERTY_LONGITUDE,
-                    ActivitySeine.PROPERTY_ERS_ID,
-                    ActivitySeine.PROPERTY_TIME,
-                    ActivitySeine.PROPERTY_SEA_SURFACE_TEMPERATURE,
-                    ActivitySeine.PROPERTY_REASON_FOR_NO_FISHING,
-                    ActivitySeine.PROPERTY_COMMENT,
-                    ActivitySeine.PROPERTY_VESSEL_SPEED,
-                    ActivitySeine.PROPERTY_OBSERVED_SYSTEM,
-                    ActivitySeine.PROPERTY_OBSERVED_SYSTEM_DISTANCE,
-                    ActivitySeine.PROPERTY_VESSEL_ACTIVITY_SEINE,
-                    ActivitySeine.PROPERTY_SURROUNDING_ACTIVITY,
-                    ActivitySeine.PROPERTY_WIND,
-                    ActivitySeine.PROPERTY_DETECTION_MODE,
-                    ActivitySeine.PROPERTY_SET_SEINE,
-                    ActivitySeine.PROPERTY_FLOATING_OBJECT,
-                    ActivitySeine.PROPERTY_OPEN,
-                    ActivitySeine.PROPERTY_CURRENT_FPA_ZONE,
-                    ActivitySeine.PROPERTY_PREVIOUS_FPA_ZONE,
-                    ActivitySeine.PROPERTY_NEXT_FPA_ZONE);
-
-            builder.addCollectionStrategy(Binder.CollectionStrategy.duplicat=
e, ActivitySeine.PROPERTY_OBSERVED_SYSTEM);
-            builder.addCollectionStrategy(Binder.CollectionStrategy.duplicat=
e, ActivitySeine.PROPERTY_FLOATING_OBJECT);
-
-            //FIXME this one was used ?
-//            BinderModelBuilder<ActivitySeine, ActivitySeine> builder =3D n=
ewBinderBuilder(
-//                    ActivitySeine.class,
-//                    ActivitySeine.PROPERTY_QUADRANT,
-//                    ActivitySeine.PROPERTY_LATITUDE,
-//                    ActivitySeine.PROPERTY_LONGITUDE,
-//                    ActivitySeine.PROPERTY_TIME,
-//                    ActivitySeine.PROPERTY_SEA_SURFACE_TEMPERATURE,
-//                    ActivitySeine.PROPERTY_REASON_FOR_NO_FISHING,
-//                    ActivitySeine.PROPERTY_VESSEL_ACTIVITY_SEINE,
-//                    ActivitySeine.PROPERTY_WIND,
-//                    ActivitySeine.PROPERTY_OPEN);
-//
-            registerTopiaBinder(ActivitySeine.class, builder, EDIT);
-        }
-
-        {
-
-            BinderModelBuilder<Route, Route> builder =3D newBinderBuilder(
-                    Route.class,
-                    Route.PROPERTY_DATE,
-                    Route.PROPERTY_START_LOG_VALUE,
-                    Route.PROPERTY_END_LOG_VALUE,
-                    Route.PROPERTY_CHECK_LEVEL,
-                    Route.PROPERTY_ACTIVITY_SEINE,
-                    Route.PROPERTY_OPEN,
-                    Route.PROPERTY_COMMENT);
-
-            builder.addCollectionStrategy(Binder.CollectionStrategy.duplicat=
e, Route.PROPERTY_ACTIVITY_SEINE);
-
-            registerTopiaBinder(Route.class, builder, EDIT);
-
-        }
-
-        {
-
             BinderModelBuilder<Route, Route> builder =3D newBinderBuilder(
                     Route.class,
                     Route.PROPERTY_DATE,
@@ -878,19 +818,6 @@ public class BinderService {
=20
         }
=20
-
-        {
-
-            BinderModelBuilder<TripSeine, TripSeine> builder =3D newBinderBu=
ilder(
-                    TripSeine.class,
-                    TripSeine.PROPERTY_GEAR_USE_FEATURES_SEINE);
-
-            builder.addCollectionStrategy(Binder.CollectionStrategy.duplicat=
e, TripSeine.PROPERTY_GEAR_USE_FEATURES_SEINE);
-
-            registerTopiaBinder(TripSeine.class, builder, EDIT_GEAR_USE_FEAT=
URES_SEINE);
-
-        }
-
         {
=20
             BinderModelBuilder<TripSeine, TripSeine> builder =3D newBinderBu=
ilder(
@@ -1548,6 +1475,13 @@ public class BinderService {
     protected static void registerReferentialBinders() {
=20
         {
+            // Need to add by hand a speciesList binder
+            // see https://forge.codelutin.com/issues/6963
+            BinderModelBuilder<SpeciesList, SpeciesList> builderModel =3D ne=
wBinderBuilder(SpeciesList.class);
+            registerTopiaBinder(SpeciesList.class, builderModel, "Observe");
+
+        }
+        {
=20
             BinderModelBuilder<Program, Program> builder =3D newBinderBuilde=
r(
                     Program.class,
diff --git a/observe-business/src/main/java/fr/ird/observe/ObserveApplication=
Context.java b/observe-business/src/main/java/fr/ird/observe/ObserveApplicati=
onContext.java
index 1e92b58..bd17f13 100644
--- a/observe-business/src/main/java/fr/ird/observe/ObserveApplicationContext=
.java
+++ b/observe-business/src/main/java/fr/ird/observe/ObserveApplicationContext=
.java
@@ -25,7 +25,6 @@ import fr.ird.observe.db.DataContext;
 import fr.ird.observe.db.DataSource;
 import fr.ird.observe.db.DataSourceFactory;
 import fr.ird.observe.entities.constants.ReferenceLocale;
-import fr.ird.observe.entities.referentiel.SpeciesList;
 import fr.ird.observe.gps.GPSService;
 import fr.ird.observe.validation.ObserveValidator;
 import fr.ird.observe.validation.ValidationContext;
@@ -35,7 +34,6 @@ import jaxx.runtime.context.JAXXContextEntryDef;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.nuiton.decorator.Decorator;
-import org.nuiton.util.beans.BinderModelBuilder;
=20
 import java.util.Locale;
=20
@@ -153,12 +151,6 @@ public class ObserveApplicationContext extends DefaultAp=
plicationContext {
         if (service =3D=3D null) {
             service =3D new BinderService();
=20
-            // Need to add by hand a speciesList binder
-            // see https://forge.codelutin.com/issues/6963
-            BinderModelBuilder<SpeciesList, SpeciesList> builderModel=3D
-                    BinderModelBuilder.newEmptyBuilder(SpeciesList.class);
-            service.registerTopiaBinder(SpeciesList.class, builderModel, "Ob=
serve");
-
             BINDER_SERVICE_ENTRY_DEF.setContextValue(this, service);
         }
         return service;
diff --git a/observe-entities/src/main/java/fr/ird/observe/entities/Entities.=
java b/observe-entities/src/main/java/fr/ird/observe/entities/Entities.java
index 822d926..89340df 100644
--- a/observe-entities/src/main/java/fr/ird/observe/entities/Entities.java
+++ b/observe-entities/src/main/java/fr/ird/observe/entities/Entities.java
@@ -28,6 +28,7 @@ import fr.ird.observe.ObserveEntityEnum;
 import org.apache.commons.collections4.CollectionUtils;
 import org.nuiton.topia.persistence.TopiaEntity;
 import org.nuiton.topia.persistence.TopiaId;
+import org.nuiton.topia.persistence.util.TopiaEntityHelper;
=20
 import java.util.Arrays;
 import java.util.Collection;
@@ -353,20 +354,25 @@ public class Entities {
     public static <E extends TopiaEntity> String getTableName(E entity) {
=20
         ObserveEntityEnum entityEnum =3D ObserveEntityEnum.valueOf(entity);
-        return entityEnum.dbSchemaName()+"."+entityEnum.dbTableName();
+        return entityEnum.dbSchemaName() + "." + entityEnum.dbTableName();
=20
     }
=20
     public static boolean isSeineId(String id) {
-        return  id.contains("Seine");
+        return id.contains("Seine");
     }
=20
     public static boolean isLonglineId(String id) {
-        return  id.contains("Longline");
+        return id.contains("Longline");
     }
=20
     public static <E extends TopiaEntity> boolean isNew(E entity) {
-        return entity.getTopiaId()=3D=3Dnull;
+        return entity.getTopiaId() =3D=3D null;
+    }
+
+    @SuppressWarnings("unchecked")
+    public static <E extends TopiaEntity> Class<E> getContract(E entity) {
+        return (Class<E>) TopiaEntityHelper.getContractClass(ObserveDAOHelpe=
r.getContracts(), entity.getClass());
     }
=20
 }
diff --git a/observe-entities/src/main/java/fr/ird/observe/entities/seine/Act=
ivitySeineImpl.java b/observe-entities/src/main/java/fr/ird/observe/entities/=
seine/ActivitySeineImpl.java
index 7bfed7a..444539e 100644
--- a/observe-entities/src/main/java/fr/ird/observe/entities/seine/ActivitySe=
ineImpl.java
+++ b/observe-entities/src/main/java/fr/ird/observe/entities/seine/ActivitySe=
ineImpl.java
@@ -43,26 +43,28 @@ public class ActivitySeineImpl extends ActivitySeineAbstr=
act {
=20
     private static final long serialVersionUID =3D 2L;
=20
-    public static final String ACTIVITY_FIN_DE_VEILLE =3D "16";
+    public static final String ACTIVITY_FIN_DE_VEILLE_ID =3D "fr.ird.observe=
.entities.referentiel.seine.VesselActivitySeine#1239832675372#0.2139903338012=
5898";
=20
-    public static final String ACTIVITY_DEBUT_DE_PECHE =3D "6";
+    public static final String ACTIVITY_DEBUT_DE_PECHE_ID =3D "fr.ird.observ=
e.entities.referentiel.seine.VesselActivitySeine#1239832675369#0.125529080483=
22586";
=20
-    public static final String ACTIVITY_DEBUT_DE_PECHE_ID =3D "fr.ird.observ=
e.entities.referentiel.seine.VesselActivitySeine#1239832675369#0.027011527426=
829218";
+    public static final String ACTIVITY_FIN_DE_PECHE_ID =3D "fr.ird.observe.=
entities.referentiel.seine.VesselActivitySeine#1239832675369#0.10731168577264=
139";
=20
-    public static final String ACTIVITY_FIN_DE_PECHE =3D "7";
+    public static final String ACTIVITY_CHANGED_ZONE_ID =3D "fr.ird.observe.=
entities.referentiel.seine.VesselActivitySeine#1379684416896#0.38648073770690=
594";
=20
-    public static final String ACTIVITY_CHANGED_ZONE =3D "21";
+    private static final List<String> CALEE_OPERATIONS_ID =3D Collections.si=
ngletonList(ACTIVITY_DEBUT_DE_PECHE_ID);
=20
-    private static final List<String> CALEE_OPERATIONS =3D Collections.singl=
etonList(ACTIVITY_DEBUT_DE_PECHE_ID);
+    private static final List<String> DCP_OPERATIONS_ID =3D Arrays.asList(
+            "fr.ird.observe.entities.referentiel.seine.VesselActivitySeine#1=
239832675370#0.9125190289998782",
+            "fr.ird.observe.entities.referentiel.seine.VesselActivitySeine#1=
239832675371#0.15012142294280495",
+            "fr.ird.observe.entities.referentiel.seine.VesselActivitySeine#1=
239832675371#0.23195165331640677");
=20
-    private static final List<String> DCP_OPERATIONS =3D Arrays.asList("13",=
 "14", "15");
-
-    private static final List<String> SYSTEM_OPERATIONS =3D Arrays.asList("0=
", "11", "11", ACTIVITY_FIN_DE_VEILLE);
+    private static final List<String> SYSTEM_OPERATIONS_ID =3D Arrays.asList(
+            "fr.ird.observe.entities.referentiel.seine.VesselActivitySeine#1=
239832675349#0.363119635949572",
+            "fr.ird.observe.entities.referentiel.seine.VesselActivitySeine#1=
239832675370#0.495613158646268",
+            ACTIVITY_FIN_DE_VEILLE_ID);
=20
     public static final String PROPERTY_CHANGED_ZONE_OPERATION =3D "changedZ=
oneOperation";
=20
-//    public static final String PROPERTY_SET_OPERATION =3D "setOperation";
-
     /**
      * La valeur du quadrant (utilis=C3=A9 uniquement dans l'interface graph=
ique) :
      * en base on conserve cette information dans les coordonn=C3=A9es {@lin=
k #longitude}
@@ -87,25 +89,25 @@ public class ActivitySeineImpl extends ActivitySeineAbstr=
act {
     /** @return {@code true} si l'activite concerne un DCP */
     @Override
     public boolean isDCPOperation() {
-        return vesselActivitySeine !=3D null && DCP_OPERATIONS.contains(vess=
elActivitySeine.getCode());
+        return vesselActivitySeine !=3D null && DCP_OPERATIONS_ID.contains(v=
esselActivitySeine.getTopiaId());
     }
=20
     /** @return {@code true} si l'activite concerne une cal=C3=A9e */
     @Override
     public boolean isSetOperation() {
-        return vesselActivitySeine !=3D null && CALEE_OPERATIONS.contains(ve=
sselActivitySeine.getTopiaId());
+        return vesselActivitySeine !=3D null && CALEE_OPERATIONS_ID.contains=
(vesselActivitySeine.getTopiaId());
     }
=20
     /** @return {@code true} si l'activite concerne un syst=C3=A8me observ=
=C3=A9 */
     @Override
     public boolean isObservedSystemOperation() {
-        return vesselActivitySeine !=3D null && SYSTEM_OPERATIONS.contains(v=
esselActivitySeine.getCode());
+        return vesselActivitySeine !=3D null && SYSTEM_OPERATIONS_ID.contain=
s(vesselActivitySeine.getTopiaId());
     }
=20
     /** @return {@code true} si l'activite concerne un changement de zone */
     @Override
     public boolean isChangedZoneOperation() {
-        return vesselActivitySeine !=3D null && ACTIVITY_CHANGED_ZONE.equals=
(vesselActivitySeine.getCode());
+        return vesselActivitySeine !=3D null && ACTIVITY_CHANGED_ZONE_ID.equ=
als(vesselActivitySeine.getTopiaId());
     }
=20
     @Override
@@ -125,7 +127,7 @@ public class ActivitySeineImpl extends ActivitySeineAbstr=
act {
     @Override
     public void setQuadrant(Integer quadrant) {
         if (log.isInfoEnabled()) {
-            log.info("New quadrant value: "+quadrant);
+            log.info("New quadrant value: " + quadrant);
         }
         Integer old =3D this.quadrant;
 //        fireOnPreWrite(PROPERTY_QUADRANT, old, quadrant);
@@ -151,7 +153,7 @@ public class ActivitySeineImpl extends ActivitySeineAbstr=
act {
=20
     @Override
     public boolean isActivityFinDePeche() {
-        return vesselActivitySeine !=3D null && ACTIVITY_FIN_DE_PECHE.equals=
(vesselActivitySeine.getCode());
+        return vesselActivitySeine !=3D null && ACTIVITY_FIN_DE_PECHE_ID.equ=
als(vesselActivitySeine.getTopiaId());
     }
=20
     @Override
@@ -161,7 +163,7 @@ public class ActivitySeineImpl extends ActivitySeineAbstr=
act {
=20
     @Override
     public boolean isActivityFinDeVeille() {
-        return vesselActivitySeine !=3D null && ACTIVITY_FIN_DE_VEILLE.equal=
s(vesselActivitySeine.getCode());
+        return vesselActivitySeine !=3D null && ACTIVITY_FIN_DE_VEILLE_ID.eq=
uals(vesselActivitySeine.getTopiaId());
     }
=20
     @Override
diff --git a/observe-entities/src/main/java/fr/ird/observe/entities/seine/Act=
ivitySeines.java b/observe-entities/src/main/java/fr/ird/observe/entities/sei=
ne/ActivitySeines.java
index a3dcd99..89a923d 100644
--- a/observe-entities/src/main/java/fr/ird/observe/entities/seine/ActivitySe=
ines.java
+++ b/observe-entities/src/main/java/fr/ird/observe/entities/seine/ActivitySe=
ines.java
@@ -48,8 +48,7 @@ public class ActivitySeines {
=20
                 @Override
                 public int compare(ActivitySeine o1, ActivitySeine o2) {
-                    return o1.getTime().compareTo(
-                            o2.getTime());
+                    return o1.getTime().compareTo(o2.getTime());
                 }
             };
=20
diff --git a/observe-entities/src/main/java/fr/ird/observe/entities/seine/Rou=
tes.java b/observe-entities/src/main/java/fr/ird/observe/entities/seine/Route=
s.java
index c59c644..add626f 100644
--- a/observe-entities/src/main/java/fr/ird/observe/entities/seine/Routes.java
+++ b/observe-entities/src/main/java/fr/ird/observe/entities/seine/Routes.java
@@ -22,9 +22,11 @@ package fr.ird.observe.entities.seine;
  * #L%
  */
=20
+import fr.ird.observe.entities.referentiel.seine.VesselActivitySeine;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
=20
+import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Comparator;
 import java.util.List;
@@ -91,4 +93,24 @@ public class Routes {
         return previous;
     }
=20
+    /**
+     * Recupere les positions des activit=C3=A9s d'un certain type.
+     *
+     * @param route            la route =C3=A0 inspecter
+     * @param vesselActivityId l'id du type d'activit=C3=A9 =C3=A0 rechercher
+     * @return les positions des activitys d'un certain type donn=C3=A9
+     */
+    public static Integer[] detectActivities(Route route, String vesselActiv=
ityId) {
+        List<Integer> list =3D new ArrayList<Integer>();
+        int index =3D 0;
+        for (ActivitySeine a : route.getActivitySeine()) {
+            VesselActivitySeine vesselActivitySeine =3D a.getVesselActivityS=
eine();
+            if (vesselActivityId.equals(vesselActivitySeine.getTopiaId())) {
+                list.add(index);
+            }
+            index++;
+        }
+        return list.toArray(new Integer[list.size()]);
+    }
+
 }
diff --git a/observe-entities/src/main/java/fr/ird/observe/entities/seine/Tar=
getCatches.java b/observe-entities/src/main/java/fr/ird/observe/entities/sein=
e/TargetCatches.java
new file mode 100644
index 0000000..482cbcb
--- /dev/null
+++ b/observe-entities/src/main/java/fr/ird/observe/entities/seine/TargetCatc=
hes.java
@@ -0,0 +1,24 @@
+package fr.ird.observe.entities.seine;
+
+import com.google.common.base.Predicate;
+import com.google.common.base.Predicates;
+
+/**
+ * Created on 5/2/15.
+ *
+ * @author Tony Chemit - chemit@codelutin.com
+ * @since 4.0
+ */
+public class TargetCatches {
+
+    public static final Predicate<TargetCatch> TARGET_CATCH_IS_DISCARDED =3D=
 new Predicate<TargetCatch>() {
+        @Override
+        public boolean apply(TargetCatch input) {
+            return input.isDiscarded();
+        }
+    };
+
+    public static final Predicate<TargetCatch> TARGET_CATCH_IS_NOT_DISCARDED=
 =3D
+            Predicates.not(TARGET_CATCH_IS_DISCARDED);
+
+}
diff --git a/observe-services/src/main/java/fr/ird/observe/services/AbstractO=
bserveService.java b/observe-services/src/main/java/fr/ird/observe/services/A=
bstractObserveService.java
index 2f2df05..9fa8dc1 100644
--- a/observe-services/src/main/java/fr/ird/observe/services/AbstractObserveS=
ervice.java
+++ b/observe-services/src/main/java/fr/ird/observe/services/AbstractObserveS=
ervice.java
@@ -6,7 +6,6 @@ import com.google.common.collect.Lists;
 import fr.ird.observe.BinderService;
 import fr.ird.observe.IObserveConfig;
 import fr.ird.observe.ObserveEntityEnum;
-import fr.ird.observe.ObserveServiceHelper;
 import fr.ird.observe.entities.Entities;
 import fr.ird.observe.entities.EntityMap;
 import fr.ird.observe.entities.constants.ReferenceLocale;
@@ -20,7 +19,6 @@ import org.nuiton.topia.persistence.TopiaEntity;
 import org.nuiton.topia.persistence.util.EntityListUpdator;
 import org.nuiton.topia.persistence.util.TopiaEntityBinder;
 import org.nuiton.topia.persistence.util.TopiaEntityHelper;
-import org.nuiton.util.beans.BinderModelBuilder;
=20
 import java.util.ArrayList;
 import java.util.Collection;
@@ -201,35 +199,6 @@ public abstract class AbstractObserveService implements =
ObserveService {
=20
     }
=20
-
-    protected <E extends TopiaEntity> TopiaEntityBinder<E> loadBinder(String=
 suffix, Class<E> entityType, CreateBinder<E> createBinder) {
-
-        BinderService binderService =3D ObserveServiceHelper.get().getBinder=
Service();
-
-        String binderName =3D getClass().getName() + suffix;
-        TopiaEntityBinder<E> r =3D binderService.getTopiaBinder(entityType, =
binderName);
-
-        if (r =3D=3D null) {
-
-            BinderModelBuilder<E, E> builder =3D createBinder.createBinderBu=
ilder(binderService, binderName);
-            r =3D createBinder.registerTopiaBinder(binderService, entityType=
, builder, binderName);
-
-        }
-
-        return r;
-
-    }
-
-    protected abstract class CreateBinder<E extends TopiaEntity> {
-
-        public abstract BinderModelBuilder<E, E> createBinderBuilder(BinderS=
ervice binderService, String name);
-
-        public TopiaEntityBinder<E> registerTopiaBinder(BinderService binder=
Service, Class<E> entityType, BinderModelBuilder<E, E> builder, String name) {
-            return binderService.registerTopiaBinder(entityType, builder, na=
me);
-        }
-
-    }
-
     public <P extends TopiaEntity, E extends TopiaEntity> String doSave(Stri=
ng parentId, E toSave, SaveAction<P, E> saveAction) {
         E saved;
=20
diff --git a/observe-services/src/main/java/fr/ird/observe/services/data/long=
line/ActivityLonglineService.java b/observe-services/src/main/java/fr/ird/obs=
erve/services/data/longline/ActivityLonglineService.java
index 3d640bc..3aaa858 100644
--- a/observe-services/src/main/java/fr/ird/observe/services/data/longline/Ac=
tivityLonglineService.java
+++ b/observe-services/src/main/java/fr/ird/observe/services/data/longline/Ac=
tivityLonglineService.java
@@ -18,8 +18,6 @@ public interface ActivityLonglineService extends ObserveSer=
vice {
=20
     List<ActivityLongline> getActivityLonglineStubByTrip(String tripId);
=20
-    ActivityLongline loadForDisplay(String activityLonglineId);
-
     ActivityLongline loadForEdit(String activityLonglineId);
=20
     ActivityLongline preCreate(String tripLonglineId);
diff --git a/observe-services/src/main/java/fr/ird/observe/services/data/long=
line/ActivityLonglineServiceImpl.java b/observe-services/src/main/java/fr/ird=
/observe/services/data/longline/ActivityLonglineServiceImpl.java
index 8a81987..20a96c5 100644
--- a/observe-services/src/main/java/fr/ird/observe/services/data/longline/Ac=
tivityLonglineServiceImpl.java
+++ b/observe-services/src/main/java/fr/ird/observe/services/data/longline/Ac=
tivityLonglineServiceImpl.java
@@ -38,7 +38,7 @@ public class ActivityLonglineServiceImpl extends AbstractOb=
serveService implemen
     }
=20
     @Override
-    public ActivityLongline loadForDisplay(String activityLonglineId) {
+    public ActivityLongline loadForEdit(String activityLonglineId) {
=20
         ActivityLongline loaded =3D getDao().newInstance();
         ActivityLongline toLoad =3D getDao().findByTopiaId(activityLonglineI=
d);
@@ -48,11 +48,6 @@ public class ActivityLonglineServiceImpl extends AbstractO=
bserveService implemen
=20
     }
=20
-    @Override
-    public ActivityLongline loadForEdit(String activityLonglineId) {
-        return loadForDisplay(activityLonglineId);
-    }
-
=20
     @Override
     public ActivityLongline preCreate(String tripLonglineId) {
diff --git a/observe-services/src/main/java/fr/ird/observe/services/data/long=
line/SetLonglineService.java b/observe-services/src/main/java/fr/ird/observe/=
services/data/longline/SetLonglineService.java
index 89c8324..a4b4902 100644
--- a/observe-services/src/main/java/fr/ird/observe/services/data/longline/Se=
tLonglineService.java
+++ b/observe-services/src/main/java/fr/ird/observe/services/data/longline/Se=
tLonglineService.java
@@ -15,7 +15,7 @@ import java.util.List;
  */
 public interface SetLonglineService extends ObserveService {
=20
-    SetLongline loadSet(String setLonglineId);
+    SetLongline loadForDisplay(String setLonglineId);
=20
     List<Section> getSections(String setLonglineId);
=20
diff --git a/observe-services/src/main/java/fr/ird/observe/services/data/long=
line/SetLonglineServiceImpl.java b/observe-services/src/main/java/fr/ird/obse=
rve/services/data/longline/SetLonglineServiceImpl.java
index 793e631..b6e88aa 100644
--- a/observe-services/src/main/java/fr/ird/observe/services/data/longline/Se=
tLonglineServiceImpl.java
+++ b/observe-services/src/main/java/fr/ird/observe/services/data/longline/Se=
tLonglineServiceImpl.java
@@ -23,11 +23,6 @@ import java.util.List;
  */
 public class SetLonglineServiceImpl extends AbstractObserveService implement=
s SetLonglineService {
=20
-    @Override
-    public SetLongline loadSet(String setLonglineId) {
-        return null;
-    }
-
     public List<Section> getSections(String setLonglineId) {
=20
         TopiaDAO<Section> dao =3D getDao(Section.class);
@@ -69,6 +64,30 @@ public class SetLonglineServiceImpl extends AbstractObserv=
eService implements Se
     }
=20
     @Override
+    public SetLongline loadForDisplay(String setLonglineId) {
+
+        SetLonglineDAO dao =3D getDao();
+
+        SetLongline loaded =3D dao.newInstance();
+        SetLongline toLoad =3D dao.findByTopiaId(setLonglineId);
+        copy(SetLongline.class, BinderService.EDIT, toLoad, loaded);
+        return loaded;
+
+    }
+
+    @Override
+    public SetLongline loadForEdit(String setLonglineId) {
+
+        SetLonglineDAO dao =3D getDao();
+
+        SetLongline loaded =3D dao.newInstance();
+        SetLongline toLoad =3D dao.findByTopiaId(setLonglineId);
+        copy(SetLongline.class, BinderService.EDIT, toLoad, loaded);
+        return loaded;
+
+    }
+
+    @Override
     public SetLongline preCreate(String activityLonglineId) {
=20
         ActivityLongline activityLongline =3D findByTopiaId(ActivityLongline=
.class, activityLonglineId);
@@ -98,11 +117,6 @@ public class SetLonglineServiceImpl extends AbstractObser=
veService implements Se
     }
=20
     @Override
-    public SetLongline loadForEdit(String setLonglineId) {
-        return null;
-    }
-
-    @Override
     public String save(String activityLonglineId, SetLongline setLongline) {
=20
         String setLonglineId =3D doSave(activityLonglineId, setLongline, new=
 SaveAction<ActivityLongline, SetLongline>(ActivityLongline.class, SetLonglin=
e.class) {
diff --git a/observe-services/src/main/java/fr/ird/observe/services/data/sein=
e/NonTargetCatchService.java b/observe-services/src/main/java/fr/ird/observe/=
services/data/seine/NonTargetCatchService.java
index a92d6b4..59786f6 100644
--- a/observe-services/src/main/java/fr/ird/observe/services/data/seine/NonTa=
rgetCatchService.java
+++ b/observe-services/src/main/java/fr/ird/observe/services/data/seine/NonTa=
rgetCatchService.java
@@ -15,6 +15,6 @@ public interface NonTargetCatchService extends ObserveServi=
ce {
     SetSeine loadForEdit(String setId);
=20
     @Commit
-    void save(SetSeine parent, List<NonTargetLength> tailleToDelete);
+    void save(SetSeine toSave, List<NonTargetLength> nonTargetLengthsToDelet=
e);
=20
 }
diff --git a/observe-services/src/main/java/fr/ird/observe/services/data/sein=
e/NonTargetCatchServiceImpl.java b/observe-services/src/main/java/fr/ird/obse=
rve/services/data/seine/NonTargetCatchServiceImpl.java
index c7a6139..51d5711 100644
--- a/observe-services/src/main/java/fr/ird/observe/services/data/seine/NonTa=
rgetCatchServiceImpl.java
+++ b/observe-services/src/main/java/fr/ird/observe/services/data/seine/NonTa=
rgetCatchServiceImpl.java
@@ -52,14 +52,16 @@ public class NonTargetCatchServiceImpl extends AbstractOb=
serveService implements
         }
=20
         return loaded;
+
     }
=20
     @Override
-    public void save(SetSeine parent, final List<NonTargetLength> tailleToDe=
lete) {
+    public void save(SetSeine toSave, final List<NonTargetLength> nonTargetL=
engthsToDelete) {
+
         TopiaEntityBinder<SetSeine> parentBinder =3D getBinder(SetSeine.clas=
s, BinderService.EDIT_NON_TARGET_CATCH);
         TopiaEntityBinder<NonTargetCatch> childbinder =3D getBinder(NonTarge=
tCatch.class, BinderService.EDIT);
=20
-        doSaveList(parent, new SaveCollectionAction<SetSeine, NonTargetCatch=
>(
+        doSaveList(toSave, new SaveCollectionAction<SetSeine, NonTargetCatch=
>(
                 SetSeine.class, NonTargetCatch.class, getListUpdator(), pare=
ntBinder, childbinder) {
=20
             @Override
@@ -81,18 +83,18 @@ public class NonTargetCatchServiceImpl extends AbstractOb=
serveService implements
             @Override
             public void onUpdateFinalize(SetSeine parent, Collection<NonTarg=
etCatch> oldChilds) throws TopiaException {
=20
-                if (CollectionUtils.isNotEmpty(tailleToDelete)) {
+                if (CollectionUtils.isNotEmpty(nonTargetLengthsToDelete)) {
=20
                     // on a demande la suppression de taille obsoletes
=20
                     if (log.isInfoEnabled()) {
-                        log.info("Will remove " + tailleToDelete.size() + " =
obsolete nonTargetSample(s).");
+                        log.info("Will remove " + nonTargetLengthsToDelete.s=
ize() + " obsolete nonTargetSample(s).");
                     }
=20
                     NonTargetSample echantillon =3D parent.getNonTargetSampl=
e().get(0);
=20
                     // on supprime les echantillons obsoletes
-                    echantillon.getNonTargetLength().removeAll(tailleToDelet=
e);
+                    echantillon.getNonTargetLength().removeAll(nonTargetLeng=
thsToDelete);
=20
                 }
             }
@@ -106,4 +108,5 @@ public class NonTargetCatchServiceImpl extends AbstractOb=
serveService implements
                 NonTargetCatch.class,
                 SetSeine.PROPERTY_NON_TARGET_CATCH);
     }
+
 }
diff --git a/observe-services/src/main/java/fr/ird/observe/services/data/sein=
e/NonTargetSampleService.java b/observe-services/src/main/java/fr/ird/observe=
/services/data/seine/NonTargetSampleService.java
index c4bc584..e433ab6 100644
--- a/observe-services/src/main/java/fr/ird/observe/services/data/seine/NonTa=
rgetSampleService.java
+++ b/observe-services/src/main/java/fr/ird/observe/services/data/seine/NonTa=
rgetSampleService.java
@@ -6,8 +6,8 @@ import fr.ird.observe.entities.seine.NonTargetSample;
 import fr.ird.observe.services.Commit;
 import fr.ird.observe.services.ObserveService;
=20
-import java.util.Collection;
 import java.util.List;
+import java.util.Set;
=20
 /**
  * Created on 4/26/15.
@@ -17,21 +17,18 @@ import java.util.List;
  */
 public interface NonTargetSampleService extends ObserveService {
=20
-    List<Species> getAvailableEspeceForNonTargetSample(String setSeineId);
+    List<Species> getAvailableSpeciesForNonTargetSample(String setSeineId);
=20
     NonTargetSample getNonTargetSample(String setSeineId);
=20
     boolean canUseNonTargetSample(String setSeineId);
=20
-    void getObsoleteEspeceForNonTargetSample(String setSeineId,
-                                             List<Species> speciessUsed,
-                                             Collection<Species> speciessToD=
elete,
-                                             List<NonTargetLength> tailleToD=
elete);
+    List<NonTargetLength> getObsoleteNonTargetLengths(String setSeineId, Set=
<String> speciesIdsUsed);
=20
     @Commit
-    void delete(String setId, NonTargetSample editBean);
+    String save(String setId, NonTargetSample editBean);
=20
     @Commit
-    String save(String setId, NonTargetSample editBean);
+    void delete(String setId, NonTargetSample editBean);
=20
 }
diff --git a/observe-services/src/main/java/fr/ird/observe/services/data/sein=
e/NonTargetSampleServiceImpl.java b/observe-services/src/main/java/fr/ird/obs=
erve/services/data/seine/NonTargetSampleServiceImpl.java
index b453188..d7a0983 100644
--- a/observe-services/src/main/java/fr/ird/observe/services/data/seine/NonTa=
rgetSampleServiceImpl.java
+++ b/observe-services/src/main/java/fr/ird/observe/services/data/seine/NonTa=
rgetSampleServiceImpl.java
@@ -16,6 +16,7 @@ import org.nuiton.topia.persistence.util.TopiaEntityBinder;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
+import java.util.Set;
=20
 /**
  * Created on 4/26/15.
@@ -33,7 +34,7 @@ public class NonTargetSampleServiceImpl extends AbstractObs=
erveService implement
     }
=20
     @Override
-    public List<Species> getAvailableEspeceForNonTargetSample(String setSein=
eId) {
+    public List<Species> getAvailableSpeciesForNonTargetSample(String setSei=
neId) {
=20
         List<Species> speciesList =3D new ArrayList<Species>();
=20
@@ -110,36 +111,38 @@ public class NonTargetSampleServiceImpl extends Abstrac=
tObserveService implement
     }
=20
     @Override
-    public void getObsoleteEspeceForNonTargetSample(String setSeineId,
-                                                    List<Species> speciessUs=
ed,
-                                                    Collection<Species> spec=
iessToDelete,
-                                                    List<NonTargetLength> ta=
illeToDelete) {
+    public List<NonTargetLength> getObsoleteNonTargetLengths(String setSeine=
Id, Set<String> speciessUsed) {
=20
         SetSeine setSeine =3D findByTopiaId(SetSeine.class, setSeineId);
=20
-        if (setSeine.isNonTargetSampleEmpty()) {
-            return;
-        }
+        List<NonTargetLength> nonTargetLengthsToDelete =3D new ArrayList<Non=
TargetLength>();
=20
-        NonTargetSample echantillon =3D setSeine.getNonTargetSample().get(0);
+        if (!setSeine.isNonTargetSampleEmpty()) {
=20
-        if (echantillon.isNonTargetLengthEmpty()) {
-            return;
-        }
+            NonTargetSample nonTargetSample =3D setSeine.getNonTargetSample(=
).get(0);
+
+            if (!nonTargetSample.isNonTargetLengthEmpty()) {
+
+                for (NonTargetLength taille : nonTargetSample.getNonTargetLe=
ngth()) {
+
+                    Species species =3D taille.getSpecies();
+                    if (!speciessUsed.contains(species.getTopiaId())) {
+
+                        // l'esp=C3=A8ce n'existe plus dans les rejet faune,=
 on doit le supprimer
+                        nonTargetLengthsToDelete.add(taille);
+                        if (log.isDebugEnabled()) {
+                            log.debug("remove obsolote echantillon " + taill=
e + " for species " + species);
+                        }
+
+                    }
=20
-        for (NonTargetLength taille : echantillon.getNonTargetLength()) {
-            Species tailleEspece =3D taille.getSpecies();
-            if (!speciessUsed.contains(tailleEspece)) {
-                // l'species n'existe plus dans les rejet faune,
-                // on doit le supprimer
-                tailleToDelete.add(taille);
-                speciessToDelete.add(tailleEspece);
-                if (log.isDebugEnabled()) {
-                    log.debug("remove obsolote echantillon " + taille + " fo=
r species " + tailleEspece);
                 }
+
             }
+
         }
=20
+        return nonTargetLengthsToDelete;
=20
     }
=20
@@ -161,11 +164,11 @@ public class NonTargetSampleServiceImpl extends Abstrac=
tObserveService implement
             }
=20
             @Override
-            public NonTargetSample onUpdate(SetSeine parentBean, NonTargetSa=
mple toSave, NonTargetSample beanToSave) {
+            public NonTargetSample onUpdate(SetSeine parentBean, NonTargetSa=
mple toUpdate, NonTargetSample updated) {
=20
-                copyExcluding(NonTargetSample.class, BinderService.EDIT, toS=
ave, beanToSave, NonTargetSample.PROPERTY_NON_TARGET_LENGTH);
-                getDao().update(beanToSave);
-                return beanToSave;
+                copyExcluding(NonTargetSample.class, BinderService.EDIT, toU=
pdate, updated, NonTargetSample.PROPERTY_NON_TARGET_LENGTH);
+                getDao().update(updated);
+                return updated;
=20
             }
         });
@@ -175,8 +178,9 @@ public class NonTargetSampleServiceImpl extends AbstractO=
bserveService implement
     }
=20
     @Override
-    public void delete(String setId, NonTargetSample bean) {
-        doDelete(setId, bean.getTopiaId(), new DeleteAction<SetSeine, NonTar=
getSample>(SetSeine.class, NonTargetSample.class) {
+    public void delete(String setId, NonTargetSample toDelete) {
+
+        doDelete(setId, toDelete.getTopiaId(), new DeleteAction<SetSeine, No=
nTargetSample>(SetSeine.class, NonTargetSample.class) {
             @Override
             public void onDelete(SetSeine parent, NonTargetSample toDelete) {
=20
diff --git a/observe-services/src/main/java/fr/ird/observe/services/data/sein=
e/RouteService.java b/observe-services/src/main/java/fr/ird/observe/services/=
data/seine/RouteService.java
index 72efcf3..76976c9 100644
--- a/observe-services/src/main/java/fr/ird/observe/services/data/seine/Route=
Service.java
+++ b/observe-services/src/main/java/fr/ird/observe/services/data/seine/Route=
Service.java
@@ -18,8 +18,6 @@ public interface RouteService extends ObserveService {
=20
     Route getRouteStub(String routeId);
=20
-    Route loadForDisplay(String routeId);
-
     Route loadForEdit(String routeId);
=20
     Route preCreate(String tripSeineId);
diff --git a/observe-services/src/main/java/fr/ird/observe/services/data/sein=
e/RouteServiceImpl.java b/observe-services/src/main/java/fr/ird/observe/servi=
ces/data/seine/RouteServiceImpl.java
index c524c74..533f3a7 100644
--- a/observe-services/src/main/java/fr/ird/observe/services/data/seine/Route=
ServiceImpl.java
+++ b/observe-services/src/main/java/fr/ird/observe/services/data/seine/Route=
ServiceImpl.java
@@ -37,7 +37,7 @@ public class RouteServiceImpl extends AbstractObserveServic=
e implements RouteSer
     }
=20
     @Override
-    public Route loadForDisplay(String routeId) {
+    public Route loadForEdit(String routeId) {
=20
         Route loaded =3D getDao().newInstance();
         Route toLoad =3D getDao().findByTopiaId(routeId);
@@ -54,12 +54,6 @@ public class RouteServiceImpl extends AbstractObserveServi=
ce implements RouteSer
     }
=20
     @Override
-    public Route loadForEdit(String routeId) {
-        Route loaded =3D loadForDisplay(routeId);
-        return loaded;
-    }
-
-    @Override
     public Route preCreate(String tripSeineId) {
=20
         TripSeine tripLongline =3D findByTopiaId(TripSeine.class, tripSeineI=
d);
diff --git a/observe-services/src/main/java/fr/ird/observe/services/data/sein=
e/SetSeineServiceImpl.java b/observe-services/src/main/java/fr/ird/observe/se=
rvices/data/seine/SetSeineServiceImpl.java
index ed9bd24..87b0113 100644
--- a/observe-services/src/main/java/fr/ird/observe/services/data/seine/SetSe=
ineServiceImpl.java
+++ b/observe-services/src/main/java/fr/ird/observe/services/data/seine/SetSe=
ineServiceImpl.java
@@ -38,8 +38,9 @@ public class SetSeineServiceImpl extends AbstractObserveSer=
vice implements SetSe
     @Override
     public SetSeine loadForEdit(String setSeineId) {
=20
-        SetSeine loaded =3D getDao().newInstance();
-        SetSeine toLoad =3D getDao().findByTopiaId(setSeineId);
+        SetSeineDAO dao =3D getDao();
+        SetSeine loaded =3D dao.newInstance();
+        SetSeine toLoad =3D dao.findByTopiaId(setSeineId);
         copy(SetSeine.class, BinderService.EDIT, toLoad, loaded);
=20
         //FIXME See why need this ?
diff --git a/observe-services/src/main/java/fr/ird/observe/services/data/sein=
e/TargetCatchService.java b/observe-services/src/main/java/fr/ird/observe/ser=
vices/data/seine/TargetCatchService.java
new file mode 100644
index 0000000..0ae9764
--- /dev/null
+++ b/observe-services/src/main/java/fr/ird/observe/services/data/seine/Targe=
tCatchService.java
@@ -0,0 +1,28 @@
+package fr.ird.observe.services.data.seine;
+
+import fr.ird.observe.entities.seine.SetSeine;
+import fr.ird.observe.entities.seine.TargetLength;
+import fr.ird.observe.services.Commit;
+import fr.ird.observe.services.ObserveService;
+
+import java.util.List;
+
+/**
+ * Created on 5/2/15.
+ *
+ * @author Tony Chemit - chemit@codelutin.com
+ * @since 4.0
+ */
+public interface TargetCatchService extends ObserveService {
+
+    SetSeine loadForEdit(String setSeineId);
+
+    SetSeine loadForEditDiscarded(String setSeineId);
+
+    @Commit
+    void save(SetSeine setSeinetoSave, List<TargetLength> targetLengthsToDel=
ete);
+
+    @Commit
+    void saveForDiscarded(SetSeine setSeinetoSave, List<TargetLength> target=
LengthsToDelete);
+
+}
diff --git a/observe-services/src/main/java/fr/ird/observe/services/data/sein=
e/TargetCatchServiceImpl.java b/observe-services/src/main/java/fr/ird/observe=
/services/data/seine/TargetCatchServiceImpl.java
new file mode 100644
index 0000000..e2155d1
--- /dev/null
+++ b/observe-services/src/main/java/fr/ird/observe/services/data/seine/Targe=
tCatchServiceImpl.java
@@ -0,0 +1,164 @@
+package fr.ird.observe.services.data.seine;
+
+import com.google.common.base.Predicate;
+import fr.ird.observe.BinderService;
+import fr.ird.observe.entities.referentiel.seine.WeightCategory;
+import fr.ird.observe.entities.seine.SetSeine;
+import fr.ird.observe.entities.seine.TargetCatch;
+import fr.ird.observe.entities.seine.TargetCatches;
+import fr.ird.observe.entities.seine.TargetLength;
+import fr.ird.observe.entities.seine.TargetSample;
+import fr.ird.observe.services.AbstractObserveService;
+import fr.ird.observe.services.referential.ReferentialService;
+import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nuiton.topia.TopiaException;
+import org.nuiton.topia.persistence.TopiaDAO;
+import org.nuiton.topia.persistence.util.EntityListUpdator;
+import org.nuiton.topia.persistence.util.TopiaEntityBinder;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * Created on 5/2/15.
+ *
+ * @author Tony Chemit - chemit@codelutin.com
+ * @since 4.0
+ */
+public class TargetCatchServiceImpl extends AbstractObserveService implement=
s TargetCatchService {
+
+    /** Logger. */
+    private static final Log log =3D LogFactory.getLog(TargetCatchServiceImp=
l.class);
+
+    @Override
+    public SetSeine loadForEdit(String setSeineId) {
+
+        SetSeine loaded =3D load(setSeineId, BinderService.EDIT_TARGET_CATCH=
, TargetCatches.TARGET_CATCH_IS_NOT_DISCARDED);
+        return loaded;
+
+    }
+
+    @Override
+    public SetSeine loadForEditDiscarded(String setSeineId) {
+
+        SetSeine loaded =3D load(setSeineId, BinderService.EDIT_DISCARD_TARG=
ET_CATCH, TargetCatches.TARGET_CATCH_IS_DISCARDED);
+        return loaded;
+
+    }
+
+    @Override
+    public void save(SetSeine setSeinetoSave, final List<TargetLength> targe=
tLengthsToDelete) {
+
+        save(setSeinetoSave, BinderService.EDIT_TARGET_CATCH, TargetCatches.=
TARGET_CATCH_IS_NOT_DISCARDED, targetLengthsToDelete);
+
+    }
+
+    @Override
+    public void saveForDiscarded(SetSeine setSeinetoSave, final List<TargetL=
ength> targetLengthsToDelete) {
+
+        save(setSeinetoSave, BinderService.EDIT_DISCARD_TARGET_CATCH, Target=
Catches.TARGET_CATCH_IS_DISCARDED, targetLengthsToDelete);
+
+    }
+
+    protected SetSeine load(String setId, String binderContext, Predicate<Ta=
rgetCatch> predicate) {
+
+        TopiaDAO<SetSeine> setSeineDao =3D getDao(SetSeine.class);
+        SetSeine toLoad =3D setSeineDao.findByTopiaId(setId);
+        SetSeine loaded =3D setSeineDao.newInstance();
+
+        copyExcluding(SetSeine.class, binderContext, toLoad, loaded, SetSein=
e.PROPERTY_TARGET_CATCH);
+
+        if (!toLoad.isTargetCatchEmpty()) {
+
+            ReferentialService referentialService =3D newService(Referential=
Service.class);
+
+            TopiaDAO<TargetCatch> dao =3D getDao(TargetCatch.class);
+            TopiaEntityBinder<TargetCatch> binder =3D getBinder(TargetCatch.=
class, binderContext);
+
+            List<TargetCatch> childsLoaded =3D new ArrayList<TargetCatch>();
+
+            for (TargetCatch childToLoad : toLoad.getTargetCatch()) {
+
+                if (predicate.apply(childToLoad)) {
+
+                    WeightCategory weightCategory =3D childToLoad.getWeightC=
ategory();
+                    if (weightCategory !=3D null) {
+                        referentialService.loadDecoratedWeightCategory(weigh=
tCategory);
+                    }
+
+                    TargetCatch childLoaded =3D dao.newInstance();
+                    binder.load(childToLoad, childLoaded, true);
+                    childsLoaded.add(childLoaded);
+
+                }
+
+            }
+
+            loaded.setTargetCatch(childsLoaded);
+
+        }
+
+        return loaded;
+
+    }
+
+    void save(SetSeine setSeinetoSave, String binderContext, final Predicate=
<TargetCatch> predicate, final List<TargetLength> targetLengthsToDelete) {
+
+        TopiaEntityBinder<SetSeine> parentBinder =3D getBinder(SetSeine.clas=
s, binderContext);
+        TopiaEntityBinder<TargetCatch> childBinder =3D getBinder(TargetCatch=
.class, binderContext);
+
+        doSaveList(setSeinetoSave, new SaveCollectionAction<SetSeine, Target=
Catch>(
+                SetSeine.class, TargetCatch.class, getListUpdator(), parentB=
inder, childBinder) {
+
+            @Override
+            public void onUpdateFinalize(SetSeine parent, Collection<TargetC=
atch> oldChilds) throws TopiaException {
+
+                if (CollectionUtils.isNotEmpty(oldChilds)) {
+
+                    Collection<TargetCatch> targetCatchesToReinject =3D new =
ArrayList<TargetCatch>();
+
+                    for (TargetCatch oldChild : oldChilds) {
+
+                        if (predicate.apply(oldChild)) {
+
+                            // on r=C3=A9injecte cette capture
+                            targetCatchesToReinject.add(oldChild);
+
+                        }
+
+                    }
+
+                    parent.addAllTargetCatch(targetCatchesToReinject);
+
+                }
+
+                if (CollectionUtils.isNotEmpty(targetLengthsToDelete)) {
+
+                    // suppression des =C3=A9chantillons obsoletes
+
+                    if (log.isInfoEnabled()) {
+                        log.info("Will remove " + targetLengthsToDelete.size=
() + " obsolete targetLength(s).");
+                    }
+
+                    TargetSample targetSample =3D parent.getTargetSample().g=
et(0);
+
+                    // on supprime les echantillons obsoletes
+                    targetSample.getTargetLength().removeAll(targetLengthsTo=
Delete);
+
+                }
+            }
+        });
+
+    }
+
+    protected EntityListUpdator<SetSeine, TargetCatch> getListUpdator() {
+        return EntityListUpdator.newEntityListUpdator(
+                SetSeine.class,
+                TargetCatch.class,
+                SetSeine.PROPERTY_TARGET_CATCH);
+    }
+
+}
diff --git a/observe-services/src/main/java/fr/ird/observe/services/data/sein=
e/TargetSampleService.java b/observe-services/src/main/java/fr/ird/observe/se=
rvices/data/seine/TargetSampleService.java
index 689f730..c1b2d32 100644
--- a/observe-services/src/main/java/fr/ird/observe/services/data/seine/Targe=
tSampleService.java
+++ b/observe-services/src/main/java/fr/ird/observe/services/data/seine/Targe=
tSampleService.java
@@ -6,8 +6,8 @@ import fr.ird.observe.entities.seine.TargetSample;
 import fr.ird.observe.services.Commit;
 import fr.ird.observe.services.ObserveService;
=20
-import java.util.Collection;
 import java.util.List;
+import java.util.Set;
=20
 /**
  * Created on 4/26/15.
@@ -17,20 +17,18 @@ import java.util.List;
  */
 public interface TargetSampleService extends ObserveService {
=20
-    List<Species> getAvailableEspeceForTargetSample(String setSeineId, boole=
an discarded);
+    List<Species> getAvailableSpeciesForTargetSample(String setSeineId, bool=
ean discarded);
+
+    List<TargetLength> getObsoleteTargetLengths(String setSeineId, Set<Strin=
g> speciesIdsUsed, boolean discarded);
=20
     TargetSample getTargetSample(String setSeineId, boolean discarded);
=20
     boolean canUseTargetSample(String setSeineId, boolean discarded);
=20
-    void getObsoleteEspeceForTargetSample(String setSeineId,
-                                          Collection<Species> speciessUsed,
-                                          Collection<Species> speciessToDele=
te,
-                                          List<TargetLength> tailleToDelete,
-                                          boolean discarded);
     @Commit
-    void delete(String setId, TargetSample bean);
+    String save(String setSeineId, TargetSample toSave);
=20
     @Commit
-    String save(String setSeineId, TargetSample toSave);
+    void delete(String setId, TargetSample bean);
+
 }
diff --git a/observe-services/src/main/java/fr/ird/observe/services/data/sein=
e/TargetSampleServiceImpl.java b/observe-services/src/main/java/fr/ird/observ=
e/services/data/seine/TargetSampleServiceImpl.java
index 2ce82b8..8735b1b 100644
--- a/observe-services/src/main/java/fr/ird/observe/services/data/seine/Targe=
tSampleServiceImpl.java
+++ b/observe-services/src/main/java/fr/ird/observe/services/data/seine/Targe=
tSampleServiceImpl.java
@@ -16,6 +16,7 @@ import org.nuiton.topia.persistence.util.TopiaEntityBinder;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
+import java.util.Set;
=20
 /**
  * Created on 4/26/15.
@@ -37,7 +38,7 @@ public class TargetSampleServiceImpl extends AbstractObserv=
eService implements T
     }
=20
     @Override
-    public List<Species> getAvailableEspeceForTargetSample(String setSeineId=
, boolean discarded) {
+    public List<Species> getAvailableSpeciesForTargetSample(String setSeineI=
d, boolean discarded) {
=20
         List<Species> speciesList =3D new ArrayList<Species>();
=20
@@ -136,48 +137,36 @@ public class TargetSampleServiceImpl extends AbstractOb=
serveService implements T
     }
=20
     @Override
-    public void getObsoleteEspeceForTargetSample(String setSeineId,
-                                                 Collection<Species> species=
sUsed,
-                                                 Collection<Species> species=
sToDelete,
-                                                 List<TargetLength> tailleTo=
Delete,
-                                                 boolean discarded) {
+    public List<TargetLength> getObsoleteTargetLengths(String setSeineId, Se=
t<String> speciesIdsUsed, boolean discarded) {
=20
         SetSeine setSeine =3D findByTopiaId(SetSeine.class, setSeineId);
=20
-        if (setSeine.isTargetSampleEmpty()) {
-            return;
-        }
+        List<TargetLength> targetLengthsToDelete =3D new ArrayList<TargetLen=
gth>();
=20
-        TargetSample echantillon =3D setSeine.getTargetSample(discarded);
+        if (!setSeine.isTargetSampleEmpty()) {
=20
-        if (echantillon =3D=3D null || echantillon.isTargetLengthEmpty()) {
-            return;
-        }
+            TargetSample targetSample =3D setSeine.getTargetSample(discarded=
);
+            if (targetSample !=3D null && !targetSample.isTargetLengthEmpty(=
)) {
+
+                for (TargetLength targetLength : targetSample.getTargetLengt=
h()) {
+
+                    Species species =3D targetLength.getSpecies();
+
+                    if (!speciesIdsUsed.contains(species.getTopiaId())) {
+                        // l'esp=C3=A8ce n'existe plus dans les rejet faune,=
 on doit le supprimer
+                        targetLengthsToDelete.add(targetLength);
+                        if (log.isDebugEnabled()) {
+                            log.debug("remove obsolote echantillon " + targe=
tLength + " for species " + species);
+                        }
+                    }
=20
-        for (TargetLength taille : echantillon.getTargetLength()) {
-            Species tailleEspece =3D taille.getSpecies();
-            if (!speciessUsed.contains(tailleEspece)) {
-                // l'species n'existe plus dans les rejet faune,
-                // on doit le supprimer
-                tailleToDelete.add(taille);
-                speciessToDelete.add(tailleEspece);
-                if (log.isDebugEnabled()) {
-                    log.debug("remove obsolote echantillon " + taille + " fo=
r species " + tailleEspece);
                 }
+
             }
-        }
=20
-    }
+        }
=20
-    @Override
-    public void delete(String setId, TargetSample bean) {
-        doDelete(setId, bean.getTopiaId(), new DeleteAction<SetSeine, Target=
Sample>(SetSeine.class, TargetSample.class) {
-            @Override
-            public void onDelete(SetSeine parent, TargetSample toDelete) {
-                super.onDelete(parent, toDelete);
-                parent.removeTargetSample(toDelete);
-            }
-        });
+        return targetLengthsToDelete;
=20
     }
=20
@@ -196,11 +185,11 @@ public class TargetSampleServiceImpl extends AbstractOb=
serveService implements T
             }
=20
             @Override
-            public TargetSample onUpdate(SetSeine parentBean, TargetSample t=
oSave, TargetSample beanToSave) {
+            public TargetSample onUpdate(SetSeine parentBean, TargetSample t=
oUpdate, TargetSample updated) {
=20
-                copyExcluding(TargetSample.class, BinderService.EDIT, toSave=
, beanToSave, TargetSample.PROPERTY_TARGET_LENGTH);
-                getDao().update(beanToSave);
-                return beanToSave;
+                copyExcluding(TargetSample.class, BinderService.EDIT, toUpda=
te, updated, TargetSample.PROPERTY_TARGET_LENGTH);
+                getDao().update(updated);
+                return updated;
=20
             }
         });
@@ -209,4 +198,16 @@ public class TargetSampleServiceImpl extends AbstractObs=
erveService implements T
=20
     }
=20
+    @Override
+    public void delete(String setId, TargetSample bean) {
+        doDelete(setId, bean.getTopiaId(), new DeleteAction<SetSeine, Target=
Sample>(SetSeine.class, TargetSample.class) {
+            @Override
+            public void onDelete(SetSeine parent, TargetSample toDelete) {
+                super.onDelete(parent, toDelete);
+                parent.removeTargetSample(toDelete);
+            }
+        });
+
+    }
+
 }
diff --git a/observe-services/src/main/java/fr/ird/observe/services/referenti=
al/ReferentialService.java b/observe-services/src/main/java/fr/ird/observe/se=
rvices/referential/ReferentialService.java
index 5ae0df8..654a379 100644
--- a/observe-services/src/main/java/fr/ird/observe/services/referential/Refe=
rentialService.java
+++ b/observe-services/src/main/java/fr/ird/observe/services/referential/Refe=
rentialService.java
@@ -34,6 +34,8 @@ public interface ReferentialService extends ObserveService {
=20
     List<WeightCategory> loadDecoratedWeightCategory();
=20
+    void loadDecoratedWeightCategory(WeightCategory weightCategory);
+
     Set<String> getSpeciesListSpeciesIds(String speciesListId);
=20
     <R extends ReferenceEntity> R preCreate(Class<R> entityType);
diff --git a/observe-services/src/main/java/fr/ird/observe/services/referenti=
al/ReferentialServiceImpl.java b/observe-services/src/main/java/fr/ird/observ=
e/services/referential/ReferentialServiceImpl.java
index 270858f..fa3c99a 100644
--- a/observe-services/src/main/java/fr/ird/observe/services/referential/Refe=
rentialServiceImpl.java
+++ b/observe-services/src/main/java/fr/ird/observe/services/referential/Refe=
rentialServiceImpl.java
@@ -123,6 +123,14 @@ public class ReferentialServiceImpl extends AbstractObse=
rveService implements Re
     }
=20
     @Override
+    public void loadDecoratedWeightCategory(WeightCategory weightCategory) {
+
+        decorate(WeightCategory.class, weightCategory);
+        decorate(Species.class, weightCategory.getSpecies());
+
+    }
+
+    @Override
     public Set<String> getSpeciesListSpeciesIds(String speciesListId) {
=20
         SpeciesList speciesList =3D findByTopiaId(SpeciesList.class, species=
ListId);
diff --git a/observe-swing/src/main/java/fr/ird/observe/ui/content/ContentUIH=
andler.java b/observe-swing/src/main/java/fr/ird/observe/ui/content/ContentUI=
Handler.java
index 01dad8b..1ef2472 100644
--- a/observe-swing/src/main/java/fr/ird/observe/ui/content/ContentUIHandler.=
java
+++ b/observe-swing/src/main/java/fr/ird/observe/ui/content/ContentUIHandler.=
java
@@ -22,7 +22,6 @@
 package fr.ird.observe.ui.content;
=20
 import fr.ird.observe.BinderService;
-import fr.ird.observe.DataService;
 import fr.ird.observe.DecoratorService;
 import fr.ird.observe.ObserveContext;
 import fr.ird.observe.ObserveServiceHelper;
@@ -64,6 +63,8 @@ import javax.swing.JComponent;
 import javax.swing.JOptionPane;
 import javax.swing.JToolBar;
 import javax.swing.UIManager;
+import javax.swing.event.TableModelListener;
+import javax.swing.table.TableModel;
 import java.awt.Component;
 import java.util.ArrayList;
 import java.util.List;
@@ -92,15 +93,15 @@ public abstract class ContentUIHandler<E extends TopiaEnt=
ity> {
     /** l'interface graphique que le controleur utilise */
     protected ObserveContentUI<E> ui;
=20
-    public ContentUIHandler(ObserveContentUI<E> ui, DataContextType parentTy=
pe, DataContextType type) {
+    protected ContentUIHandler(ObserveContentUI<E> ui, DataContextType paren=
tType, DataContextType type) {
         this.ui =3D ui;
         this.parentType =3D parentType;
         this.type =3D type;
-        prefix =3D "[" + ui.getClass().getSimpleName() + "] ";
+        this.prefix =3D "[" + ui.getClass().getSimpleName() + "] ";
         if (log.isDebugEnabled()) {
             log.debug("New handler [" + this + "] for ui " + prefix);
         }
-        errorIcon =3D UIManager.getIcon("action.error");
+        this.errorIcon =3D UIManager.getIcon("action.error");
     }
=20
     public static <E extends TopiaEntity> ContentUIHandler<E> newHandler(Obs=
erveContentUI<E> ui) {
@@ -301,22 +302,14 @@ public abstract class ContentUIHandler<E extends TopiaE=
ntity> {
         return ObserveContext.get().getBinderService();
     }
=20
-    public <E extends TopiaEntity> void copy(Class<E> type, String context, =
E source, E target) {
+    public <EE extends TopiaEntity> void copy(Class<EE> type, String context=
, EE source, EE target) {
         getBinderService().copy(type, context, source, target);
     }
=20
-    public <E extends TopiaEntity> void copyExcluding(Class<E> type, String =
context, E source, E target, String... propertyNames) {
-        getBinderService().copyExcluding(type, context, source, target, prop=
ertyNames);
-    }
-
-    public <E extends TopiaEntity> void copy(Class<E> type, String context, =
E source, E target, boolean bindTechnical) {
+    public <EE extends TopiaEntity> void copy(Class<EE> type, String context=
, EE source, EE target, boolean bindTechnical) {
         getBinderService().copy(type, context, source, target, bindTechnical=
);
     }
=20
-    public <E extends TopiaEntity> TopiaEntityBinder<E> getBinder(Class<E> t=
ype, String context) {
-        return getBinderService().getBinder(type, context);
-    }
-
     protected DataSource getDataSource() {
         return ui.getDataSource();
     }
@@ -613,19 +606,6 @@ public abstract class ContentUIHandler<E extends TopiaEn=
tity> {
         }
     }
=20
-//    protected E onCreate(TopiaContext tx, Object parentBean, E editBean) t=
hrows TopiaException {
-//        return editBean;
-//    }
-//
-//    protected E onUpdate(TopiaContext tx, Object parentBean, E beanToSave)=
 throws TopiaException {
-//        // rien par defaut
-//        return beanToSave;
-//    }
-//
-//    protected void onDelete(TopiaContext tx, Object parentBean, E beanToDe=
lete) throws TopiaException {
-//        // rien par defaut
-//    }
-
     protected void addInfoMessage(String message) {
         addMessage(ui,
                    NuitonValidatorScope.INFO,
@@ -649,26 +629,6 @@ public abstract class ContentUIHandler<E extends TopiaEn=
tity> {
         return getModel().getLoadBinder();
     }
=20
-//    protected final TopiaExecutor<E> getLoadExecutor() {
-//        return loadExecutor;
-//    }
-//
-//    protected final TopiaExecutor2<? extends TopiaEntity, E> getPreCreateE=
xecutor() {
-//        return preCreateExecutor;
-//    }
-//
-//    protected final TopiaExecutor2<? extends TopiaEntity, E> getCreateExec=
utor() {
-//        return createExecutor;
-//    }
-//
-//    protected final TopiaExecutor2<? extends TopiaEntity, E> getUpdateExec=
utor() {
-//        return updateExecutor;
-//    }
-//
-//    protected final TopiaExecutor2<? extends TopiaEntity, E> getDeleteExec=
utor() {
-//        return deleteExecutor;
-//    }
-
     protected final ContentMode computeContentMode() {
         ContentMode mode;
=20
@@ -693,10 +653,6 @@ public abstract class ContentUIHandler<E extends TopiaEn=
tity> {
         return contextName;
     }
=20
-    protected final DataService getDataService() {
-        return ObserveContext.get().getDataService();
-    }
-
     protected final <S extends ObserveService> S getService(Class<S> service=
Type) {
         return ObserveContext.get().getService(serviceType);
     }
@@ -805,4 +761,15 @@ public abstract class ContentUIHandler<E extends TopiaEn=
tity> {
         quadrantBG.add(editor.getQuadrant4());
=20
     }
+
+    protected void setQuadrant(CoordinatesEditor editor, Integer quadrant) {
+        editor.setQuadrant(null);
+        editor.setQuadrant(quadrant);
+    }
+
+    protected void reloadTableModelListener(TableModel tableModel, TableMode=
lListener listener) {
+        tableModel.removeTableModelListener(listener);
+        tableModel.addTableModelListener(listener);
+    }
+
 }
diff --git a/observe-swing/src/main/java/fr/ird/observe/ui/content/ContentUIM=
odel.java b/observe-swing/src/main/java/fr/ird/observe/ui/content/ContentUIMo=
del.java
index 48eb5af..42f3797 100644
--- a/observe-swing/src/main/java/fr/ird/observe/ui/content/ContentUIModel.ja=
va
+++ b/observe-swing/src/main/java/fr/ird/observe/ui/content/ContentUIModel.ja=
va
@@ -137,35 +137,9 @@ public abstract class ContentUIModel<E extends TopiaEnti=
ty> extends AbstractSeri
     }
=20
     public final TopiaEntityBinder<E> getLoadBinder() {
-
-//        if (loadBinder =3D=3D null) {
-//
-//            BinderService binderService =3D ObserveServiceHelper.get().get=
BinderService();
-//
-//            String binderName =3D getClass().getName() + "-open";
-//            TopiaEntityBinder<E> r =3D binderService.getTopiaBinder(beanTy=
pe, binderName);
-//            if (r =3D=3D null) {
-//
-//                BinderModelBuilder<E, E> builder =3D createOpeningBinder(b=
inderService, binderName);
-//
-//                if (builder !=3D null) {
-//
-//                    r =3D binderService.registerTopiaBinder(beanType, buil=
der, binderName);
-//
-//                }
-//
-//            }
-//
-//            loadBinder =3D r;
-//
-//        }
-
         return loadBinder;
-
     }
=20
-//    protected abstract BinderModelBuilder<E, E> createOpeningBinder(Binder=
Service binderService, String binderName);
-
     public E getBean() {
         return bean;
     }
diff --git a/observe-swing/src/main/java/fr/ird/observe/ui/content/impl/longl=
ine/LonglineGlobalCompositionUIHandler.java b/observe-swing/src/main/java/fr/=
ird/observe/ui/content/impl/longline/LonglineGlobalCompositionUIHandler.java
index 3a5fec7..70d3ef9 100644
--- a/observe-swing/src/main/java/fr/ird/observe/ui/content/impl/longline/Lon=
glineGlobalCompositionUIHandler.java
+++ b/observe-swing/src/main/java/fr/ird/observe/ui/content/impl/longline/Lon=
glineGlobalCompositionUIHandler.java
@@ -50,7 +50,7 @@ import static org.nuiton.i18n.I18n.t;
 public class LonglineGlobalCompositionUIHandler extends ContentUIHandler<Set=
Longline> {
=20
     /** Logger */
-    static private Log log =3D LogFactory.getLog(LonglineGlobalCompositionUI=
Handler.class);
+    public static final Log log =3D LogFactory.getLog(LonglineGlobalComposit=
ionUIHandler.class);
=20
     public LonglineGlobalCompositionUIHandler(LonglineGlobalCompositionUI ui=
) {
         super(ui, DataContextType.ActivityLongline, DataContextType.SetLongl=
ine);
@@ -142,7 +142,7 @@ public class LonglineGlobalCompositionUIHandler extends C=
ontentUIHandler<SetLong
         // utilisation du mode requis
         setContentMode(mode);
=20
-        if (mode !=3D ContentMode.READ) {
+        if (ContentMode.READ !=3D mode) {
             getUi().startEdit(null);
         }
=20
@@ -184,7 +184,7 @@ public class LonglineGlobalCompositionUIHandler extends C=
ontentUIHandler<SetLong
     }
=20
     @Override
-    protected boolean doSave(SetLongline bean) throws Exception {
+    protected boolean doSave(SetLongline bean) {
=20
         copy(SetLongline.class, BinderService.EDIT_FLOATLINES_COMPOSITION, g=
etUi().getFloatlinesCompositionUI().getBean(), bean);
         copy(SetLongline.class, BinderService.EDIT_BRANCHLINES_COMPOSITION, =
getUi().getBranchlinesCompositionUI().getBean(), bean);
diff --git a/observe-swing/src/main/java/fr/ird/observe/ui/content/impl/longl=
ine/SetLonglineUIHandler.java b/observe-swing/src/main/java/fr/ird/observe/ui=
/content/impl/longline/SetLonglineUIHandler.java
index 7cf9f43..34e4f92 100644
--- a/observe-swing/src/main/java/fr/ird/observe/ui/content/impl/longline/Set=
LonglineUIHandler.java
+++ b/observe-swing/src/main/java/fr/ird/observe/ui/content/impl/longline/Set=
LonglineUIHandler.java
@@ -145,6 +145,9 @@ public class SetLonglineUIHandler extends ContentUIHandle=
r<SetLongline> {
=20
         super.initUI();
=20
+        // listen messages to see if required to add
+        reloadTableModelListener(getUi().getErrorTableModel(), computeTabVal=
idStateListener);
+
         getUi().getSettingStartTimeStamp().getSliderHidor().addPropertyChang=
eListener(HidorButton.PROPERTY_TARGET_VISIBLE, onToogleTimeEditorSliderChange=
dListener);
         getUi().getSettingEndTimeStamp().getSliderHidor().addPropertyChangeL=
istener(HidorButton.PROPERTY_TARGET_VISIBLE, onToogleTimeEditorSliderChangedL=
istener);
         getUi().getHaulingStartTimeStamp().getSliderHidor().addPropertyChang=
eListener(HidorButton.PROPERTY_TARGET_VISIBLE, onToogleTimeEditorSliderChange=
dListener);
@@ -226,15 +229,10 @@ public class SetLonglineUIHandler extends ContentUIHand=
ler<SetLongline> {
         // utilisation du mode requis
         setContentMode(mode);
=20
-        // To be sure always remove listener (could prevent some leaks)
-        getUi().getErrorTableModel().removeTableModelListener(computeTabVali=
dStateListener);
-        // listen messages to see if required to add
-        getUi().getErrorTableModel().addTableModelListener(computeTabValidSt=
ateListener);
-
         SwingValidatorMessageTableModel errorTableModel =3D getUi().getError=
TableModel();
         computeTabValidState(errorTableModel);
=20
-        if (mode !=3D ContentMode.READ) {
+        if (ContentMode.READ !=3D mode) {
             getUi().startEdit(null);
         }
=20
diff --git a/observe-swing/src/main/java/fr/ird/observe/ui/content/impl/seine=
/ActivitySeineObservedSystemUIHandler.java b/observe-swing/src/main/java/fr/i=
rd/observe/ui/content/impl/seine/ActivitySeineObservedSystemUIHandler.java
index 86ace0a..149899d 100644
--- a/observe-swing/src/main/java/fr/ird/observe/ui/content/impl/seine/Activi=
tySeineObservedSystemUIHandler.java
+++ b/observe-swing/src/main/java/fr/ird/observe/ui/content/impl/seine/Activi=
tySeineObservedSystemUIHandler.java
@@ -109,6 +109,7 @@ public class ActivitySeineObservedSystemUIHandler extends=
 ContentUIHandler<Activ
         copy(ActivitySeine.class, BinderService.EDIT_OBSERVED_SYSTEM, saved,=
 bean);
=20
         return true;
+
     }
=20
 }
diff --git a/observe-swing/src/main/java/fr/ird/observe/ui/content/impl/seine=
/SetSeineUIHandler.java b/observe-swing/src/main/java/fr/ird/observe/ui/conte=
nt/impl/seine/SetSeineUIHandler.java
index 1fe72ea..d8dc84c 100644
--- a/observe-swing/src/main/java/fr/ird/observe/ui/content/impl/seine/SetSei=
neUIHandler.java
+++ b/observe-swing/src/main/java/fr/ird/observe/ui/content/impl/seine/SetSei=
neUIHandler.java
@@ -137,10 +137,8 @@ public class SetSeineUIHandler extends ContentUIHandler<=
SetSeine> {
=20
         super.initUI();
=20
-        // To be sure always remove listener (could prevent some leaks)
-        getUi().getErrorTableModel().removeTableModelListener(computeTabVali=
dStateListener);
         // listen messages to see if required to add
-        getUi().getErrorTableModel().addTableModelListener(computeTabValidSt=
ateListener);
+        reloadTableModelListener(getUi().getErrorTableModel(), computeTabVal=
idStateListener);
=20
         getUi().getStartTime().getSliderHidor().addPropertyChangeListener(Hi=
dorButton.PROPERTY_TARGET_VISIBLE, onToogleTimeEditorSliderChangedListener);
         getUi().getEndPursingTimeStamp().getSliderHidor().addPropertyChangeL=
istener(HidorButton.PROPERTY_TARGET_VISIBLE, onToogleTimeEditorSliderChangedL=
istener);
@@ -199,7 +197,7 @@ public class SetSeineUIHandler extends ContentUIHandler<S=
etSeine> {
         SwingValidatorMessageTableModel errorTableModel =3D getUi().getError=
TableModel();
         computeTabValidState(errorTableModel);
=20
-        if (mode !=3D ContentMode.READ) {
+        if (ContentMode.READ !=3D mode) {
             getUi().startEdit(null);
         }
     }
diff --git a/observe-swing/src/main/java/fr/ird/observe/ui/content/open/Conte=
ntOpenableUIHandler.java b/observe-swing/src/main/java/fr/ird/observe/ui/cont=
ent/open/ContentOpenableUIHandler.java
index 1b52eef..7aafb12 100644
--- a/observe-swing/src/main/java/fr/ird/observe/ui/content/open/ContentOpena=
bleUIHandler.java
+++ b/observe-swing/src/main/java/fr/ird/observe/ui/content/open/ContentOpena=
bleUIHandler.java
@@ -55,6 +55,20 @@ public abstract class ContentOpenableUIHandler<E extends T=
opiaEntity & OpenableE
=20
     protected final String closeMessage;
=20
+    /**
+     * M=C3=A9thode invoqu=C3=A9e =C3=A0 chaque ouverture de l'=C3=A9cran.
+     *
+     * La m=C3=A9thode est invoqu=C3=A9e par {@link #openUI()}.
+     *
+     * @param selectedParentId l'id du parent s=C3=A9lectionn=C3=A9
+     * @param selectedId       l'id de l'entit=C3=A9 de l'=C3=A9cran, peut =
=C3=AAtre {@code null} en cas de cr=C3=A9ation.
+     * @param mode             le mode de l'=C3=A9cran
+     * @since 4.0
+     */
+    protected abstract void onOpenUI(String selectedParentId, String selecte=
dId, ContentMode mode);
+
+    protected abstract boolean obtainCanReopen(boolean create);
+
     protected ContentOpenableUIHandler(ContentOpenableUI<E> ui,
                                        DataContextType parentType,
                                        DataContextType type,
@@ -65,8 +79,6 @@ public abstract class ContentOpenableUIHandler<E extends To=
piaEntity & OpenableE
=20
     }
=20
-    protected abstract boolean obtainCanReopen(boolean create);
-
     protected void updateOpenState(String beanId, boolean openState) {
         OpenableService service =3D getService(OpenableService.class);
         service.updateOpenState(beanId, openState);
@@ -88,6 +100,29 @@ public abstract class ContentOpenableUIHandler<E extends =
TopiaEntity & OpenableE
     }
=20
     @Override
+    public void openUI() throws Exception {
+
+        super.openUI();
+
+        String selectedParentId =3D getSelectedParentId();
+        String selectedId =3D getSelectedId();
+        ContentMode mode =3D computeContentMode();
+
+        if (log.isInfoEnabled()) {
+            log.info(prefix + "selectedParentId =3D " + selectedParentId);
+            log.info(prefix + "selectedId       =3D " + selectedId);
+            log.info(prefix + "content mode     =3D " + mode);
+        }
+
+        onOpenUI(selectedParentId, selectedId, mode);
+
+        boolean create =3D selectedId =3D=3D null;
+
+        finalizeOpenUI(mode, create);
+
+    }
+
+    @Override
     protected boolean computeCanWrite(DataSource source) {
         return source.canWriteData();
     }
@@ -297,6 +332,7 @@ public abstract class ContentOpenableUIHandler<E extends =
TopiaEntity & OpenableE
             log.debug("PARENT NODE =3D " + parentNode);
         }
         treeHelper.addUnsavedNode(parentNode, getBeanType());
+
     }
=20
     protected final void obtainChildPosition(E bean) throws DataSourceExcept=
ion {
@@ -310,6 +346,7 @@ public abstract class ContentOpenableUIHandler<E extends =
TopiaEntity & OpenableE
         }
=20
         getUi().setContextValue(position, POSITION_OPENABLE);
+
     }
=20
     protected final void finalizeOpenUI(ContentMode mode, boolean create) {
@@ -345,7 +382,7 @@ public abstract class ContentOpenableUIHandler<E extends =
TopiaEntity & OpenableE
         }
         model.setCanReopen(canReopen);
=20
-        if (mode !=3D ContentMode.READ) {
+        if (ContentMode.READ !=3D mode) {
             getUi().startEdit(null);
         }
     }
diff --git a/observe-swing/src/main/java/fr/ird/observe/ui/content/open/impl/=
longline/ActivityLonglineUIHandler.java b/observe-swing/src/main/java/fr/ird/=
observe/ui/content/open/impl/longline/ActivityLonglineUIHandler.java
index 61e8c9a..bc11d0a 100644
--- a/observe-swing/src/main/java/fr/ird/observe/ui/content/open/impl/longlin=
e/ActivityLonglineUIHandler.java
+++ b/observe-swing/src/main/java/fr/ird/observe/ui/content/open/impl/longlin=
e/ActivityLonglineUIHandler.java
@@ -33,6 +33,7 @@ import fr.ird.observe.ui.content.ContentUIModel;
 import fr.ird.observe.ui.content.open.ContentOpenableUIHandler;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.nuiton.jaxx.widgets.gis.absolute.CoordinatesEditor;
 import org.nuiton.validator.NuitonValidatorScope;
=20
 import static org.nuiton.i18n.I18n.n;
@@ -77,18 +78,18 @@ public class ActivityLonglineUIHandler extends ContentOpe=
nableUIHandler<Activity
=20
             // mode creation
             return ContentMode.CREATE;
+
         }
=20
-        // l'activity existe en base
+        // l'activit=C3=A9 existe en base
         if (dataContext.isSelectedOpen(ActivityLongline.class)) {
=20
-            // l'activity est ouverte, donc modifiable
+            // l'activit=C3=A9 est ouverte, donc modifiable
             return ContentMode.UPDATE;
-        }
=20
-        ActivityLonglineUI ui =3D getUi();
+        }
=20
-        // l'activity n'est pas ouverte, donc pas =C3=A9ditable
+        // l'activit=C3=A9 n'est pas ouverte, donc pas =C3=A9ditable
         if (!dataContext.isSelectedOpen(TripLongline.class)) {
=20
             // la mar=C3=A9e n'est pas ouverte
@@ -100,35 +101,25 @@ public class ActivityLonglineUIHandler extends ContentO=
penableUIHandler<Activity
             if (getModel().isHistoricalData()) {
=20
                 addInfoMessage(t("observe.message.historical.data"));
+
             }
=20
         } else {
=20
-            // seule l'activity n'est pas ouverte
+            // seule l'activit=C3=A9 n'est pas ouverte
             addInfoMessage(t(closeMessage));
+
         }
=20
         return ContentMode.READ;
+
     }
=20
     @Override
-    public void openUI() throws Exception {
-        super.openUI();
-
-        resetQuadrant(getUi().getCoordinatesEditor());
-
-        String tripId =3D getSelectedParentId();
-        String activityId =3D getSelectedId();
-
-        if (log.isInfoEnabled()) {
-            log.info(prefix + "tripId     =3D " + tripId);
-            log.info(prefix + "activityId =3D " + activityId);
-        }
+    protected void onOpenUI(String tripId, String activityId, ContentMode mo=
de) {
=20
-        ContentMode mode =3D computeContentMode();
-        if (log.isInfoEnabled()) {
-            log.info(prefix + "content mode " + mode);
-        }
+        CoordinatesEditor coordinatesEditor =3D getUi().getCoordinatesEditor=
();
+        resetQuadrant(coordinatesEditor);
=20
         boolean create =3D activityId =3D=3D null;
=20
@@ -143,39 +134,32 @@ public class ActivityLonglineUIHandler extends ContentO=
penableUIHandler<Activity
         } else {
=20
             // update mode
-            if (mode =3D=3D ContentMode.UPDATE) {
-                loaded =3D service.loadForEdit(activityId);
-            } else {
-                loaded =3D service.loadForDisplay(activityId);
-            }
+            loaded =3D service.loadForEdit(activityId);
=20
         }
=20
         ActivityLongline bean =3D getBean();
         copy(ActivityLongline.class, BinderService.EDIT, loaded, bean);
=20
-        finalizeOpenUI(mode, create);
-
-        getUi().getCoordinatesEditor().setLatitudeAndLongitude(bean.getLatit=
ude(), bean.getLongitude());
+        coordinatesEditor.setLatitudeAndLongitude(bean.getLatitude(), bean.g=
etLongitude());
         if (create) {
+
+            // on positionne le quadrant (celui de l'activit=C3=A9 pr=C3=A9c=
=C3=A9dent si elle existe)
             Integer quadrant =3D bean.getQuadrant();
-            getUi().getCoordinatesEditor().setQuadrant(null);
-            getUi().getCoordinatesEditor().setQuadrant(quadrant);
+            setQuadrant(coordinatesEditor, quadrant);
+
         }
=20
-        // on annule la modification engendree par ce binding
-        getModel().setModified(create);
     }
=20
     @Override
     public void startEditUI(String... binding) {
-        ActivityLonglineUI ui =3D getUi();
=20
         ContentUIModel<ActivityLongline> model =3D getModel();
=20
         boolean create =3D model.getMode() =3D=3D ContentMode.CREATE;
         String contextName =3D getValidatorContextName(model.getMode());
-        ui.getValidator().setContext(contextName);
+        getUi().getValidator().setContext(contextName);
         if (create) {
             addMessage(ui,
                        NuitonValidatorScope.INFO,
@@ -196,7 +180,9 @@ public class ActivityLonglineUIHandler extends ContentOpe=
nableUIHandler<Activity
                 ActivityLonglineUI.BINDING_FPA_ZONE_SELECTED_ITEM,
                 ActivityLonglineUI.BINDING_CLOSE_ENABLED,
                 ActivityLonglineUI.BINDING_CLOSE_AND_CREATE_ENABLED);
+
         model.setModified(create);
+
     }
=20
     @Override
@@ -232,9 +218,6 @@ public class ActivityLonglineUIHandler extends ContentOpe=
nableUIHandler<Activity
             ActivityLonglineService service =3D getService(ActivityLonglineS=
ervice.class);
             String tripId =3D getSelectedParentId();
             service.delete(tripId, bean.getTopiaId());
-            if (log.isInfoEnabled()) {
-                log.info("Delete done for Activity " + bean.getTopiaId());
-            }
             result =3D true;
=20
         }
@@ -255,6 +238,7 @@ public class ActivityLonglineUIHandler extends ContentOpe=
nableUIHandler<Activity
                             dataContext.isSelectedOpen(TripLongline.class) &&
                             !dataContext.isOpenActivity();
         return canReopen;
+
     }
=20
 }
diff --git a/observe-swing/src/main/java/fr/ird/observe/ui/content/open/impl/=
longline/TripLonglineUIHandler.java b/observe-swing/src/main/java/fr/ird/obse=
rve/ui/content/open/impl/longline/TripLonglineUIHandler.java
index 9d0b3c8..a85a3ed 100644
--- a/observe-swing/src/main/java/fr/ird/observe/ui/content/open/impl/longlin=
e/TripLonglineUIHandler.java
+++ b/observe-swing/src/main/java/fr/ird/observe/ui/content/open/impl/longlin=
e/TripLonglineUIHandler.java
@@ -87,11 +87,14 @@ public class TripLonglineUIHandler extends ContentOpenabl=
eUIHandler<TripLongline
         }
=20
         addInfoMessage(t(closeMessage));
+
         return ContentMode.READ;
+
     }
=20
     @Override
     public void initUI() throws Exception {
+
         super.initUI();
=20
         TripLonglineUI ui =3D getUi();
@@ -131,19 +134,7 @@ public class TripLonglineUIHandler extends ContentOpenab=
leUIHandler<TripLongline
     }
=20
     @Override
-    public void openUI() throws Exception {
-        super.openUI();
-
-        ContentMode mode =3D computeContentMode();
-
-        String programId =3D getSelectedParentId();
-        String tripId =3D getSelectedId();
-
-        if (log.isInfoEnabled()) {
-            log.info(prefix + "programId =3D " + programId);
-            log.info(prefix + "tripId    =3D " + tripId);
-            log.info(prefix + "mode      =3D " + mode);
-        }
+    protected void onOpenUI(String programId, String tripId, ContentMode mod=
e) {
=20
         TripLongline loaded;
=20
@@ -154,24 +145,19 @@ public class TripLonglineUIHandler extends ContentOpena=
bleUIHandler<TripLongline
         if (create) {
=20
             // create mode
-
-            if (log.isInfoEnabled()) {
-                log.info(prefix + "create a new trip");
-            }
-
             loaded =3D service.preCreate(programId);
=20
         } else {
=20
             // update mode
-            if (log.isInfoEnabled()) {
-                log.info(prefix + "using existing trip " + tripId);
-            }
+            if (ContentMode.UPDATE =3D=3D mode) {
=20
-            if (mode =3D=3D ContentMode.UPDATE) {
                 loaded =3D service.loadForEdit(tripId);
+
             } else {
+
                 loaded =3D service.loadForDisplay(tripId);
+
             }
=20
         }
@@ -181,14 +167,11 @@ public class TripLonglineUIHandler extends ContentOpena=
bleUIHandler<TripLongline
         getUi().getTripLonglineTabPane().setSelectedIndex(0);
         buildTripMap =3D true;
=20
-        finalizeOpenUI(mode, create);
     }
=20
     @Override
     public void startEditUI(String... binding) {
=20
-        TripLonglineUI ui =3D getUi();
-
         ContentOpenableUIModel<TripLongline> model =3D getModel();
=20
         ContentMode mode =3D model.getMode();
@@ -196,7 +179,7 @@ public class TripLonglineUIHandler extends ContentOpenabl=
eUIHandler<TripLongline
         boolean create =3D mode =3D=3D ContentMode.CREATE;
=20
         String contextName =3D getValidatorContextName(mode);
-        ui.getValidator().setContext(contextName);
+        getUi().getValidator().setContext(contextName);
=20
         if (create) {
             addInfoMessage(t("observe.tripLongline.message.creating"));
@@ -205,6 +188,7 @@ public class TripLonglineUIHandler extends ContentOpenabl=
eUIHandler<TripLongline
             if (model.isHistoricalData()) {
=20
                 addInfoMessage(t("observe.message.historical.data"));
+
             }
         }
=20
@@ -221,7 +205,9 @@ public class TripLonglineUIHandler extends ContentOpenabl=
eUIHandler<TripLongline
                           TripLonglineUI.BINDING_HOME_ID_TEXT,
                           TripLonglineUI.BINDING_CLOSE_ENABLED,
                           TripLonglineUI.BINDING_CLOSE_AND_CREATE_ENABLED);
+
         model.setModified(create);
+
     }
=20
     @Override
@@ -237,6 +223,7 @@ public class TripLonglineUIHandler extends ContentOpenabl=
eUIHandler<TripLongline
         obtainChildPosition(bean);
=20
         return true;
+
     }
=20
     @Override
diff --git a/observe-swing/src/main/java/fr/ird/observe/ui/content/open/impl/=
seine/ActivitySeineUIHandler.java b/observe-swing/src/main/java/fr/ird/observ=
e/ui/content/open/impl/seine/ActivitySeineUIHandler.java
index 7e0e1fe..3b3ab5f 100644
--- a/observe-swing/src/main/java/fr/ird/observe/ui/content/open/impl/seine/A=
ctivitySeineUIHandler.java
+++ b/observe-swing/src/main/java/fr/ird/observe/ui/content/open/impl/seine/A=
ctivitySeineUIHandler.java
@@ -29,8 +29,8 @@ import fr.ird.observe.entities.seine.ActivitySeine;
 import fr.ird.observe.entities.seine.ActivitySeineImpl;
 import fr.ird.observe.entities.seine.Route;
 import fr.ird.observe.entities.seine.TripSeine;
-import fr.ird.observe.services.referential.ReferentialService;
 import fr.ird.observe.services.data.seine.ActivitySeineService;
+import fr.ird.observe.services.referential.ReferentialService;
 import fr.ird.observe.ui.content.ContentMode;
 import fr.ird.observe.ui.content.ContentUIModel;
 import fr.ird.observe.ui.content.open.ContentOpenableUIHandler;
@@ -38,6 +38,7 @@ import jaxx.runtime.validator.swing.SwingValidatorMessage;
 import jaxx.runtime.validator.swing.SwingValidatorMessageTableModel;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.nuiton.jaxx.widgets.gis.absolute.CoordinatesEditor;
 import org.nuiton.validator.NuitonValidatorScope;
=20
 import javax.swing.event.TableModelEvent;
@@ -81,6 +82,16 @@ public class ActivitySeineUIHandler extends ContentOpenabl=
eUIHandler<ActivitySei
     }
=20
     @Override
+    public void initUI() throws Exception {
+
+        super.initUI();
+
+        // listen messages to see if required to add
+        reloadTableModelListener(getUi().getErrorTableModel(), computeTabVal=
idStateListener);
+
+    }
+
+    @Override
     protected ContentMode getContentMode(DataContext dataContext) {
=20
         String activityId =3D getSelectedId();
@@ -91,16 +102,15 @@ public class ActivitySeineUIHandler extends ContentOpena=
bleUIHandler<ActivitySei
             return ContentMode.CREATE;
         }
=20
-        // l'activity existe en base
+        // l'activit=C3=A9 existe en base
         if (dataContext.isSelectedOpen(ActivitySeine.class)) {
=20
-            // l'activity est ouverte, donc modifiable
+            // l'activit=C3=A9 est ouverte, donc modifiable
             return ContentMode.UPDATE;
-        }
=20
-        ActivitySeineUI ui =3D getUi();
+        }
=20
-        // l'activity n'est pas ouverte, donc pas =C3=A9ditable
+        // l'activit=C3=A9 n'est pas ouverte, donc pas =C3=A9ditable
         if (!dataContext.isSelectedOpen(Route.class)) {
=20
             // la route n'est pas ouverte
@@ -120,47 +130,26 @@ public class ActivitySeineUIHandler extends ContentOpen=
ableUIHandler<ActivitySei
             if (getModel().isHistoricalData()) {
=20
                 addInfoMessage(t("observe.message.historical.data"));
+
             }
=20
         } else {
=20
-            // seule l'activity n'est pas ouverte
+            // seule l'activit=C3=A9 n'est pas ouverte
             addInfoMessage(t(closeMessage));
+
         }
=20
         return ContentMode.READ;
-    }
-
-    @Override
-    public void initUI() throws Exception {
-
-        super.initUI();
-
-        // To be sure always remove listener (could prevent some leaks)
-        getUi().getErrorTableModel().removeTableModelListener(computeTabVali=
dStateListener);
-        // listen messages to see if required to add
-        getUi().getErrorTableModel().addTableModelListener(computeTabValidSt=
ateListener);
=20
     }
=20
     @Override
-    public void openUI() throws Exception {
-        super.openUI();
-
-        resetQuadrant(getUi().getCoordinatesEditor());
+    protected void onOpenUI(String routeId, String activityId, ContentMode m=
ode) {
=20
-        String routeId =3D getSelectedParentId();
-        String activityId =3D getSelectedId();
-
-        if (log.isInfoEnabled()) {
-            log.info(prefix + "routeId    =3D " + routeId);
-            log.info(prefix + "activityId =3D " + activityId);
-        }
+        CoordinatesEditor coordinatesEditor =3D getUi().getCoordinatesEditor=
();
=20
-        ContentMode mode =3D computeContentMode();
-        if (log.isInfoEnabled()) {
-            log.info(prefix + "content mode " + mode);
-        }
+        resetQuadrant(coordinatesEditor);
=20
         boolean create =3D activityId =3D=3D null;
=20
@@ -185,29 +174,25 @@ public class ActivitySeineUIHandler extends ContentOpen=
ableUIHandler<ActivitySei
         SwingValidatorMessageTableModel errorTableModel =3D getUi().getError=
TableModel();
         computeTabValidState(errorTableModel);
=20
-        finalizeOpenUI(mode, create);
-
-        getUi().getCoordinatesEditor().setLatitudeAndLongitude(bean.getLatit=
ude(), bean.getLongitude());
+        coordinatesEditor.setLatitudeAndLongitude(bean.getLatitude(), bean.g=
etLongitude());
         if (create) {
+
+            // on positionne le quadrant (celui de l'activit=C3=A9 pr=C3=A9c=
=C3=A9dent si elle existe)
             Integer quadrant =3D bean.getQuadrant();
-            getUi().getCoordinatesEditor().setQuadrant(null);
-            getUi().getCoordinatesEditor().setQuadrant(quadrant);
-        }
+            setQuadrant(coordinatesEditor, quadrant);
=20
-        // on annule la modification engendree par ce binding
-        getModel().setModified(create);
+        }
=20
     }
=20
     @Override
     public void startEditUI(String... binding) {
-        ActivitySeineUI ui =3D getUi();
=20
         ContentUIModel<ActivitySeine> model =3D getModel();
=20
         boolean create =3D model.getMode() =3D=3D ContentMode.CREATE;
         String contextName =3D getValidatorContextName(model.getMode());
-        ui.getValidator().setContext(contextName);
+        getUi().getValidator().setContext(contextName);
         if (create) {
             addMessage(ui,
                        NuitonValidatorScope.INFO,
@@ -215,9 +200,9 @@ public class ActivitySeineUIHandler extends ContentOpenab=
leUIHandler<ActivitySei
                        t("observe.activitySeine.message.creating"));
         } else {
             addMessage(ui,
-                    NuitonValidatorScope.INFO,
-                    getEntityLabel(ActivitySeine.class),
-                    t("observe.activitySeine.message.updating"));
+                       NuitonValidatorScope.INFO,
+                       getEntityLabel(ActivitySeine.class),
+                       t("observe.activitySeine.message.updating"));
         }
=20
         super.startEditUI(ActivitySeineUI.BINDING_TIME_TIME,
@@ -232,7 +217,9 @@ public class ActivitySeineUIHandler extends ContentOpenab=
leUIHandler<ActivitySei
                           ActivitySeineUI.BINDING_CLOSE_ENABLED,
                           ActivitySeineUI.BINDING_ADD_SET_ENABLED,
                           ActivitySeineUI.BINDING_CLOSE_AND_CREATE_ENABLED);
+
         model.setModified(create);
+
     }
=20
     @Override
diff --git a/observe-swing/src/main/java/fr/ird/observe/ui/content/open/impl/=
seine/RouteUIHandler.java b/observe-swing/src/main/java/fr/ird/observe/ui/con=
tent/open/impl/seine/RouteUIHandler.java
index 2fc2bd5..90ba8bc 100644
--- a/observe-swing/src/main/java/fr/ird/observe/ui/content/open/impl/seine/R=
outeUIHandler.java
+++ b/observe-swing/src/main/java/fr/ird/observe/ui/content/open/impl/seine/R=
outeUIHandler.java
@@ -42,6 +42,7 @@ import org.nuiton.validator.NuitonValidatorScope;
=20
 import javax.swing.JOptionPane;
 import java.util.Date;
+import java.util.List;
=20
 import static org.nuiton.i18n.I18n.n;
 import static org.nuiton.i18n.I18n.t;
@@ -78,6 +79,7 @@ public class RouteUIHandler extends ContentOpenableUIHandle=
r<Route> {
=20
             // mode creation
             return ContentMode.CREATE;
+
         }
=20
         // route deja existante       =20
@@ -85,9 +87,8 @@ public class RouteUIHandler extends ContentOpenableUIHandle=
r<Route> {
=20
             // la route est ouverte
             return ContentMode.UPDATE;
-        }
=20
-        RouteUI ui =3D getUi();
+        }
=20
         // route non ouverte
         if (!dataContext.isSelectedOpen(TripSeine.class)) {
@@ -104,26 +105,11 @@ public class RouteUIHandler extends ContentOpenableUIHa=
ndler<Route> {
                        t(closeMessage));
         }
         return ContentMode.READ;
+
     }
=20
     @Override
-    public void openUI() throws Exception {
-
-        super.openUI();
-
-        String tripId =3D getSelectedParentId();
-        String routeId =3D getSelectedId();
-
-        if (log.isInfoEnabled()) {
-            log.info(prefix + "tripId  =3D " + tripId);
-            log.info(prefix + "routeId =3D " + routeId);
-        }
-
-        ContentMode mode =3D computeContentMode();
-
-        if (log.isInfoEnabled()) {
-            log.info(prefix + "content mode =3D " + mode);
-        }
+    protected void onOpenUI(String tripId, String routeId, ContentMode mode)=
 {
=20
         Route loaded;
=20
@@ -138,19 +124,13 @@ public class RouteUIHandler extends ContentOpenableUIHa=
ndler<Route> {
         } else {
=20
             // update mode
-            if (mode =3D=3D ContentMode.UPDATE) {
-                loaded =3D service.loadForEdit(routeId);
-            } else {
-                loaded =3D service.loadForDisplay(routeId);
-            }
+            loaded =3D service.loadForEdit(routeId);
=20
         }
=20
         Route bean =3D getBean();
         copy(Route.class, BinderService.EDIT, loaded, bean);
=20
-        finalizeOpenUI(mode, create);
-
     }
=20
     @Override
@@ -159,9 +139,7 @@ public class RouteUIHandler extends ContentOpenableUIHand=
ler<Route> {
         boolean create =3D getModel().getMode() =3D=3D ContentMode.CREATE;
         String contextName =3D getValidatorContextName(getModel().getMode());
=20
-        RouteUI ui =3D getUi();
-
-        ui.getValidator().setContext(contextName);
+        getUi().getValidator().setContext(contextName);
=20
         if (create) {
             addMessage(ui,
@@ -189,6 +167,7 @@ public class RouteUIHandler extends ContentOpenableUIHand=
ler<Route> {
=20
         // le formulaire est en =C3=A9tat modifi=C3=A9 uniquement si on est =
en cr=C3=A9ation
         getModel().setModified(create);
+
     }
=20
     @Override
@@ -200,7 +179,6 @@ public class RouteUIHandler extends ContentOpenableUIHand=
ler<Route> {
             log.info("will save route " + bean.getTopiaId());
         }
=20
-
         bean.setOpen(true);
=20
         RouteService service =3D getService(RouteService.class);
@@ -214,64 +192,12 @@ public class RouteUIHandler extends ContentOpenableUIHa=
ndler<Route> {
=20
     @Override
     protected void afterSave(boolean refresh) {
+
         super.afterSave(refresh);
         repaintTripNode();
-    }
=20
-    @Override
-    protected void afterDelete() {
-        super.afterDelete();
-        repaintTripNode();
     }
=20
-//    @Override
-//    protected Route onCreate(TopiaContext tx, Object parent, Route editBea=
n) throws TopiaException {
-//
-//        TripSeine parentBean =3D (TripSeine) parent;
-//
-//        // creation de la route
-//        Route beanToSave =3D ObserveDAOHelper.getRouteDAO(tx).create();
-//        editBean.setTopiaId(beanToSave.getTopiaId());
-//
-//        // ajout de la route dans la amree
-//        parentBean.addRoute(beanToSave);
-//
-//        // on renseigne le jour d'observation car on en a besoin pour
-//        // mettre la date de fin de la maree
-//        beanToSave.setDate(editBean.getDate());
-//
-//        // on met a jour si necessaire la date de fin de la maree
-//        updateDateFin(parentBean);
-//
-//        return beanToSave;
-//    }
-//
-//    @Override
-//    protected Route onUpdate(TopiaContext tx, Object parent, Route beanToS=
ave) throws TopiaException {
-//
-//        TripSeine parentBean =3D (TripSeine) parent;
-//
-//        Route editBean =3D getBean();
-//
-//        // on conserve l'ancienne date d'observation
-//        Date oldDate =3D DateUtil.getDay(beanToSave.getDate());
-//
-//        // recopie des propri=C3=A9t=C3=A9s vers le bean a sauver
-//        getLoadBinder().copyExcluding(editBean, beanToSave, Route.PROPERTY=
_ACTIVITY_SEINE);
-//
-//        if (!oldDate.equals(editBean.getDate())) {
-//
-//            // le jour a change, il faut mettre =C3=A0 jour les dates des =
activitys
-//            // et des sets
-//            beanToSave.updateDates();
-//        }
-//
-//        // on met a jour si necessaire la date de fin de la maree
-//        updateDateFin(parentBean);
-//
-//        return beanToSave;
-//    }
-
     @Override
     protected boolean doDelete(Route bean) {
=20
@@ -300,6 +226,14 @@ public class RouteUIHandler extends ContentOpenableUIHan=
dler<Route> {
     }
=20
     @Override
+    protected void afterDelete() {
+
+        super.afterDelete();
+        repaintTripNode();
+
+    }
+
+    @Override
     public boolean doCloseData() throws Exception {
=20
         Route route =3D getBean();
@@ -335,7 +269,6 @@ public class RouteUIHandler extends ContentOpenableUIHand=
ler<Route> {
                 log.debug("response : " + reponse);
             }
=20
-
             switch (reponse) {
                 case JOptionPane.CLOSED_OPTION:
                 case 3:
@@ -390,6 +323,7 @@ public class RouteUIHandler extends ContentOpenableUIHand=
ler<Route> {
         super.doCloseData();
=20
         return true;
+
     }
=20
     protected ActivitySeineUI addActivityFinDeVeille(boolean close) {
@@ -398,26 +332,22 @@ public class RouteUIHandler extends ContentOpenableUIHa=
ndler<Route> {
=20
         // on cr=C3=A9ee l'activity de fin de veille
         ObserveNode parentNode =3D treeHelper.getSelectedNode();
-        parentNode =3D treeHelper.findNode(
-                parentNode,
-                n("observe.common.activities")
-        );
+        parentNode =3D treeHelper.findNode(parentNode, n("observe.common.act=
ivities"));
         if (log.isDebugEnabled()) {
             log.debug("PARENT NODE =3D " + parentNode);
         }
         treeHelper.addUnsavedNode(parentNode, ActivitySeine.class);
=20
         // on recup=C3=A8re l'=C3=A9cran d'=C3=A9dition
-        ActivitySeineUI selectedUI =3D (ActivitySeineUI)
-                ObserveContext.get().getSelectedContentUI();
+        ActivitySeineUI selectedUI =3D (ActivitySeineUI) ObserveContext.get(=
).getSelectedContentUI();
=20
         // on recup=C3=A8re l'activity de fin de veille
         VesselActivitySeine vesselActivitySeine =3D null;
=20
-        for (Object o : selectedUI.getVesselActivitySeine().getData()) {
-            VesselActivitySeine a =3D (VesselActivitySeine) o;
-            if (ActivitySeineImpl.ACTIVITY_FIN_DE_VEILLE.equals(a.getCode())=
) {
-                vesselActivitySeine =3D a;
+        List<VesselActivitySeine> vesselActivitySeines =3D selectedUI.getVes=
selActivitySeine().getData();
+        for (VesselActivitySeine vesselActivitySeine1 : vesselActivitySeines=
) {
+            if (ActivitySeineImpl.ACTIVITY_FIN_DE_VEILLE_ID.equals(vesselAct=
ivitySeine1.getTopiaId())) {
+                vesselActivitySeine =3D vesselActivitySeine1;
                 break;
             }
         }
@@ -434,14 +364,16 @@ public class RouteUIHandler extends ContentOpenableUIHa=
ndler<Route> {
=20
             // on ferme l'=C3=A9cean
             selectedUI.stopEdit();
+
         }
+
         return selectedUI;
+
     }
=20
     @Override
     protected boolean obtainCanReopen(boolean create) {
=20
-
         DataContext dataContext =3D getDataContext();
=20
         // on peut reouvrir une route si :
@@ -451,6 +383,7 @@ public class RouteUIHandler extends ContentOpenableUIHand=
ler<Route> {
                             dataContext.isSelectedOpen(TripSeine.class) &&
                             !dataContext.isOpenRoute();
         return canReopen;
+
     }
=20
     protected void repaintTripNode() {
@@ -463,20 +396,20 @@ public class RouteUIHandler extends ContentOpenableUIHa=
ndler<Route> {
=20
         getUi().removeContextValue(Boolean.class, UPDATE_TRIP_NODE);
=20
-        if (updateTripNode =3D=3D null || !updateTripNode) {
-            return;
-        }
+        if (updateTripNode !=3D null && updateTripNode) {
=20
+            ObserveTreeHelper treeHelper =3D getTreeHelper(getUi());
+            ObserveNode tripNode =3D treeHelper.getSelectedNode().getParent(=
).getParent();
+            if (log.isInfoEnabled()) {
+                log.info("Refresh trip node : " + tripNode);
+            }
+            treeHelper.reloadNode(tripNode, false);
=20
-        ObserveTreeHelper treeHelper =3D getTreeHelper(getUi());
-        ObserveNode tripNode =3D treeHelper.getSelectedNode().getParent().ge=
tParent();
-        if (log.isInfoEnabled()) {
-            log.info("Refresh trip node : " + tripNode);
         }
-        treeHelper.reloadNode(tripNode, false);
=20
     }
=20
+    //FIXME Remettre =C3=A7a en place
     protected void updateDateFin(TripSeine parentBean) {
=20
         Date endDate =3D parentBean.getEndDate();
diff --git a/observe-swing/src/main/java/fr/ird/observe/ui/content/open/impl/=
seine/TripSeineUIHandler.java b/observe-swing/src/main/java/fr/ird/observe/ui=
/content/open/impl/seine/TripSeineUIHandler.java
index 619a52c..661bc93 100644
--- a/observe-swing/src/main/java/fr/ird/observe/ui/content/open/impl/seine/T=
ripSeineUIHandler.java
+++ b/observe-swing/src/main/java/fr/ird/observe/ui/content/open/impl/seine/T=
ripSeineUIHandler.java
@@ -90,6 +90,7 @@ public class TripSeineUIHandler extends ContentOpenableUIHa=
ndler<TripSeine> {
=20
     @Override
     public void initUI() throws Exception {
+
         super.initUI();
=20
         TripSeineUI ui =3D getUi();
@@ -130,19 +131,7 @@ public class TripSeineUIHandler extends ContentOpenableU=
IHandler<TripSeine> {
     }
=20
     @Override
-    public void openUI() throws Exception {
-        super.openUI();
-
-        ContentMode mode =3D computeContentMode();
-
-        String programId =3D getSelectedParentId();
-        final String tripId =3D getSelectedId();
-
-        if (log.isInfoEnabled()) {
-            log.info(prefix + "programId =3D " + programId);
-            log.info(prefix + "tripId    =3D " + tripId);
-            log.info(prefix + "mode      =3D " + mode);
-        }
+    protected void onOpenUI(String programId, String tripId, ContentMode mod=
e) {
=20
         TripSeineService service =3D getService(TripSeineService.class);
=20
@@ -152,25 +141,19 @@ public class TripSeineUIHandler extends ContentOpenable=
UIHandler<TripSeine> {
         if (create) {
=20
             // create mode
-
-            if (log.isInfoEnabled()) {
-                log.info(prefix + "create a new trip");
-            }
-
-
             loaded =3D service.preCreate(programId);
=20
         } else {
=20
             // update mode
-            if (log.isInfoEnabled()) {
-                log.info(prefix + "using existing trip " + tripId);
-            }
+            if (ContentMode.UPDATE =3D=3D mode) {
=20
-            if (mode =3D=3D ContentMode.UPDATE) {
                 loaded =3D service.loadForEdit(tripId);
+
             } else {
+
                 loaded =3D service.loadForDisplay(tripId);
+
             }
=20
         }
@@ -178,16 +161,14 @@ public class TripSeineUIHandler extends ContentOpenable=
UIHandler<TripSeine> {
         TripSeine bean =3D getBean();
         copy(TripSeine.class, BinderService.EDIT, loaded, bean);
         getUi().getTripSeineTabPane().setSelectedIndex(0);
+
         buildTripMap =3D true;
=20
-        finalizeOpenUI(mode, create);
     }
=20
     @Override
     public void startEditUI(String... binding) {
=20
-        TripSeineUI ui =3D getUi();
-
         ContentOpenableUIModel<TripSeine> model =3D getModel();
=20
         ContentMode mode =3D model.getMode();
@@ -195,7 +176,7 @@ public class TripSeineUIHandler extends ContentOpenableUI=
Handler<TripSeine> {
         boolean create =3D mode =3D=3D ContentMode.CREATE;
=20
         String contextName =3D getValidatorContextName(mode);
-        ui.getValidator().setContext(contextName);
+        getUi().getValidator().setContext(contextName);
=20
         if (create) {
=20
@@ -219,7 +200,9 @@ public class TripSeineUIHandler extends ContentOpenableUI=
Handler<TripSeine> {
                           TripSeineUI.BINDING_ERS_ID_TEXT,
                           TripSeineUI.BINDING_CLOSE_ENABLED,
                           TripSeineUI.BINDING_CLOSE_AND_CREATE_ENABLED);
+
         model.setModified(create);
+
     }
=20
     @Override
@@ -235,6 +218,7 @@ public class TripSeineUIHandler extends ContentOpenableUI=
Handler<TripSeine> {
         obtainChildPosition(bean);
=20
         return true;
+
     }
=20
     @Override
diff --git a/observe-swing/src/main/java/fr/ird/observe/ui/content/table/Cont=
entTableUIHandler.java b/observe-swing/src/main/java/fr/ird/observe/ui/conten=
t/table/ContentTableUIHandler.java
index c5be916..1242dfc 100644
--- a/observe-swing/src/main/java/fr/ird/observe/ui/content/table/ContentTabl=
eUIHandler.java
+++ b/observe-swing/src/main/java/fr/ird/observe/ui/content/table/ContentTabl=
eUIHandler.java
@@ -33,11 +33,8 @@ import fr.ird.observe.ui.content.ContentMode;
 import fr.ird.observe.ui.content.ContentUIHandler;
 import fr.ird.observe.ui.content.ObserveContentUI;
 import fr.ird.observe.ui.tree.ObserveNode;
-import jaxx.runtime.swing.ErrorDialogUI;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.nuiton.topia.TopiaContext;
-import org.nuiton.topia.TopiaException;
 import org.nuiton.topia.persistence.TopiaEntity;
 import org.nuiton.validator.NuitonValidatorScope;
=20
@@ -47,7 +44,6 @@ import javax.swing.SwingUtilities;
 import javax.swing.event.ListSelectionEvent;
 import javax.swing.table.DefaultTableCellRenderer;
 import java.awt.Rectangle;
-import java.util.Collection;
 import java.util.Collections;
 import java.util.List;
 import java.util.Set;
@@ -79,6 +75,33 @@ public abstract class ContentTableUIHandler<E extends Topi=
aEntity, D extends Top
      */
     protected abstract void onSelectedRowChanged(int editingRow, D bean, boo=
lean create);
=20
+    /**
+     * Initialiser le tableau de l'=C3=A9cran.
+     *
+     * Cette m=C3=A9thode est appel=C3=A9e la premi=C3=A8re fois que l'=C3=
=A9cran est affich=C3=A9.
+     *
+     * @param renderer le renderer par d=C3=A9faut =C3=A0 utiliser.
+     */
+    protected abstract void initTableUI(DefaultTableCellRenderer renderer);
+
+    /**
+     * Pour charger le bean d'=C3=A9dition dans la m=C3=A9thode {@link #open=
UI()}.
+     *
+     * Cette m=C3=A9thode est appel=C3=A9e =C3=A0 chaque affichage de l'=C3=
=A9cran.
+     *
+     * @param mode le mode de l'=C3=A9cran
+     */
+    protected abstract void loadEditBean(ContentMode mode);
+
+    /**
+     * Pour enregistre l'objet en cours d'=C3=A9dition.
+     *
+     * Cette m=C3=A9thode est appel=C3=A9 dans la m=C3=A9thode {@link #doSav=
e(TopiaEntity)}.
+     *
+     * @param editBean l'objet =C3=A0 enregistrer
+     */
+    protected abstract void doPersist(E editBean);
+
     @Override
     protected boolean computeCanWrite(DataSource source) {
         return source.canWriteData();
@@ -123,10 +146,102 @@ public abstract class ContentTableUIHandler<E extends =
TopiaEntity, D extends Top
         return (ObserveContentTableUI<E, D>) super.getUi();
     }
=20
+    protected ContentTableModel<E, D> getTableModel() {
+        return getUi().getTableModel();
+    }
+
     public final D getTableEditBean() {
         return getModel().getTableEditBean();
     }
=20
+    @Override
+    public void initUI() throws Exception {
+
+        ContentTableUIInitializer<E, D, ObserveContentTableUI<E, D>> uiIniti=
alizer =3D
+                new ContentTableUIInitializer<E, D, ObserveContentTableUI<E,=
 D>>(getUi());
+        uiInitializer.initUI(ObserveContext.get().getServices());
+
+    }
+
+    @Override
+    public void openUI() throws Exception {
+
+        super.openUI();
+
+        ContentTableModel<E, D> tableModel =3D getTableModel();
+
+        // r=C3=A9cup=C3=A9ration de la ligne s=C3=A9lectionn=C3=A9e
+        int oldIndex =3D tableModel.getSelectedRow();
+
+        // on d=C3=A9ttache le mod=C3=A8le du tableau
+        tableModel.dettachModel();
+
+        // r=C3=A9cup=C3=A9ration du mode de l'=C3=A9cran
+        ContentMode mode =3D computeContentMode();
+
+        // chargement du bean d'=C3=A9dition
+        loadEditBean(mode);
+
+        // chargement de l'=C3=A9cran d'=C3=A9dition
+        loadTableEditBeanForm(mode);
+
+        // enregistrement du mode de l'=C3=A9cran
+        getModel().setMode(mode);
+
+        // initialisation du mod=C3=A8le du tableau
+        tableModel.attachModel();
+
+        boolean canEdit =3D mode =3D=3D ContentMode.UPDATE;
+
+        if (canEdit) {
+            // on lance le mode edition
+            ui.startEdit(null);
+        }
+
+        if (!tableModel.isEmpty()) {
+
+            if (tableModel.getRowCount() <=3D oldIndex) {
+                oldIndex =3D 0;
+            }
+            if (oldIndex =3D=3D -1) {
+                oldIndex =3D 0;
+            }
+
+            // le tableau contient au moins une entr=C3=A9e
+            // on la s=C3=A9lectionne la premi=C3=A8re entr=C3=A9e
+            tableModel.changeSelectedRow(oldIndex);
+
+        }
+
+        if (canEdit) {
+
+            // on force l'ecran en non modification
+            //FIXME normalement, on ne devrait pas a avoir a faire ca ?
+            //FIXME mais il est possible que les validateurs modifient l'=C3=
=A9tat
+            //FIXME modified sur l'ecran lors des bindings d'initilisation...
+            getModel().setModified(false);
+
+        }
+
+    }
+
+    protected void loadTableEditBeanForm(ContentMode mode) {
+        // par defaut, rien =C3=A0 faire
+    }
+
+
+    @Override
+    public void startEditUI(String... binding) {
+
+        addUpdateInfoMessage();
+        super.startEditUI(binding);
+
+    }
+
+    protected void resetEditBean() {
+        getTableModel().resetEditBean();
+    }
+
     public final void updateEditor(ListSelectionEvent event) {
=20
         final ObserveContentTableUI<E, D> ui =3D getUi();
@@ -142,7 +257,10 @@ public abstract class ContentTableUIHandler<E extends To=
piaEntity, D extends Top
         if (log.isDebugEnabled()) {
             log.debug(event);
         }
-        if (getTableModel().isEmpty()) {
+
+        ContentTableModel<E, D> tableModel =3D getTableModel();
+
+        if (tableModel.isEmpty()) {
             // le modele est vide, on ne propage rien
             //FIXME le mod=C3=A8le de selection ne devrait plus declancher d=
es evenement
             //FIXME des que le modele est vide ?
@@ -172,111 +290,28 @@ public abstract class ContentTableUIHandler<E extends =
TopiaEntity, D extends Top
             }
         });
=20
-        int selectedRow =3D getTableModel().getSelectedRow();
+        int selectedRow =3D tableModel.getSelectedRow();
         if (newIndex =3D=3D selectedRow) {
             // on bloque du code re-entrant
             log.debug("new index already set in model " + newIndex + ", do n=
othing");
             return;
         }
         // on doit changer de ligne selectionne dans le modele
-        getTableModel().changeSelectedRow(newIndex);
-    }
-
-    protected abstract void initTableUI(DefaultTableCellRenderer renderer);
+        tableModel.changeSelectedRow(newIndex);
=20
-//    protected String getEditBeanIdToLoad(DataContext dataContext,
-//                                                  DataService dataService,
-//                                                  DataSource dataSource) t=
hrows DataSourceException {
-//        throw new IllegalStateException("Do NOT USE ME!!!");
-//    }
-
-//    protected E loadEditBean(ContentMode mode,
-//                             DataContext dataContext,
-//                             DataService dataService,
-//                             DataSource dataSource) throws DataSourceExcep=
tion {
-//
-//        loadEditBean(mode);
-//
-////        String id =3D getEditBeanIdToLoad(dataContext, dataService, data=
Source);
-////
-////        if (id =3D=3D null) {
-////            throw new IllegalStateException("Could not find id form " + =
this);
-////        }
-////
-////        // preparation du bean d'=C3=A9dition
-////        dataService.loadEditEntity(dataSource, id, getLoadExecutor());
-//
-////        getModel().setMode(mode);
-////
-////        // initialisation du mod=C3=A8le du tableau
-////        getUi().getTableModel().attachModel();
-//
-//        E editBean =3D getBean();
-//        return editBean;
-//
-//    }
-
-    //FIXME Rendre cette methode abstract
-    protected abstract void loadEditBean(ContentMode mode) ;
-
-//    protected abstract void loadEditBean() throws DataSourceException {
-//
-//        String id =3D getEditBeanIdToLoad(getDataContext(), getDataService=
(), getDataSource());
-//
-//        if (id =3D=3D null) {
-//            throw new IllegalStateException("Could not find id form " + th=
is);
-//        }
-//
-//        // preparation du bean d'=C3=A9dition
-//        getDataService().loadEditEntity(getDataSource(), id, getLoadExecut=
or());
-//
-//    }
-
-//    //FIXME A supprimer
-//    @Override
-//    protected final void onLoad(TopiaContext tx, E bean) throws TopiaExcep=
tion {
-//        super.onLoad(tx, bean);
-//
-//        // on duplique la liste des fils traites dans le tableau
-//        // sinon on reste sur les references d'origine et on aura pas
-//        // la possibilit=C3=A9 d'annuler l'edition ensuite car on aura mod=
ifie
-//        // les entr=C3=A9es d'origine...
-//        E editBean =3D getBean();
-//        Collection<D> data =3D loadChilds(tx, editBean);
-//        getModel().getChildsUpdator().setChilds(editBean, data);
-//    }
-//
-//    //FIXME A supprimer
-//    protected Collection<D> loadChilds(TopiaContext tx, E bean) throws Top=
iaException {
-//        Collection<D> childs =3D getModel().getChildsUpdator().getChilds(b=
ean);
-//        Collection<D> data =3D new ArrayList<D>();
-//        if (CollectionUtils.isNotEmpty(childs)) {
-//            Loador<D> loader =3D getModel().getChildLoador();
-//            TopiaDAO<D> dao =3D getDataSource().getDAO(tx, getTableEditBea=
n());
-//            for (D c : childs) {
-//                try {
-//                    D cUp =3D dao.findByTopiaId(c.getTopiaId());
-//                    D c2 =3D getModel().newTableEditBean();
-//                    loader.load(cUp, c2, true);
-//                    data.add(c2);
-//                } catch (Exception e) {
-//                    throw new RuntimeException(e);
-//                }
-//            }
-//        }
-//        return data;
-//    }
-
-    @Override
-    public void initUI() throws Exception {
+    }
=20
-        ContentTableUIInitializer<E, D, ObserveContentTableUI<E, D>> uiIniti=
alizer =3D
-                new ContentTableUIInitializer<E, D, ObserveContentTableUI<E,=
 D>>(getUi());
-        uiInitializer.initUI(ObserveContext.get().getServices());
+    public void removeSelectedRow(int selectedRow) {
+        try {
+            getTableModel().doRemoveRow(selectedRow, false);
+        } finally {
=20
+            // always reset busy model to false
+            ObserveContext.get().getObserveMainUI().setBusy(false);
+        }
     }
=20
-    public Set<String> loadSpeciesList(String speciesListId, String errorMes=
sage) {
+    protected Set<String> loadSpeciesList(String speciesListId, String error=
Message) {
=20
         Set<String> speciesIds;
         try {
@@ -294,7 +329,6 @@ public abstract class ContentTableUIHandler<E extends Top=
iaEntity, D extends Top
=20
     }
=20
-
     protected void prepareSpeciesList(String speciesListId, JComponent speci=
esComponent, String errorMessage) throws DataSourceException {
         Set<String> speciesIds =3D loadSpeciesList(speciesListId, errorMessa=
ge);
=20
@@ -303,73 +337,6 @@ public abstract class ContentTableUIHandler<E extends To=
piaEntity, D extends Top
                 Species2.newSpeciesByIdPredicate(speciesIds));
     }
=20
-    protected void loadTableEditBeanForm(ContentMode mode) {
-        // par defaut, rien =C3=A0 faire
-    }
-
-    @Override
-    public void openUI() throws Exception {
-
-        super.openUI();
-
-        // r=C3=A9cup=C3=A9ration du mode de l'=C3=A9cran
-        ContentMode mode =3D computeContentMode();
-
-        ObserveContentTableUI<E, D> ui =3D getUi();
-
-        int oldIndex =3D ui.getTableModel().getSelectedRow();
-
-        ui.getTableModel().dettachModel();
-
-        // chargement du bean d'=C3=A9dition
-        loadEditBean(mode);
-
-        // chargement de l'=C3=A9cran d'=C3=A9dition
-        loadTableEditBeanForm(mode);
-
-        // enregistrement du mode de l'=C3=A9cran
-        getModel().setMode(mode);
-
-        // initialisation du mod=C3=A8le du tableau
-        getUi().getTableModel().attachModel();
-
-        boolean canEdit =3D mode =3D=3D ContentMode.UPDATE;
-
-        if (canEdit) {
-            // on lance le mode edition
-            ui.startEdit(null);
-        }
-
-        if (!ui.getTableModel().isEmpty()) {
-            if (ui.getTableModel().getRowCount() <=3D oldIndex) {
-                oldIndex =3D 0;
-            }
-            if (oldIndex =3D=3D -1) {
-                oldIndex =3D 0;
-            }
-
-            // le tableau contient au moins une entr=C3=A9e
-            // on la s=C3=A9lectionne la premi=C3=A8re entr=C3=A9e
-            ui.getTableModel().changeSelectedRow(oldIndex);
-        }
-
-        if (canEdit) {
-
-            // on force l'ecran en non modification
-            //FIXME normalement, on ne devrait pas a avoir a faire ca ?
-            //FIXME mais il est possible que les validateurs modifient l'=C3=
=A9tat
-            //FIXME modified sur l'ecran lors des bindings d'initilisation...
-            getModel().setModified(false);
-        }
-    }
-
-    @Override
-    public void startEditUI(String... binding) {
-
-        addUpdateInfoMessage();
-        super.startEditUI(binding);
-    }
-
     protected void addUpdateInfoMessage() {
         String message =3D n("observe.entity.message.updating");
         ObserveNode node =3D getTreeHelper(getUi()).getSelectedNode();
@@ -379,163 +346,36 @@ public abstract class ContentTableUIHandler<E extends =
TopiaEntity, D extends Top
         addMessage(getUi(), NuitonValidatorScope.INFO, entityLabel, message);
     }
=20
-    public void removeSelectedRow(int selectedRow) {
-        try {
-            getTableModel().doRemoveRow(selectedRow, false);
-        } finally {
-
-            // always reset busy model to false
-            ObserveContext.get().getObserveMainUI().setBusy(false);
-        }
-    }
-
-//    @Override
-//    protected boolean doSave(E bean,
-//                             DataService dataService,
-//                             DataSource dataSource,
-//                             TopiaEntityBinder<E> binder) throws Exception=
 {
-//
-//        ObserveContentTableUI<E, D> ui =3D getUi();
-//
-//        List<D> objets =3D ui.getTableModel().getData();
-//
-//        boolean canContinue;
-//        try {
-//            canContinue =3D prepareSave(bean, objets);
-//        } catch (Exception e) {
-//            if (log.isErrorEnabled()) {
-//                log.error(e);
-//            }
-//            ErrorDialogUI.showError(e);
-//            canContinue =3D false;
-//        }
-//        if (!canContinue) {
-//
-//            // l'utilisateur a choisi de ne pas sauvegarder
-//            return false;
-//        }
-//        doPersist(bean, dataService, dataSource);
-//
-//
-//        return true;
-//    }
-
     @Override
-    protected boolean doSave(E bean) {
+    protected final boolean doSave(E bean) {
=20
-        ObserveContentTableUI<E, D> ui =3D getUi();
+        List<D> objets =3D getTableModel().getData();
=20
-        List<D> objets =3D ui.getTableModel().getData();
+        boolean canContinue =3D prepareSave(bean, objets);
=20
-        boolean canContinue;
-        try {
-            canContinue =3D prepareSave(bean, objets);
-        } catch (Exception e) {
-            if (log.isErrorEnabled()) {
-                log.error(e);
-            }
-            ErrorDialogUI.showError(e);
-            canContinue =3D false;
-        }
-        if (!canContinue) {
+        if (canContinue) {
+
+            doPersist(bean);
+            canContinue =3D true;
=20
-            // l'utilisateur a choisi de ne pas sauvegarder
-            return false;
         }
-        doPersist(bean);
=20
+        return canContinue;
=20
-        return true;
     }
=20
+    protected boolean prepareSave(E editBean, List<D> objets) {
=20
-//    protected void doPersist(E bean, DataService dataService, DataSource d=
ataSource) throws DataSourceException {
-//        // sauvegarde du bean en base
-//        dataService.update(dataSource, null, bean, getUpdateExecutor());
-//    }
-
-    protected void doPersist(E editBean) {
-
+        // par defaut, rien de specifique a faire avant de faire la sauvegar=
de
+        return true;
     }
=20
-//    @Override
-//    protected E onUpdate(TopiaContext tx, Object parentBean, E beanToSave)=
 throws TopiaException {
-//
-//        List<D> childs =3D getUi().getTableModel().getData();
-//
-//        E editBean =3D getBean();
-//
-//        TopiaEntityBinder<E> binder =3D getLoadBinder();
-//
-//        Loador<D> childBinder =3D getModel().getChildLoador();
-//
-//        EntityListUpdator<E, D> childUpdator =3D getModel().getChildsUpdat=
or();
-//
-//        // recopie des propri=C3=A9t=C3=A9s du bean en excluant toujours l=
a liste des fils
-//        binder.copyExcluding(editBean, beanToSave, childUpdator.getPropert=
yName());
-//
-//        // on conserve l'ancienne liste des fils (pour traitement ult=C3=
=A9rieure)
-//        Collection<D> oldChilds =3D
-//                new ArrayList<D>(childUpdator.getChilds(beanToSave));
-//
-//        // suppression des fils dans le bean a sauver
-//        childUpdator.removeAll(beanToSave);
-//
-//        TopiaDAO<D> dao =3D ObserveDAOHelper.getDAO(tx, getModel().getChil=
dType());
-//
-//        for (D child : childs) {
-//
-//            D childToSave;
-//
-//            if (child.getTopiaId() =3D=3D null) {
-//
-//                // creation du fils
-//                Map<String, Object> map =3D childBinder.obtainProperties(c=
hild);
-//
-//                childToSave =3D dao.create(map);
-//
-//            } else {
-//
-//                // mise a jour du fils
-//
-//                childToSave =3D dao.findByTopiaId(child.getTopiaId());
-//
-//                childBinder.load(child, childToSave, false);
-//            }
-//
-//            // ajout du fils au bean =C3=A0 sauver
-//            childUpdator.addToList(beanToSave, childToSave);
-//        }
-//
-//        // on donne la main aux implantations pour faire des traitements
-//        // suppl=C3=A9mentaires
-//        onUpdateFinalize(tx, beanToSave, oldChilds);
-//
-//        return beanToSave;
-//    }
-
     @Override
     protected void afterSave(boolean refresh) {
=20
         // on recharge l'=C3=A9cran
         resetEditUI();
-    }
-
-    protected boolean prepareSave(E editBean, List<D> objets) throws Excepti=
on {
=20
-        // par defaut, rien de specifique a faire avant de faire la sauvegar=
de
-        return true;
     }
=20
-    protected void onUpdateFinalize(TopiaContext tx, E bean, Collection<D> o=
ldChilds) throws TopiaException {
-        // par d=C3=A9faut, rien =C3=A0 faire
-    }
-
-    protected ContentTableModel<E, D> getTableModel() {
-        return getUi().getTableModel();
-    }
-
-    protected void resetEditBean() {
-        getTableModel().resetEditBean();
-    }
 }
diff --git a/observe-swing/src/main/java/fr/ird/observe/ui/content/table/Cont=
entTableUIModel.java b/observe-swing/src/main/java/fr/ird/observe/ui/content/=
table/ContentTableUIModel.java
index 2f6646b..fadfe3c 100644
--- a/observe-swing/src/main/java/fr/ird/observe/ui/content/table/ContentTabl=
eUIModel.java
+++ b/observe-swing/src/main/java/fr/ird/observe/ui/content/table/ContentTabl=
eUIModel.java
@@ -99,7 +99,7 @@ public abstract class ContentTableUIModel<E extends TopiaEn=
tity, D extends Topia
=20
         BinderService binderService =3D ObserveServiceHelper.get().getBinder=
Service();
=20
-        this.childLoador =3D binderService.getTopiaBinder(childType, childBi=
nderContext);
+        this.childLoador =3D binderService.getBinder(childType, childBinderC=
ontext);
=20
     }
=20
diff --git a/observe-swing/src/main/java/fr/ird/observe/ui/content/table/impl=
/longline/SizeMeasuresTableModel.java b/observe-swing/src/main/java/fr/ird/ob=
serve/ui/content/table/impl/longline/SizeMeasuresTableModel.java
index 3bb120a..a08f575 100644
--- a/observe-swing/src/main/java/fr/ird/observe/ui/content/table/impl/longli=
ne/SizeMeasuresTableModel.java
+++ b/observe-swing/src/main/java/fr/ird/observe/ui/content/table/impl/longli=
ne/SizeMeasuresTableModel.java
@@ -22,6 +22,7 @@ package fr.ird.observe.ui.content.table.impl.longline;
  * #L%
  */
=20
+import fr.ird.observe.BinderService;
 import fr.ird.observe.ObserveServiceHelper;
 import fr.ird.observe.entities.longline.SizeMeasure;
 import fr.ird.observe.entities.longline.SizeMeasureImpl;
@@ -40,7 +41,7 @@ public class SizeMeasuresTableModel extends EditableTableWi=
thCacheTableModelSupp
=20
     public SizeMeasuresTableModel() {
=20
-        super(ObserveServiceHelper.get().getBinderService().getSimpleTopiaBi=
nder(SizeMeasure.class));
+        super(ObserveServiceHelper.get().getBinderService().getBinder(SizeMe=
asure.class, BinderService.EDIT));
=20
     }
=20
diff --git a/observe-swing/src/main/java/fr/ird/observe/ui/content/table/impl=
/longline/WeightMeasuresTableModel.java b/observe-swing/src/main/java/fr/ird/=
observe/ui/content/table/impl/longline/WeightMeasuresTableModel.java
index d36086d..e125f4b 100644
--- a/observe-swing/src/main/java/fr/ird/observe/ui/content/table/impl/longli=
ne/WeightMeasuresTableModel.java
+++ b/observe-swing/src/main/java/fr/ird/observe/ui/content/table/impl/longli=
ne/WeightMeasuresTableModel.java
@@ -22,6 +22,7 @@ package fr.ird.observe.ui.content.table.impl.longline;
  * #L%
  */
=20
+import fr.ird.observe.BinderService;
 import fr.ird.observe.ObserveServiceHelper;
 import fr.ird.observe.entities.longline.WeightMeasure;
 import fr.ird.observe.entities.longline.WeightMeasureImpl;
@@ -39,7 +40,7 @@ public class WeightMeasuresTableModel extends EditableTable=
WithCacheTableModelSu
     private static final long serialVersionUID =3D 1L;
=20
     public WeightMeasuresTableModel() {
-        super(ObserveServiceHelper.get().getBinderService().getSimpleTopiaBi=
nder(WeightMeasure.class));
+        super(ObserveServiceHelper.get().getBinderService().getBinder(Weight=
Measure.class, BinderService.EDIT));
     }
=20
     @Override
diff --git a/observe-swing/src/main/java/fr/ird/observe/ui/content/table/impl=
/seine/NonTargetCatchUIHandler.java b/observe-swing/src/main/java/fr/ird/obse=
rve/ui/content/table/impl/seine/NonTargetCatchUIHandler.java
index 0a96590..8e59f98 100644
--- a/observe-swing/src/main/java/fr/ird/observe/ui/content/table/impl/seine/=
NonTargetCatchUIHandler.java
+++ b/observe-swing/src/main/java/fr/ird/observe/ui/content/table/impl/seine/=
NonTargetCatchUIHandler.java
@@ -54,10 +54,10 @@ import javax.swing.table.DefaultTableCellRenderer;
 import java.beans.PropertyChangeEvent;
 import java.beans.PropertyChangeListener;
 import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
+import java.util.Collections;
 import java.util.HashSet;
 import java.util.List;
+import java.util.Set;
=20
 import static org.nuiton.i18n.I18n.n;
 import static org.nuiton.i18n.I18n.t;
@@ -71,11 +71,16 @@ public class NonTargetCatchUIHandler extends ContentTable=
UIHandler<SetSeine, Non
     /** Logger */
     static private Log log =3D LogFactory.getLog(NonTargetCatchUIHandler.cla=
ss);
=20
-    /** l'entr=C3=A9e dans le contexte pour r=C3=A9cup=C3=A9rer la liste com=
plete des speciess */
+    /**
+     * L'entr=C3=A9e dans le contexte pour r=C3=A9cup=C3=A9rer la liste comp=
lete des esp=C3=A8ces.
+     */
     protected final JAXXContextEntryDef<List<Species>> ALL_ESPECES_ENTRY =3D
             UIHelper.newListContextEntryDef("NonTargetCatchUI-all-speciess");
=20
-    protected final JAXXContextEntryDef<List<NonTargetLength>> ALL_TAILLES_T=
O_DELETE_ENTRY =3D
+    /**
+     * L'entr=C3=A9e dans le contexte pour conserver les mensurations obsol=
=C3=A8tes =C3=A0 supprimer lors de la sauvegarde.
+     */
+    protected final JAXXContextEntryDef<List<NonTargetLength>> ALL_NON_TARGE=
T_LENGTH_TO_DELETE_ENTRY =3D
             UIHelper.newListContextEntryDef("NonTargetCatchUI-all-taille-to-=
delete");
=20
     /**
@@ -147,69 +152,44 @@ public class NonTargetCatchUIHandler extends ContentTab=
leUIHandler<SetSeine, Non
         return (NonTargetCatchUI) super.getUi();
     }
=20
-    public String getCatchWeightDataTip(NonTargetCatchComputedValueSource co=
mputed) {
-        String result;
-
-        if (computed =3D=3D null) {
-            result =3D t("observe.common.catchWeightComputed.observed.tip");
-        } else {
-            result =3D t("observe.common.catchWeightComputed.computed.tip", =
computed.toString());
-        }
-        return result;
-    }
-
-    public String getTotalCountDataTip(NonTargetCatchComputedValueSource com=
puted) {
-        String result;
-
-        if (computed =3D=3D null) {
-            result =3D t("observe.common.totalCountComputed.observed.tip");
-        } else {
-            result =3D t("observe.common.totalCountComputed.computed.tip", c=
omputed.toString());
-
-        }
-        return result;
-    }
-
-    public String getMeanWeightDataTip(NonTargetCatchComputedValueSource com=
puted) {
-        String result;
-
-        if (computed =3D=3D null) {
-            result =3D t("observe.common.meanWeightComputed.observed.tip");
-        } else {
-            result =3D t("observe.common.meanWeightComputed.computed.tip", c=
omputed.toString());
-        }
-        return result;
-    }
-
-    public String getMeanLengthDataTip(NonTargetCatchComputedValueSource com=
puted) {
-        String result;
-
-        if (computed =3D=3D null) {
-            result =3D t("observe.common.meanLengthComputed.observed.tip");
-        } else {
-            result =3D t("observe.common.meanLengthComputed.computed.tip", c=
omputed.toString());
-        }
-        return result;
-    }
+    @Override
+    protected void initTableUI(DefaultTableCellRenderer renderer) {
=20
-    public void resetCatchWeightComputed() {
-        getTableEditBean().setCatchWeightComputedSource(null);
-        getUi().getCatchWeight().grabFocus();
-    }
+        JTable table =3D getUi().getTable();
=20
-    public void resetTotalCountComputed() {
-        getTableEditBean().setTotalCountComputedSource(null);
-        getUi().getTotalCount().grabFocus();
-    }
+        UIHelper.fixTableColumnWidth(table, 3, 55);
+        UIHelper.fixTableColumnWidth(table, 4, 65);
+        UIHelper.fixTableColumnWidth(table, 5, 75);
+        UIHelper.fixTableColumnWidth(table, 6, 55);
+        UIHelper.fixTableColumnWidth(table, 7, 50);
=20
-    public void resetMeanWeightComputed() {
-        getTableEditBean().setMeanWeightComputedSource(null);
-        getUi().getMeanWeight().grabFocus();
-    }
+        UIHelper.setI18nTableHeaderRenderer(
+                table,
+                n("observe.nonTargetCatch.table.speciesFaune"),
+                n("observe.nonTargetCatch.table.speciesFaune.tip"),
+                n("observe.nonTargetCatch.table.speciesFate"),
+                n("observe.nonTargetCatch.table.speciesFate.tip"),
+                n("observe.nonTargetCatch.table.reasonForDiscard"),
+                n("observe.nonTargetCatch.table.reasonForDiscard.tip"),
+                n("observe.nonTargetCatch.table.catchWeight"),
+                n("observe.nonTargetCatch.table.catchWeight.tip"),
+                n("observe.nonTargetCatch.table.totalCount"),
+                n("observe.nonTargetCatch.table.totalCount.tip"),
+                n("observe.nonTargetCatch.table.meanWeight"),
+                n("observe.nonTargetCatch.table.meanWeight.tip"),
+                n("observe.nonTargetCatch.table.meanLength"),
+                n("observe.nonTargetCatch.table.meanLength.tip"),
+                n("observe.nonTargetCatch.table.comment"),
+                n("observe.nonTargetCatch.table.comment.tip"));
=20
-    public void resetMeanLengthComputed() {
-        getTableEditBean().setMeanLengthComputedSource(null);
-        getUi().getMeanLength().grabFocus();
+        UIHelper.setTableColumnRenderer(table, 0, UIHelper.newDecorateTableC=
ellRenderer(renderer, Species.class));
+        UIHelper.setTableColumnRenderer(table, 1, UIHelper.newDecorateTableC=
ellRenderer(renderer, SpeciesFate.class));
+        UIHelper.setTableColumnRenderer(table, 2, UIHelper.newDecorateTableC=
ellRenderer(renderer, ReasonForDiscard.class));
+        UIHelper.setTableColumnRenderer(table, 3, UIHelper.newEmptyNumberTab=
leCellRenderer(renderer));
+        UIHelper.setTableColumnRenderer(table, 4, UIHelper.newEmptyNumberTab=
leCellRenderer(renderer));
+        UIHelper.setTableColumnRenderer(table, 5, UIHelper.newEmptyNumberTab=
leCellRenderer(renderer));
+        UIHelper.setTableColumnRenderer(table, 6, UIHelper.newEmptyNumberTab=
leCellRenderer(renderer));
+        UIHelper.setTableColumnRenderer(table, 7, UIHelper.newStringTableCel=
lRenderer(renderer, 10, true));
     }
=20
     @Override
@@ -289,9 +269,8 @@ public class NonTargetCatchUIHandler extends ContentTable=
UIHandler<SetSeine, Non
     }
=20
     @Override
-    protected void onSelectedRowChanged(int editingRow,
-                                        NonTargetCatch bean,
-                                        boolean create) {
+    protected void onSelectedRowChanged(int editingRow, NonTargetCatch bean,=
 boolean create) {
+
         NonTargetCatchUI ui =3D getUi();
=20
         ContentTableModel<SetSeine, NonTargetCatch> model =3D getTableModel(=
);
@@ -302,20 +281,23 @@ public class NonTargetCatchUIHandler extends ContentTab=
leUIHandler<SetSeine, Non
             return;
         }
=20
-        List<Species> availableEspeces;
+        List<Species> availableSpecies;
         JComponent requestFocus;
=20
         if (create) {
-            availableEspeces =3D new ArrayList<Species>(ALL_ESPECES_ENTRY.ge=
tContextValue(ui));
=20
+            availableSpecies =3D new ArrayList<Species>(ALL_ESPECES_ENTRY.ge=
tContextValue(ui));
             requestFocus =3D ui.getSpecies();
+
         } else {
+
             Species species =3D bean.getSpecies();
-            availableEspeces =3D Arrays.asList(species);
+            availableSpecies =3D Collections.singletonList(species);
             requestFocus =3D ui.getTable();
+
         }
=20
-        ui.getSpecies().setData(availableEspeces);
+        ui.getSpecies().setData(availableSpecies);
         requestFocus.requestFocus();
=20
         NonTargetCatch tableEditBean =3D getTableEditBean();
@@ -330,103 +312,48 @@ public class NonTargetCatchUIHandler extends ContentTa=
bleUIHandler<SetSeine, Non
=20
         tableEditBean.removePropertyChangeListener(NonTargetCatch.PROPERTY_M=
EAN_LENGTH, meanLengthChanged);
         tableEditBean.addPropertyChangeListener(NonTargetCatch.PROPERTY_MEAN=
_LENGTH, meanLengthChanged);
-    }
-
-    @Override
-    protected void initTableUI(DefaultTableCellRenderer renderer) {
-
-        JTable table =3D getUi().getTable();
-
-        UIHelper.fixTableColumnWidth(table, 3, 55);
-        UIHelper.fixTableColumnWidth(table, 4, 65);
-        UIHelper.fixTableColumnWidth(table, 5, 75);
-        UIHelper.fixTableColumnWidth(table, 6, 55);
-        UIHelper.fixTableColumnWidth(table, 7, 50);
-
-        UIHelper.setI18nTableHeaderRenderer(
-                table,
-                n("observe.nonTargetCatch.table.speciesFaune"),
-                n("observe.nonTargetCatch.table.speciesFaune.tip"),
-                n("observe.nonTargetCatch.table.speciesFate"),
-                n("observe.nonTargetCatch.table.speciesFate.tip"),
-                n("observe.nonTargetCatch.table.reasonForDiscard"),
-                n("observe.nonTargetCatch.table.reasonForDiscard.tip"),
-                n("observe.nonTargetCatch.table.catchWeight"),
-                n("observe.nonTargetCatch.table.catchWeight.tip"),
-                n("observe.nonTargetCatch.table.totalCount"),
-                n("observe.nonTargetCatch.table.totalCount.tip"),
-                n("observe.nonTargetCatch.table.meanWeight"),
-                n("observe.nonTargetCatch.table.meanWeight.tip"),
-                n("observe.nonTargetCatch.table.meanLength"),
-                n("observe.nonTargetCatch.table.meanLength.tip"),
-                n("observe.nonTargetCatch.table.comment"),
-                n("observe.nonTargetCatch.table.comment.tip"));
-
-        UIHelper.setTableColumnRenderer(table, 0, UIHelper.newDecorateTableC=
ellRenderer(renderer, Species.class));
-        UIHelper.setTableColumnRenderer(table, 1, UIHelper.newDecorateTableC=
ellRenderer(renderer, SpeciesFate.class));
-        UIHelper.setTableColumnRenderer(table, 2, UIHelper.newDecorateTableC=
ellRenderer(renderer, ReasonForDiscard.class));
-        UIHelper.setTableColumnRenderer(table, 3, UIHelper.newEmptyNumberTab=
leCellRenderer(renderer));
-        UIHelper.setTableColumnRenderer(table, 4, UIHelper.newEmptyNumberTab=
leCellRenderer(renderer));
-        UIHelper.setTableColumnRenderer(table, 5, UIHelper.newEmptyNumberTab=
leCellRenderer(renderer));
-        UIHelper.setTableColumnRenderer(table, 6, UIHelper.newEmptyNumberTab=
leCellRenderer(renderer));
-        UIHelper.setTableColumnRenderer(table, 7, UIHelper.newStringTableCel=
lRenderer(renderer, 10, true));
-    }
-
-    @Override
-    protected boolean doSave(SetSeine bean) {
-
-        try {
-
-            return super.doSave(bean);
-
-        } finally {
-
-            // toujours supprimer la r=C3=A9f=C3=A9rence du context, quoiqu'=
il arrive
-            ALL_TAILLES_TO_DELETE_ENTRY.removeContextValue(getUi());
-        }
=20
     }
=20
     @Override
-    protected boolean prepareSave(SetSeine editBean, List<NonTargetCatch> ob=
jets) throws Exception {
+    protected boolean prepareSave(SetSeine editBean, List<NonTargetCatch> ob=
jets) {
=20
         super.prepareSave(editBean, objets);
=20
         List<Species> speciessUsed =3D getTableModel().getColumnValues(0);
-
-        Collection<Species> speciessToDelete =3D new HashSet<Species>();
-        List<NonTargetLength> tailleToDelete =3D new ArrayList<NonTargetLeng=
th>();
+        Set<String> speciesIdsUsed =3D new HashSet<String>();
+        for (Species species : speciessUsed) {
+            speciesIdsUsed.add(species.getTopiaId());
+        }
=20
         NonTargetSampleService service =3D getService(NonTargetSampleService=
.class);
-        service.getObsoleteEspeceForNonTargetSample(editBean.getTopiaId(),
-                                                    speciessUsed,
-                                                    speciessToDelete,
-                                                    tailleToDelete);
+        List<NonTargetLength> lengthsToDelete =3D service.getObsoleteNonTarg=
etLengths(editBean.getTopiaId(), speciesIdsUsed);
=20
-        if (!tailleToDelete.isEmpty()) {
+        if (!lengthsToDelete.isEmpty()) {
+
+            // il existe des echantillon faune a supprimer on demande une co=
nfirmation
+
+            Set<Species> speciessToDelete =3D new HashSet<Species>();
+            for (NonTargetLength targetLength : lengthsToDelete) {
+                speciessToDelete.add(targetLength.getSpecies());
+            }
=20
-            // il existe des echantillon faune a supprimer on demande une
-            // confirmation
             StringBuilder sb =3D new StringBuilder();
             StringBuilder sb2 =3D new StringBuilder();
-            Decorator<Species> decorator;
-            Decorator<NonTargetLength> decorator2;
-            decorator =3D getDecoratorService().getDecoratorByType(Species.c=
lass);
-            decorator2 =3D getDecoratorService().getDecoratorByType(NonTarge=
tLength.class);
+            Decorator<Species> speciesDecorator =3D getDecoratorService().ge=
tDecoratorByType(Species.class);
+            Decorator<NonTargetLength> nonTargetLengthDecorator =3D getDecor=
atorService().getDecoratorByType(NonTargetLength.class);
=20
             for (Species e : speciessToDelete) {
-                sb.append("  - ").append(decorator.toString(e)).append('\n');
+                sb.append("  - ").append(speciesDecorator.toString(e)).appen=
d('\n');
             }
-            for (NonTargetLength t : tailleToDelete) {
-                sb2.append("  - ").append(decorator2.toString(t)).append('\n=
');
+            for (NonTargetLength t : lengthsToDelete) {
+                sb2.append("  - ").append(nonTargetLengthDecorator.toString(=
t)).append('\n');
             }
             int reponse =3D UIHelper.askUser(
                     t("observe.title.need.confirm"),
                     t("observe.nonTargetCatch.message.table.will.delete.nonT=
argetSample", sb.toString(), sb2.toString()),
                     JOptionPane.ERROR_MESSAGE,
-                    new Object[]{
-                            t("observe.choice.continue"),
-                            t("observe.choice.cancel")},
+                    new Object[]{t("observe.choice.continue"), t("observe.ch=
oice.cancel")},
                     0);
             if (log.isDebugEnabled()) {
                 log.debug("response : " + reponse);
@@ -444,7 +371,8 @@ public class NonTargetCatchUIHandler extends ContentTable=
UIHandler<SetSeine, Non
             }
=20
             // on conserve les tailles a supprimer
-            ALL_TAILLES_TO_DELETE_ENTRY.setContextValue(getUi(), tailleToDel=
ete);
+            ALL_NON_TARGET_LENGTH_TO_DELETE_ENTRY.setContextValue(getUi(), l=
engthsToDelete);
+
         }
=20
         return true;
@@ -454,11 +382,84 @@ public class NonTargetCatchUIHandler extends ContentTab=
leUIHandler<SetSeine, Non
     @Override
     protected void doPersist(SetSeine editBean) {
=20
-        List<NonTargetLength> tailleToDelete =3D ALL_TAILLES_TO_DELETE_ENTRY=
.getContextValue(getUi());
+        List<NonTargetLength> tailleToDelete =3D ALL_NON_TARGET_LENGTH_TO_DE=
LETE_ENTRY.getContextValue(getUi());
=20
-        NonTargetCatchService service =3D getService(NonTargetCatchService.c=
lass);
-        service.save(editBean, tailleToDelete);
+        try {
=20
+            NonTargetCatchService service =3D getService(NonTargetCatchServi=
ce.class);
+            service.save(editBean, tailleToDelete);
+
+        } finally {
+
+            // toujours supprimer la r=C3=A9f=C3=A9rence du context, quoiqu'=
il arrive
+            ALL_NON_TARGET_LENGTH_TO_DELETE_ENTRY.removeContextValue(getUi()=
);
+        }
+
+    }
+
+    public String getCatchWeightDataTip(NonTargetCatchComputedValueSource co=
mputed) {
+        String result;
+
+        if (computed =3D=3D null) {
+            result =3D t("observe.common.catchWeightComputed.observed.tip");
+        } else {
+            result =3D t("observe.common.catchWeightComputed.computed.tip", =
computed.toString());
+        }
+        return result;
+    }
+
+    public String getTotalCountDataTip(NonTargetCatchComputedValueSource com=
puted) {
+        String result;
+
+        if (computed =3D=3D null) {
+            result =3D t("observe.common.totalCountComputed.observed.tip");
+        } else {
+            result =3D t("observe.common.totalCountComputed.computed.tip", c=
omputed.toString());
+
+        }
+        return result;
+    }
+
+    public String getMeanWeightDataTip(NonTargetCatchComputedValueSource com=
puted) {
+        String result;
+
+        if (computed =3D=3D null) {
+            result =3D t("observe.common.meanWeightComputed.observed.tip");
+        } else {
+            result =3D t("observe.common.meanWeightComputed.computed.tip", c=
omputed.toString());
+        }
+        return result;
+    }
+
+    public String getMeanLengthDataTip(NonTargetCatchComputedValueSource com=
puted) {
+        String result;
+
+        if (computed =3D=3D null) {
+            result =3D t("observe.common.meanLengthComputed.observed.tip");
+        } else {
+            result =3D t("observe.common.meanLengthComputed.computed.tip", c=
omputed.toString());
+        }
+        return result;
+    }
+
+    public void resetCatchWeightComputed() {
+        getTableEditBean().setCatchWeightComputedSource(null);
+        getUi().getCatchWeight().grabFocus();
+    }
+
+    public void resetTotalCountComputed() {
+        getTableEditBean().setTotalCountComputedSource(null);
+        getUi().getTotalCount().grabFocus();
+    }
+
+    public void resetMeanWeightComputed() {
+        getTableEditBean().setMeanWeightComputedSource(null);
+        getUi().getMeanWeight().grabFocus();
+    }
+
+    public void resetMeanLengthComputed() {
+        getTableEditBean().setMeanLengthComputedSource(null);
+        getUi().getMeanLength().grabFocus();
     }
=20
 }
diff --git a/observe-swing/src/main/java/fr/ird/observe/ui/content/table/impl=
/seine/NonTargetSampleUIHandler.java b/observe-swing/src/main/java/fr/ird/obs=
erve/ui/content/table/impl/seine/NonTargetSampleUIHandler.java
index 920fd6c..88bc806 100644
--- a/observe-swing/src/main/java/fr/ird/observe/ui/content/table/impl/seine/=
NonTargetSampleUIHandler.java
+++ b/observe-swing/src/main/java/fr/ird/observe/ui/content/table/impl/seine/=
NonTargetSampleUIHandler.java
@@ -36,6 +36,7 @@ import fr.ird.observe.ui.content.ContentMode;
 import fr.ird.observe.ui.content.table.ContentTableModel;
 import fr.ird.observe.ui.content.table.ContentTableUIHandler;
 import jaxx.runtime.context.JAXXContextEntryDef;
+import jaxx.runtime.swing.editor.NumberEditor;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.nuiton.validator.NuitonValidatorScope;
@@ -46,7 +47,7 @@ import javax.swing.table.DefaultTableCellRenderer;
 import java.beans.PropertyChangeEvent;
 import java.beans.PropertyChangeListener;
 import java.util.ArrayList;
-import java.util.Arrays;
+import java.util.Collections;
 import java.util.List;
=20
 import static org.nuiton.i18n.I18n.n;
@@ -103,6 +104,38 @@ public class NonTargetSampleUIHandler extends ContentTab=
leUIHandler<NonTargetSam
         return (NonTargetSampleUI) super.getUi();
     }
=20
+    @Override
+    protected void initTableUI(DefaultTableCellRenderer renderer) {
+
+        JTable table =3D getUi().getTable();
+
+        UIHelper.fixTableColumnWidth(table, 1, 100);
+        UIHelper.fixTableColumnWidth(table, 2, 100);
+
+        UIHelper.setI18nTableHeaderRenderer(
+                table,
+                n("observe.nonTargetSample.table.speciesFaune"),
+                n("observe.nonTargetSample.table.speciesFaune.tip"),
+                n("observe.nonTargetSample.table.length"),
+                n("observe.nonTargetSample.table.length.tip"),
+                n("observe.nonTargetSample.table.meanWeight"),
+                n("observe.nonTargetSample.table.meanWeight.tip"),
+                n("observe.nonTargetSample.table.count"),
+                n("observe.nonTargetSample.table.count.tip"),
+                n("observe.nonTargetSample.table.gender"),
+                n("observe.nonTargetSample.table.gender.tip"),
+                n("observe.nonTargetSample.table.picturesReferences"),
+                n("observe.nonTargetSample.table.picturesReferences.tip"));
+
+        UIHelper.setTableColumnRenderer(table, 0, UIHelper.newDecorateTableC=
ellRenderer(renderer, Species.class));
+        UIHelper.setTableColumnRenderer(table, 1, UIHelper.newEmptyNumberTab=
leCellRenderer(renderer));
+        UIHelper.setTableColumnRenderer(table, 2, UIHelper.newEmptyNumberTab=
leCellRenderer(renderer));
+        UIHelper.setTableColumnRenderer(table, 3, UIHelper.newEmptyNumberTab=
leCellRenderer(renderer));
+        UIHelper.setTableColumnRenderer(table, 4, UIHelper.newDecorateTableC=
ellRenderer(renderer, Sex.class));
+        UIHelper.setTableColumnRenderer(table, 5, renderer);
+
+    }
+
     public void resetWeightSource() {
         getTableEditBean().setWeightSource(false);
         getUi().getWeight().grabFocus();
@@ -134,7 +167,7 @@ public class NonTargetSampleUIHandler extends ContentTabl=
eUIHandler<NonTargetSam
             String setId =3D getDataContext().getSelectedSetId();
=20
             NonTargetSampleService service =3D getService(NonTargetSampleSer=
vice.class);
-            speciesList =3D service.getAvailableEspeceForNonTargetSample(set=
Id);
+            speciesList =3D service.getAvailableSpeciesForNonTargetSample(se=
tId);
=20
             ALL_ESPECES_ENTRY.setContextValue(getUi(), speciesList);
         }
@@ -152,6 +185,8 @@ public class NonTargetSampleUIHandler extends ContentTabl=
eUIHandler<NonTargetSam
=20
         String setId =3D getDataContext().getSelectedSetId();
=20
+        NonTargetSampleService service =3D getService(NonTargetSampleService=
.class);
+
         if (editBean.getTopiaId() !=3D null && editBean.isNonTargetLengthEmp=
ty()) {
=20
             // remove orphan target sample
@@ -159,47 +194,22 @@ public class NonTargetSampleUIHandler extends ContentTa=
bleUIHandler<NonTargetSam
                 log.info("Remove obsolete nonTargetSample " + editBean.getTo=
piaId() + " from Set: " + setId);
             }
=20
-            getService(NonTargetSampleService.class).delete(setId, editBean);
+            service.delete(setId, editBean);
=20
         } else {
=20
-            String savedId =3D getService(NonTargetSampleService.class).save=
(setId, editBean);
+            String savedId =3D service.save(setId, editBean);
=20
             editBean.setTopiaId(savedId);
=20
             getService(NonTargetLengthService.class).save(editBean);
+
         }
     }
=20
-//    @Override
-//    protected NonTargetSample onCreate(TopiaContext tx,
-//                                       Object parent,
-//                                       NonTargetSample editBean) throws To=
piaException {
-//        SetSeine parentBean =3D (SetSeine) parent;
-//        NonTargetSample beanToSave =3D
-//                ObserveDAOHelper.getNonTargetSampleDAO(tx).create();
-//        if (log.isInfoEnabled()) {
-//            log.info("Echantillon faune " + beanToSave.getTopiaId() +
-//                     " was created.");
-//        }
-//        editBean.setTopiaId(beanToSave.getTopiaId());
-//        editBean.setTopiaCreateDate(beanToSave.getTopiaCreateDate());
-//        editBean.setTopiaVersion(beanToSave.getTopiaVersion());
-//        parentBean.addNonTargetSample(beanToSave);
-//        return beanToSave;
-//    }
-
-//    @Override
-//    protected void onDelete(TopiaContext tx, Object parent, NonTargetSampl=
e beanToDelete) throws TopiaException {
-//        SetSeine parentBean =3D (SetSeine) parent;
-//        parentBean.removeNonTargetSample(beanToDelete);
-//    }
-
-    @SuppressWarnings("unchecked")
     @Override
-    protected void onSelectedRowChanged(int editingRow,
-                                        NonTargetLength bean,
-                                        boolean create) {
+    protected void onSelectedRowChanged(int editingRow, NonTargetLength bean=
, boolean create) {
+
         ContentTableModel<NonTargetSample, NonTargetLength> model =3D getTab=
leModel();
=20
         if (!model.isEditable()) {
@@ -223,12 +233,10 @@ public class NonTargetSampleUIHandler extends ContentTa=
bleUIHandler<NonTargetSam
                 ui.getAcquisitionModeGroup().setSelectedValue(ModeSaisieEcha=
ntillonEnum.byEffectif);
             }
=20
-            availableEspeces =3D new ArrayList<Species>(
-                    ALL_ESPECES_ENTRY.getContextValue(ui));
+            availableEspeces =3D new ArrayList<Species>(ALL_ESPECES_ENTRY.ge=
tContextValue(ui));
             requestFocus =3D ui.getSpecies();
-        } else {
=20
-            requestFocus =3D ui.getCount();
+        } else {
=20
             // on passe le mode de saisie
             int acquisitionMode =3D bean.getAcquisitionMode();
@@ -237,8 +245,11 @@ public class NonTargetSampleUIHandler extends ContentTab=
leUIHandler<NonTargetSam
             ui.getAcquisitionModeGroup().setSelectedValue(null);
             ui.getAcquisitionModeGroup().setSelectedValue(enumValue);
=20
-            availableEspeces =3D Arrays.asList(species);
+            availableEspeces =3D Collections.singletonList(species);
+            requestFocus =3D ui.getCount();
+
         }
+
         ui.getSpecies().setData(availableEspeces);
         requestFocus.requestFocus();
=20
@@ -248,40 +259,12 @@ public class NonTargetSampleUIHandler extends ContentTa=
bleUIHandler<NonTargetSam
=20
         tableEditBean.removePropertyChangeListener(NonTargetLength.PROPERTY_=
LENGTH, lengthChanged);
         tableEditBean.addPropertyChangeListener(NonTargetLength.PROPERTY_LEN=
GTH, lengthChanged);
-    }
-
-    @Override
-    protected void initTableUI(DefaultTableCellRenderer renderer) {
-        JTable table =3D getUi().getTable();
-
-        UIHelper.fixTableColumnWidth(table, 1, 100);
-        UIHelper.fixTableColumnWidth(table, 2, 100);
-
-        UIHelper.setI18nTableHeaderRenderer(
-                table,
-                n("observe.nonTargetSample.table.speciesFaune"),
-                n("observe.nonTargetSample.table.speciesFaune.tip"),
-                n("observe.nonTargetSample.table.length"),
-                n("observe.nonTargetSample.table.length.tip"),
-                n("observe.nonTargetSample.table.meanWeight"),
-                n("observe.nonTargetSample.table.meanWeight.tip"),
-                n("observe.nonTargetSample.table.count"),
-                n("observe.nonTargetSample.table.count.tip"),
-                n("observe.nonTargetSample.table.gender"),
-                n("observe.nonTargetSample.table.gender.tip"),
-                n("observe.nonTargetSample.table.picturesReferences"),
-                n("observe.nonTargetSample.table.picturesReferences.tip"));
=20
-        UIHelper.setTableColumnRenderer(table, 0, UIHelper.newDecorateTableC=
ellRenderer(renderer, Species.class));
-        UIHelper.setTableColumnRenderer(table, 1, UIHelper.newEmptyNumberTab=
leCellRenderer(renderer));
-        UIHelper.setTableColumnRenderer(table, 2, UIHelper.newEmptyNumberTab=
leCellRenderer(renderer));
-        UIHelper.setTableColumnRenderer(table, 3, UIHelper.newEmptyNumberTab=
leCellRenderer(renderer));
-        UIHelper.setTableColumnRenderer(table, 4, UIHelper.newDecorateTableC=
ellRenderer(renderer, Sex.class));
-        UIHelper.setTableColumnRenderer(table, 5, renderer);
     }
=20
     @Override
     protected ContentMode getContentMode(DataContext dataContext) {
+
         ContentMode mode =3D super.getContentMode(dataContext);
=20
         String setId =3D getDataContext().getSelectedSetId();
@@ -320,20 +303,21 @@ public class NonTargetSampleUIHandler extends ContentTa=
bleUIHandler<NonTargetSam
             return;
         }
=20
-        NonTargetSampleUI ui =3D getUi();
+        NumberEditor weight =3D getUi().getWeight();
+        NumberEditor count =3D getUi().getCount();
=20
-        boolean createMode =3D ui.getTableModel().isCreate();
+        boolean createMode =3D getTableModel().isCreate();
=20
-        NonTargetLength editBean =3D ui.getTableEditBean();
+        NonTargetLength editBean =3D getTableEditBean();
         switch (newMode) {
=20
             case byEffectif:
=20
                 // le weight n'est pas modifiable
-                ui.getWeight().setEnabled(false);
+                weight.setEnabled(false);
=20
                 // l'count est modifiable
-                ui.getCount().setEnabled(true);
+                count.setEnabled(true);
=20
                 if (createMode) {
=20
@@ -347,11 +331,10 @@ public class NonTargetSampleUIHandler extends ContentTa=
bleUIHandler<NonTargetSam
             case byIndividu:
=20
                 // le weight est pas modifiable
-                ui.getWeight().setEnabled(true);
+                weight.setEnabled(true);
=20
                 // l'count n'est pas modifiable et est toujours de 1
-                ui.getCount().setEnabled(false);
-
+                count.setEnabled(false);
=20
                 if (createMode) {
=20
@@ -365,6 +348,9 @@ public class NonTargetSampleUIHandler extends ContentTabl=
eUIHandler<NonTargetSam
=20
             // on propage le mode de saisie dans le bean
             editBean.setAcquisitionMode(newMode.ordinal());
+
         }
+
     }
+
 }
diff --git a/observe-swing/src/main/java/fr/ird/observe/ui/content/table/impl=
/seine/ObjectObservedSpeciesUIHandler.java b/observe-swing/src/main/java/fr/i=
rd/observe/ui/content/table/impl/seine/ObjectObservedSpeciesUIHandler.java
index f012ad7..1db6bda 100644
--- a/observe-swing/src/main/java/fr/ird/observe/ui/content/table/impl/seine/=
ObjectObservedSpeciesUIHandler.java
+++ b/observe-swing/src/main/java/fr/ird/observe/ui/content/table/impl/seine/=
ObjectObservedSpeciesUIHandler.java
@@ -47,8 +47,7 @@ import static org.nuiton.i18n.I18n.n;
 public class ObjectObservedSpeciesUIHandler extends ContentTableUIHandler<Fl=
oatingObject, ObjectObservedSpecies> {
=20
     /** Logger */
-    static private Log log =3D
-            LogFactory.getLog(ObjectObservedSpeciesUIHandler.class);
+    public static final Log log =3D LogFactory.getLog(ObjectObservedSpeciesU=
IHandler.class);
=20
     public ObjectObservedSpeciesUIHandler(ObjectObservedSpeciesUI ui) {
         super(ui, DataContextType.SetSeine);
@@ -72,11 +71,6 @@ public class ObjectObservedSpeciesUIHandler extends Conten=
tTableUIHandler<Floati
=20
     }
=20
-//    @Override
-//    protected String getEditBeanIdToLoad(DataContext dataContext, DataServ=
ice dataService, DataSource dataSource) {
-//        return dataContext.getSelectedFloatingObjectId();
-//    }
-
     @Override
     protected void onSelectedRowChanged(int editingRow, ObjectObservedSpecie=
s bean, boolean create) {
         if (log.isDebugEnabled()) {
diff --git a/observe-swing/src/main/java/fr/ird/observe/ui/content/table/impl=
/seine/TargetCatchUIHandler.java b/observe-swing/src/main/java/fr/ird/observe=
/ui/content/table/impl/seine/TargetCatchUIHandler.java
index d9a3e19..3967c6a 100644
--- a/observe-swing/src/main/java/fr/ird/observe/ui/content/table/impl/seine/=
TargetCatchUIHandler.java
+++ b/observe-swing/src/main/java/fr/ird/observe/ui/content/table/impl/seine/=
TargetCatchUIHandler.java
@@ -23,8 +23,8 @@ package fr.ird.observe.ui.content.table.impl.seine;
=20
 import fr.ird.observe.BinderService;
 import fr.ird.observe.ObserveConfig;
-import fr.ird.observe.db.DataSourceException;
 import fr.ird.observe.db.constants.DataContextType;
+import fr.ird.observe.entities.Entities;
 import fr.ird.observe.entities.referentiel.Ocean;
 import fr.ird.observe.entities.referentiel.ReferenceEntities;
 import fr.ird.observe.entities.referentiel.Species;
@@ -34,7 +34,7 @@ import fr.ird.observe.entities.seine.SetSeine;
 import fr.ird.observe.entities.seine.TargetCatch;
 import fr.ird.observe.entities.seine.TargetLength;
 import fr.ird.observe.services.data.TripService;
-import fr.ird.observe.services.data.seine.NonTargetCatchService;
+import fr.ird.observe.services.data.seine.TargetCatchService;
 import fr.ird.observe.services.data.seine.TargetSampleService;
 import fr.ird.observe.services.referential.ReferentialService;
 import fr.ird.observe.ui.UIHelper;
@@ -55,12 +55,11 @@ import javax.swing.table.DefaultTableCellRenderer;
 import java.beans.PropertyChangeEvent;
 import java.beans.PropertyChangeListener;
 import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
 import java.util.Collections;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
+import java.util.Set;
=20
 import static org.nuiton.i18n.I18n.n;
 import static org.nuiton.i18n.I18n.t;
@@ -74,12 +73,14 @@ public class TargetCatchUIHandler extends ContentTableUIH=
andler<SetSeine, Target
     /** Logger */
     private static final Log log =3D LogFactory.getLog(TargetCatchUIHandler.=
class);
=20
-    JAXXContextEntryDef<List<TargetLength>> ALL_TAILLES_TO_DELETE_ENTRY =3D
+    /**
+     * L'entr=C3=A9e dans le contexte pour conserver les mensurations obsol=
=C3=A8tes =C3=A0 supprimer lors de la sauvegarde.
+     */
+    JAXXContextEntryDef<List<TargetLength>> ALL_TARGET_LENGTH_TO_DELETE_ENTR=
Y =3D
             UIHelper.newListContextEntryDef("TargetCatchUI-all-taille-to-del=
ete");
=20
     /**
-     * l'entr=C3=A9e dans le contexte pour r=C3=A9cup=C3=A9rer la liste comp=
l=C3=A8tes des
-     * cat=C3=A9gories
+     * L'entr=C3=A9e dans le contexte pour r=C3=A9cup=C3=A9rer la liste comp=
l=C3=A8te des cat=C3=A9gories.
      */
     JAXXContextEntryDef<List<WeightCategory>> ALL_CATEGORIES_ENTRY =3D
             UIHelper.newListContextEntryDef("TargetCatchUI-all-categories");
@@ -95,10 +96,11 @@ public class TargetCatchUIHandler extends ContentTableUIH=
andler<SetSeine, Target
=20
     @Override
     public void initUI() throws Exception {
+
         super.initUI();
=20
-        // lors de la modification d'une species (sur une entree non sauvee)
-        //   - on recalcule la liste des categories pour cette species.
+        // lors de la modification d'une esp=C3=A8ces (sur une entree non sa=
uvee)
+        //   - on recalcule la liste des categories pour cette esp=C3=A8ce.
         //   - on reinitialiser la categorie selectionnee
=20
         getUi().getSpecies().addPropertyChangeListener(
@@ -108,18 +110,15 @@ public class TargetCatchUIHandler extends ContentTableU=
IHandler<SetSeine, Target
                     @Override
                     public void propertyChange(PropertyChangeEvent evt) {
=20
-                        ContentTableModel<SetSeine, TargetCatch> model;
-                        model =3D getTableModel();
+                        ContentTableModel<SetSeine, TargetCatch> model =3D g=
etTableModel();
+                        TargetCatch bean =3D model.getRowBean();
=20
-                        if (model.getRowBean().getTopiaId() =3D=3D null) {
-
-                            // en mode creation , on doit recalculer la liste
-                            // des categories
+                        if (Entities.isNew(bean)) {
=20
+                            // en mode creation , on doit recalculer la list=
e des categories
                             Species species =3D (Species) evt.getNewValue();
-
-
                             onEspeceChanged(species);
+
                         }
                     }
                 }
@@ -127,12 +126,42 @@ public class TargetCatchUIHandler extends ContentTableU=
IHandler<SetSeine, Target
     }
=20
     @Override
+    protected void initTableUI(DefaultTableCellRenderer renderer) {
+
+        JTable table =3D getUi().getTable();
+
+        UIHelper.fixTableColumnWidth(table, 2, 100);
+        UIHelper.fixTableColumnWidth(table, 3, 50);
+        UIHelper.fixTableColumnWidth(table, 4, 50);
+
+        UIHelper.setI18nTableHeaderRenderer(
+                table,
+                n("observe.targetCatch.table.speciesThon"),
+                n("observe.targetCatch.table.speciesThon.tip"),
+                n("observe.targetCatch.table.weightCategory"),
+                n("observe.targetCatch.table.weightCategory.tip"),
+                n("observe.targetCatch.table.well"),
+                n("observe.targetCatch.table.well.tip"),
+                n("observe.targetCatch.table.weight"),
+                n("observe.targetCatch.table.weight.tip"),
+                n("observe.targetCatch.table.comment"),
+                n("observe.targetCatch.table.comment.tip"));
+
+        UIHelper.setTableColumnRenderer(table, 0, UIHelper.newDecorateTableC=
ellRenderer(renderer, Species.class));
+        UIHelper.setTableColumnRenderer(table, 1, UIHelper.newDecorateTableC=
ellRenderer(renderer, WeightCategory.class));
+        UIHelper.setTableColumnRenderer(table, 2, renderer);
+        UIHelper.setTableColumnRenderer(table, 3, UIHelper.newEmptyNumberTab=
leCellRenderer(renderer));
+        UIHelper.setTableColumnRenderer(table, 4, UIHelper.newStringTableCel=
lRenderer(renderer, 10, true));
+
+    }
+
+    @Override
     protected void loadEditBean(ContentMode mode) {
=20
         List<Species> speciesList;
         List<WeightCategory> categorieList;
=20
-        if (mode =3D=3D ContentMode.UPDATE) {
+        if (ContentMode.UPDATE =3D=3D mode) {
=20
             // on charge le formulaire uniquement si en mode =C3=A9dition
=20
@@ -142,7 +171,7 @@ public class TargetCatchUIHandler extends ContentTableUIH=
andler<SetSeine, Target
             ObserveConfig config =3D getUi().getContextValue(ObserveConfig.c=
lass);
             String speciesListId =3D config.getSpeciesListSeineTargetCatchId=
();
=20
-            java.util.Set<String> speciesIds =3D loadSpeciesList(speciesList=
Id, n("observe.error.speciesList.seine.targetCatch.notFound"));
+            Set<String> speciesIds =3D loadSpeciesList(speciesListId, n("obs=
erve.error.speciesList.seine.targetCatch.notFound"));
=20
             categorieList =3D Species2.filterWeightCategoryBySpeciesIds(cate=
gorieList, speciesIds);
=20
@@ -165,109 +194,63 @@ public class TargetCatchUIHandler extends ContentTable=
UIHandler<SetSeine, Target
=20
             speciesList =3D new ArrayList<Species>();
             categorieList =3D new ArrayList<WeightCategory>();
-        }
=20
-        TargetCatchUI ui =3D getUi();
+        }
=20
         ALL_CATEGORIES_ENTRY.setContextValue(ui, categorieList);
=20
-        ui.getSpecies().setData(speciesList);
+        getUi().getSpecies().setData(speciesList);
=20
         String setId =3D getDataContext().getSelectedSetId();
=20
-        SetSeine setSeine =3D getService(NonTargetCatchService.class).loadFo=
rEdit(setId);
+        TargetCatchService service =3D getService(TargetCatchService.class);
+        SetSeine setSeine =3D service.loadForEdit(setId);
=20
         copy(SetSeine.class, BinderService.EDIT_TARGET_CATCH, setSeine, getB=
ean());
=20
     }
=20
-//    @Override
-//    protected Collection<TargetCatch> loadChilds(TopiaContext tx, SetSeine=
 bean) throws TopiaException {
-//        Collection<TargetCatch> childs =3D getModel().getChildsUpdator().g=
etChilds(bean);
-//        Collection<TargetCatch> data =3D new ArrayList<TargetCatch>();
-//        if (CollectionUtils.isNotEmpty(childs)) {
-//            TopiaDAO<TargetCatch> dao =3D
-//                    getDataSource().getDAO(tx, getTableEditBean());
-//            TopiaEntityBinder<TargetCatch> childLoador =3D getModel().getC=
hildLoador();
-//
-//            DecoratorService decoratorService =3D getDecoratorService();
-//
-//            for (TargetCatch c : childs) {
-//                if (c.isDiscarded()) {
-//                    // c'est un rejet, on ne le retient pas dans cette lis=
te
-//                    if (log.isDebugEnabled()) {
-//                        log.debug("targetDiscarded " + c.getSpecies().getL=
abel2() +
-//                                  " non retenu.");
-//                    }
-//                    continue;
-//                }
-//                try {
-//
-//                    TargetCatch c2 =3D getModel().newTableEditBean();
-//                    TargetCatch safeC =3D dao.findByTopiaId(c.getTopiaId()=
);
-//                    WeightCategory weightCategory =3D safeC.getWeightCateg=
ory();
-//                    if (weightCategory !=3D null) {
-//                        Species species =3D weightCategory.getSpecies();
-//                        decoratorService.decorate(species);
-//                    }
-//                    childLoador.load(safeC, c2, true);
-//                    data.add(c2);
-//                } catch (Exception e) {
-//                    throw new RuntimeException(e);
-//                }
-//            }
-//        }
-//        return data;
-//    }
-
     @Override
-    protected boolean prepareSave(SetSeine bean, List<TargetCatch> objets) t=
hrows DataSourceException {
+    protected boolean prepareSave(SetSeine bean, List<TargetCatch> objets) {
=20
-        // on recupere les speciess acceptables pour des echantillonnages
-        // i.e une species d'un targetCatch
+        // on recupere les esp=C3=A8ces acceptables pour des echantillonnages
+        // i.e une esp=C3=A8ce d'un targetCatch
=20
-        Collection<Species> speciessUsed =3D new HashSet<Species>();
-        for (TargetCatch c : objets) {
-            speciessUsed.add(c.getSpecies());
+        Set<String> speciesIdsUsed =3D new HashSet<String>();
+        for (TargetCatch targetCatch : objets) {
+            speciesIdsUsed.add(targetCatch.getSpecies().getTopiaId());
         }
=20
-        // il faut supprimer les echantillon thons sur des speciess qui ne
-        // sont plus sur un rejet
-
-        List<TargetLength> tailleToDelete =3D new ArrayList<TargetLength>();
-        Collection<Species> speciessToDelete =3D new HashSet<Species>();
+        // il faut supprimer les echantillon thons sur des esp=C3=A8ces qui =
ne sont plus sur un rejet
=20
         TargetSampleService service =3D getService(TargetSampleService.class=
);
-        service.getObsoleteEspeceForTargetSample(bean.getTopiaId(),
-                                                 speciessUsed,
-                                                 speciessToDelete,
-                                                 tailleToDelete,
-                                                 false);
+        List<TargetLength> targetLengthsToDelete =3D
+                service.getObsoleteTargetLengths(bean.getTopiaId(), speciesI=
dsUsed, false);
+
+        if (!targetLengthsToDelete.isEmpty()) {
=20
-        if (!tailleToDelete.isEmpty()) {
+            Set<Species> speciessToDelete =3D new HashSet<Species>();
+            for (TargetLength targetLength : targetLengthsToDelete) {
+                speciessToDelete.add(targetLength.getSpecies());
+            }
=20
-            // il existe des echantillon thon a supprimer on demande une
-            // confirmation
+            // il existe des echantillon thon a supprimer on demande une con=
firmation
             StringBuilder sb =3D new StringBuilder(512);
             StringBuilder sb2 =3D new StringBuilder(512);
-            Decorator<Species> decorator =3D
-                    getDecoratorService().getDecoratorByType(Species.class);
-            Decorator<TargetLength> decorator2 =3D
-                    getDecoratorService().getDecoratorByType(TargetLength.cl=
ass);
+            Decorator<Species> speciesDecorator =3D getDecoratorService().ge=
tDecoratorByType(Species.class);
+            Decorator<TargetLength> targetLengthDecorator =3D getDecoratorSe=
rvice().getDecoratorByType(TargetLength.class);
=20
             for (Species e : speciessToDelete) {
-                sb.append("  - ").append(decorator.toString(e)).append('\n');
+                sb.append("  - ").append(speciesDecorator.toString(e)).appen=
d('\n');
             }
-            for (TargetLength t : tailleToDelete) {
-                sb2.append("  - ").append(decorator2.toString(t)).append('\n=
');
+            for (TargetLength t : targetLengthsToDelete) {
+                sb2.append("  - ").append(targetLengthDecorator.toString(t))=
.append('\n');
             }
             int reponse =3D UIHelper.askUser(
                     t("observe.title.need.confirm"),
                     t("observe.targetDiscarded.message.table.will.delete.tar=
getLength", sb.toString(), sb2.toString()),
                     JOptionPane.ERROR_MESSAGE,
-                    new Object[]{
-                            t("observe.choice.continue"),
-                            t("observe.choice.cancel")},
+                    new Object[]{t("observe.choice.continue"), t("observe.ch=
oice.cancel")},
                     0);
             if (log.isDebugEnabled()) {
                 log.debug("response : " + reponse);
@@ -284,77 +267,69 @@ public class TargetCatchUIHandler extends ContentTableU=
IHandler<SetSeine, Target
=20
                 // l'utilisateur a choisi de ne pas continuer
                 return false;
+
             }
=20
             // on conserve les tailles a supprimer
-            ALL_TAILLES_TO_DELETE_ENTRY.setContextValue(getUi(), tailleToDel=
ete);
+            ALL_TARGET_LENGTH_TO_DELETE_ENTRY.setContextValue(getUi(), targe=
tLengthsToDelete);
+
         }
=20
         for (TargetCatch targetCatch : objets) {
=20
             // on attache la set
             targetCatch.setSetSeine(bean);
+
         }
+
         return true;
+
     }
=20
-//    @Override
-//    protected void onUpdateFinalize(TopiaContext tx, SetSeine bean, Collec=
tion<TargetCatch> oldChilds) {
-//
-//        if (oldChilds !=3D null && !oldChilds.isEmpty()) {
-//
-//            // on reinjecte les rejet thon precedemment saisie dans la set
-//            for (TargetCatch targetCatch : oldChilds) {
-//                if (targetCatch.isDiscarded()) {
-//                    bean.addTargetCatch(targetCatch);
-//                }
-//            }
-//        }
-//
-//
-//        List<TargetLength> tailleToDelete =3D ALL_TAILLES_TO_DELETE_ENTRY.=
getContextValue(getUi());
-//
-//        if (tailleToDelete !=3D null && !tailleToDelete.isEmpty()) {
-//
-//            // on a demande la suppression de taille obsoletes
-//
-//            if (log.isInfoEnabled()) {
-//                log.info("Will remove " + tailleToDelete.size() +
-//                         " obsolete targetLength(s).");
-//            }
-//
-//            TargetSample echantillon =3D bean.getTargetSample(false);
-//
-//            // on supprime les echantillons obsoletes
-//            echantillon.getTargetLength().removeAll(tailleToDelete);
-//        }
-//    }
+    @Override
+    protected void doPersist(SetSeine editBean) {
+
+        List<TargetLength> tailleToDelete =3D ALL_TARGET_LENGTH_TO_DELETE_EN=
TRY.getContextValue(getUi());
+
+        try {
+
+            TargetCatchService service =3D getService(TargetCatchService.cla=
ss);
+            service.save(editBean, tailleToDelete);
+
+        } finally {
+
+            // toujours supprimer la r=C3=A9f=C3=A9rence du context, quoiqu'=
il arrive
+            ALL_TARGET_LENGTH_TO_DELETE_ENTRY.removeContextValue(getUi());
+
+        }
+
+    }
=20
     @Override
     protected void onSelectedRowChanged(int editingRow, TargetCatch bean, bo=
olean create) {
=20
         TargetCatchUI ui =3D getUi();
=20
-        WeightCategory beanWeightCategory =3D bean.getWeightCategory();
-        Species beanEspece =3D beanWeightCategory =3D=3D null ?
-                             null : beanWeightCategory.getSpecies();
+        WeightCategory weightCategory =3D bean.getWeightCategory();
+        Species species =3D weightCategory =3D=3D null ? null : weightCatego=
ry.getSpecies();
+
+        BeanComboBox<Species> speciesComboBox =3D ui.getSpecies();
+        BeanComboBox<WeightCategory> weightCategoryComboBox =3D ui.getWeight=
Category();
=20
         JComponent requestFocus;
         if (create) {
=20
-            // on reinitilise toujours l'species (pour reinitialiser la liste
-            // des categories)
-            ui.getSpecies().setSelectedItem(null);
+            // on reinitilise toujours l'esp=C3=A8ce (pour reinitialiser la =
liste des categories)
+            speciesComboBox.setSelectedItem(null);
=20
             if (!getTableModel().isCreate()) {
-                // on repositionne l'species (cela reconstruira la liste
-                // des categories)
-                ui.getSpecies().setSelectedItem(beanEspece);
+                // on repositionne l'esp=C3=A8ce (cela reconstruira la liste=
 des categories)
+                speciesComboBox.setSelectedItem(species);
                 // on repositionne la categorie
-                ui.getWeightCategory().setSelectedItem(beanWeightCategory);
+                weightCategoryComboBox.setSelectedItem(weightCategory);
             }
=20
-            requestFocus =3D ui.getSpecies();
+            requestFocus =3D speciesComboBox;
=20
         } else {
=20
@@ -362,48 +337,20 @@ public class TargetCatchUIHandler extends ContentTableU=
IHandler<SetSeine, Target
             // au singleton de sa valeur correspondante dans le bean
             // puisque dans ce mode, pas possibilite de modifier de cette
             // valeur (clef metier)
-            ui.getSpecies().setSelectedItem(beanEspece);
-            ui.getWeightCategory().setData(
-                    Arrays.asList(beanWeightCategory));
-            ui.getWeightCategory().setSelectedItem(beanWeightCategory);
+            speciesComboBox.setSelectedItem(species);
+            weightCategoryComboBox.setData(Collections.singletonList(weightC=
ategory));
+            weightCategoryComboBox.setSelectedItem(weightCategory);
=20
             requestFocus =3D ui.getCatchWeight();
+
         }
=20
         if (log.isDebugEnabled()) {
-            log.debug("selected categoriePoid " + beanWeightCategory);
-            log.debug("selected species " + beanEspece);
+            log.debug("selected categoriePoid " + weightCategory);
+            log.debug("selected species " + species);
         }
         requestFocus.requestFocus();
-    }
-
-    @Override
-    protected void initTableUI(DefaultTableCellRenderer renderer) {
-
-        JTable table =3D getUi().getTable();
-
-        UIHelper.fixTableColumnWidth(table, 2, 100);
-        UIHelper.fixTableColumnWidth(table, 3, 50);
-        UIHelper.fixTableColumnWidth(table, 4, 50);
=20
-        UIHelper.setI18nTableHeaderRenderer(
-                table,
-                n("observe.targetCatch.table.speciesThon"),
-                n("observe.targetCatch.table.speciesThon.tip"),
-                n("observe.targetCatch.table.weightCategory"),
-                n("observe.targetCatch.table.weightCategory.tip"),
-                n("observe.targetCatch.table.well"),
-                n("observe.targetCatch.table.well.tip"),
-                n("observe.targetCatch.table.weight"),
-                n("observe.targetCatch.table.weight.tip"),
-                n("observe.targetCatch.table.comment"),
-                n("observe.targetCatch.table.comment.tip"));
-
-        UIHelper.setTableColumnRenderer(table, 0, UIHelper.newDecorateTableC=
ellRenderer(renderer, Species.class));
-        UIHelper.setTableColumnRenderer(table, 1, UIHelper.newDecorateTableC=
ellRenderer(renderer, WeightCategory.class));
-        UIHelper.setTableColumnRenderer(table, 2, renderer);
-        UIHelper.setTableColumnRenderer(table, 3, UIHelper.newEmptyNumberTab=
leCellRenderer(renderer));
-        UIHelper.setTableColumnRenderer(table, 4, UIHelper.newStringTableCel=
lRenderer(renderer, 10, true));
     }
=20
     @SuppressWarnings("unchecked")
@@ -418,21 +365,22 @@ public class TargetCatchUIHandler extends ContentTableU=
IHandler<SetSeine, Target
             // species puis une categorie
=20
             availableCategories =3D Collections.emptyList();
+
         } else {
=20
-            // un species est selectionnee,
+            // une esp=C3=A8ce est selectionnee,
             // on calcule les categories pour cette species
=20
             availableCategories =3D getAllCategories(getUi());
=20
-            // on ne conserve que les categories de l'species
-            for (Iterator<WeightCategory> it =3D availableCategories.iterato=
r();
-                 it.hasNext(); ) {
+            // on ne conserve que les categories de l'esp=C3=A8ce
+            for (Iterator<WeightCategory> it =3D availableCategories.iterato=
r(); it.hasNext(); ) {
                 WeightCategory weighte =3D it.next();
                 if (!species.equals(weighte.getSpecies())) {
                     it.remove();
                 }
             }
+
         }
=20
         // on met a jour la liste des categories disponibles
@@ -441,6 +389,7 @@ public class TargetCatchUIHandler extends ContentTableUIH=
andler<SetSeine, Target
=20
         // on reinitialise toujours la categorie selectionnee
         combo.setSelectedItem(null);
+
     }
=20
     protected List<WeightCategory> getAllCategories(JAXXContext context) {
diff --git a/observe-swing/src/main/java/fr/ird/observe/ui/content/table/impl=
/seine/TargetDiscardCatchUIHandler.java b/observe-swing/src/main/java/fr/ird/=
observe/ui/content/table/impl/seine/TargetDiscardCatchUIHandler.java
index f1ad697..b640cda 100644
--- a/observe-swing/src/main/java/fr/ird/observe/ui/content/table/impl/seine/=
TargetDiscardCatchUIHandler.java
+++ b/observe-swing/src/main/java/fr/ird/observe/ui/content/table/impl/seine/=
TargetDiscardCatchUIHandler.java
@@ -24,6 +24,7 @@ package fr.ird.observe.ui.content.table.impl.seine;
 import fr.ird.observe.BinderService;
 import fr.ird.observe.ObserveConfig;
 import fr.ird.observe.db.constants.DataContextType;
+import fr.ird.observe.entities.Entities;
 import fr.ird.observe.entities.referentiel.Ocean;
 import fr.ird.observe.entities.referentiel.ReferenceEntities;
 import fr.ird.observe.entities.referentiel.Species;
@@ -34,7 +35,8 @@ import fr.ird.observe.entities.seine.SetSeine;
 import fr.ird.observe.entities.seine.TargetCatch;
 import fr.ird.observe.entities.seine.TargetLength;
 import fr.ird.observe.services.data.TripService;
-import fr.ird.observe.services.data.seine.NonTargetCatchService;
+import fr.ird.observe.services.data.seine.TargetCatchService;
+import fr.ird.observe.services.data.seine.TargetSampleService;
 import fr.ird.observe.services.referential.ReferentialService;
 import fr.ird.observe.ui.UIHelper;
 import fr.ird.observe.ui.content.ContentMode;
@@ -45,21 +47,24 @@ import jaxx.runtime.context.JAXXContextEntryDef;
 import jaxx.runtime.swing.editor.bean.BeanComboBox;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.nuiton.decorator.Decorator;
=20
 import javax.swing.JComponent;
+import javax.swing.JOptionPane;
 import javax.swing.JTable;
 import javax.swing.table.DefaultTableCellRenderer;
 import java.beans.PropertyChangeEvent;
 import java.beans.PropertyChangeListener;
 import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
+import java.util.Set;
=20
 import static org.nuiton.i18n.I18n.n;
+import static org.nuiton.i18n.I18n.t;
=20
 /**
  * @author Tony Chemit - chemit@codelutin.com
@@ -68,47 +73,30 @@ import static org.nuiton.i18n.I18n.n;
 public class TargetDiscardCatchUIHandler extends ContentTableUIHandler<SetSe=
ine, TargetCatch> {
=20
     /** Logger */
-    static private Log log =3D LogFactory.getLog(TargetDiscardCatchUIHandler=
.class);
+    private static final Log log =3D LogFactory.getLog(TargetDiscardCatchUIH=
andler.class);
=20
+    /**
+     * L'entr=C3=A9e dans le contexte pour r=C3=A9cup=C3=A9rer la liste comp=
l=C3=A8te des cat=C3=A9gories.
+     */
     JAXXContextEntryDef<List<WeightCategory>> ALL_CATEGORIES_ENTRY =3D
             UIHelper.newListContextEntryDef("RejetThonUI-all-categories");
=20
+    /**
+     * L'entr=C3=A9e dans le contexte pour r=C3=A9cup=C3=A9rer la liste comp=
l=C3=A8te des raisons de rejet.
+     */
     JAXXContextEntryDef<List<ReasonForDiscard>> ALL_RAISONS_REJET_ENTRY =3D
             UIHelper.newListContextEntryDef("RejetThonUI-all-reasonForDiscar=
ds");
=20
-    JAXXContextEntryDef<List<TargetLength>> ALL_TAILLES_TO_DELETE_ENTRY =3D
+    /**
+     * L'entr=C3=A9e dans le contexte pour conserver les mensurations obsol=
=C3=A8tes =C3=A0 supprimer lors de la sauvegarde.
+     */
+    JAXXContextEntryDef<List<TargetLength>> ALL_TARGET_LENGTH_TO_DELETE_ENTR=
Y =3D
             UIHelper.newListContextEntryDef("RejetThonUI-all-taille-to-delet=
e");
=20
     public TargetDiscardCatchUIHandler(TargetDiscardCatchUI ui) {
         super(ui, DataContextType.SetSeine);
     }
=20
-    protected static Collection<WeightCategory> getWeightCategoryUsed(
-            ContentTableModel<SetSeine, TargetCatch> model) {
-        List<WeightCategory> list =3D model.getColumnValues(1);
-        Collection<WeightCategory> set =3D new HashSet<WeightCategory>(list);
-        list.clear();
-        return set;
-    }
-
-    protected static Collection<ReasonForDiscard> getReasonForDiscardUsed(
-            ContentTableModel<SetSeine, TargetCatch> model,
-            WeightCategory weightCategory) {
-
-        Collection<ReasonForDiscard> set =3D new HashSet<ReasonForDiscard>();
-        if (weightCategory !=3D null) {
-            for (int i =3D 0; i < model.getRowCount(); i++) {
-                TargetCatch c =3D model.getValueAt(i);
-                if (c !=3D null &&
-                    weightCategory.equals(c.getWeightCategory()) &&
-                    c.getReasonForDiscard() !=3D null) {
-                    set.add(c.getReasonForDiscard());
-                }
-            }
-        }
-        return set;
-    }
-
     @Override
     public TargetDiscardCatchUI getUi() {
         return (TargetDiscardCatchUI) super.getUi();
@@ -119,29 +107,26 @@ public class TargetDiscardCatchUIHandler extends Conten=
tTableUIHandler<SetSeine,
=20
         super.initUI();
=20
-        TargetDiscardCatchUI ui =3D getUi();
-
-        // lors de la modification d'une species (sur une entree non sauvee)
-        //   - on recalcule la liste des categories pour cette species.
+        // lors de la modification d'une esp=C3=A8ce (sur une entree non sau=
vee)
+        //   - on recalcule la liste des categories pour cette esp=C3=A8ce.
         //   - on reinitialiser la categorie selectionnee
=20
-        ui.getSpecies().addPropertyChangeListener(
+        getUi().getSpecies().addPropertyChangeListener(
                 BeanComboBox.PROPERTY_SELECTED_ITEM,
                 new PropertyChangeListener() {
=20
                     @Override
                     public void propertyChange(PropertyChangeEvent evt) {
=20
-                        ContentTableModel<SetSeine, TargetCatch> model =3D
-                                getTableModel();
+                        ContentTableModel<SetSeine, TargetCatch> model =3D g=
etTableModel();
                         TargetCatch bean =3D model.getRowBean();
=20
-                        if (bean.getTopiaId() =3D=3D null) {
-                            // en mode creation , on doit recalculer la liste
-                            // des categories
+                        if (Entities.isNew(bean)) {
=20
+                            // en mode creation , on doit recalculer la list=
e des categories
                             Species species =3D (Species) evt.getNewValue();
                             onEspeceChanged(bean, species);
+
                         }
                     }
                 }
@@ -151,22 +136,22 @@ public class TargetDiscardCatchUIHandler extends Conten=
tTableUIHandler<SetSeine,
         //   - on recalcule la liste des raison rejets.
         //   - on reinitialiser la raison rejet selectionnee
=20
-        ui.getWeightCategory().addPropertyChangeListener(
+        getUi().getWeightCategory().addPropertyChangeListener(
                 BeanComboBox.PROPERTY_SELECTED_ITEM,
                 new PropertyChangeListener() {
=20
                     @Override
                     public void propertyChange(PropertyChangeEvent evt) {
=20
-                        ContentTableModel<SetSeine, TargetCatch> model =3D
-                                getTableModel();
+                        ContentTableModel<SetSeine, TargetCatch> model =3D g=
etTableModel();
                         TargetCatch bean =3D model.getRowBean();
-                        if (bean.getTopiaId() =3D=3D null) {
-                            // en mode creation , on doit recalculer la liste
-                            // des raison rejet
-                            WeightCategory weightCategory =3D
-                                    (WeightCategory) evt.getNewValue();
+
+                        if (Entities.isNew(bean)) {
+
+                            // en mode creation , on doit recalculer la list=
e des raison rejet
+                            WeightCategory weightCategory =3D (WeightCategor=
y) evt.getNewValue();
                             onCategorieChanged(bean, weightCategory);
+
                         }
=20
                     }
@@ -176,12 +161,44 @@ public class TargetDiscardCatchUIHandler extends Conten=
tTableUIHandler<SetSeine,
     }
=20
     @Override
+    protected void initTableUI(DefaultTableCellRenderer renderer) {
+
+        JTable table =3D getUi().getTable();
+        UIHelper.fixTableColumnWidth(table, 3, 75);
+        UIHelper.fixTableColumnWidth(table, 4, 20);
+        UIHelper.fixTableColumnWidth(table, 5, 50);
+
+        UIHelper.setI18nTableHeaderRenderer(
+                table,
+                n("observe.targetDiscarded.table.speciesThon"),
+                n("observe.targetDiscarded.table.speciesThon.tip"),
+                n("observe.targetDiscarded.table.weightCategory"),
+                n("observe.targetDiscarded.table.weightCategory.tip"),
+                n("observe.targetDiscarded.table.reasonForDiscard"),
+                n("observe.targetDiscarded.table.reasonForDiscard.tip"),
+                n("observe.targetDiscarded.table.weight"),
+                n("observe.targetDiscarded.table.weight.tip"),
+                n("observe.targetDiscarded.table.broughtOnDeck"),
+                n("observe.targetDiscarded.table.broughtOnDeck.tip"),
+                n("observe.targetDiscarded.table.comment"),
+                n("observe.targetDiscarded.table.comment.tip"));
+
+        UIHelper.setTableColumnRenderer(table, 0, UIHelper.newDecorateTableC=
ellRenderer(renderer, Species.class));
+        UIHelper.setTableColumnRenderer(table, 1, UIHelper.newDecorateTableC=
ellRenderer(renderer, WeightCategory.class));
+        UIHelper.setTableColumnRenderer(table, 2, UIHelper.newDecorateTableC=
ellRenderer(renderer, ReasonForDiscard.class));
+        UIHelper.setTableColumnRenderer(table, 3, UIHelper.newEmptyNumberTab=
leCellRenderer(renderer));
+        UIHelper.setTableColumnRenderer(table, 4, UIHelper.newStringTableCel=
lRenderer(renderer, 20, false));
+        UIHelper.setTableColumnRenderer(table, 5, UIHelper.newStringTableCel=
lRenderer(renderer, 10, true));
+
+    }
+
+    @Override
     protected void loadEditBean(ContentMode mode) {
=20
         List<WeightCategory> categorieList;
         List<ReasonForDiscard> reasonForDiscardList;
=20
-        if (mode =3D=3D ContentMode.UPDATE) {
+        if (ContentMode.UPDATE =3D=3D mode) {
=20
             // on charge le formulaire uniquement si en mode =C3=A9dition
=20
@@ -192,7 +209,7 @@ public class TargetDiscardCatchUIHandler extends ContentT=
ableUIHandler<SetSeine,
             // filtre sur la liste d'esp=C3=A8ce configuree
             ObserveConfig config =3D getUi().getContextValue(ObserveConfig.c=
lass);
             String speciesListId =3D config.getSpeciesListSeineTargetCatchId=
();
-            java.util.Set<String> speciesIds =3D loadSpeciesList(speciesList=
Id, n("observe.error.speciesList.seine.targetCatch.notFound"));
+            Set<String> speciesIds =3D loadSpeciesList(speciesListId, n("obs=
erve.error.speciesList.seine.targetCatch.notFound"));
=20
             categorieList =3D Species2.filterWeightCategoryBySpeciesIds(cate=
gorieList, speciesIds);
=20
@@ -214,203 +231,128 @@ public class TargetDiscardCatchUIHandler extends Cont=
entTableUIHandler<SetSeine,
=20
             categorieList =3D new ArrayList<WeightCategory>();
             reasonForDiscardList =3D new ArrayList<ReasonForDiscard>();
-        }
=20
-        TargetDiscardCatchUI ui =3D getUi();
+        }
=20
         ALL_CATEGORIES_ENTRY.setContextValue(ui, categorieList);
         ALL_RAISONS_REJET_ENTRY.setContextValue(ui, reasonForDiscardList);
=20
         String setId =3D getDataContext().getSelectedSetId();
=20
-        SetSeine setSeine =3D getService(NonTargetCatchService.class).loadFo=
rEdit(setId);
+        TargetCatchService service =3D getService(TargetCatchService.class);
+        SetSeine setSeine =3D service.loadForEditDiscarded(setId);
=20
         copy(SetSeine.class, BinderService.EDIT_DISCARD_TARGET_CATCH, setSei=
ne, getBean());
=20
     }
=20
-//    @Override
-//    protected String getEditBeanIdToLoad(DataContext dataContext, DataServ=
ice dataService, DataSource dataSource) {
-//        return dataContext.getSelectedSetId();
-//    }
-
-//    @Override
-//    protected Collection<TargetCatch> loadChilds(TopiaContext tx, SetSeine=
 bean) throws TopiaException {
-//        Collection<TargetCatch> childs =3D getModel().getChildsUpdator().g=
etChilds(bean);
-//        Collection<TargetCatch> data =3D new ArrayList<TargetCatch>();
-//        if (CollectionUtils.isNotEmpty(childs)) {
-//            TopiaDAO<TargetCatch> dao =3D
-//                    getDataSource().getDAO(tx, getTableEditBean());
-//            TopiaEntityBinder<TargetCatch> childLoador =3D getModel().getC=
hildLoador();
-//            DecoratorService decoratorService =3D getDecoratorService();
-//            for (TargetCatch c : childs) {
-//                if (!c.isDiscarded()) {
-//                    // ce n'est pas un rejet, on ne le retient pas dans ce=
tte
-//                    // liste
-//                    if (log.isDebugEnabled()) {
-//                        log.debug("targetCatch " + c.getSpecies().getLabel=
2() + " non retenu.");
-//                    }
-//                    continue;
-//                }
-//                try {
-//                    TargetCatch c2 =3D getModel().newTableEditBean();
-//                    TargetCatch safeC =3D dao.findByTopiaId(c.getTopiaId()=
);
-//                    WeightCategory weightCategory =3D safeC.getWeightCateg=
ory();
-//                    if (weightCategory !=3D null) {
-//                        Species species =3D weightCategory.getSpecies();
-//                        decoratorService.decorate(species);
-//                    }
-//                    childLoador.load(safeC, c2, true);
-//                    data.add(c2);
-//                } catch (Exception e) {
-//                    throw new RuntimeException(e);
-//                }
-//            }
-//        }
-//        return data;
-//    }
-
-//    @Override
-//    protected boolean doSave(SetSeine bean,
-//                             DataService dataService,
-//                             DataSource dataSource,
-//                             TopiaEntityBinder<SetSeine> binder) throws Ex=
ception {
-//        try {
-//            return super.doSave(bean, dataService, dataSource, binder);
-//        } finally {
-//
-//            // toujours supprimer la r=C3=A9f=C3=A9rence du context, quoiq=
u'il arrive
-//            ALL_TAILLES_TO_DELETE_ENTRY.removeContextValue(getUi());
-//        }
-//    }
-
-//    @Override
-//    protected boolean prepareSave(SetSeine bean, List<TargetCatch> objets)=
 throws DataSourceException {
-//
-//        // on recupere les speciess acceptables pour des echantillonnages
-//        // i.e une species d'un targetDiscarded montee sur le pont
-//
-//        java.util.Set<Species> speciessUsed =3D new HashSet<Species>();
-//        for (TargetCatch c : objets) {
-//            if (c.getBroughtOnDeck() !=3D null && c.getBroughtOnDeck()) {
-//                speciessUsed.add(c.getSpecies());
-//            }
-//        }
-//
-//        // il faut supprimer les echantillon thons sur des speciess qui ne
-//        // sont plus sur un rejet
-//
-//        List<TargetLength> tailleToDelete =3D new ArrayList<TargetLength>(=
);
-//        java.util.Set<Species> speciessToDelete =3D new HashSet<Species>();
-//
-//        TargetSampleService service =3D getService(TargetSampleService.cla=
ss);
-//        service.getObsoleteEspeceForTargetSample(bean.getTopiaId(),
-//                                                 speciessUsed,
-//                                                 speciessToDelete,
-//                                                 tailleToDelete,
-//                                                 true);
-//
-//        if (!tailleToDelete.isEmpty()) {
-//
-//            // il existe des echantillon thon a supprimer on demande une
-//            // confirmation
-//            StringBuilder sb =3D new StringBuilder(512);
-//            StringBuilder sb2 =3D new StringBuilder(512);
-//            Decorator<Species> decorator =3D
-//                    getDecoratorService().getDecoratorByType(Species.class=
);
-//            Decorator<TargetLength> decorator2 =3D
-//                    getDecoratorService().getDecoratorByType(TargetLength.=
class);
-//
-//            for (Species e : speciessToDelete) {
-//                sb.append("  - ").append(decorator.toString(e)).append('\n=
');
-//            }
-//            for (TargetLength t : tailleToDelete) {
-//                sb2.append("  - ").append(decorator2.toString(t)).append('=
\n');
-//            }
-//            int reponse =3D UIHelper.askUser(
-//                    t("observe.title.need.confirm"),
-//                    t("observe.targetDiscarded.message.table.will.delete.t=
argetLength", sb.toString(), sb2.toString()),
-//                    JOptionPane.ERROR_MESSAGE,
-//                    new Object[]{
-//                            t("observe.choice.continue"),
-//                            t("observe.choice.cancel")},
-//                    0);
-//            if (log.isDebugEnabled()) {
-//                log.debug("response : " + reponse);
-//            }
-//            boolean canContinue =3D false;
-//            switch (reponse) {
-//                case 0:
-//                    // wil reset ui
-//                    canContinue =3D true;
-//                    break;
-//            }
-//
-//            if (!canContinue) {
-//
-//                // l'utilisateur a choisi de ne pas continuer
-//                return false;
-//            }
-//
-//            // on conserve les tailles a supprimer
-//            ALL_TAILLES_TO_DELETE_ENTRY.setContextValue(getUi(), tailleToD=
elete);
-//        }
-//
-//        // mise a jour de la propriete targetDiscarded
-//        bean.setTargetDiscarded(!objets.isEmpty());
-//
-//        for (TargetCatch discarded : objets) {
-//
-//            // FIXME : on devrait pas a avoir a repositionner la propriete=
 discarded
-//            discarded.setDiscarded(true);
-//
-//            // on attache la set
-//            discarded.setSetSeine(bean);
-//        }
-//
-//        return true;
-//    }
-
-//    @Override
-//    protected void onUpdateFinalize(TopiaContext tx, SetSeine bean, Collec=
tion<TargetCatch> oldChilds) {
-//
-//        if (oldChilds !=3D null && !oldChilds.isEmpty()) {
-//
-//            // on reinjecte les discarded thon precedemment saisies dans l=
a set
-//            // et qui ne sont pas des rejets
-//
-//            for (TargetCatch targetCatch : oldChilds) {
-//                if (!targetCatch.isDiscarded()) {
-//                    bean.addTargetCatch(targetCatch);
-//                }
-//            }
-//        }
-//
-//        List<TargetLength> tailleToDelete =3D ALL_TAILLES_TO_DELETE_ENTRY.=
getContextValue(getUi());
-//
-//        if (tailleToDelete !=3D null && !tailleToDelete.isEmpty()) {
-//
-//            // on a demande la suppression de taille obsoletes
-//
-//            if (log.isInfoEnabled()) {
-//                log.info("Will remove " + tailleToDelete.size() +
-//                         " obsolete targetLength(s).");
-//            }
-//
-//            TargetSample echantillon =3D bean.getTargetSample(true);
-//
-//            // on supprime les echantillons obsoletes
-//            echantillon.getTargetLength().removeAll(tailleToDelete);
-//        }
-//    }
+    @Override
+    protected boolean prepareSave(SetSeine editBean, List<TargetCatch> objet=
s) {
+
+        // on recupere les esp=C3=A8ces acceptables pour des echantillonnages
+        // i.e une esp=C3=A8ces d'un targetDiscarded montee sur le pont
+
+        Set<String> speciesIdsUsed =3D new HashSet<String>();
+        for (TargetCatch targetCatch : objets) {
+            speciesIdsUsed.add(targetCatch.getSpecies().getTopiaId());
+        }
+
+        // il faut supprimer les echantillon thons sur des esp=C3=A8ces qui =
ne sont plus sur un rejet
+
+        TargetSampleService service =3D getService(TargetSampleService.class=
);
+        List<TargetLength> targetLengthsToDelete =3D service.getObsoleteTarg=
etLengths(editBean.getTopiaId(), speciesIdsUsed, true);
+
+        if (!targetLengthsToDelete.isEmpty()) {
+
+            // il existe des echantillon thon a supprimer on demande une con=
firmation
+
+            Set<Species> speciessToDelete =3D new HashSet<Species>();
+            for (TargetLength targetLength : targetLengthsToDelete) {
+                speciessToDelete.add(targetLength.getSpecies());
+            }
+
+            StringBuilder sb =3D new StringBuilder(512);
+            StringBuilder sb2 =3D new StringBuilder(512);
+            Decorator<Species> speciesDecorator =3D getDecoratorService().ge=
tDecoratorByType(Species.class);
+            Decorator<TargetLength> targetLengthDecorator =3D getDecoratorSe=
rvice().getDecoratorByType(TargetLength.class);
+
+            for (Species e : speciessToDelete) {
+                sb.append("  - ").append(speciesDecorator.toString(e)).appen=
d('\n');
+            }
+            for (TargetLength t : targetLengthsToDelete) {
+                sb2.append("  - ").append(targetLengthDecorator.toString(t))=
.append('\n');
+            }
+            int reponse =3D UIHelper.askUser(
+                    t("observe.title.need.confirm"),
+                    t("observe.targetDiscarded.message.table.will.delete.tar=
getLength", sb.toString(), sb2.toString()),
+                    JOptionPane.ERROR_MESSAGE,
+                    new Object[]{t("observe.choice.continue"), t("observe.ch=
oice.cancel")},
+                    0);
+            if (log.isDebugEnabled()) {
+                log.debug("response : " + reponse);
+            }
+            boolean canContinue =3D false;
+            switch (reponse) {
+                case 0:
+                    // wil reset ui
+                    canContinue =3D true;
+                    break;
+            }
+
+            if (!canContinue) {
+
+                // l'utilisateur a choisi de ne pas continuer
+                return false;
+
+            }
+
+            // on conserve les tailles a supprimer
+            ALL_TARGET_LENGTH_TO_DELETE_ENTRY.setContextValue(getUi(), targe=
tLengthsToDelete);
+
+        }
+
+        // mise a jour de la propriete targetDiscarded
+        editBean.setTargetDiscarded(!objets.isEmpty());
+
+        for (TargetCatch targetCatch : objets) {
+
+            // FIXME : on devrait pas a avoir a repositionner la propriete d=
iscarded
+            targetCatch.setDiscarded(true);
+
+            // on attache la set
+            targetCatch.setSetSeine(editBean);
+
+        }
+
+        return true;
+
+    }
+
+    @Override
+    protected void doPersist(SetSeine editBean) {
+
+        List<TargetLength> targetLengthsToDelete =3D ALL_TARGET_LENGTH_TO_DE=
LETE_ENTRY.getContextValue(ui);
+
+        try {
+
+            TargetCatchService service =3D getService(TargetCatchService.cla=
ss);
+            service.saveForDiscarded(editBean, targetLengthsToDelete);
+
+        } finally {
+
+            ALL_TARGET_LENGTH_TO_DELETE_ENTRY.removeContextValue(ui);
+
+        }
+
+    }
=20
     @Override
     protected void onSelectedRowChanged(int editingRow, TargetCatch bean, bo=
olean create) {
+
         TargetDiscardCatchUI ui =3D getUi();
=20
         WeightCategory beanWeightCategory =3D bean.getWeightCategory();
-        Species beanEspece =3D beanWeightCategory =3D=3D null ? null :
-                             beanWeightCategory.getSpecies();
+        Species beanEspece =3D beanWeightCategory =3D=3D null ? null : beanW=
eightCategory.getSpecies();
         ReasonForDiscard beanReasonForDiscard =3D bean.getReasonForDiscard();
         if (log.isDebugEnabled()) {
             log.debug("selected categoriePoid " + beanWeightCategory);
@@ -418,8 +360,11 @@ public class TargetDiscardCatchUIHandler extends Content=
TableUIHandler<SetSeine,
             log.debug("selected reasonForDiscard " + beanReasonForDiscard);
         }
=20
+        BeanComboBox<Species> speciesComboBox =3D ui.getSpecies();
+
         JComponent requestFocus;
         if (create) {
+
             ContentTableModel<SetSeine, TargetCatch> model =3D getTableModel=
();
             if (model.isCreate()) {
                 // par d=C3=A9faut, on consid=C3=A8re que l'esp=C3=A8ce a =
=C3=A9t=C3=A9 mont=C3=A9 sur le pont
@@ -428,71 +373,42 @@ public class TargetDiscardCatchUIHandler extends Conten=
tTableUIHandler<SetSeine,
             }
=20
             // on recalcule la liste des speciess disponibles
-            List<Species> availableEspeces =3D buildEspeceList(
-                    beanEspece, beanWeightCategory);
-            ui.getSpecies().setData(availableEspeces);
+            List<Species> availableEspeces =3D buildEspeceList(beanEspece, b=
eanWeightCategory);
+            speciesComboBox.setData(availableEspeces);
=20
-            // on reinitilise toujours l'species (pour reinitialiser la liste
-            // des categories)
-            ui.getSpecies().setSelectedItem(null);
+            // on reinitilise toujours la liste des esp=C3=A8ces (pour reini=
tialiser la liste des categories)
+            speciesComboBox.setSelectedItem(null);
=20
             if (!model.isCreate()) {
                 // on repositionne l'species (cela reconstruira la liste
                 // des categories)
-                ui.getSpecies().setSelectedItem(beanEspece);
+                speciesComboBox.setSelectedItem(beanEspece);
                 // on repositionne la categorie
                 ui.getWeightCategory().setSelectedItem(beanWeightCategory);
                 ui.getReasonForDiscard().setSelectedItem(beanReasonForDiscar=
d);
             }
=20
-            requestFocus =3D ui.getSpecies();
+            requestFocus =3D speciesComboBox;
+
         } else {
+
             // en mode mise a jour, on restreint la liste des categories
             // au singleton de sa valeur correspondante dans le bean
             // puisque dans ce mode, pas possibilite de modifier de cette
             // valeur (clef metier)
-            ui.getSpecies().setSelectedItem(beanEspece);
-            ui.getWeightCategory().setData(Arrays.asList(beanWeightCategory)=
);
+            speciesComboBox.setSelectedItem(beanEspece);
+            ui.getWeightCategory().setData(Collections.singletonList(beanWei=
ghtCategory));
             ui.getWeightCategory().setSelectedItem(beanWeightCategory);
-            ui.getReasonForDiscard().setData(Arrays.asList(beanReasonForDisc=
ard));
+            ui.getReasonForDiscard().setData(Collections.singletonList(beanR=
easonForDiscard));
             ui.getReasonForDiscard().setSelectedItem(beanReasonForDiscard);
=20
             requestFocus =3D ui.getCatchWeight();
+
         }
=20
         requestFocus.requestFocus();
     }
=20
-    @Override
-    protected void initTableUI(DefaultTableCellRenderer renderer) {
-        JTable table =3D getUi().getTable();
-        UIHelper.fixTableColumnWidth(table, 3, 75);
-        UIHelper.fixTableColumnWidth(table, 4, 20);
-        UIHelper.fixTableColumnWidth(table, 5, 50);
-
-        UIHelper.setI18nTableHeaderRenderer(
-                table,
-                n("observe.targetDiscarded.table.speciesThon"),
-                n("observe.targetDiscarded.table.speciesThon.tip"),
-                n("observe.targetDiscarded.table.weightCategory"),
-                n("observe.targetDiscarded.table.weightCategory.tip"),
-                n("observe.targetDiscarded.table.reasonForDiscard"),
-                n("observe.targetDiscarded.table.reasonForDiscard.tip"),
-                n("observe.targetDiscarded.table.weight"),
-                n("observe.targetDiscarded.table.weight.tip"),
-                n("observe.targetDiscarded.table.broughtOnDeck"),
-                n("observe.targetDiscarded.table.broughtOnDeck.tip"),
-                n("observe.targetDiscarded.table.comment"),
-                n("observe.targetDiscarded.table.comment.tip"));
-
-        UIHelper.setTableColumnRenderer(table, 0, UIHelper.newDecorateTableC=
ellRenderer(renderer, Species.class));
-        UIHelper.setTableColumnRenderer(table, 1, UIHelper.newDecorateTableC=
ellRenderer(renderer, WeightCategory.class));
-        UIHelper.setTableColumnRenderer(table, 2, UIHelper.newDecorateTableC=
ellRenderer(renderer, ReasonForDiscard.class));
-        UIHelper.setTableColumnRenderer(table, 3, UIHelper.newEmptyNumberTab=
leCellRenderer(renderer));
-        UIHelper.setTableColumnRenderer(table, 4, UIHelper.newStringTableCel=
lRenderer(renderer, 20, false));
-        UIHelper.setTableColumnRenderer(table, 5, UIHelper.newStringTableCel=
lRenderer(renderer, 10, true));
-    }
-
     protected void onEspeceChanged(TargetCatch bean, Species species) {
=20
         WeightCategory weightCategory =3D null;
@@ -511,15 +427,13 @@ public class TargetDiscardCatchUIHandler extends Conten=
tTableUIHandler<SetSeine,
             // un species est selectionne, on met a jour la liste des catego=
ries
             // disponibles pour cet species
=20
-            List<WeightCategory> availableCategories =3D buildWeightCategory=
List(
-                    species);
+            List<WeightCategory> availableCategories =3D buildWeightCategory=
List(species);
=20
             data =3D availableCategories;
=20
             weightCategory =3D bean.getWeightCategory();
=20
-            if (weightCategory !=3D null &&
-                !availableCategories.contains(weightCategory)) {
+            if (weightCategory !=3D null && !availableCategories.contains(we=
ightCategory)) {
                 weightCategory =3D null;
             }
         }
@@ -530,9 +444,11 @@ public class TargetDiscardCatchUIHandler extends Content=
TableUIHandler<SetSeine,
=20
         // on selectionne la categorie retenue
         combo.setSelectedItem(weightCategory);
+
     }
=20
     protected void onCategorieChanged(TargetCatch bean, WeightCategory weigh=
tCategory) {
+
         TargetDiscardCatchUI ui =3D getUi();
=20
         ReasonForDiscard reasonForDiscard =3D null;
@@ -574,6 +490,7 @@ public class TargetDiscardCatchUIHandler extends ContentT=
ableUIHandler<SetSeine,
=20
         // on selectionne la raison rejet retenue
         combo.setSelectedItem(reasonForDiscard);
+
     }
=20
     protected List<Species> buildEspeceList(Species species, WeightCategory =
weightCategory) {
@@ -594,7 +511,9 @@ public class TargetDiscardCatchUIHandler extends ContentT=
ableUIHandler<SetSeine,
         List<Species> result =3D new ArrayList<Species>(usedEspeces);
         weightCategoryList.clear();
         usedEspeces.clear();
+
         return result;
+
     }
=20
     protected List<WeightCategory> buildWeightCategoryList(Species species) {
@@ -615,9 +534,9 @@ public class TargetDiscardCatchUIHandler extends ContentT=
ableUIHandler<SetSeine,
         removeFullyUsedCategories(weightCategoryList);
=20
         return weightCategoryList;
+
     }
=20
-    @SuppressWarnings("unchecked")
     protected List<ReasonForDiscard> buildReasonFordiscardList(WeightCategor=
y weightCategory) {
=20
         ContentTableModel<SetSeine, TargetCatch> model =3D getTableModel();
@@ -634,6 +553,7 @@ public class TargetDiscardCatchUIHandler extends ContentT=
ableUIHandler<SetSeine,
         }
=20
         return reasonForDiscardList;
+
     }
=20
     protected List<WeightCategory> getAllCategories(JAXXContext context) {
@@ -642,22 +562,46 @@ public class TargetDiscardCatchUIHandler extends Conten=
tTableUIHandler<SetSeine,
         return list;
     }
=20
-    protected void removeFullyUsedCategories(
-            List<WeightCategory> weightCategoryAvaillable) {
-
-        ContentTableModel<SetSeine, TargetCatch> model =3D getTableModel();
+    protected void removeFullyUsedCategories(List<WeightCategory> weightCate=
goryAvaillable) {
=20
-        int nbReasonForDiscard =3D
-                ALL_RAISONS_REJET_ENTRY.getContextValue(getUi()).size();
+        int nbReasonForDiscard =3D ALL_RAISONS_REJET_ENTRY.getContextValue(g=
etUi()).size();
=20
-        // on filtre toutes les weightCategory qui ont deja references toutes
-        // les raisons rejets
-        for (WeightCategory c : getWeightCategoryUsed(model)) {
-            Collection<ReasonForDiscard> raisonUsed =3D getReasonForDiscardU=
sed(model, c);
+        // on filtre toutes les weightCategory qui ont deja references toute=
s les raisons rejets
+        for (WeightCategory c : getWeightCategoryUsed()) {
+            Collection<ReasonForDiscard> raisonUsed =3D getReasonForDiscardU=
sed(c);
             if (raisonUsed.size() =3D=3D nbReasonForDiscard) {
                 // toutes les raison de rejet epuis=C3=A9 pour cette categor=
ie
                 weightCategoryAvaillable.remove(c);
             }
         }
+
+    }
+
+    protected Collection<WeightCategory> getWeightCategoryUsed() {
+
+        ContentTableModel<SetSeine, TargetCatch> model =3D getTableModel();
+
+        List<WeightCategory> list =3D model.getColumnValues(1);
+        Collection<WeightCategory> set =3D new HashSet<WeightCategory>(list);
+        list.clear();
+        return set;
+
+    }
+
+    protected Collection<ReasonForDiscard> getReasonForDiscardUsed(WeightCat=
egory weightCategory) {
+
+        ContentTableModel<SetSeine, TargetCatch> model =3D getTableModel();
+
+        Collection<ReasonForDiscard> set =3D new HashSet<ReasonForDiscard>();
+        if (weightCategory !=3D null) {
+            for (int i =3D 0; i < model.getRowCount(); i++) {
+                TargetCatch c =3D model.getValueAt(i);
+                if (c !=3D null && weightCategory.equals(c.getWeightCategory=
()) && c.getReasonForDiscard() !=3D null) {
+                    set.add(c.getReasonForDiscard());
+                }
+            }
+        }
+        return set;
+
     }
 }
diff --git a/observe-swing/src/main/java/fr/ird/observe/ui/content/table/impl=
/seine/TargetSampleUIHandler.java b/observe-swing/src/main/java/fr/ird/observ=
e/ui/content/table/impl/seine/TargetSampleUIHandler.java
index bcfc0d7..5a90ee1 100644
--- a/observe-swing/src/main/java/fr/ird/observe/ui/content/table/impl/seine/=
TargetSampleUIHandler.java
+++ b/observe-swing/src/main/java/fr/ird/observe/ui/content/table/impl/seine/=
TargetSampleUIHandler.java
@@ -148,7 +148,7 @@ public class TargetSampleUIHandler extends ContentTableUI=
Handler<TargetSample, T
             String setId =3D getDataContext().getSelectedSetId();
=20
             // on ne charge les speciess uniquement si on est en mode =C3=A9=
dition
-            List<Species> speciesList =3D getService(TargetSampleService.cla=
ss).getAvailableEspeceForTargetSample(setId, discarded);
+            List<Species> speciesList =3D getService(TargetSampleService.cla=
ss).getAvailableSpeciesForTargetSample(setId, discarded);
=20
             getUi().getSpecies().setData(speciesList);
         }
diff --git a/observe-swing/src/main/java/fr/ird/observe/ui/tree/SetLonglineNo=
de.java b/observe-swing/src/main/java/fr/ird/observe/ui/tree/SetLonglineNode.=
java
index 4b0fb0c..570f852 100644
--- a/observe-swing/src/main/java/fr/ird/observe/ui/tree/SetLonglineNode.java
+++ b/observe-swing/src/main/java/fr/ird/observe/ui/tree/SetLonglineNode.java
@@ -44,7 +44,7 @@ public class SetLonglineNode extends EntityNodeSupport<SetL=
ongline> {
     @Override
     protected SetLongline getEntity(ObserveServiceFactory services) {
         SetLonglineService service =3D services.getService(SetLonglineServic=
e.class);
-        return service.loadSet(id);
+        return service.loadForDisplay(id);
     }
=20
 }
diff --git a/observe-validation/src/main/java/fr/ird/observe/validation/field=
/VesselActivityFieldValidator.java b/observe-validation/src/main/java/fr/ird/=
observe/validation/field/VesselActivityFieldValidator.java
index 191eab6..0710dd2 100644
--- a/observe-validation/src/main/java/fr/ird/observe/validation/field/Vessel=
ActivityFieldValidator.java
+++ b/observe-validation/src/main/java/fr/ird/observe/validation/field/Vessel=
ActivityFieldValidator.java
@@ -25,15 +25,15 @@ package fr.ird.observe.validation.field;
 import com.opensymphony.xwork2.util.ValueStack;
 import com.opensymphony.xwork2.validator.ValidationException;
 import com.opensymphony.xwork2.validator.validators.FieldValidatorSupport;
+import fr.ird.observe.entities.referentiel.seine.VesselActivitySeine;
 import fr.ird.observe.entities.seine.ActivitySeine;
 import fr.ird.observe.entities.seine.ActivitySeineImpl;
-import fr.ird.observe.entities.seine.TripSeine;
 import fr.ird.observe.entities.seine.Route;
-import fr.ird.observe.entities.referentiel.seine.VesselActivitySeine;
+import fr.ird.observe.entities.seine.Routes;
+import fr.ird.observe.entities.seine.TripSeine;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
=20
-import java.util.ArrayList;
 import java.util.List;
=20
 /**
@@ -144,29 +144,28 @@ public class VesselActivityFieldValidator extends Field=
ValidatorSupport {
                 log.debug("route :  " + route);
             }
=20
-            String activityCode =3D activitySeine.getVesselActivitySeine().g=
etCode();
+            String vesselActivityId =3D activitySeine.getVesselActivitySeine=
().getTopiaId();
             int nbActivitys =3D route.sizeActivitySeine();
=20
-            if (code.equals("-16") && !activityCode.equals(ActivitySeineImpl=
.ACTIVITY_FIN_DE_VEILLE)) {
+            if (code.equals("-16") && !activitySeine.isActivityFinDeVeille()=
) {
=20
                 valid =3D validate_16(activitySeine, maree, route, nbActivit=
ys, false);
             }
=20
             switch (Integer.valueOf(code)) {
                 case 6:
-                    if (activityCode.equals(ActivitySeineImpl.ACTIVITY_DEBUT=
_DE_PECHE)) {
+                    if (vesselActivityId.equals(ActivitySeineImpl.ACTIVITY_D=
EBUT_DE_PECHE_ID)) {
                         valid =3D validate_6(activitySeine, maree, route, nb=
Activitys);
                     }
                     break;
                 case 7:
-                    if (activityCode.equals(ActivitySeineImpl.ACTIVITY_FIN_D=
E_PECHE)) {
+                    if (vesselActivityId.equals(ActivitySeineImpl.ACTIVITY_F=
IN_DE_PECHE_ID)) {
                         valid =3D validate_7(activitySeine, maree, route, nb=
Activitys);
                     }
                     break;
                 case 16:
-                    if (activityCode.equals(ActivitySeineImpl.ACTIVITY_FIN_D=
E_VEILLE)) {
-                        valid =3D validate_16(activitySeine, maree, route,
-                                            nbActivitys, true);
+                    if (activitySeine.isActivityFinDeVeille()) {
+                        valid =3D validate_16(activitySeine, maree, route, n=
bActivitys, true);
                     }
                     break;
             }
@@ -223,8 +222,8 @@ public class VesselActivityFieldValidator extends FieldVa=
lidatorSupport {
         //FIXME: sinon on verifier que l'activity qu'on veut cr=C3=A9er n'es=
t pas
         //FIXME: dans un intervalle (debut-fin)
         List<ActivitySeine> activitySeines =3D route.getActivitySeine();
-        Integer[] detectDebutSet =3D detectActivity(route, ActivitySeineImpl=
.ACTIVITY_DEBUT_DE_PECHE);
-        Integer[] detectFinSet =3D detectActivity(route, ActivitySeineImpl.A=
CTIVITY_FIN_DE_PECHE);
+        Integer[] detectDebutSet =3D Routes.detectActivities(route, Activity=
SeineImpl.ACTIVITY_DEBUT_DE_PECHE_ID);
+        Integer[] detectFinSet =3D Routes.detectActivities(route, ActivitySe=
ineImpl.ACTIVITY_FIN_DE_PECHE_ID);
         int nbDebutReal =3D 0;
         int lastDebutReal =3D 0;
         for (Integer i : detectDebutSet) {
@@ -273,8 +272,8 @@ public class VesselActivityFieldValidator extends FieldVa=
lidatorSupport {
             return false;
         }
         List<ActivitySeine> activitySeines =3D route.getActivitySeine();
-        Integer[] detectDebutSet =3D detectActivity(route, ActivitySeineImpl=
.ACTIVITY_DEBUT_DE_PECHE);
-        Integer[] detectFinSet =3D detectActivity(route, ActivitySeineImpl.A=
CTIVITY_FIN_DE_PECHE);
+        Integer[] detectDebutSet =3D Routes.detectActivities(route, Activity=
SeineImpl.ACTIVITY_DEBUT_DE_PECHE_ID);
+        Integer[] detectFinSet =3D Routes.detectActivities(route, ActivitySe=
ineImpl.ACTIVITY_FIN_DE_PECHE_ID);
         Integer lastFinSet =3D null;
         if (detectFinSet.length > 0) {
             lastFinSet =3D detectFinSet[detectFinSet.length - 1];
@@ -359,7 +358,7 @@ public class VesselActivityFieldValidator extends FieldVa=
lidatorSupport {
             // on est sur une activity de fin de veille           =20
             List<ActivitySeine> activitySeines =3D route.getActivitySeine();
             // une seule activity de fin de veille par route
-            Integer[] detectActivity =3D detectActivity(route, ActivitySeine=
Impl.ACTIVITY_FIN_DE_VEILLE);
+            Integer[] detectActivity =3D Routes.detectActivities(route, Acti=
vitySeineImpl.ACTIVITY_FIN_DE_VEILLE_ID);
             if (activitySeine.getTopiaId() =3D=3D null && detectActivity.len=
gth > 0) {
=20
                 log.info("il existe deja une activity de fin de veille!");
@@ -380,8 +379,8 @@ public class VesselActivityFieldValidator extends FieldVa=
lidatorSupport {
 //            }
             // il ne peut pas rester une activity de debut de peche sans fin
             // de set (sauf si non coup de senne ?)
-            Integer[] detectDebutSet =3D detectActivity(route, ActivitySeine=
Impl.ACTIVITY_DEBUT_DE_PECHE);
-            Integer[] detectFinSet =3D detectActivity(route, ActivitySeineIm=
pl.ACTIVITY_FIN_DE_PECHE);
+            Integer[] detectDebutSet =3D Routes.detectActivities(route, Acti=
vitySeineImpl.ACTIVITY_DEBUT_DE_PECHE_ID);
+            Integer[] detectFinSet =3D Routes.detectActivities(route, Activi=
tySeineImpl.ACTIVITY_FIN_DE_PECHE_ID);
             int nbDebutReal =3D 0;
             for (Integer i : detectDebutSet) {
                 ActivitySeine bActivitySeine =3D activitySeines.get(i);
@@ -423,23 +422,4 @@ public class VesselActivityFieldValidator extends FieldV=
alidatorSupport {
         return true;
     }
=20
-    /**
-     * Recupere les positions des activitys d'un certain type
-     *
-     * @param route la route =C3=A0 inspecter
-     * @param code  le code du type d'activit=C3=A9 =C3=A0 rechercher
-     * @return les positions des activitys d'un certain type donn=C3=A9
-     */
-    protected Integer[] detectActivity(Route route, String code) {
-        List<Integer> list =3D new ArrayList<Integer>();
-        int index =3D 0;
-        for (ActivitySeine a : route.getActivitySeine()) {
-            String c =3D a.getVesselActivitySeine().getCode();
-            if (code.equals(c)) {
-                list.add(index);
-            }
-            index++;
-        }
-        return list.toArray(new Integer[list.size()]);
-    }
 }

--=20
To stop receiving notification emails like this one, please contact
codelutin.com SCM administrator <admin+scm@list.forge.codelutin.com>.

--===============7732948896259298477==--


