001    /**
002     * Copyright (c) 2000-present 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.portlet.toolbar.contributor.locator;
016    
017    import com.liferay.portal.kernel.portlet.toolbar.contributor.PortletToolbarContributor;
018    
019    import java.util.List;
020    
021    import javax.portlet.PortletRequest;
022    
023    /**
024     * Provides an interface responsible for providing {@link
025     * PortletToolbarContributor} instances that extend the portlet toolbar by
026     * adding more elements.
027     *
028     * <p>
029     * Implementations of this class must use the OSGI Registry to return {@link
030     * PortletToolbarContributor} implementations. The way that the {@link
031     * PortletToolbarContributor}s are registered in OSGI Registry must be
032     * synchronized with the way that implementations of this class searches for
033     * them.
034     * </p>
035     *
036     * <p>
037     * Typically, implementations of this class leverage the MVC pattern used the by
038     * the portlet. This allows for different extensions to the portlet toolbar for
039     * different views of the portlet.
040     * </p>
041     *
042     * <p>
043     * Implementations of this class must be OSGI components.
044     * </p>
045     *
046     * @author Sergio Gonz??lez
047     */
048    public interface PortletToolbarContributorLocator {
049    
050            /**
051             * Returns portlet toolbar contributors for a particular portlet and
052             * request.
053             *
054             * @param  portletId the portlet's ID
055             * @param  portletRequest the portlet request
056             * @return portlet toolbar contributors for a particular portlet and request
057             */
058            public List<PortletToolbarContributor> getPortletToolbarContributors(
059                    String portletId, PortletRequest portletRequest);
060    
061    }