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 Brian Wing Shun Chan
023     * @author Keith R. Davis
024     * @author Iliyan Peychev
025     */
026    public class UploadProgressTag extends IncludeTag {
027    
028            public void setHeight(int height) {
029                    _height = height;
030            }
031    
032            public void setId(String id) {
033                    _id = id;
034            }
035    
036            public void setMessage(String message) {
037                    _message = message;
038            }
039    
040            /**
041             * @deprecated As of 7.0.0, with no direct replacement
042             */
043            @Deprecated
044            public void setRedirect(String redirect) {
045            }
046    
047            public void setUpdatePeriod(Integer updatePeriod) {
048                    _updatePeriod = updatePeriod;
049            }
050    
051            @Override
052            protected void cleanUp() {
053                    _height = 25;
054                    _id = null;
055                    _message = null;
056                    _updatePeriod = 1000;
057            }
058    
059            @Override
060            protected String getPage() {
061                    return _PAGE;
062            }
063    
064            @Override
065            protected void setAttributes(HttpServletRequest request) {
066                    request.setAttribute("liferay-ui:progress:id", _id);
067                    request.setAttribute("liferay-ui:progress:height", _height);
068                    request.setAttribute("liferay-ui:progress:message", _message);
069                    request.setAttribute("liferay-ui:progress:updatePeriod", _updatePeriod);
070            }
071    
072            private static final String _PAGE = "/html/taglib/ui/progress/page.jsp";
073    
074            private Integer _height;
075            private String _id;
076            private String _message;
077            private Integer _updatePeriod;
078    
079    }