001    /**
002     * Copyright (c) 2000-2012 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 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            @Override
052            protected void cleanUp() {
053                    _className = null;
054                    _classPK = 0;
055                    _contentCallback = null;
056                    _curCategoryIds = null;
057                    _focus = false;
058                    _hiddenInput = "assetCategoryIds";
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:asset-categories-selector:className", _className);
070                    request.setAttribute(
071                            "liferay-ui:asset-categories-selector:classPK",
072                            String.valueOf(_classPK));
073                    request.setAttribute(
074                            "liferay-ui:asset-categories-selector:contentCallback",
075                            String.valueOf(_contentCallback));
076                    request.setAttribute(
077                            "liferay-ui:asset-categories-selector:curCategoryIds",
078                            _curCategoryIds);
079                    request.setAttribute(
080                            "liferay-ui:asset-categories-selector:focus",
081                            String.valueOf(_focus));
082                    request.setAttribute(
083                            "liferay-ui:asset-categories-selector:hiddenInput", _hiddenInput);
084            }
085    
086            private static final String _PAGE =
087                    "/html/taglib/ui/asset_categories_selector/page.jsp";
088    
089            private String _className;
090            private long _classPK;
091            private String _contentCallback;
092            private String _curCategoryIds;
093            private boolean _focus;
094            private String _hiddenInput = "assetCategoryIds";
095    
096    }