we check now if the parent article is allowed for publication while adding a child...
authorngu <ngu>
Sun, 26 Oct 2008 13:37:28 +0000 (13:37 +0000)
committerngu <ngu>
Sun, 26 Oct 2008 13:37:28 +0000 (13:37 +0000)
source/mircoders/localizer/basic/MirBasicChildArticlePostingHandler.java

index 311f126..4e346ca 100755 (executable)
@@ -72,7 +72,14 @@ public class MirBasicChildArticlePostingHandler extends MirBasicArticlePostingHa
     String parentId = aRequest.getParameter("to_content");
     if (parentId==null)
       throw new SessionExc("initializeSession: parent id not set!");
+    // check if the parent article is published.
+    EntityAdapter article = MirGlobal.localizer().dataModel().adapterModel().makeEntityAdapter("content", 
+      DatabaseContent.getInstance().selectById(parentId));
+    if (!MirGlobal.localizer().openPostings().allowArticlePublication((EntityContent)article.getEntity())) {
+      throw new ServletModuleExc("Illegal article");
+    }
+
 
     aSession.setAttribute("to_content", parentId);
   }
-}
\ No newline at end of file
+}