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.taglib.util.IncludeTag;
018    
019    import javax.servlet.http.HttpServletRequest;
020    
021    /**
022     * @author Iliyan Peychev
023     * @author Sergio Gonz??lez
024     */
025    public class ProgressTag extends IncludeTag {
026    
027            public void setHeight(int height) {
028                    _height = height;
029            }
030    
031            public void setId(String id) {
032                    _id = id;
033            }
034    
035            public void setMessage(String message) {
036                    _message = message;
037            }
038    
039            public void setSessionKey(String sessionKey) {
040                    _sessionKey = sessionKey;
041            }
042    
043            public void setUpdatePeriod(Integer updatePeriod) {
044                    _updatePeriod = updatePeriod;
045            }
046    
047            @Override
048            protected void cleanUp() {
049                    _height = 25;
050                    _id = null;
051                    _message = null;
052                    _sessionKey = null;
053                    _updatePeriod = 1000;
054            }
055    
056            @Override
057            protected String getPage() {
058                    return _PAGE;
059            }
060    
061            @Override
062            protected void setAttributes(HttpServletRequest request) {
063                    request.setAttribute("liferay-ui:progress:id", _id);
064                    request.setAttribute("liferay-ui:progress:height", _height);
065                    request.setAttribute("liferay-ui:progress:message", _message);
066                    request.setAttribute("liferay-ui:progress:sessionKey", _sessionKey);
067                    request.setAttribute("liferay-ui:progress:updatePeriod", _updatePeriod);
068            }
069    
070            private static final String _PAGE = "/html/taglib/ui/progress/page.jsp";
071    
072            private Integer _height;
073            private String _id;
074            private String _message;
075            private String _sessionKey;
076            private Integer _updatePeriod;
077    
078    }