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="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  }