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.portlet.documentlibrary.util;
016    
017    import com.liferay.portal.kernel.search.BaseIndexer;
018    import com.liferay.portal.kernel.search.Document;
019    import com.liferay.portal.kernel.search.Indexer;
020    import com.liferay.portal.kernel.search.IndexerPostProcessor;
021    import com.liferay.portal.kernel.search.SearchContext;
022    import com.liferay.portal.kernel.search.Summary;
023    import com.liferay.portlet.journal.model.JournalArticle;
024    import com.liferay.portlet.journal.model.JournalFolder;
025    
026    import java.util.Locale;
027    
028    import javax.portlet.PortletURL;
029    
030    /**
031     * @author Julio Camarero
032     * @author Eudaldo Alonso
033     */
034    public class JournalSearcher extends BaseIndexer {
035    
036            public static final String[] CLASS_NAMES = {
037                    JournalArticle.class.getName(), JournalFolder.class.getName()
038            };
039    
040            public static Indexer getInstance() {
041                    return new JournalSearcher();
042            }
043    
044            public JournalSearcher() {
045                    setFilterSearch(true);
046                    setPermissionAware(true);
047            }
048    
049            public String[] getClassNames() {
050                    return CLASS_NAMES;
051            }
052    
053            @Override
054            public IndexerPostProcessor[] getIndexerPostProcessors() {
055                    throw new UnsupportedOperationException();
056            }
057    
058            public String getPortletId() {
059                    return null;
060            }
061    
062            @Override
063            public void registerIndexerPostProcessor(
064                    IndexerPostProcessor indexerPostProcessor) {
065    
066                    throw new UnsupportedOperationException();
067            }
068    
069            @Override
070            protected void doDelete(Object obj) throws Exception {
071                    throw new UnsupportedOperationException();
072            }
073    
074            @Override
075            protected Document doGetDocument(Object obj) throws Exception {
076                    throw new UnsupportedOperationException();
077            }
078    
079            @Override
080            protected Summary doGetSummary(
081                            Document document, Locale locale, String snippet,
082                            PortletURL portletURL)
083                    throws Exception {
084    
085                    throw new UnsupportedOperationException();
086            }
087    
088            @Override
089            protected void doReindex(Object obj) throws Exception {
090                    throw new UnsupportedOperationException();
091            }
092    
093            @Override
094            protected void doReindex(String className, long classPK) throws Exception {
095                    throw new UnsupportedOperationException();
096            }
097    
098            @Override
099            protected void doReindex(String[] ids) throws Exception {
100                    throw new UnsupportedOperationException();
101            }
102    
103            @Override
104            protected String getPortletId(SearchContext searchContext) {
105                    return null;
106            }
107    
108    }