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="AssetTagsNavigationTag.java.html"><b><i>View Source</i></b></a>
23   *
24   * @author Alvaro del Castillo
25   * @author Eduardo Lundgren
26   * @author Jorge Ferrer
27   */
28  public class AssetTagsNavigationTag extends IncludeTag {
29  
30      public void setClassNameId(long classNameId) {
31          _classNameId = classNameId;
32      }
33  
34      public void setDisplayStyle(String displayStyle) {
35          _displayStyle = displayStyle;
36      }
37  
38      public void setHidePortletWhenEmpty(boolean hidePortletWhenEmpty) {
39          _hidePortletWhenEmpty = hidePortletWhenEmpty;
40      }
41  
42      public void setShowAssetCount(boolean showAssetCount) {
43          _showAssetCount = showAssetCount;
44      }
45  
46      public void setShowZeroAssetCount(boolean showZeroAssetCount) {
47          _showZeroAssetCount = showZeroAssetCount;
48      }
49  
50      protected void cleanUp() {
51          _classNameId = 0;
52          _displayStyle = "cloud";
53          _hidePortletWhenEmpty = false;
54          _showAssetCount = false;
55          _showZeroAssetCount = false;
56      }
57  
58      protected String getPage() {
59          return _PAGE;
60      }
61  
62      protected void setAttributes(HttpServletRequest request) {
63          request.setAttribute(
64              "liferay-ui:asset-tags-navigation:classNameId",
65              String.valueOf(_classNameId));
66          request.setAttribute(
67              "liferay-ui:asset-tags-navigation:displayStyle", _displayStyle);
68          request.setAttribute(
69              "liferay-ui:asset-tags-navigation:hidePortletWhenEmpty",
70              String.valueOf(_hidePortletWhenEmpty));
71          request.setAttribute(
72              "liferay-ui:asset-tags-navigation:showAssetCount",
73              String.valueOf(_showAssetCount));
74          request.setAttribute(
75              "liferay-ui:asset-tags-navigation:showZeroAssetCount",
76              String.valueOf(_showZeroAssetCount));
77      }
78  
79      private static final String _PAGE =
80          "/html/taglib/ui/asset_tags_navigation/page.jsp";
81  
82      private long _classNameId;
83      private String _displayStyle = "cloud";
84      private boolean _hidePortletWhenEmpty;
85      private boolean _showAssetCount;
86      private boolean _showZeroAssetCount;
87  
88  }