1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   *
12   *
13   */
14  
15  package com.liferay.portal.kernel.dao.search;
16  
17  import com.liferay.portal.kernel.util.ParamUtil;
18  
19  import javax.portlet.PortletRequest;
20  
21  import javax.servlet.http.HttpServletRequest;
22  
23  /**
24   * <a href="DisplayTerms.java.html"><b><i>View Source</i></b></a>
25   *
26   * @author Brian Wing Shun Chan
27   */
28  public class DisplayTerms {
29  
30      public static final String KEYWORDS = "keywords";
31  
32      public static final String ADVANCED_SEARCH = "advancedSearch";
33  
34      public static final String AND_OPERATOR = "andOperator";
35  
36      public DisplayTerms(HttpServletRequest request) {
37          keywords = ParamUtil.getString(request, KEYWORDS);
38          advancedSearch = ParamUtil.getBoolean(request, ADVANCED_SEARCH);
39          andOperator = ParamUtil.getBoolean(request, AND_OPERATOR, true);
40      }
41  
42      public DisplayTerms(PortletRequest portletRequest) {
43          keywords = ParamUtil.getString(portletRequest, KEYWORDS);
44          advancedSearch = ParamUtil.getBoolean(portletRequest, ADVANCED_SEARCH);
45          andOperator = ParamUtil.getBoolean(portletRequest, AND_OPERATOR, true);
46      }
47  
48      public String getKeywords() {
49          return keywords;
50      }
51  
52      public boolean isAdvancedSearch() {
53          return advancedSearch;
54      }
55  
56      public void setAdvancedSearch(boolean advancedSearch) {
57          this.advancedSearch = advancedSearch;
58      }
59  
60      public boolean isAndOperator() {
61          return andOperator;
62      }
63  
64      protected String keywords;
65      protected boolean advancedSearch;
66      protected boolean andOperator;
67  
68  }