Index: topia2/src/java/org/codelutin/topia/persistence/flatfile/TopiaDAOFlatFile.java diff -u topia2/src/java/org/codelutin/topia/persistence/flatfile/TopiaDAOFlatFile.java:1.8 topia2/src/java/org/codelutin/topia/persistence/flatfile/TopiaDAOFlatFile.java:1.9 --- topia2/src/java/org/codelutin/topia/persistence/flatfile/TopiaDAOFlatFile.java:1.8 Mon Sep 4 09:55:22 2006 +++ topia2/src/java/org/codelutin/topia/persistence/flatfile/TopiaDAOFlatFile.java Mon Oct 23 15:01:58 2006 @@ -23,9 +23,9 @@ * * @author poussin * - * @version $Revision: 1.8 $ + * @version $Revision: 1.9 $ * - * Last update: $Date: 2006/09/04 09:55:22 $ by : $Author: ruchaud $ + * Last update: $Date: 2006/10/23 15:01:58 $ by : $Author: ruchaud $ */ package org.codelutin.topia.persistence.flatfile; @@ -253,8 +253,7 @@ * @see org.codelutin.topia.TopiaDAO#update() */ public Entity update(Entity e) throws TopiaException { - Serializable id = getId(e); - getContext().fireVetoableUpdate(entityClass, id); + getContext().getFiresSupport().fireOnPreUpdate(getContext(), e, new Object[]{}); // le topiaId contient le nom du fichier a partir duquel l'entity // a ete chargé @@ -315,7 +314,7 @@ out.close(); } - getContext().fireOnUpdated(entityClass, id, e); + getContext().getFiresSupport().fireOnPostUpdate(getContext(), e, new Object[]{}); return e; } catch (IllegalAccessException eee) { @@ -335,8 +334,7 @@ * @see org.codelutin.topia.TopiaDAO#delete() */ public void delete(Entity e) throws TopiaException { - Serializable id = getId(e); - getContext().fireVetoableDelete(entityClass, id); + getContext().getFiresSupport().fireOnPreDelete(getContext(), e, new Object[]{}); // le topiaId contient le nom du fichier a partir duquel l'entity // a ete chargé String oldId = e.getTopiaId().toString(); @@ -344,7 +342,7 @@ cache.remove(f); f.delete(); - getContext().fireOnDeleted(entityClass, id, e); + getContext().getFiresSupport().fireOnPostDelete(getContext(), e, new Object[]{}); } @@ -374,6 +372,7 @@ protected Entity findByFile(File f) throws TopiaException { long lastModified = f.lastModified(); Entity e = cache.get(f); + getContext().getFiresSupport().fireOnPreLoad(getContext(), e, new Object[]{}); // si on a pas encore l'entity ou que le fichier est plus recent // il faut relire l'entité if (e == null) { @@ -383,7 +382,6 @@ // nouvelle transaction // || e.getTopiaCreateDate().getTime() < lastModified) { String keyValue = FileUtil.basename(f, "." + ext); - getContext().fireVetoableLoad(entityClass, keyValue); if (e == null) { e = instanciateNew(); @@ -433,7 +431,7 @@ // on le met en cache car on doit toujours retourner // la meme instance au cours du temps cache.put(f, e); - getContext().fireOnLoaded(entityClass, keyValue, e); + getContext().getFiresSupport().fireOnPostLoad(getContext(), e, new Object[]{}); } return e; }