001    /**
002     * Copyright (c) 2000-2013 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.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.PortletURL;
024    
025    /**
026     * @author Brian Wing Shun Chan
027     */
028    public class DummyIndexer implements Indexer {
029    
030            @Override
031            public void addRelatedEntryFields(Document document, Object obj) {
032            }
033    
034            @Override
035            public void delete(long companyId, String uid) {
036            }
037    
038            @Override
039            public void delete(Object obj) {
040            }
041    
042            @Override
043            public String[] getClassNames() {
044                    return new String[0];
045            }
046    
047            @Override
048            public Document getDocument(Object obj) {
049                    return null;
050            }
051    
052            @Override
053            public BooleanQuery getFacetQuery(
054                    String className, SearchContext searchContext) {
055    
056                    return null;
057            }
058    
059            @Override
060            public BooleanQuery getFullQuery(SearchContext searchContext) {
061                    return null;
062            }
063    
064            @Override
065            public IndexerPostProcessor[] getIndexerPostProcessors() {
066                    return new IndexerPostProcessor[0];
067            }
068    
069            @Override
070            public String getPortletId() {
071                    return StringPool.BLANK;
072            }
073    
074            @Override
075            public String getSearchEngineId() {
076                    return StringPool.BLANK;
077            }
078    
079            @Override
080            public String getSortField(String orderByCol) {
081                    return StringPool.BLANK;
082            }
083    
084            @Override
085            public String getSortField(String orderByCol, int sortType) {
086                    return StringPool.BLANK;
087            }
088    
089            @Override
090            public Summary getSummary(
091                    Document document, Locale locale, String snippet,
092                    PortletURL portletURL) {
093    
094                    return null;
095            }
096    
097            @Override
098            public boolean hasPermission(
099                    PermissionChecker permissionChecker, String entryClassName,
100                    long entryClassPK, String actionId) {
101    
102                    return false;
103            }
104    
105            @Override
106            public boolean isFilterSearch() {
107                    return false;
108            }
109    
110            @Override
111            public boolean isPermissionAware() {
112                    return false;
113            }
114    
115            @Override
116            public boolean isStagingAware() {
117                    return false;
118            }
119    
120            @Override
121            public boolean isVisible(long classPK, int status) throws Exception {
122                    return true;
123            }
124    
125            @Override
126            public boolean isVisibleRelatedEntry(long classPK, int status)
127                    throws Exception {
128    
129                    return true;
130            }
131    
132            @Override
133            public void postProcessContextQuery(
134                    BooleanQuery contextQuery, SearchContext searchContext) {
135            }
136    
137            @Override
138            public void postProcessSearchQuery(
139                    BooleanQuery searchQuery, SearchContext searchContext) {
140            }
141    
142            @Override
143            public void registerIndexerPostProcessor(
144                    IndexerPostProcessor indexerPostProcessor) {
145            }
146    
147            @Override
148            public void reindex(Object obj) {
149            }
150    
151            @Override
152            public void reindex(String className, long classPK) {
153            }
154    
155            @Override
156            public void reindex(String[] ids) {
157            }
158    
159            @Override
160            public void reindexDDMStructures(List<Long> ddmStructureIds) {
161            }
162    
163            @Override
164            public Hits search(SearchContext searchContext) {
165                    return null;
166            }
167    
168            @Override
169            public void unregisterIndexerPostProcessor(
170                    IndexerPostProcessor indexerPostProcessor) {
171            }
172    
173    }