001    /**
002     * Copyright (c) 2000-2013 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.portlet.PortletURL;
020    
021    import javax.servlet.http.HttpServletRequest;
022    
023    /**
024     * @author Brian Wing Shun Chan
025     * @author Jorge Ferrer
026     */
027    public class AssetCategoriesSummaryTag extends IncludeTag {
028    
029            public PortletURL getPortletURL() {
030                    return _portletURL;
031            }
032    
033            public void setClassName(String className) {
034                    _className = className;
035            }
036    
037            public void setClassPK(long classPK) {
038                    _classPK = classPK;
039            }
040    
041            public void setMessage(String message) {
042                    _message = message;
043            }
044    
045            public void setPortletURL(PortletURL portletURL) {
046                    _portletURL = portletURL;
047            }
048    
049            @Override
050            protected void cleanUp() {
051                    _className = null;
052                    _classPK = 0;
053                    _message = null;
054                    _portletURL = null;
055            }
056    
057            @Override
058            protected String getPage() {
059                    return _PAGE;
060            }
061    
062            @Override
063            protected void setAttributes(HttpServletRequest request) {
064                    request.setAttribute(
065                            "liferay-ui:asset-categories-summary:className", _className);
066                    request.setAttribute(
067                            "liferay-ui:asset-categories-summary:classPK",
068                            String.valueOf(_classPK));
069                    request.setAttribute(
070                            "liferay-ui:asset-categories-summary:message", _message);
071                    request.setAttribute(
072                            "liferay-ui:asset-categories-summary:portletURL", _portletURL);
073            }
074    
075            private static final String _PAGE =
076                    "/html/taglib/ui/asset_categories_summary/page.jsp";
077    
078            private String _className;
079            private long _classPK;
080            private String _message;
081            private PortletURL _portletURL;
082    
083    }