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