This is an automated email from the git hooks/post-receive script. New commit to branch feature/8148-correctionParanamer in repository tutti. See https://gitlab.nuiton.org/codelutin/tutti.git commit 42812cbb7aa50808756f85d2421abe587efd35de Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Tue Mar 22 13:59:46 2016 +0100 mettre a jour le cache de référentiel après la sauvegarde d'un element de ce référentiel (see #8148). --- .../ird/observe/ui/content/ContentUIHandler.java | 1 + .../ui/content/ref/ContentReferenceUIHandler.java | 44 ++++++---------------- 2 files changed, 12 insertions(+), 33 deletions(-) diff --git a/observe-application-swing/src/main/java/fr/ird/observe/ui/content/ContentUIHandler.java b/observe-application-swing/src/main/java/fr/ird/observe/ui/content/ContentUIHandler.java index eab6b00..fe3b9b5 100644 --- a/observe-application-swing/src/main/java/fr/ird/observe/ui/content/ContentUIHandler.java +++ b/observe-application-swing/src/main/java/fr/ird/observe/ui/content/ContentUIHandler.java @@ -976,6 +976,7 @@ public abstract class ContentUIHandler<E extends IdDto> { list.setData(data); list.putClientProperty("data", data); + list.getList().setListData(data.toArray()); } diff --git a/observe-application-swing/src/main/java/fr/ird/observe/ui/content/ref/ContentReferenceUIHandler.java b/observe-application-swing/src/main/java/fr/ird/observe/ui/content/ref/ContentReferenceUIHandler.java index cca8e33..da303ce 100644 --- a/observe-application-swing/src/main/java/fr/ird/observe/ui/content/ref/ContentReferenceUIHandler.java +++ b/observe-application-swing/src/main/java/fr/ird/observe/ui/content/ref/ContentReferenceUIHandler.java @@ -52,6 +52,7 @@ import jaxx.runtime.swing.CardLayout2Ext; import jaxx.runtime.swing.ErrorDialogUI; import jaxx.runtime.swing.editor.bean.BeanListHeader; import jaxx.runtime.validator.swing.SwingValidatorUtil; +import org.apache.commons.collections.MapUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.time.FastDateFormat; import org.apache.commons.logging.Log; @@ -682,6 +683,7 @@ public class ContentReferenceUIHandler<E extends ReferentialDto> extends Content } SaveResultDto saveResult = getReferentialService().save(bean); + saveResult.toDto(bean); if (bean instanceof ProgramDto) { @@ -693,6 +695,10 @@ public class ContentReferenceUIHandler<E extends ReferentialDto> extends Content } + // on met a jour le referentiel dans le cache et le model + ReferenceSetRequestDefinitions requestDefinition = ReferenceSetRequestDefinitions.get(getBeanType()); + loadReferentialReferenceSetsInModel(requestDefinition.name()); + return true; } @@ -746,6 +752,10 @@ public class ContentReferenceUIHandler<E extends ReferentialDto> extends Content treeHelper.updateProgram((ProgramDto) bean); } + // on met a jour le referentiel dans le cache et le model + ReferenceSetRequestDefinitions requestDefinition = ReferenceSetRequestDefinitions.get(getBeanType()); + loadReferentialReferenceSetsInModel(requestDefinition.name()); + return true; } @@ -762,7 +772,7 @@ public class ContentReferenceUIHandler<E extends ReferentialDto> extends Content // recherche des utilisation du bean dans la base DtoMap usages = getReferentialService().findAllUsages(bean); - if (usages.isEmpty()) { + if (MapUtils.isEmpty(usages)) { if (log.isDebugEnabled()) { log.debug("No usage found, no warning to display"); } @@ -803,38 +813,6 @@ public class ContentReferenceUIHandler<E extends ReferentialDto> extends Content return incomingReferences; } - //FIXME -// @Override -// protected E onPreCreate(TopiaContext tx, -// Object parent, -// E bean) throws TopiaException { -// -// // par defaut, les objets en creation sont activés -// bean.setTopiaId(null); -// bean.setTopiaCreateDate(null); -// bean.setTopiaVersion(0); -// bean.setStatus(ReferenceStatus.enabled); -// return bean; -// } - - //FIXME -// @Override -// protected final E onCreate(TopiaContext tx, -// Object parent, -// E editBean) throws TopiaException { -// -// // obtention du dictionnaire de la clef metier -// Map<String, Object> properties = -// getLoadBinder().obtainProperties(editBean, getModel().getNaturalIds()); -// -// // creation de l'entite -// TopiaDAO<E> dao = getDataSource().getDAO(tx, getModel().getBeanType()); -// E beanToSave = dao.create(properties); -// -// // application du topiaId sur le bean d'édition -// editBean.setTopiaId(beanToSave.getTopiaId()); -// return beanToSave; -// } public <I> int[] updateIndices(JList<I> jlist, Collection<I> list) { if (log.isDebugEnabled()) { -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.