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="FlagsTag.java.html"><b><i>View Source</i></b></a>
23   *
24   * @author Julio Camarero
25   */
26  public class FlagsTag extends IncludeTag {
27  
28      public void setClassName(String className) {
29          _className = className;
30      }
31  
32      public void setClassPK(long classPK) {
33          _classPK = classPK;
34      }
35  
36      public void setContentTitle(String contentTitle) {
37          _contentTitle = contentTitle;
38      }
39  
40      public void setLabel(boolean label) {
41          _label = label;
42      }
43  
44      public void setMessage(String message) {
45          _message = message;
46      }
47  
48      public void setReportedUserId(long reportedUserId) {
49          _reportedUserId = reportedUserId;
50      }
51  
52      protected void cleanUp() {
53          _className = null;
54          _classPK = 0;
55          _contentTitle = null;
56          _label = true;
57          _message = null;
58          _reportedUserId = 0;
59      }
60  
61      protected String getPage() {
62          return _PAGE;
63      }
64  
65      protected void setAttributes(HttpServletRequest request) {
66          request.setAttribute("liferay-ui:flags:className", _className);
67          request.setAttribute(
68              "liferay-ui:flags:classPK", String.valueOf(_classPK));
69          request.setAttribute("liferay-ui:flags:contentTitle", _contentTitle);
70          request.setAttribute("liferay-ui:flags:label", String.valueOf(_label));
71          request.setAttribute("liferay-ui:flags:message", _message);
72          request.setAttribute(
73              "liferay-ui:flags:reportedUserId", String.valueOf(_reportedUserId));
74      }
75  
76      private static final String _PAGE = "/html/taglib/ui/flags/page.jsp";
77  
78      private String _className;
79      private long _classPK;
80      private String _contentTitle;
81      private boolean _label = true;
82      private String _message;
83      private long _reportedUserId;
84  
85  }