1 10 package org.mmbase.applications.community.taglib; 11 12 import javax.servlet.jsp.JspTagException ; 13 14 import org.mmbase.bridge.Node; 15 import org.mmbase.bridge.Module; 16 17 import org.mmbase.bridge.jsp.taglib.NodeTag; 18 19 26 27 public class ChannelTag extends NodeTag { 28 29 public final static String OPEN = "OPEN"; 30 public final static String READONLY = "READONLY"; 31 public final static String CLOSE = "CLOSE"; 32 33 String action=OPEN; 34 35 public void setChannel(String c) throws JspTagException { 36 setNumber(c); 37 } 38 39 public void setAction(String c) throws JspTagException { 40 action=getAttributeValue(c).toUpperCase(); 41 if (!action.equals(OPEN) && 42 !action.equals(CLOSE) && 43 !action.equals(READONLY)) { 44 throw new JspTagException ("Action need be one of OPEN, CLOSE or READONLY."); 45 } 46 } 47 48 public int doStartTag() throws JspTagException { 49 super.doStartTag() ; 50 Module community=getCloudContext().getModule("communityprc"); 51 Node node=getNodeVar(); 52 community.getInfo("CHANNEL-"+node.getNumber()+"-"+action,pageContext.getRequest(),pageContext.getResponse()); 53 return EVAL_BODY_BUFFERED; 54 } 55 } 56 | Popular Tags |