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.state; 029 030import java.util.List; 031import java.util.Map; 032 033/** Interface for the state all facet types have in common. */ 034public interface I_CmsSearchStateFacet { 035 036 /** Add a facet entry to the collection of checked entries. 037 * @param entry The facet entry. 038 */ 039 void addChecked(String entry); 040 041 /** 042 * Clear the collection of checked entries - i.e., tell that nothing is checked. 043 */ 044 void clearChecked(); 045 046 /** Returns all checked entries of a facet. 047 * @return List of the facet's entries that are checked. 048 */ 049 List<String> getCheckedEntries(); 050 051 /** Returns a flag, indicating if the checked entries should be ignored. 052 * @return Flag, indicating if the checked entries should be ignored. 053 */ 054 boolean getIgnoreChecked(); 055 056 /** Returns a map that tells for each facet entry (an arbitrary string), if it is checked. 057 * @return Map from facet entries to their check state. 058 */ 059 Map<String, Boolean> getIsChecked(); 060 061 /** Returns a flag, indicating if the limit for the maximal number of facet entries should be used. 062 * @return A flag, indicating if the limit for the maximal number of facet entries should be used. 063 */ 064 boolean getUseLimit(); 065 066 /** Set, if the checked facet entries should be ignored. (This influences the generated query part, by (not) adding specific filter queries.) 067 * @param ignore Flag, indicating if the checked entries should be ignored or not. 068 */ 069 void setIgnoreChecked(boolean ignore); 070 071 /** Set, if the limit for the maximal number of facet entries should be used. 072 * @param useLimit Flag, indicating if the configured limit for the maximal number of facet entries should be used. 073 */ 074 void setUseLimit(boolean useLimit); 075}