001/*
002 * This library is part of OpenCms -
003 * the Open Source Content Management System
004 *
005 * Copyright (c) Alkacon Software GmbH & Co. KG (https://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: https://www.alkacon.com
019 *
020 * For further information about OpenCms, please see the
021 * project website: https://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        /**
043        * Sort alphabetically.
044        */
045        index
046    }
047
048    /** Returns true if the filters of all facets are not applied when calculating the facet items. Otherwise returns false.
049     * @return A flag, indicating if the filters of facet's should be ignored or not.
050     */
051    boolean getIgnoreAllFacetFilters();
052
053    /** Returns the facet specific request parameter used to send the information if the maximum number of facet entries should be ignored.
054     * @return The facet specific request parameter used to send the information if the maximum number of facet entries should be ignored.
055     */
056    String getIgnoreMaxParamKey();
057
058    /**
059     * Returns the tags of other facets, for which the filters from this facet should be ignored.
060     * @return the tags of other facets, for which the filters from this facet should be ignored.
061     */
062    String getIgnoreTags();
063
064    /** Returns true if the facet filters, such that only documents with all checked facet entries appear, otherwise false.
065     * @return A flag, indicating if the facet's filters are concatenated by AND (or OR).
066     */
067    boolean getIsAndFacet();
068
069    /** Returns the label that is intended to be displayed over the facet's entries.
070     * @return The label that is intended to be displayed over the facet's entries.
071     */
072    String getLabel();
073
074    /** Returns the minimal number of hits necessary to show a facet entry.
075     * @return The minimal number of hits necessary to show a facet entry. (Solr: facet.mincount)
076     */
077    Integer getMinCount();
078
079    /** Returns the name used to identify the facet.
080     * @return The name used to identify the facet.
081     */
082    String getName();
083
084    /** Returns the facet specific request parameter used to send the checked facet entries.
085     * @return The facet specific request parameter used to send the checked facet entries.
086     */
087    String getParamKey();
088
089    /** A list of facet-entries that should be preselected, if the search form is rendered the first time.
090     * @return The list of facet-entries that should be preselected, if the search form is rendered the first time.
091     */
092    List<String> getPreSelection();
093
094    /** Propagate the names of the other facets that are configured.
095     * @param names the names of the other facets
096     */
097    void propagateAllFacetNames(Collection<String> names);
098
099}