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