1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
13   */
14  
15  package com.liferay.taglib.ui;
16  
17  import com.liferay.taglib.util.IncludeTag;
18  
19  import javax.servlet.http.HttpServletRequest;
20  
21  /**
22   * <a href="NavigationTag.java.html"><b><i>View Source</i></b></a>
23   *
24   * @author Brian Wing Shun Chan
25   * @author Jorge Ferrer
26   */
27  public class NavigationTag extends IncludeTag {
28  
29      public int doStartTag() {
30          HttpServletRequest request =
31              (HttpServletRequest)pageContext.getRequest();
32  
33          request.setAttribute("liferay-ui:navigation:bulletStyle", _bulletStyle);
34          request.setAttribute(
35              "liferay-ui:navigation:displayStyle", _displayStyle);
36          request.setAttribute("liferay-ui:navigation:headerType", _headerType);
37          request.setAttribute(
38              "liferay-ui:navigation:rootLayoutType", _rootLayoutType);
39          request.setAttribute(
40              "liferay-ui:navigation:rootLayoutLevel",
41              String.valueOf(_rootLayoutLevel));
42          request.setAttribute(
43              "liferay-ui:navigation:includedLayouts", _includedLayouts);
44          request.setAttribute(
45              "liferay-ui:navigation:nestedChildren",
46              String.valueOf(_nestedChildren));
47  
48          return EVAL_BODY_BUFFERED;
49      }
50  
51      public void setBulletStyle(String bulletStyle) {
52          _bulletStyle = bulletStyle;
53      }
54  
55      public void setDisplayStyle(String displayStyle) {
56          _displayStyle = displayStyle;
57      }
58  
59      public void setHeaderType(String headerType) {
60          _headerType = headerType;
61      }
62  
63      public void setRootLayoutType(String rootLayoutType) {
64          _rootLayoutType = rootLayoutType;
65      }
66  
67      public void setRootLayoutLevel(int rootLayoutLevel) {
68          _rootLayoutLevel = rootLayoutLevel;
69      }
70  
71      public void setIncludedLayouts(String includedLayouts) {
72          _includedLayouts = includedLayouts;
73      }
74  
75      public void setNestedChildren(boolean nestedChildren) {
76          _nestedChildren = nestedChildren;
77      }
78  
79      protected String getDefaultPage() {
80          return _PAGE;
81      }
82  
83      private static final String _PAGE = "/html/taglib/ui/navigation/page.jsp";
84  
85      private String _bulletStyle = "1";
86      private String _displayStyle = "1";
87      private String _headerType = "none";
88      private String _rootLayoutType = "absolute";
89      private int _rootLayoutLevel = 1;
90      private String _includedLayouts = "auto";
91      private boolean _nestedChildren = true;
92  
93  }