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="CustomAttributeListTag.java.html"><b><i>View Source</i></b></a>
23   *
24   * @author Brian Wing Shun Chan
25   */
26  public class CustomAttributeListTag extends IncludeTag {
27  
28      public int doStartTag() {
29          HttpServletRequest request =
30              (HttpServletRequest)pageContext.getRequest();
31  
32          request.setAttribute(
33              "liferay-ui:custom-attribute-list:className", _className);
34          request.setAttribute(
35              "liferay-ui:custom-attribute-list:classPK",
36              String.valueOf(_classPK));
37          request.setAttribute(
38              "liferay-ui:custom-attribute-list:editable",
39              String.valueOf(_editable));
40          request.setAttribute(
41              "liferay-ui:custom-attribute-list:label", String.valueOf(_label));
42  
43          return EVAL_BODY_BUFFERED;
44      }
45  
46      public void setClassName(String className) {
47          _className = className;
48      }
49  
50      public void setClassPK(long classPK) {
51          _classPK = classPK;
52      }
53  
54      public void setEditable(boolean editable) {
55          _editable = editable;
56      }
57  
58      public void setLabel(boolean label) {
59          _label = label;
60      }
61  
62      protected String getDefaultPage() {
63          return _PAGE;
64      }
65  
66      private static final String _PAGE =
67          "/html/taglib/ui/custom_attribute_list/page.jsp";
68  
69      private String _className;
70      private long _classPK;
71      private boolean _editable = false;
72      private boolean _label = false;
73  
74  }