1 10 package org.mmbase.applications.community.taglib; 11 12 import java.util.*; 13 14 import javax.servlet.jsp.JspTagException ; 15 16 import org.mmbase.bridge.*; 17 import org.mmbase.bridge.jsp.taglib.*; 18 import org.mmbase.bridge.jsp.taglib.util.Attribute; 19 20 26 27 public class WhoTag extends AbstractNodeListTag { 28 29 private String channel= null; 30 31 protected Module community = null; 32 33 public void setChannel(String channel) throws JspTagException { 34 this.channel= getAttributeValue(channel); 35 } 36 37 public int doStartTag() throws JspTagException { 38 community=getCloudContext().getModule("communityprc"); 41 if (community==null) throw new JspTagException ("Community module is not active"); 42 if (channel==null) { Node n = getNode(); 44 channel = n.getStringValue("number"); 45 } 46 47 Hashtable params=new Hashtable(); 48 params.put("CHANNEL",channel); 49 try { 50 Cloud cloud=getCloudVar(); 51 params.put("CLOUD",cloud); 52 } catch (JspTagException e) {} 53 54 if (orderby != null) params.put("SORTFIELDS",orderby); 55 if (directions !=null) params.put("SORTDIRS", directions); 56 Attribute max = listHelper.getMax(); 57 Attribute offset = listHelper.getOffset(); 58 if (offset != Attribute.NULL) params.put("FROMCOUNT", "" + offset.getInt(this, 0)); 59 if (max != Attribute.NULL) params.put("MAX", max.getString(this)); 60 NodeList nodes = community.getList("WHO", params, pageContext.getRequest(), pageContext.getResponse()); 61 return setReturnValues(nodes,false); 62 } 63 } | Popular Tags |