1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   *
12   * 
13   */
14  
15  package com.liferay.taglib.ui;
16  
17  import com.liferay.portal.model.Layout;
18  import com.liferay.taglib.util.IncludeTag;
19  
20  import javax.portlet.PortletURL;
21  
22  import javax.servlet.http.HttpServletRequest;
23  
24  /**
25   * <a href="BreadcrumbTag.java.html"><b><i>View Source</i></b></a>
26   *
27   * @author Brian Wing Shun Chan
28   */
29  public class BreadcrumbTag extends IncludeTag {
30  
31      public int doStartTag() {
32          HttpServletRequest request =
33              (HttpServletRequest)pageContext.getRequest();
34  
35          request.setAttribute(
36              "liferay-ui:breadcrumb:displayStyle",
37              String.valueOf(_displayStyle));
38          request.setAttribute("liferay-ui:breadcrumb:portletURL", _portletURL);
39          request.setAttribute("liferay-ui:breadcrumb:selLayout", _selLayout);
40          request.setAttribute(
41              "liferay-ui:breadcrumb:selLayoutParam", _selLayoutParam);
42  
43          return EVAL_BODY_BUFFERED;
44      }
45  
46      public void setDisplayStyle(int displayStyle) {
47          _displayStyle = displayStyle;
48      }
49  
50      public void setPortletURL(PortletURL portletURL) {
51          _portletURL = portletURL;
52      }
53  
54      public void setSelLayout(Layout selLayout) {
55          _selLayout = selLayout;
56      }
57  
58      public void setSelLayoutParam(String selLayoutParam) {
59          _selLayoutParam = selLayoutParam;
60      }
61  
62      protected String getDefaultPage() {
63          return _PAGE;
64      }
65  
66      private static final String _PAGE = "/html/taglib/ui/breadcrumb/page.jsp";
67  
68      private int _displayStyle = 1;
69      private PortletURL _portletURL;
70      private Layout _selLayout;
71      private String _selLayoutParam;
72  
73  }