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 void setBulletStyle(String bulletStyle) {
30          _bulletStyle = bulletStyle;
31      }
32  
33      public void setDisplayStyle(String displayStyle) {
34          _displayStyle = displayStyle;
35      }
36  
37      public void setHeaderType(String headerType) {
38          _headerType = headerType;
39      }
40  
41      public void setIncludedLayouts(String includedLayouts) {
42          _includedLayouts = includedLayouts;
43      }
44  
45      public void setNestedChildren(boolean nestedChildren) {
46          _nestedChildren = nestedChildren;
47      }
48  
49      public void setRootLayoutLevel(int rootLayoutLevel) {
50          _rootLayoutLevel = rootLayoutLevel;
51      }
52  
53      public void setRootLayoutType(String rootLayoutType) {
54          _rootLayoutType = rootLayoutType;
55      }
56  
57      protected void cleanUp() {
58          _bulletStyle = "1";
59          _displayStyle = "1";
60          _headerType = "none";
61          _includedLayouts = "auto";
62          _nestedChildren = true;
63          _rootLayoutLevel = 1;
64          _rootLayoutType = "absolute";
65      }
66  
67      protected String getPage() {
68          return _PAGE;
69      }
70  
71      protected void setAttributes(HttpServletRequest request) {
72          request.setAttribute("liferay-ui:navigation:bulletStyle", _bulletStyle);
73          request.setAttribute(
74              "liferay-ui:navigation:displayStyle", _displayStyle);
75          request.setAttribute("liferay-ui:navigation:headerType", _headerType);
76          request.setAttribute(
77              "liferay-ui:navigation:includedLayouts", _includedLayouts);
78          request.setAttribute(
79              "liferay-ui:navigation:nestedChildren",
80              String.valueOf(_nestedChildren));
81          request.setAttribute(
82              "liferay-ui:navigation:rootLayoutLevel",
83              String.valueOf(_rootLayoutLevel));
84          request.setAttribute(
85              "liferay-ui:navigation:rootLayoutType", _rootLayoutType);
86      }
87  
88      private static final String _PAGE = "/html/taglib/ui/navigation/page.jsp";
89  
90      private String _bulletStyle = "1";
91      private String _displayStyle = "1";
92      private String _headerType = "none";
93      private String _includedLayouts = "auto";
94      private boolean _nestedChildren = true;
95      private int _rootLayoutLevel = 1;
96      private String _rootLayoutType = "absolute";
97  
98  }