001    /**
002     * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.kernel.search;
016    
017    import com.liferay.portal.kernel.dao.orm.QueryUtil;
018    
019    import java.io.Serializable;
020    
021    import java.util.Map;
022    
023    /**
024     * @author Brian Wing Shun Chan
025     * @author Julio Camarero
026     */
027    public class SearchContext implements Serializable {
028    
029            public long[] getAssetCategoryIds() {
030                    return _assetCategoryIds;
031            }
032    
033            public String[] getAssetTagNames() {
034                    return _assetTagNames;
035            }
036    
037            public Serializable getAttribute(String name) {
038                    return _attributes.get(name);
039            }
040    
041            public Map<String, Serializable> getAttributes() {
042                    return _attributes;
043            }
044    
045            public BooleanClause[] getBooleanClauses() {
046                    return _booleanClauses;
047            }
048    
049            public long[] getCategoryIds() {
050                    return _categoryIds;
051            }
052    
053            public long getCompanyId() {
054                    return _companyId;
055            }
056    
057            public int getEnd() {
058                    return _end;
059            }
060    
061            public long[] getFolderIds() {
062                    return _folderIds;
063            }
064    
065            public long[] getGroupIds() {
066                    return _groupIds;
067            }
068    
069            public String getKeywords() {
070                    return _keywords;
071            }
072    
073            public long[] getNodeIds() {
074                    return _nodeIds;
075            }
076    
077            public long getOwnerUserId() {
078                    return _ownerUserId;
079            }
080    
081            public String[] getPortletIds() {
082                    return _portletIds;
083            }
084    
085            public Sort[] getSorts() {
086                    return _sorts;
087            }
088    
089            public int getStart() {
090                    return _start;
091            }
092    
093            public long getUserId() {
094                    return _userId;
095            }
096    
097            public boolean isAndSearch(){
098                    return _andSearch;
099            }
100    
101            public boolean isScopeStrict() {
102                    return _scopeStrict;
103            }
104    
105            public void setAndSearch(boolean andSearch) {
106                    _andSearch = andSearch;
107            }
108    
109            public void setAssetCategoryIds(long[] assetCategoryIds) {
110                    _assetCategoryIds = assetCategoryIds;
111            }
112    
113            public void setAssetTagNames(String[] assetTagNames) {
114                    _assetTagNames = assetTagNames;
115            }
116    
117            public void setAttribute(String name, Serializable value) {
118                    _attributes.put(name, value);
119            }
120    
121            public void setAttributes(Map<String, Serializable> attributes) {
122                    _attributes = attributes;
123            }
124    
125            public void setBooleanClauses(BooleanClause[] booleanClauses) {
126                    _booleanClauses = booleanClauses;
127            }
128    
129            public void setCategoryIds(long[] categoryIds) {
130                    _categoryIds = categoryIds;
131            }
132    
133            public void setCompanyId(long companyId) {
134                    _companyId = companyId;
135            }
136    
137            public void setEnd(int end) {
138                    _end = end;
139            }
140    
141            public void setFolderIds(long[] folderIds) {
142                    _folderIds = folderIds;
143            }
144    
145            public void setGroupIds(long[] groupIds) {
146                    _groupIds = groupIds;
147            }
148    
149            public void setKeywords(String keywords) {
150                    _keywords = keywords;
151            }
152    
153            public void setNodeIds(long[] nodeIds) {
154                    _nodeIds = nodeIds;
155            }
156    
157            public void setOwnerUserId(long ownerUserId) {
158                    _ownerUserId = ownerUserId;
159            }
160    
161            public void setPortletIds(String[] portletIds) {
162                    _portletIds = portletIds;
163            }
164    
165            public void setScopeStrict(boolean scopeStrict) {
166                    _scopeStrict = scopeStrict;
167            }
168    
169            public void setSorts(Sort[] sorts) {
170                    _sorts = sorts;
171            }
172    
173            public void setStart(int start) {
174                    _start = start;
175            }
176    
177            public void setUserId(long userId) {
178                    _userId = userId;
179            }
180    
181            private boolean _andSearch;
182            private long[] _assetCategoryIds;
183            private String[] _assetTagNames;
184            private Map<String, Serializable> _attributes;
185            private BooleanClause[] _booleanClauses;
186            private long[] _categoryIds;
187            private long _companyId;
188            private int _end = QueryUtil.ALL_POS;
189            private long[] _folderIds;
190            private long[] _groupIds;
191            private String _keywords;
192            private long[] _nodeIds;
193            private long _ownerUserId;
194            private String[] _portletIds;
195            private boolean _scopeStrict = true;
196            private Sort[] _sorts;
197            private int _start = QueryUtil.ALL_POS;
198            private long _userId;
199    
200    }