1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   *
12   *
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="TagsSelectorTag.java.html"><b><i>View Source</i></b></a>
23   *
24   * @author Brian Wing Shun Chan
25   * @author Jorge Ferrer
26   */
27  public class TagsSelectorTag extends IncludeTag {
28  
29      public int doStartTag() {
30          HttpServletRequest request =
31              (HttpServletRequest)pageContext.getRequest();
32  
33          request.setAttribute("liferay-ui:tags_selector:className", _className);
34          request.setAttribute(
35              "liferay-ui:tags_selector:classPK", String.valueOf(_classPK));
36          request.setAttribute(
37              "liferay-ui:tags_selector:folksonomy", String.valueOf(_folksonomy));
38          request.setAttribute(
39              "liferay-ui:tags_selector:hiddenInput", _hiddenInput);
40          request.setAttribute("liferay-ui:tags_selector:curTags", _curTags);
41          request.setAttribute(
42              "liferay-ui:tags_selector:focus", String.valueOf(_focus));
43          request.setAttribute(
44              "liferay-ui:tags_selector:contentCallback",
45              String.valueOf(_contentCallback));
46  
47          return EVAL_BODY_BUFFERED;
48      }
49  
50      public void setClassName(String className) {
51          _className = className;
52      }
53  
54      public void setClassPK(long classPK) {
55          _classPK = classPK;
56      }
57  
58      public void setFolksonomy(boolean folksonomy) {
59          _folksonomy = folksonomy;
60      }
61  
62      public void setHiddenInput(String hiddenInput) {
63          _hiddenInput = hiddenInput;
64      }
65  
66      public void setCurTags(String curTags) {
67          _curTags = curTags;
68      }
69  
70      public void setFocus(boolean focus) {
71          _focus = focus;
72      }
73  
74      public void setContentCallback(String contentCallback) {
75          _contentCallback = contentCallback;
76      }
77  
78      protected String getDefaultPage() {
79          return _PAGE;
80      }
81  
82      private static final String _PAGE =
83          "/html/taglib/ui/tags_selector/page.jsp";
84  
85      private String _className;
86      private long _classPK;
87      private boolean _folksonomy = true;
88      private String _hiddenInput;
89      private String _curTags;
90      private boolean _focus;
91      private String _contentCallback;
92  
93  }