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 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 setCurTags(String curTags) {
42          _curTags = curTags;
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          _curTags = null;
58          _focus = false;
59          _hiddenInput = "assetTagNames";
60      }
61  
62      protected String getPage() {
63          return _PAGE;
64      }
65  
66      protected void setAttributes(HttpServletRequest request) {
67          request.setAttribute(
68              "liferay-ui:asset-tags-selector:className", _className);
69          request.setAttribute(
70              "liferay-ui:asset-tags-selector:classPK", String.valueOf(_classPK));
71          request.setAttribute(
72              "liferay-ui:asset-tags-selector:contentCallback",
73              String.valueOf(_contentCallback));
74          request.setAttribute(
75              "liferay-ui:asset-tags-selector:curTags", _curTags);
76          request.setAttribute(
77              "liferay-ui:asset-tags-selector:focus", String.valueOf(_focus));
78          request.setAttribute(
79              "liferay-ui:asset-tags-selector:hiddenInput", _hiddenInput);
80      }
81  
82      private static final String _PAGE =
83          "/html/taglib/ui/asset_tags_selector/page.jsp";
84  
85      private String _className;
86      private long _classPK;
87      private String _contentCallback;
88      private String _curTags;
89      private boolean _focus;
90      private String _hiddenInput = "assetTagNames";
91  
92  }