KickJava   Java API By Example, From Geeks To Geeks.

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


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  * Make query distinct (or not)
21  *
22  * @author Michiel Meeuwissen
23  * @since MMBase-1.7
24  * @version $Id: QueryDistinctTag.java,v 1.1 2003/12/18 09:05:47 michiel Exp $
25  */

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

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