KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mmbase > applications > community > taglib > DeleteTag


1 /*
2
3 This software is OSI Certified Open Source Software.
4 OSI Certified is a certification mark of the Open Source Initiative.
5
6 The license (Mozilla version 1.0) can be read at the MMBase site.
7 See http://www.MMBase.org/license
8
9 */

10 package org.mmbase.applications.community.taglib;
11
12 import javax.servlet.jsp.JspTagException JavaDoc;
13
14 import org.mmbase.bridge.Node;
15 import org.mmbase.bridge.Module;
16
17 import org.mmbase.bridge.jsp.taglib.NodeTag;
18
19 /**
20  *
21  * As NodeTag, but the node (which should be a message) will be removed after the body.
22  * Also removed are all replies to the message.
23  *
24  * @author Pierre van Rooden
25  * @version $Id: DeleteTag.java,v 1.5 2003/06/18 20:03:57 michiel Exp $
26  */

27  
28 public class DeleteTag extends NodeTag {
29
30     public void setMessage(String JavaDoc msg) throws JspTagException JavaDoc {
31         setNumber(msg);
32     }
33
34     public int doEndTag() throws JspTagException JavaDoc {
35         Module community=getCloudContext().getModule("communityprc");
36         if (community==null)
37             throw new JspTagException JavaDoc("Community module not available.");
38         Node node=getNodeVar();
39         community.getInfo("MESSAGE-"+node.getNumber()+"-DEL",pageContext.getRequest(),pageContext.getResponse());
40         return super.doEndTag();
41     }
42 }
43
Popular Tags