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.taglib.ui;
016    
017    import com.liferay.portal.kernel.dao.search.RowChecker;
018    
019    import java.util.LinkedHashMap;
020    
021    import javax.portlet.PortletURL;
022    
023    import javax.servlet.http.HttpServletRequest;
024    import javax.servlet.jsp.tagext.TagSupport;
025    
026    /**
027     * @author Brian Wing Shun Chan
028     */
029    public class GroupSearchTag extends TagSupport {
030    
031            public void setGroupParams(LinkedHashMap<String, Object> groupParams) {
032                    _groupParams = groupParams;
033            }
034    
035            public void setPortletURL(PortletURL portletURL) {
036                    _portletURL = portletURL;
037            }
038    
039            public void setRowChecker(RowChecker rowChecker) {
040                    _rowChecker = rowChecker;
041            }
042    
043            protected void cleanUp() {
044                    _groupParams = null;
045                    _portletURL = null;
046                    _rowChecker = null;
047            }
048    
049            protected String getEndPage() {
050                    return _END_PAGE;
051            }
052    
053            protected String getStartPage() {
054                    return _START_PAGE;
055            }
056    
057            protected void setAttributes(HttpServletRequest request) {
058                    request.setAttribute(
059                            "liferay-ui:group-search:groupParams", _groupParams);
060                    request.setAttribute("liferay-ui:group-search:portletURL", _portletURL);
061                    request.setAttribute("liferay-ui:group-search:rowChecker", _rowChecker);
062            }
063    
064            private static final String _END_PAGE =
065                    "/html/taglib/ui/group_search/end.jsp";
066    
067            private static final String _START_PAGE =
068                    "/html/taglib/ui/group_search/start.jsp";
069    
070            private LinkedHashMap<String, Object> _groupParams;
071            private PortletURL _portletURL;
072            private RowChecker _rowChecker;
073    
074    }