001    /**
002     * Copyright (c) 2000-2011 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 AssetTagsSelectorTag extends IncludeTag {
026    
027            public void setClassName(String className) {
028                    _className = className;
029            }
030    
031            public void setClassPK(long classPK) {
032                    _classPK = classPK;
033            }
034    
035            public void setContentCallback(String contentCallback) {
036                    _contentCallback = contentCallback;
037            }
038    
039            public void setCurTags(String curTags) {
040                    _curTags = curTags;
041            }
042    
043            public void setFocus(boolean focus) {
044                    _focus = focus;
045            }
046    
047            public void setHiddenInput(String hiddenInput) {
048                    _hiddenInput = hiddenInput;
049            }
050    
051            protected void cleanUp() {
052                    _className = null;
053                    _classPK = 0;
054                    _contentCallback = null;
055                    _curTags = null;
056                    _focus = false;
057                    _hiddenInput = "assetTagNames";
058            }
059    
060            protected String getPage() {
061                    return _PAGE;
062            }
063    
064            protected void setAttributes(HttpServletRequest request) {
065                    request.setAttribute(
066                            "liferay-ui:asset-tags-selector:className", _className);
067                    request.setAttribute(
068                            "liferay-ui:asset-tags-selector:classPK", String.valueOf(_classPK));
069                    request.setAttribute(
070                            "liferay-ui:asset-tags-selector:contentCallback",
071                            String.valueOf(_contentCallback));
072                    request.setAttribute(
073                            "liferay-ui:asset-tags-selector:curTags", _curTags);
074                    request.setAttribute(
075                            "liferay-ui:asset-tags-selector:focus", String.valueOf(_focus));
076                    request.setAttribute(
077                            "liferay-ui:asset-tags-selector:hiddenInput", _hiddenInput);
078            }
079    
080            private static final String _PAGE =
081                    "/html/taglib/ui/asset_tags_selector/page.jsp";
082    
083            private String _className;
084            private long _classPK;
085            private String _contentCallback;
086            private String _curTags;
087            private boolean _focus;
088            private String _hiddenInput = "assetTagNames";
089    
090    }