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 int doStartTag() {
30          HttpServletRequest request =
31              (HttpServletRequest)pageContext.getRequest();
32  
33          request.setAttribute(
34              "liferay-ui:asset-categories-selector:className", _className);
35          request.setAttribute(
36              "liferay-ui:asset-categories-selector:classPK",
37              String.valueOf(_classPK));
38          request.setAttribute(
39              "liferay-ui:asset-categories-selector:contentCallback",
40              String.valueOf(_contentCallback));
41          request.setAttribute(
42              "liferay-ui:asset-categories-selector:curCategoryIds",
43              _curCategoryIds);
44          request.setAttribute(
45              "liferay-ui:asset-categories-selector:focus",
46              String.valueOf(_focus));
47          request.setAttribute(
48              "liferay-ui:asset-categories-selector:hiddenInput", _hiddenInput);
49  
50          return EVAL_BODY_BUFFERED;
51      }
52  
53      public void setClassName(String className) {
54          _className = className;
55      }
56  
57      public void setClassPK(long classPK) {
58          _classPK = classPK;
59      }
60  
61      public void setContentCallback(String contentCallback) {
62          _contentCallback = contentCallback;
63      }
64  
65      public void setCurCategoryIds(String curCategoryIds) {
66          _curCategoryIds= curCategoryIds;
67      }
68  
69      public void setFocus(boolean focus) {
70          _focus = focus;
71      }
72  
73      public void setHiddenInput(String hiddenInput) {
74          _hiddenInput = hiddenInput;
75      }
76  
77      protected String getDefaultPage() {
78          return _PAGE;
79      }
80  
81      private static final String _PAGE =
82          "/html/taglib/ui/asset_categories_selector/page.jsp";
83  
84      private String _className;
85      private long _classPK;
86      private String _contentCallback;
87      private String _curCategoryIds;
88      private boolean _focus;
89      private String _hiddenInput = "assetCategoryIds";
90  
91  }