001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portal.kernel.search;
016    
017    import com.liferay.portal.kernel.util.StringPool;
018    import com.liferay.portal.security.permission.PermissionChecker;
019    
020    import java.util.List;
021    import java.util.Locale;
022    
023    import javax.portlet.PortletRequest;
024    import javax.portlet.PortletResponse;
025    import javax.portlet.PortletURL;
026    
027    /**
028     * @author Brian Wing Shun Chan
029     */
030    public class DummyIndexer implements Indexer {
031    
032            @Override
033            public void addRelatedEntryFields(Document document, Object obj) {
034            }
035    
036            @Override
037            public void delete(long companyId, String uid) {
038            }
039    
040            @Override
041            public void delete(Object obj) {
042            }
043    
044            @Override
045            public String[] getClassNames() {
046                    return new String[0];
047            }
048    
049            @Override
050            public Document getDocument(Object obj) {
051                    return null;
052            }
053    
054            @Override
055            public BooleanQuery getFacetQuery(
056                    String className, SearchContext searchContext) {
057    
058                    return null;
059            }
060    
061            @Override
062            public BooleanQuery getFullQuery(SearchContext searchContext) {
063                    return null;
064            }
065    
066            @Override
067            public IndexerPostProcessor[] getIndexerPostProcessors() {
068                    return new IndexerPostProcessor[0];
069            }
070    
071            @Override
072            public String getPortletId() {
073                    return StringPool.BLANK;
074            }
075    
076            @Override
077            public String getSearchEngineId() {
078                    return StringPool.BLANK;
079            }
080    
081            @Override
082            public String getSortField(String orderByCol) {
083                    return StringPool.BLANK;
084            }
085    
086            @Override
087            public String getSortField(String orderByCol, int sortType) {
088                    return StringPool.BLANK;
089            }
090    
091            /**
092             * @deprecated As of 7.0.0, replaced by {@link #getSummary(Document, Locale,
093             *             String, PortletURL, PortletRequest, PortletResponse)}
094             */
095            @Deprecated
096            @Override
097            public Summary getSummary(
098                    Document document, Locale locale, String snippet,
099                    PortletURL portletURL) {
100    
101                    return null;
102            }
103    
104            @Override
105            public Summary getSummary(
106                    Document document, Locale locale, String snippet, PortletURL portletURL,
107                    PortletRequest portletRequest, PortletResponse portletResponse) {
108    
109                    return null;
110            }
111    
112            @Override
113            public boolean hasPermission(
114                    PermissionChecker permissionChecker, String entryClassName,
115                    long entryClassPK, String actionId) {
116    
117                    return false;
118            }
119    
120            @Override
121            public boolean isFilterSearch() {
122                    return false;
123            }
124    
125            @Override
126            public boolean isPermissionAware() {
127                    return false;
128            }
129    
130            @Override
131            public boolean isStagingAware() {
132                    return false;
133            }
134    
135            @Override
136            public boolean isVisible(long classPK, int status) throws Exception {
137                    return true;
138            }
139    
140            @Override
141            public boolean isVisibleRelatedEntry(long classPK, int status)
142                    throws Exception {
143    
144                    return true;
145            }
146    
147            @Override
148            public void postProcessContextQuery(
149                    BooleanQuery contextQuery, SearchContext searchContext) {
150            }
151    
152            @Override
153            public void postProcessSearchQuery(
154                    BooleanQuery searchQuery, SearchContext searchContext) {
155            }
156    
157            @Override
158            public void registerIndexerPostProcessor(
159                    IndexerPostProcessor indexerPostProcessor) {
160            }
161    
162            @Override
163            public void reindex(Object obj) {
164            }
165    
166            @Override
167            public void reindex(String className, long classPK) {
168            }
169    
170            @Override
171            public void reindex(String[] ids) {
172            }
173    
174            @Override
175            public void reindexDDMStructures(List<Long> ddmStructureIds) {
176            }
177    
178            @Override
179            public Hits search(SearchContext searchContext) {
180                    return null;
181            }
182    
183            @Override
184            public void unregisterIndexerPostProcessor(
185                    IndexerPostProcessor indexerPostProcessor) {
186            }
187    
188    }