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="AssetCategoriesNavigationTag.java.html"><b><i>View Source</i></b>
23   * </a>
24   *
25   * @author Alvaro del Castillo
26   * @author Eduardo Lundgren
27   * @author Jorge Ferrer
28   */
29  public class AssetCategoriesNavigationTag extends IncludeTag {
30  
31      public int doStartTag() {
32          HttpServletRequest request =
33              (HttpServletRequest)pageContext.getRequest();
34  
35          request.setAttribute(
36              "liferay-ui:asset-tags-navigation:hidePortletWhenEmpty",
37              String.valueOf(_hidePortletWhenEmpty));
38          request.setAttribute(
39              "liferay-ui:asset-tags-navigation:vocabularyIds", _vocabularyIds);
40  
41          return EVAL_BODY_BUFFERED;
42      }
43  
44      public void setHidePortletWhenEmpty(boolean hidePortletWhenEmpty) {
45          _hidePortletWhenEmpty = hidePortletWhenEmpty;
46      }
47  
48      public void setVocabularyIds(long[] vocabularyIds) {
49          _vocabularyIds = vocabularyIds;
50      }
51  
52      protected String getDefaultPage() {
53          return _PAGE;
54      }
55  
56      private static final String _PAGE =
57          "/html/taglib/ui/asset_categories_navigation/page.jsp";
58  
59      private boolean _hidePortletWhenEmpty;
60      private long[] _vocabularyIds;
61  
62  }