001    /**
002     * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.taglib.ui;
016    
017    import com.liferay.taglib.util.IncludeTag;
018    
019    import javax.servlet.http.HttpServletRequest;
020    
021    /**
022     * @author Alvaro del Castillo
023     * @author Eduardo Lundgren
024     * @author Jorge Ferrer
025     */
026    public class AssetTagsNavigationTag extends IncludeTag {
027    
028            public void setClassNameId(long classNameId) {
029                    _classNameId = classNameId;
030            }
031    
032            public void setDisplayStyle(String displayStyle) {
033                    _displayStyle = displayStyle;
034            }
035    
036            public void setHidePortletWhenEmpty(boolean hidePortletWhenEmpty) {
037                    _hidePortletWhenEmpty = hidePortletWhenEmpty;
038            }
039    
040            public void setShowAssetCount(boolean showAssetCount) {
041                    _showAssetCount = showAssetCount;
042            }
043    
044            public void setShowZeroAssetCount(boolean showZeroAssetCount) {
045                    _showZeroAssetCount = showZeroAssetCount;
046            }
047    
048            protected void cleanUp() {
049                    _classNameId = 0;
050                    _displayStyle = "cloud";
051                    _hidePortletWhenEmpty = false;
052                    _showAssetCount = false;
053                    _showZeroAssetCount = false;
054            }
055    
056            protected String getPage() {
057                    return _PAGE;
058            }
059    
060            protected void setAttributes(HttpServletRequest request) {
061                    request.setAttribute(
062                            "liferay-ui:asset-tags-navigation:classNameId",
063                            String.valueOf(_classNameId));
064                    request.setAttribute(
065                            "liferay-ui:asset-tags-navigation:displayStyle", _displayStyle);
066                    request.setAttribute(
067                            "liferay-ui:asset-tags-navigation:hidePortletWhenEmpty",
068                            String.valueOf(_hidePortletWhenEmpty));
069                    request.setAttribute(
070                            "liferay-ui:asset-tags-navigation:showAssetCount",
071                            String.valueOf(_showAssetCount));
072                    request.setAttribute(
073                            "liferay-ui:asset-tags-navigation:showZeroAssetCount",
074                            String.valueOf(_showZeroAssetCount));
075            }
076    
077            private static final String _PAGE =
078                    "/html/taglib/ui/asset_tags_navigation/page.jsp";
079    
080            private long _classNameId;
081            private String _displayStyle = "cloud";
082            private boolean _hidePortletWhenEmpty;
083            private boolean _showAssetCount;
084            private boolean _showZeroAssetCount;
085    
086    }