001/*
002 * This library is part of OpenCms -
003 * the Open Source Content Management System
004 *
005 * Copyright (c) Alkacon Software GmbH & Co. KG (http://www.alkacon.com)
006 *
007 * This library is free software; you can redistribute it and/or
008 * modify it under the terms of the GNU Lesser General Public
009 * License as published by the Free Software Foundation; either
010 * version 2.1 of the License, or (at your option) any later version.
011 *
012 * This library is distributed in the hope that it will be useful,
013 * but WITHOUT ANY WARRANTY; without even the implied warranty of
014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015 * Lesser General Public License for more details.
016 *
017 * For further information about Alkacon Software, please see the
018 * company website: http://www.alkacon.com
019 *
020 * For further information about OpenCms, please see the
021 * project website: http://www.opencms.org
022 *
023 * You should have received a copy of the GNU Lesser General Public
024 * License along with this library; if not, write to the Free Software
025 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
026 */
027
028package org.opencms.jsp.search.config;
029
030import java.util.Collection;
031import java.util.List;
032
033/** Configuration common to all facets. Used as base interface for all special facet interfaces. */
034public interface I_CmsSearchConfigurationFacet {
035
036    /** Sort orders available for Solr facet entries. */
037    public enum SortOrder {
038        /**
039         * Sort by the number of hits.
040         */
041        count, /**
042         * Sort alphabetically.
043         */
044        index
045    }
046
047    /** Returns true if the filters of all facets are not applied when calculating the facet items. Otherwise returns false.
048     * @return A flag, indicating if the filters of facet's should be ignored or not.
049     */
050    boolean getIgnoreAllFacetFilters();
051
052    /** Returns the facet specific request parameter used to send the information if the maximum number of facet entries should be ignored.
053     * @return The facet specific request parameter used to send the information if the maximum number of facet entries should be ignored.
054     */
055    String getIgnoreMaxParamKey();
056
057    /**
058     * Returns the tags of other facets, for which the filters from this facet should be ignored.
059     * @return the tags of other facets, for which the filters from this facet should be ignored.
060     */
061    String getIgnoreTags();
062
063    /** Returns true if the facet filters, such that only documents with all checked facet entries appear, otherwise false.
064     * @return A flag, indicating if the facet's filters are concatenated by AND (or OR).
065     */
066    boolean getIsAndFacet();
067
068    /** Returns the label that is intended to be displayed over the facet's entries.
069     * @return The label that is intended to be displayed over the facet's entries.
070     */
071    String getLabel();
072
073    /** Returns the minimal number of hits necessary to show a facet entry.
074     * @return The minimal number of hits necessary to show a facet entry. (Solr: facet.mincount)
075     */
076    Integer getMinCount();
077
078    /** Returns the name used to identify the facet.
079     * @return The name used to identify the facet.
080     */
081    String getName();
082
083    /** Returns the facet specific request parameter used to send the checked facet entries.
084     * @return The facet specific request parameter used to send the checked facet entries.
085     */
086    String getParamKey();
087
088    /** A list of facet-entries that should be preselected, if the search form is rendered the first time.
089     * @return The list of facet-entries that should be preselected, if the search form is rendered the first time.
090     */
091    List<String> getPreSelection();
092
093    /** Propagate the names of the other facets that are configured.
094     * @param names the names of the other facets
095     */
096    void propagateAllFacetNames(Collection<String> names);
097
098}