001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.taglib.ui;
016    
017    import com.liferay.portal.kernel.dao.search.RowChecker;
018    import com.liferay.taglib.util.IncludeTag;
019    
020    import java.util.LinkedHashMap;
021    
022    import javax.portlet.PortletURL;
023    
024    import javax.servlet.http.HttpServletRequest;
025    
026    /**
027     * @author Brian Wing Shun Chan
028     */
029    public class UserSearchTag extends IncludeTag {
030    
031            public void setPortletURL(PortletURL portletURL) {
032                    _portletURL = portletURL;
033            }
034    
035            public void setRowChecker(RowChecker rowChecker) {
036                    _rowChecker = rowChecker;
037            }
038    
039            public void setUserParams(LinkedHashMap<String, Object> userParams) {
040                    _userParams = userParams;
041            }
042    
043            @Override
044            protected void cleanUp() {
045                    _portletURL = null;
046                    _rowChecker = null;
047                    _userParams = null;
048            }
049    
050            @Override
051            protected String getEndPage() {
052                    return _END_PAGE;
053            }
054    
055            @Override
056            protected String getStartPage() {
057                    return _START_PAGE;
058            }
059    
060            @Override
061            protected void setAttributes(HttpServletRequest request) {
062                    request.setAttribute("liferay-ui:user-search:portletURL", _portletURL);
063                    request.setAttribute("liferay-ui:user-search:rowChecker", _rowChecker);
064                    request.setAttribute("liferay-ui:user-search:userParams", _userParams);
065            }
066    
067            private static final String _END_PAGE =
068                    "/html/taglib/ui/user_search/end.jsp";
069    
070            private static final String _START_PAGE =
071                    "/html/taglib/ui/user_search/start.jsp";
072    
073            private PortletURL _portletURL;
074            private RowChecker _rowChecker;
075            private LinkedHashMap<String, Object> _userParams;
076    
077    }