Source Code Cross Referenced for SearchContainer.java in  » Portal » liferay-portal-4.4.2 » com » liferay » portal » kernel » dao » search » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Portal » liferay portal 4.4.2 » com.liferay.portal.kernel.dao.search 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         * Copyright (c) 2000-2008 Liferay, Inc. All rights reserved.
003:         *
004:         * Permission is hereby granted, free of charge, to any person obtaining a copy
005:         * of this software and associated documentation files (the "Software"), to deal
006:         * in the Software without restriction, including without limitation the rights
007:         * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
008:         * copies of the Software, and to permit persons to whom the Software is
009:         * furnished to do so, subject to the following conditions:
010:         *
011:         * The above copyright notice and this permission notice shall be included in
012:         * all copies or substantial portions of the Software.
013:         *
014:         * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
015:         * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
016:         * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
017:         * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
018:         * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
019:         * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
020:         * SOFTWARE.
021:         */package com.liferay.portal.kernel.dao.search;
022:
023:        import com.liferay.portal.kernel.util.OrderByComparator;
024:        import com.liferay.portal.kernel.util.ParamUtil;
025:
026:        import java.util.ArrayList;
027:        import java.util.List;
028:        import java.util.Map;
029:
030:        import javax.portlet.PortletURL;
031:        import javax.portlet.RenderRequest;
032:
033:        /**
034:         * <a href="SearchContainer.java.html"><b><i>View Source</i></b></a>
035:         *
036:         * @author Brian Wing Shun Chan
037:         *
038:         */
039:        public class SearchContainer {
040:
041:            public static final String DEFAULT_CUR_PARAM = "cur";
042:
043:            public static final int DEFAULT_CUR_VALUE = 1;
044:
045:            public static final int DEFAULT_DELTA = 20;
046:
047:            public SearchContainer() {
048:            }
049:
050:            public SearchContainer(RenderRequest req,
051:                    DisplayTerms displayTerms, DisplayTerms searchTerms,
052:                    String curParam, int delta, PortletURL iteratorURL,
053:                    List headerNames, String emptyResultsMessage) {
054:
055:                _displayTerms = displayTerms;
056:                _searchTerms = searchTerms;
057:
058:                _curParam = curParam;
059:                _curValue = ParamUtil.get(req, _curParam, 1);
060:                setDelta(delta);
061:
062:                _iteratorURL = iteratorURL;
063:
064:                _iteratorURL.setParameter(DisplayTerms.KEYWORDS, ParamUtil
065:                        .getString(req, DisplayTerms.KEYWORDS));
066:                _iteratorURL.setParameter(DisplayTerms.ADVANCED_SEARCH, String
067:                        .valueOf(ParamUtil.getBoolean(req,
068:                                DisplayTerms.ADVANCED_SEARCH)));
069:                _iteratorURL.setParameter(DisplayTerms.AND_OPERATOR, String
070:                        .valueOf(ParamUtil.getBoolean(req,
071:                                DisplayTerms.AND_OPERATOR, true)));
072:
073:                if (headerNames != null) {
074:                    _headerNames = new ArrayList(headerNames.size());
075:
076:                    _headerNames.addAll(headerNames);
077:                }
078:
079:                _emptyResultsMessage = emptyResultsMessage;
080:            }
081:
082:            public DisplayTerms getDisplayTerms() {
083:                return _displayTerms;
084:            }
085:
086:            public DisplayTerms getSearchTerms() {
087:                return _searchTerms;
088:            }
089:
090:            public String getCurParam() {
091:                return _curParam;
092:            }
093:
094:            public int getCurValue() {
095:                return _curValue;
096:            }
097:
098:            public int getDelta() {
099:                return _delta;
100:            }
101:
102:            public void setDelta(int delta) {
103:                if (delta <= 0) {
104:                    _delta = DEFAULT_DELTA;
105:                } else {
106:                    _delta = delta;
107:                }
108:
109:                _calculateStartAndEnd();
110:            }
111:
112:            public int getStart() {
113:                return _start;
114:            }
115:
116:            public int getEnd() {
117:                return _end;
118:            }
119:
120:            public int getResultEnd() {
121:                return _resultEnd;
122:            }
123:
124:            public int getTotal() {
125:                return _total;
126:            }
127:
128:            public void setTotal(int total) {
129:                _total = total;
130:
131:                if (((_curValue - 1) * _delta) > _total) {
132:                    _curValue = DEFAULT_CUR_VALUE;
133:                }
134:
135:                _calculateStartAndEnd();
136:            }
137:
138:            public List getResults() {
139:                return _results;
140:            }
141:
142:            public void setResults(List results) {
143:                _results = results;
144:            }
145:
146:            public List getResultRows() {
147:                return _resultRows;
148:            }
149:
150:            public PortletURL getIteratorURL() {
151:                return _iteratorURL;
152:            }
153:
154:            public void setIteratorURL(PortletURL iteratorURL) {
155:                _iteratorURL = iteratorURL;
156:            }
157:
158:            public List getHeaderNames() {
159:                return _headerNames;
160:            }
161:
162:            public void setHeaderNames(List headerNames) {
163:                _headerNames = headerNames;
164:            }
165:
166:            public Map getOrderableHeaders() {
167:                return _orderableHeaders;
168:            }
169:
170:            public void setOrderableHeaders(Map orderableHeaders) {
171:                _orderableHeaders = orderableHeaders;
172:            }
173:
174:            public String getOrderByCol() {
175:                return _orderByCol;
176:            }
177:
178:            public void setOrderByCol(String orderByCol) {
179:                _orderByCol = orderByCol;
180:            }
181:
182:            public String getOrderByType() {
183:                return _orderByType;
184:            }
185:
186:            public void setOrderByType(String orderByType) {
187:                _orderByType = orderByType;
188:            }
189:
190:            public OrderByComparator getOrderByComparator() {
191:                return _orderByComparator;
192:            }
193:
194:            public void setOrderByComparator(OrderByComparator orderByComparator) {
195:                _orderByComparator = orderByComparator;
196:            }
197:
198:            public String getEmptyResultsMessage() {
199:                return _emptyResultsMessage;
200:            }
201:
202:            public void setEmptyResultsMessage(String emptyResultsMessage) {
203:                _emptyResultsMessage = emptyResultsMessage;
204:            }
205:
206:            public RowChecker getRowChecker() {
207:                return _rowChecker;
208:            }
209:
210:            public void setRowChecker(RowChecker rowChecker) {
211:                _rowChecker = rowChecker;
212:            }
213:
214:            public boolean isHover() {
215:                return _hover;
216:            }
217:
218:            public void setHover(boolean hover) {
219:                _hover = hover;
220:            }
221:
222:            private void _calculateStartAndEnd() {
223:                _start = (_curValue - 1) * _delta;
224:                _end = _start + _delta;
225:
226:                _resultEnd = _end;
227:
228:                if (_resultEnd > _total) {
229:                    _resultEnd = _total;
230:                }
231:            }
232:
233:            private DisplayTerms _displayTerms;
234:            private DisplayTerms _searchTerms;
235:            private String _curParam = DEFAULT_CUR_PARAM;
236:            private int _curValue;
237:            private int _delta = DEFAULT_DELTA;
238:            private int _start;
239:            private int _end;
240:            private int _resultEnd;
241:            private int _total;
242:            private List _results = new ArrayList();
243:            private List _resultRows = new ArrayList();
244:            private PortletURL _iteratorURL;
245:            private List _headerNames;
246:            private Map _orderableHeaders;
247:            private String _orderByCol;
248:            private String _orderByType;
249:            private OrderByComparator _orderByComparator;
250:            private String _emptyResultsMessage;
251:            private RowChecker _rowChecker;
252:            private boolean _hover = true;
253:
254:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.