001    /**
002     * Copyright (c) 2000-2010 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 Jorge Ferrer
024     */
025    public class NavigationTag extends IncludeTag {
026    
027            public void setBulletStyle(String bulletStyle) {
028                    _bulletStyle = bulletStyle;
029            }
030    
031            public void setDisplayStyle(String displayStyle) {
032                    _displayStyle = displayStyle;
033            }
034    
035            public void setHeaderType(String headerType) {
036                    _headerType = headerType;
037            }
038    
039            public void setIncludedLayouts(String includedLayouts) {
040                    _includedLayouts = includedLayouts;
041            }
042    
043            public void setNestedChildren(boolean nestedChildren) {
044                    _nestedChildren = nestedChildren;
045            }
046    
047            public void setRootLayoutLevel(int rootLayoutLevel) {
048                    _rootLayoutLevel = rootLayoutLevel;
049            }
050    
051            public void setRootLayoutType(String rootLayoutType) {
052                    _rootLayoutType = rootLayoutType;
053            }
054    
055            protected void cleanUp() {
056                    _bulletStyle = "1";
057                    _displayStyle = "1";
058                    _headerType = "none";
059                    _includedLayouts = "auto";
060                    _nestedChildren = true;
061                    _rootLayoutLevel = 1;
062                    _rootLayoutType = "absolute";
063            }
064    
065            protected String getPage() {
066                    return _PAGE;
067            }
068    
069            protected void setAttributes(HttpServletRequest request) {
070                    request.setAttribute("liferay-ui:navigation:bulletStyle", _bulletStyle);
071                    request.setAttribute(
072                            "liferay-ui:navigation:displayStyle", _displayStyle);
073                    request.setAttribute("liferay-ui:navigation:headerType", _headerType);
074                    request.setAttribute(
075                            "liferay-ui:navigation:includedLayouts", _includedLayouts);
076                    request.setAttribute(
077                            "liferay-ui:navigation:nestedChildren",
078                            String.valueOf(_nestedChildren));
079                    request.setAttribute(
080                            "liferay-ui:navigation:rootLayoutLevel",
081                            String.valueOf(_rootLayoutLevel));
082                    request.setAttribute(
083                            "liferay-ui:navigation:rootLayoutType", _rootLayoutType);
084            }
085    
086            private static final String _PAGE = "/html/taglib/ui/navigation/page.jsp";
087    
088            private String _bulletStyle = "1";
089            private String _displayStyle = "1";
090            private String _headerType = "none";
091            private String _includedLayouts = "auto";
092            private boolean _nestedChildren = true;
093            private int _rootLayoutLevel = 1;
094            private String _rootLayoutType = "absolute";
095    
096    }