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.ade.galleries.client;
029
030import org.opencms.ade.galleries.shared.CmsGallerySearchScope;
031
032/**
033 * The full text search tab handler.<p>
034 *
035 * This class receives events information from the full text search tab and
036 * delegates them to the gallery search controller.
037 *
038 * @since 8.0.0
039 */
040public class CmsSearchTabHandler extends A_CmsTabHandler {
041
042    /**
043     * Constructor.<p>
044     *
045     * @param controller the gallery controller
046     */
047    public CmsSearchTabHandler(CmsGalleryController controller) {
048
049        super(controller);
050    }
051
052    /**
053     * Delegates the clear input action (click on the clear button) to the controller.<p>
054     */
055    public void clearInput() {
056
057        m_controller.clearTextSearch();
058    }
059
060    /**
061     * @see org.opencms.ade.galleries.client.A_CmsTabHandler#clearParams()
062     */
063    @Override
064    public void clearParams() {
065
066        m_controller.clearTextSearch();
067    }
068
069    /**
070     * @see org.opencms.ade.galleries.client.A_CmsTabHandler#onSelection()
071     */
072    @Override
073    public void onSelection() {
074
075        // no list present
076    }
077
078    /**
079     * @see org.opencms.ade.galleries.client.A_CmsTabHandler#onSort(java.lang.String, java.lang.String)
080     */
081    @Override
082    public void onSort(String sortParams, String filter) {
083
084        // not available for this tab
085    }
086
087    /**
088     * @see org.opencms.ade.galleries.client.A_CmsTabHandler#removeParam(java.lang.String)
089     */
090    @Override
091    public void removeParam(String paramKey) {
092
093        m_controller.removeTextSearchParameter(paramKey);
094    }
095
096    /**
097     * Delegates the value for the created until date to the controller.<p>
098     *
099     * @param createdEnd the created until date as long
100     */
101    public void setDateCreatedEnd(long createdEnd) {
102
103        m_controller.addDateCreatedEnd(createdEnd);
104    }
105
106    /**
107     * Delegates the value for the created since date to the controller.<p>
108     *
109     * @param createdStart the created since date as long
110     */
111    public void setDateCreatedStart(long createdStart) {
112
113        m_controller.addDateCreatedStart(createdStart);
114    }
115
116    /**
117     * Delegates the value for the modified until date to the controller.<p>
118     *
119     * @param modifiedEnd the modified until date as long
120     */
121    public void setDateModifiedEnd(long modifiedEnd) {
122
123        m_controller.addDateModifiedEnd(modifiedEnd);
124    }
125
126    /**
127     * Delegates the value for the modified since date to the controller.<p>
128     *
129     * @param modifiedStart the modified since date as long
130     */
131    public void setDateModifiedStart(long modifiedStart) {
132
133        m_controller.addDateModifiedStart(modifiedStart);
134    }
135
136    /**
137     * Sets if the search should include expired or unreleased resources.<p>
138     *
139     * @param includeExpired if the search should include expired or unreleased resources
140     * @param fireEvent true if a change event should be fired
141     */
142    public void setIncludeExpired(boolean includeExpired, boolean fireEvent) {
143
144        m_controller.setIncludeExpired(includeExpired, fireEvent);
145    }
146
147    /**
148     * Delegates the locale value to the controller.<p>
149     *
150     * @param locale the locale
151     */
152    public void setLocale(String locale) {
153
154        m_controller.addLocale(locale);
155    }
156
157    /**
158     * Sets the search scope.<p>
159     *
160     * @param scope the search scope
161     */
162    public void setScope(CmsGallerySearchScope scope) {
163
164        m_controller.addScope(scope);
165    }
166}