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 setOnlyActions(boolean onlyActions) {
051                    _onlyActions = onlyActions;
052            }
053    
054            public void setPrivateLayout(boolean privateLayout) {
055                    _privateLayout = privateLayout;
056            }
057    
058            public void setSelPlid(long selPlid) {
059                    _selPlid = selPlid;
060            }
061    
062            public void setShowManageBranches(boolean showManageBranches) {
063                    _showManageBranches = showManageBranches;
064            }
065    
066            @Override
067            protected void cleanUp() {
068                    _cssClass = null;
069                    _extended = true;
070                    _groupId = 0;
071                    _icon = "/dockbar/staging.png";
072                    _layoutSetBranchId = 0;
073                    _message = "staging";
074                    _onlyActions = false;
075                    _privateLayout = false;
076                    _selPlid = 0;
077                    _showManageBranches = false;
078            }
079    
080            @Override
081            protected String getPage() {
082                    return _PAGE;
083            }
084    
085            @Override
086            protected void setAttributes(HttpServletRequest request) {
087                    request.setAttribute("liferay-ui:staging:cssClass", _cssClass);
088                    request.setAttribute(
089                            "liferay-ui:staging:extended", String.valueOf(_extended));
090                    request.setAttribute(
091                            "liferay-ui:staging:groupId", String.valueOf(_groupId));
092                    request.setAttribute("liferay-ui:staging:icon", _icon);
093                    request.setAttribute(
094                            "liferay-ui:staging:layoutSetBranchId",
095                            String.valueOf(_layoutSetBranchId));
096                    request.setAttribute("liferay-ui:staging:message", _message);
097                    request.setAttribute(
098                            "liferay-ui:staging:onlyActions", String.valueOf(_onlyActions));
099                    request.setAttribute(
100                            "liferay-ui:staging:privateLayout", String.valueOf(_privateLayout));
101                    request.setAttribute(
102                            "liferay-ui:staging:selPlid", String.valueOf(_selPlid));
103                    request.setAttribute(
104                            "liferay-ui:staging:showManageBranches",
105                            String.valueOf(_showManageBranches));
106            }
107    
108            private static final String _PAGE = "/html/taglib/ui/staging/page.jsp";
109    
110            private String _cssClass;
111            private boolean _extended = true;
112            private long _groupId;
113            private String _icon = "/dockbar/staging.png";
114            private long _layoutSetBranchId;
115            private String _message = "staging";
116            private boolean _onlyActions;
117            private boolean _privateLayout;
118            private long _selPlid;
119            private boolean _showManageBranches;
120    
121    }