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     */
024    public class StagingTag extends IncludeTag {
025    
026            public void setCssClass(String cssClass) {
027                    _cssClass = cssClass;
028            }
029    
030            public void setExtended(boolean extended) {
031                    _extended = extended;
032            }
033    
034            public void setGroupId(long groupId) {
035                    _groupId = groupId;
036            }
037    
038            public void setIcon(String icon) {
039                    _icon = icon;
040            }
041    
042            public void setLayoutSetBranchId(long layoutSetBranchId) {
043                    _layoutSetBranchId = layoutSetBranchId;
044            }
045    
046            public void setMessage(String message) {
047                    _message = message;
048            }
049    
050            public void setPrivateLayout(boolean privateLayout) {
051                    _privateLayout = privateLayout;
052            }
053    
054            public void setSelPlid(long selPlid) {
055                    _selPlid = selPlid;
056            }
057    
058            public void setShowManageBranches(boolean showManageBranches) {
059                    _showManageBranches = showManageBranches;
060            }
061    
062            @Override
063            protected void cleanUp() {
064                    _cssClass = null;
065                    _extended = true;
066                    _groupId = 0;
067                    _icon = "/dockbar/staging.png";
068                    _layoutSetBranchId = 0;
069                    _message = "staging";
070                    _privateLayout = false;
071                    _selPlid = 0;
072                    _showManageBranches = false;
073            }
074    
075            @Override
076            protected String getPage() {
077                    return _PAGE;
078            }
079    
080            @Override
081            protected void setAttributes(HttpServletRequest request) {
082                    request.setAttribute("liferay-ui:staging:cssClass", _cssClass);
083                    request.setAttribute(
084                            "liferay-ui:staging:extended", String.valueOf(_extended));
085                    request.setAttribute(
086                            "liferay-ui:staging:groupId", String.valueOf(_groupId));
087                    request.setAttribute("liferay-ui:staging:icon", _icon);
088                    request.setAttribute(
089                            "liferay-ui:staging:layoutSetBranchId",
090                            String.valueOf(_layoutSetBranchId));
091                    request.setAttribute("liferay-ui:staging:message", _message);
092                    request.setAttribute(
093                            "liferay-ui:staging:privateLayout", String.valueOf(_privateLayout));
094                    request.setAttribute(
095                            "liferay-ui:staging:selPlid", String.valueOf(_selPlid));
096                    request.setAttribute(
097                            "liferay-ui:staging:showManageBranches",
098                            String.valueOf(_showManageBranches));
099            }
100    
101            private static final String _PAGE = "/html/taglib/ui/staging/page.jsp";
102    
103            private String _cssClass;
104            private boolean _extended = true;
105            private long _groupId;
106            private String _icon = "/dockbar/staging.png";
107            private long _layoutSetBranchId;
108            private String _message = "staging";
109            private boolean _privateLayout;
110            private long _selPlid;
111            private boolean _showManageBranches;
112    
113    }