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.taglib.util.IncludeTag;
018    
019    import javax.servlet.http.HttpServletRequest;
020    
021    /**
022     * @author Brian Wing Shun Chan
023     * @author Keith R. Davis
024     */
025    public class UploadProgressTag extends IncludeTag {
026    
027            public void setId(String id) {
028                    _id = id;
029            }
030    
031            public void setIframeSrc(String iframeSrc) {
032                    _iframeSrc = iframeSrc;
033            }
034    
035            public void setMessage(String message) {
036                    _message = message;
037            }
038    
039            public void setRedirect(String redirect) {
040                    _redirect = redirect;
041            }
042    
043            protected void cleanUp() {
044                    _id = null;
045                    _iframeSrc = null;
046                    _message = null;
047                    _redirect = null;
048            }
049    
050            protected String getPage() {
051                    return _PAGE;
052            }
053    
054            protected void setAttributes(HttpServletRequest request) {
055                    request.setAttribute("liferay-ui:upload-progress:id", _id);
056                    request.setAttribute(
057                            "liferay-ui:upload-progress:iframe-src", _iframeSrc);
058                    request.setAttribute("liferay-ui:upload-progress:message", _message);
059                    request.setAttribute("liferay-ui:upload-progress:redirect", _redirect);
060            }
061    
062            private static final String _PAGE =
063                    "/html/taglib/ui/upload_progress/page.jsp";
064    
065            private String _id;
066            private String _iframeSrc;
067            private String _message;
068            private String _redirect;
069    
070    }