001    /**
002     * Copyright (c) 2000-present 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.taglib.util.IncludeTag;
018    
019    import javax.servlet.http.HttpServletRequest;
020    
021    /**
022     * @author Eudaldo Alonso
023     */
024    public class EmptyResultMessageTag extends IncludeTag {
025    
026            public void setMessage(String message) {
027                    _message = message;
028            }
029    
030            public void setSearch(boolean search) {
031                    _search = search;
032            }
033    
034            @Override
035            protected void cleanUp() {
036                    _message = null;
037                    _search = false;
038            }
039    
040            @Override
041            protected String getEndPage() {
042                    return _END_PAGE;
043            }
044    
045            @Override
046            protected String getStartPage() {
047                    return _START_PAGE;
048            }
049    
050            @Override
051            protected void setAttributes(HttpServletRequest request) {
052                    request.setAttribute(
053                            "liferay-ui:empty-result-message:message", _message);
054                    request.setAttribute(
055                            "liferay-ui:empty-result-message:search", String.valueOf(_search));
056            }
057    
058            private static final String _END_PAGE =
059                    "/html/taglib/ui/empty_result_message/end.jsp";
060    
061            private static final String _START_PAGE =
062                    "/html/taglib/ui/empty_result_message/start.jsp";
063    
064            private String _message;
065            private boolean _search;
066    
067    }