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 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            @Override
044            protected void cleanUp() {
045                    _id = null;
046                    _iframeSrc = null;
047                    _message = null;
048                    _redirect = null;
049            }
050    
051            @Override
052            protected String getPage() {
053                    return _PAGE;
054            }
055    
056            @Override
057            protected void setAttributes(HttpServletRequest request) {
058                    request.setAttribute("liferay-ui:upload-progress:id", _id);
059                    request.setAttribute(
060                            "liferay-ui:upload-progress:iframe-src", _iframeSrc);
061                    request.setAttribute("liferay-ui:upload-progress:message", _message);
062                    request.setAttribute("liferay-ui:upload-progress:redirect", _redirect);
063            }
064    
065            private static final String _PAGE =
066                    "/html/taglib/ui/upload_progress/page.jsp";
067    
068            private String _id;
069            private String _iframeSrc;
070            private String _message;
071            private String _redirect;
072    
073    }