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