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.staging;
016    
017    import com.liferay.portal.model.ExportImportConfiguration;
018    import com.liferay.taglib.util.IncludeTag;
019    
020    import javax.servlet.http.HttpServletRequest;
021    
022    /**
023     * @author Levente Hud??k
024     */
025    public class ConfigurationHeaderTag extends IncludeTag {
026    
027            public void setExportImportConfiguration(
028                    ExportImportConfiguration exportImportConfiguration) {
029    
030                    _exportImportConfiguration = exportImportConfiguration;
031            }
032    
033            public void setLabel(String label) {
034                    _label = label;
035            }
036    
037            @Override
038            protected void cleanUp() {
039                    _exportImportConfiguration = null;
040                    _label = null;
041            }
042    
043            @Override
044            protected String getPage() {
045                    return _PAGE;
046            }
047    
048            @Override
049            protected void setAttributes(HttpServletRequest request) {
050                    request.setAttribute(
051                            "liferay-staging:configuration-header:exportImportConfiguration",
052                            _exportImportConfiguration);
053                    request.setAttribute(
054                            "liferay-staging:configuration-header:label", _label);
055                    request.setAttribute(
056                            "liferay-staging:configuration-header:liferayPortletRequest",
057                            pageContext.getAttribute("liferayPortletRequest"));
058            }
059    
060            private static final String _PAGE =
061                    "/html/taglib/staging/configuration_header/page.jsp";
062    
063            private ExportImportConfiguration _exportImportConfiguration;
064            private String _label;
065    
066    }