001    /**
002     * Copyright (c) 2000-2010 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 setTarget(String target) {
028                    _target = target;
029            }
030    
031            public void setTitle(String title) {
032                    _title = title;
033            }
034    
035            public void setTypes(String types) {
036                    _types = types;
037            }
038    
039            public void setUrl(String url) {
040                    _url = url;
041            }
042    
043            protected void cleanUp() {
044                    _target = null;
045                    _title = null;
046                    _types = null;
047                    _url = null;
048            }
049    
050            protected String getPage() {
051                    return _PAGE;
052            }
053    
054            protected void setAttributes(HttpServletRequest request) {
055                    request.setAttribute("liferay-ui:social-bookmark:target", _target);
056                    request.setAttribute("liferay-ui:social-bookmark:title", _title);
057                    request.setAttribute("liferay-ui:social-bookmark:types", _types);
058                    request.setAttribute("liferay-ui:social-bookmark:url", _url);
059            }
060    
061            private static final String _PAGE =
062                    "/html/taglib/ui/social_bookmarks/page.jsp";
063    
064            private String _target;
065            private String _title;
066            private String _types;
067            private String _url;
068    
069    }