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.servlet.http.HttpServletRequest;
020    
021    /**
022     * @author Brian Wing Shun Chan
023     * @author Jorge Ferrer
024     */
025    public class SocialBookmarksTag extends IncludeTag {
026    
027            public void setDisplayStyle(String displayStyle) {
028                    _displayStyle = displayStyle;
029            }
030    
031            public void setTarget(String target) {
032                    _target = target;
033            }
034    
035            public void setTitle(String title) {
036                    _title = title;
037            }
038    
039            public void setTypes(String types) {
040                    _types = types;
041            }
042    
043            public void setUrl(String url) {
044                    _url = url;
045            }
046    
047            @Override
048            protected void cleanUp() {
049                    _displayStyle = null;
050                    _target = null;
051                    _title = null;
052                    _types = null;
053                    _url = null;
054            }
055    
056            @Override
057            protected String getPage() {
058                    return _PAGE;
059            }
060    
061            @Override
062            protected void setAttributes(HttpServletRequest request) {
063                    request.setAttribute(
064                            "liferay-ui:social-bookmark:displayStyle", _displayStyle);
065                    request.setAttribute("liferay-ui:social-bookmark:target", _target);
066                    request.setAttribute("liferay-ui:social-bookmark:title", _title);
067                    request.setAttribute("liferay-ui:social-bookmark:types", _types);
068                    request.setAttribute("liferay-ui:social-bookmark:url", _url);
069            }
070    
071            private static final String _PAGE =
072                    "/html/taglib/ui/social_bookmarks/page.jsp";
073    
074            private String _displayStyle;
075            private String _target;
076            private String _title;
077            private String _types;
078            private String _url;
079    
080    }