001    /**
002     * Copyright (c) 2000-present 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 Brian Wing Shun Chan
023     * @author Jorge Ferrer
024     */
025    public class SocialBookmarksSettingsTag extends IncludeTag {
026    
027            public void setDisplayPosition(String displayPosition) {
028                    _displayPosition = displayPosition;
029            }
030    
031            public void setDisplayStyle(String displayStyle) {
032                    _displayStyle = displayStyle;
033            }
034    
035            public void setEnabled(boolean enabled) {
036                    _enabled = enabled;
037            }
038    
039            public void setTypes(String types) {
040                    _types = types;
041            }
042    
043            @Override
044            protected void cleanUp() {
045                    _displayStyle = null;
046                    _displayPosition = null;
047                    _enabled = false;
048                    _types = null;
049            }
050    
051            @Override
052            protected String getPage() {
053                    return _PAGE;
054            }
055    
056            @Override
057            protected void setAttributes(HttpServletRequest request) {
058                    request.setAttribute(
059                            "liferay-ui:social-bookmarks-settings:displayPosition",
060                            _displayPosition);
061                    request.setAttribute(
062                            "liferay-ui:social-bookmarks-settings:displayStyle", _displayStyle);
063                    request.setAttribute(
064                            "liferay-ui:social-bookmarks-settings:enabled",
065                            String.valueOf(_enabled));
066                    request.setAttribute(
067                            "liferay-ui:social-bookmarks-settings:types", _types);
068            }
069    
070            private static final String _PAGE =
071                    "/html/taglib/ui/social_bookmarks_settings/page.jsp";
072    
073            private String _displayPosition;
074            private String _displayStyle;
075            private boolean _enabled;
076            private String _types;
077    
078    }