001    /**
002     * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portlet.enterpriseadmin.search;
016    
017    import com.liferay.portal.kernel.dao.search.SearchContainer;
018    import com.liferay.portal.model.Role;
019    
020    import java.util.ArrayList;
021    import java.util.List;
022    
023    import javax.portlet.PortletRequest;
024    import javax.portlet.PortletURL;
025    
026    /**
027     * @author Brian Wing Shun Chan
028     */
029    public class TeamSearch extends SearchContainer<Role> {
030    
031            static List<String> headerNames = new ArrayList<String>();
032    
033            static {
034                    headerNames.add("name");
035                    headerNames.add("description");
036            }
037    
038            public static final String EMPTY_RESULTS_MESSAGE = "no-teams-were-found";
039    
040            public TeamSearch(PortletRequest portletRequest, PortletURL iteratorURL) {
041                    super(
042                            portletRequest, new TeamDisplayTerms(portletRequest),
043                            new TeamSearchTerms(portletRequest), DEFAULT_CUR_PARAM,
044                            DEFAULT_DELTA, iteratorURL, headerNames, EMPTY_RESULTS_MESSAGE);
045    
046                    TeamDisplayTerms displayTerms = (TeamDisplayTerms)getDisplayTerms();
047    
048                    iteratorURL.setParameter(
049                            TeamDisplayTerms.DESCRIPTION, displayTerms.getDescription());
050                    iteratorURL.setParameter(TeamDisplayTerms.NAME, displayTerms.getName());
051            }
052    
053    }