From 481cf8d42613676a7e89cd490781c7da738c1d25 Mon Sep 17 00:00:00 2001 From: zapata Date: Tue, 24 Dec 2002 22:31:50 +0000 Subject: [PATCH] deleting a comment now unchecks the is_produced flag of the article the comment belongs to --- source/mircoders/module/ModuleComment.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/source/mircoders/module/ModuleComment.java b/source/mircoders/module/ModuleComment.java index 4a483b17..2a2c280e 100755 --- a/source/mircoders/module/ModuleComment.java +++ b/source/mircoders/module/ModuleComment.java @@ -77,6 +77,19 @@ public class ModuleComment extends AbstractModule } } + public void deleteById (String anId) throws ModuleException { + try { + Entity theEntity = theStorage.selectById((String)anId); + if (theEntity != null) + DatabaseContent.getInstance().setUnproduced("id=" + theEntity.getValue("to_media")); + + super.deleteById(anId); + } + catch (StorageObjectException e){ + throw new ModuleException(e.toString()); + } + } + /** * setValues in the Entity and updates them on the StorageObject */ @@ -84,7 +97,7 @@ public class ModuleComment extends AbstractModule try { Entity theEntity = theStorage.selectById((String)theValues.get("id")); if (theEntity == null) - throw new ModuleException("No Objekt with id in Database id: " + theValues.get("id")); + throw new ModuleException("No Object in the database with id " + theValues.get("id")); DatabaseContent.getInstance().setUnproduced("id=" + theEntity.getValue("to_media")); theEntity.setValues(theValues); theEntity.update(); -- 2.11.0