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