1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
13   */
14  
15  package com.liferay.taglib.ui;
16  
17  import com.liferay.taglib.util.IncludeTag;
18  
19  import javax.servlet.http.HttpServletRequest;
20  
21  /**
22   * <a href="AssetCategoriesSelectorTag.java.html"><b><i>View Source</i></b></a>
23   *
24   * @author Brian Wing Shun Chan
25   * @author Jorge Ferrer
26   */
27  public class AssetCategoriesSelectorTag extends IncludeTag {
28  
29      public void setClassName(String className) {
30          _className = className;
31      }
32  
33      public void setClassPK(long classPK) {
34          _classPK = classPK;
35      }
36  
37      public void setContentCallback(String contentCallback) {
38          _contentCallback = contentCallback;
39      }
40  
41      public void setCurCategoryIds(String curCategoryIds) {
42          _curCategoryIds= curCategoryIds;
43      }
44  
45      public void setFocus(boolean focus) {
46          _focus = focus;
47      }
48  
49      public void setHiddenInput(String hiddenInput) {
50          _hiddenInput = hiddenInput;
51      }
52  
53      protected void cleanUp() {
54          _className = null;
55          _classPK = 0;
56          _contentCallback = null;
57          _curCategoryIds = null;
58          _focus = false;
59          _hiddenInput = "assetCategoryIds";
60      }
61  
62      protected String getPage() {
63          return _PAGE;
64      }
65  
66      protected void setAttributes(HttpServletRequest request) {
67          request.setAttribute(
68              "liferay-ui:asset-categories-selector:className", _className);
69          request.setAttribute(
70              "liferay-ui:asset-categories-selector:classPK",
71              String.valueOf(_classPK));
72          request.setAttribute(
73              "liferay-ui:asset-categories-selector:contentCallback",
74              String.valueOf(_contentCallback));
75          request.setAttribute(
76              "liferay-ui:asset-categories-selector:curCategoryIds",
77              _curCategoryIds);
78          request.setAttribute(
79              "liferay-ui:asset-categories-selector:focus",
80              String.valueOf(_focus));
81          request.setAttribute(
82              "liferay-ui:asset-categories-selector:hiddenInput", _hiddenInput);
83      }
84  
85      private static final String _PAGE =
86          "/html/taglib/ui/asset_categories_selector/page.jsp";
87  
88      private String _className;
89      private long _classPK;
90      private String _contentCallback;
91      private String _curCategoryIds;
92      private boolean _focus;
93      private String _hiddenInput = "assetCategoryIds";
94  
95  }