KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mmbase > bridge > jsp > taglib > containers > QueryMaxNumberTag


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.bridge.jsp.taglib.containers;
11
12 import javax.servlet.jsp.JspTagException JavaDoc;
13
14 import org.mmbase.bridge.Query;
15 import org.mmbase.bridge.jsp.taglib.CloudReferrerTag;
16 import org.mmbase.bridge.jsp.taglib.util.Attribute;
17 //import org.mmbase.util.logging.*;
18

19 /**
20  * Applies a maxnumber to the surrounding query.
21  *
22  * @author Michiel Meeuwissen
23  * @since MMBase-1.7
24  * @version $Id: QueryMaxNumberTag.java,v 1.1 2003/12/18 09:05:47 michiel Exp $
25  */

26 public class QueryMaxNumberTag extends CloudReferrerTag implements QueryContainerReferrer {
27
28     //private static final Logger log = Logging.getLoggerInstance(QueryMaxNumberTag.class);
29

30     protected Attribute container = Attribute.NULL;
31
32     protected Attribute max = Attribute.NULL;
33
34     public void setContainer(String JavaDoc c) throws JspTagException JavaDoc {
35         container = getAttribute(c);
36     }
37
38     public void setValue(String JavaDoc a) throws JspTagException JavaDoc {
39         max = getAttribute(a);
40     }
41
42
43     public int doStartTag() throws JspTagException JavaDoc {
44         QueryContainer c = (QueryContainer) findParentTag(QueryContainer.class, (String JavaDoc) container.getValue(this));
45         Query query = c.getQuery();
46         query.setMaxNumber(max.getInt(this, -1));
47         return SKIP_BODY;
48     }
49
50 }
51
Popular Tags