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="AssetTagsSelectorTag.java.html"><b><i>View Source</i></b></a>
23   *
24   * @author Brian Wing Shun Chan
25   * @author Jorge Ferrer
26   */
27  public class AssetTagsSelectorTag extends IncludeTag {
28  
29      public int doStartTag() {
30          HttpServletRequest request =
31              (HttpServletRequest)pageContext.getRequest();
32  
33          request.setAttribute(
34              "liferay-ui:asset-tags-selector:className", _className);
35          request.setAttribute(
36              "liferay-ui:asset-tags-selector:classPK", String.valueOf(_classPK));
37          request.setAttribute(
38              "liferay-ui:asset-tags-selector:contentCallback",
39              String.valueOf(_contentCallback));
40          request.setAttribute(
41              "liferay-ui:asset-tags-selector:curTags", _curTags);
42          request.setAttribute(
43              "liferay-ui:asset-tags-selector:focus", String.valueOf(_focus));
44          request.setAttribute(
45              "liferay-ui:asset-tags-selector:hiddenInput", _hiddenInput);
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 setContentCallback(String contentCallback) {
59          _contentCallback = contentCallback;
60      }
61  
62      public void setCurTags(String curTags) {
63          _curTags = curTags;
64      }
65  
66      public void setFocus(boolean focus) {
67          _focus = focus;
68      }
69  
70      public void setHiddenInput(String hiddenInput) {
71          _hiddenInput = hiddenInput;
72      }
73  
74      protected String getDefaultPage() {
75          return _PAGE;
76      }
77  
78      private static final String _PAGE =
79          "/html/taglib/ui/asset_tags_selector/page.jsp";
80  
81      private String _className;
82      private long _classPK;
83      private String _contentCallback;
84      private String _curTags;
85      private boolean _focus;
86      private String _hiddenInput = "assetTagNames";
87  
88  }