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 27 28 public class ConnectionTag extends NodeTag { 29 30 public final static String JOIN = "JOIN"; 31 public final static String LEAVE = "LEAVE"; 32 public final static String STILLACTIVE = "STILLACTIVE"; 33 34 String channel=null; 35 String action=STILLACTIVE; 36 37 public void setChannel(String c) throws JspTagException { 38 channel=getAttributeValue(c); 39 } 40 41 public void setAction(String a) throws JspTagException { 42 action=getAttributeValue(a).toUpperCase(); 43 if (!action.equals(JOIN) && 44 !action.equals(LEAVE) && 45 !action.equals(STILLACTIVE)) { 46 throw new JspTagException ("Action need be one of JOIN, LEAVE or STILLACTIVE."); 47 } 48 } 49 50 public void setUser(String u) throws JspTagException { 51 setNumber(u); 52 } 53 54 public int doStartTag() throws JspTagException { 55 super.doStartTag() ; 56 Module community=getCloudContext().getModule("communityprc"); 57 Node node=getNodeVar(); 58 community.getInfo("CHANNEL-"+channel+"-"+action+"-"+node.getNumber(),pageContext.getRequest(),pageContext.getResponse()); 59 return EVAL_BODY_BUFFERED; 60 } 61 } 62 | Popular Tags |