001    /**
002     * Copyright (c) 2000-2010 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 AssetCategoriesSelectorTag 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 setCurCategoryIds(String curCategoryIds) {
040                    _curCategoryIds= curCategoryIds;
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                    _curCategoryIds = null;
056                    _focus = false;
057                    _hiddenInput = "assetCategoryIds";
058            }
059    
060            protected String getPage() {
061                    return _PAGE;
062            }
063    
064            protected void setAttributes(HttpServletRequest request) {
065                    request.setAttribute(
066                            "liferay-ui:asset-categories-selector:className", _className);
067                    request.setAttribute(
068                            "liferay-ui:asset-categories-selector:classPK",
069                            String.valueOf(_classPK));
070                    request.setAttribute(
071                            "liferay-ui:asset-categories-selector:contentCallback",
072                            String.valueOf(_contentCallback));
073                    request.setAttribute(
074                            "liferay-ui:asset-categories-selector:curCategoryIds",
075                            _curCategoryIds);
076                    request.setAttribute(
077                            "liferay-ui:asset-categories-selector:focus",
078                            String.valueOf(_focus));
079                    request.setAttribute(
080                            "liferay-ui:asset-categories-selector:hiddenInput", _hiddenInput);
081            }
082    
083            private static final String _PAGE =
084                    "/html/taglib/ui/asset_categories_selector/page.jsp";
085    
086            private String _className;
087            private long _classPK;
088            private String _contentCallback;
089            private String _curCategoryIds;
090            private boolean _focus;
091            private String _hiddenInput = "assetCategoryIds";
092    
093    }