1
14
15 package com.liferay.portlet.enterpriseadmin.search;
16
17 import com.liferay.portal.kernel.dao.search.DisplayTerms;
18 import com.liferay.portal.kernel.util.ParamUtil;
19 import com.liferay.portal.kernel.util.StringPool;
20 import com.liferay.portal.model.RoleConstants;
21
22 import javax.portlet.PortletRequest;
23
24
29 public class RoleDisplayTerms extends DisplayTerms {
30
31 public static final String DESCRIPTION = "description";
32
33 public static final String NAME = "name";
34
35 public static final String TYPE = "type";
36
37 public RoleDisplayTerms(PortletRequest portletRequest) {
38 super(portletRequest);
39
40 description = ParamUtil.getString(portletRequest, DESCRIPTION);
41 name = ParamUtil.getString(portletRequest, NAME);
42 type = ParamUtil.getInteger(portletRequest, TYPE);
43 }
44
45 public String getDescription() {
46 return description;
47 }
48
49 public String getName() {
50 return name;
51 }
52
53 public int getType() {
54 if ((type == RoleConstants.TYPE_COMMUNITY) ||
55 (type == RoleConstants.TYPE_ORGANIZATION) ||
56 (type == RoleConstants.TYPE_REGULAR)) {
57
58 return type;
59 }
60 else {
61 return 0;
62 }
63 }
64
65 public String getTypeString() {
66 if ((type == RoleConstants.TYPE_COMMUNITY) ||
67 (type == RoleConstants.TYPE_ORGANIZATION) ||
68 (type == RoleConstants.TYPE_REGULAR)) {
69
70 return String.valueOf(type);
71 }
72 else {
73 return StringPool.BLANK;
74 }
75 }
76
77 protected String description;
78 protected String name;
79 protected int type;
80
81 }