KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > info > magnolia > module > admininterface > lists > AbstractSimpleSearchList


1 /**
2  *
3  * Magnolia and its source-code is licensed under the LGPL.
4  * You may copy, adapt, and redistribute this file for commercial or non-commercial use.
5  * When copying, adapting, or redistributing this document in keeping with the guidelines above,
6  * you are required to provide proper attribution to obinary.
7  * If you reproduce or distribute the document without making any substantive modifications to its content,
8  * please use the following attribution line:
9  *
10  * Copyright 1993-2005 obinary Ltd. (http://www.obinary.com) All rights reserved.
11  *
12  */

13 package info.magnolia.module.admininterface.lists;
14
15 import info.magnolia.cms.gui.controlx.list.ListControl;
16 import info.magnolia.cms.gui.controlx.search.SearchConfig;
17 import info.magnolia.cms.gui.controlx.search.SearchableListModel;
18 import info.magnolia.cms.gui.controlx.search.SimpleSearchUtil;
19 import info.magnolia.cms.gui.query.SearchQuery;
20 import info.magnolia.cms.util.FreeMarkerUtil;
21
22 import javax.servlet.http.HttpServletRequest JavaDoc;
23 import javax.servlet.http.HttpServletResponse JavaDoc;
24
25
26 /**
27  * @author Philipp Bracher
28  * @version $Revision: 6341 $ ($Author: philipp $)
29  */

30 public abstract class AbstractSimpleSearchList extends AbstractList {
31
32     /**
33      * @param name
34      * @param request
35      * @param response
36      */

37     public AbstractSimpleSearchList(String JavaDoc name, HttpServletRequest JavaDoc request, HttpServletResponse JavaDoc response) {
38         super(name, request, response);
39     }
40
41     private String JavaDoc searchStr = "";
42
43     /**
44      * @see info.magnolia.module.admininterface.lists.AbstractList#onRender()
45      */

46     public String JavaDoc onRender() {
47         String JavaDoc str = super.onRender();
48         str += FreeMarkerUtil.process(AbstractSimpleSearchList.class, this);
49         return str;
50     }
51
52     /**
53      * @return Returns the searchStr.
54      */

55     public String JavaDoc getSearchStr() {
56         return this.searchStr;
57     }
58
59     /**
60      * @param searchStr The searchStr to set.
61      */

62     public void setSearchStr(String JavaDoc searchStr) {
63         this.searchStr = searchStr;
64     }
65
66     /**
67      * @see info.magnolia.module.admininterface.lists.AbstractList#configureList(info.magnolia.cms.gui.controlx.list.ListControl)
68      */

69     public void initList(ListControl list) {
70         super.initList(list);
71         ((SearchableListModel) list.getModel()).setQuery(this.getQuery());
72     }
73
74     /**
75      * @return
76      */

77     public SearchQuery getQuery() {
78         return SimpleSearchUtil.getSimpleSearchQuery(this.getSearchStr(), this.getSearchConfig());
79     }
80
81     /**
82      * @return
83      */

84     public abstract SearchConfig getSearchConfig();
85
86 }
87
Popular Tags