001    /**
002     * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
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    }