001/*
002 * (C) Copyright 2010-2013 Nuxeo SA (http://nuxeo.com/) and others.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *     http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 *
016 * Contributors:
017 *     Olivier Grisel
018 */
019package org.nuxeo.ecm.platform.suggestbox.service;
020
021import java.io.Serializable;
022import java.util.HashMap;
023import java.util.Map;
024
025/**
026 * Suggest to search for documents meeting some specific search criteria.
027 * 
028 * @deprecated since 6.0. The redirection to the search tab is not handled by a Suggestion anymore.
029 */
030@Deprecated
031public class SearchDocumentsSuggestion extends Suggestion {
032
033    private static final long serialVersionUID = 1L;
034
035    protected final Map<String, Serializable> searchCriteria = new HashMap<String, Serializable>();
036
037    public SearchDocumentsSuggestion(String id, String label, String iconURL) {
038        super(id, CommonSuggestionTypes.SEARCH_DOCUMENTS, label, iconURL);
039    }
040
041    public SearchDocumentsSuggestion withSearchCriterion(String searchField, Serializable searchValue) {
042        searchCriteria.put(searchField, searchValue);
043        return this;
044    }
045
046    public Map<String, Serializable> getSearchCriteria() {
047        return searchCriteria;
048    }
049
050    @Override
051    public String getObjectUrl() {
052        // TODO Generate the url to access the search page
053        return null;
054    }
055
056}