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 setContentId(String contentId) {
028                    _contentId = contentId;
029            }
030    
031            public void setDisplayStyle(String displayStyle) {
032                    _displayStyle = displayStyle;
033            }
034    
035            public void setTarget(String target) {
036                    _target = target;
037            }
038    
039            public void setTitle(String title) {
040                    _title = title;
041            }
042    
043            public void setTypes(String types) {
044                    _types = types;
045            }
046    
047            public void setUrl(String url) {
048                    _url = url;
049            }
050    
051            @Override
052            protected void cleanUp() {
053                    _contentId = null;
054                    _displayStyle = null;
055                    _target = null;
056                    _title = null;
057                    _types = null;
058                    _url = null;
059            }
060    
061            @Override
062            protected String getPage() {
063                    return _PAGE;
064            }
065    
066            @Override
067            protected void setAttributes(HttpServletRequest request) {
068                    request.setAttribute(
069                            "liferay-ui:social-bookmark:contentId", _contentId);
070                    request.setAttribute(
071                            "liferay-ui:social-bookmark:displayStyle", _displayStyle);
072                    request.setAttribute("liferay-ui:social-bookmark:target", _target);
073                    request.setAttribute("liferay-ui:social-bookmark:title", _title);
074                    request.setAttribute("liferay-ui:social-bookmark:types", _types);
075                    request.setAttribute("liferay-ui:social-bookmark:url", _url);
076            }
077    
078            private static final String _PAGE =
079                    "/html/taglib/ui/social_bookmarks/page.jsp";
080    
081            private String _contentId;
082            private String _displayStyle;
083            private String _target;
084            private String _title;
085            private String _types;
086            private String _url;
087    
088    }