1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
13   */
14  
15  package com.liferay.portal.kernel.search;
16  
17  import com.liferay.portal.kernel.dao.orm.QueryUtil;
18  
19  import java.io.Serializable;
20  
21  import java.util.Map;
22  
23  /**
24   * <a href="SearchContext.java.html"><b><i>View Source</i></b></a>
25   *
26   * @author Brian Wing Shun Chan
27   * @author Julio Camarero
28   */
29  public class SearchContext implements Serializable {
30  
31      public long[] getAssetCategoryIds() {
32          return _assetCategoryIds;
33      }
34  
35      public String[] getAssetTagNames() {
36          return _assetTagNames;
37      }
38  
39      public Serializable getAttribute(String name) {
40          return _attributes.get(name);
41      }
42  
43      public Map<String, Serializable> getAttributes() {
44          return _attributes;
45      }
46  
47      public BooleanClause[] getBooleanClauses() {
48          return _booleanClauses;
49      }
50  
51      public long[] getCategoryIds() {
52          return _categoryIds;
53      }
54  
55      public long getCompanyId() {
56          return _companyId;
57      }
58  
59      public int getEnd() {
60          return _end;
61      }
62  
63      public long[] getFolderIds() {
64          return _folderIds;
65      }
66  
67      public long[] getGroupIds() {
68          return _groupIds;
69      }
70  
71      public String getKeywords() {
72          return _keywords;
73      }
74  
75      public long[] getNodeIds() {
76          return _nodeIds;
77      }
78  
79      public long getOwnerUserId() {
80          return _ownerUserId;
81      }
82  
83      public String[] getPortletIds() {
84          return _portletIds;
85      }
86  
87      public Sort[] getSorts() {
88          return _sorts;
89      }
90  
91      public int getStart() {
92          return _start;
93      }
94  
95      public long getUserId() {
96          return _userId;
97      }
98  
99      public boolean isAndSearch(){
100         return _andSearch;
101     }
102 
103     public boolean isScopeStrict() {
104         return _scopeStrict;
105     }
106 
107     public void setAndSearch(boolean andSearch) {
108         _andSearch = andSearch;
109     }
110 
111     public void setAssetCategoryIds(long[] assetCategoryIds) {
112         _assetCategoryIds = assetCategoryIds;
113     }
114 
115     public void setAssetTagNames(String[] assetTagNames) {
116         _assetTagNames = assetTagNames;
117     }
118 
119     public void setAttribute(String name, Serializable value) {
120         _attributes.put(name, value);
121     }
122 
123     public void setAttributes(Map<String, Serializable> attributes) {
124         _attributes = attributes;
125     }
126 
127     public void setBooleanClauses(BooleanClause[] booleanClauses) {
128         _booleanClauses = booleanClauses;
129     }
130 
131     public void setCategoryIds(long[] categoryIds) {
132         _categoryIds = categoryIds;
133     }
134 
135     public void setCompanyId(long companyId) {
136         _companyId = companyId;
137     }
138 
139     public void setEnd(int end) {
140         _end = end;
141     }
142 
143     public void setFolderIds(long[] folderIds) {
144         _folderIds = folderIds;
145     }
146 
147     public void setGroupIds(long[] groupIds) {
148         _groupIds = groupIds;
149     }
150 
151     public void setKeywords(String keywords) {
152         _keywords = keywords;
153     }
154 
155     public void setNodeIds(long[] nodeIds) {
156         _nodeIds = nodeIds;
157     }
158 
159     public void setOwnerUserId(long ownerUserId) {
160         _ownerUserId = ownerUserId;
161     }
162 
163     public void setPortletIds(String[] portletIds) {
164         _portletIds = portletIds;
165     }
166 
167     public void setScopeStrict(boolean scopeStrict) {
168         _scopeStrict = scopeStrict;
169     }
170 
171     public void setSorts(Sort[] sorts) {
172         _sorts = sorts;
173     }
174 
175     public void setStart(int start) {
176         _start = start;
177     }
178 
179     public void setUserId(long userId) {
180         _userId = userId;
181     }
182 
183     private boolean _andSearch;
184     private long[] _assetCategoryIds;
185     private String[] _assetTagNames;
186     private Map<String, Serializable> _attributes;
187     private BooleanClause[] _booleanClauses;
188     private long[] _categoryIds;
189     private long _companyId;
190     private int _end = QueryUtil.ALL_POS;
191     private long[] _folderIds;
192     private long[] _groupIds;
193     private String _keywords;
194     private long[] _nodeIds;
195     private long _ownerUserId;
196     private String[] _portletIds;
197     private boolean _scopeStrict = true;
198     private Sort[] _sorts;
199     private int _start = QueryUtil.ALL_POS;
200     private long _userId;
201 
202 }