1
14
15 package com.liferay.taglib.ui;
16
17 import com.liferay.taglib.util.IncludeTag;
18
19 import javax.servlet.http.HttpServletRequest;
20
21
26 public class RatingsTag 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 setNumberOfStars(int numberOfStars) {
37 _numberOfStars = numberOfStars;
38 }
39
40 public void setType(String type) {
41 _type = type;
42 }
43
44 public void setUrl(String url) {
45 _url = url;
46 }
47
48 protected void cleanUp() {
49 _className = null;
50 _classPK = 0;
51 _numberOfStars = 5;
52 _type = "stars";
53 _url = null;
54 }
55
56 protected String getPage() {
57 return _PAGE;
58 }
59
60 protected void setAttributes(HttpServletRequest request) {
61 request.setAttribute("liferay-ui:ratings:className", _className);
62 request.setAttribute(
63 "liferay-ui:ratings:classPK", String.valueOf(_classPK));
64 request.setAttribute(
65 "liferay-ui:ratings:numberOfStars", String.valueOf(_numberOfStars));
66 request.setAttribute("liferay-ui:ratings:type", _type);
67 request.setAttribute("liferay-ui:ratings:url", _url);
68 }
69
70 private static final String _PAGE = "/html/taglib/ui/ratings/page.jsp";
71
72 private String _className;
73 private long _classPK;
74 private int _numberOfStars = 5;
75 private String _type = "stars";
76 private String _url;
77
78 }