001
014
015 package com.liferay.portlet.enterpriseadmin.search;
016
017 import com.liferay.portal.kernel.dao.search.DisplayTerms;
018 import com.liferay.portal.kernel.util.ParamUtil;
019 import com.liferay.portal.kernel.util.StringPool;
020 import com.liferay.portal.model.RoleConstants;
021
022 import javax.portlet.PortletRequest;
023
024
027 public class RoleDisplayTerms extends DisplayTerms {
028
029 public static final String DESCRIPTION = "description";
030
031 public static final String NAME = "name";
032
033 public static final String TYPE = "type";
034
035 public RoleDisplayTerms(PortletRequest portletRequest) {
036 super(portletRequest);
037
038 description = ParamUtil.getString(portletRequest, DESCRIPTION);
039 name = ParamUtil.getString(portletRequest, NAME);
040 type = ParamUtil.getInteger(portletRequest, TYPE);
041 }
042
043 public String getDescription() {
044 return description;
045 }
046
047 public String getName() {
048 return name;
049 }
050
051 public int getType() {
052 if ((type == RoleConstants.TYPE_COMMUNITY) ||
053 (type == RoleConstants.TYPE_ORGANIZATION) ||
054 (type == RoleConstants.TYPE_REGULAR)) {
055
056 return type;
057 }
058 else {
059 return 0;
060 }
061 }
062
063 public String getTypeString() {
064 if ((type == RoleConstants.TYPE_COMMUNITY) ||
065 (type == RoleConstants.TYPE_ORGANIZATION) ||
066 (type == RoleConstants.TYPE_REGULAR)) {
067
068 return String.valueOf(type);
069 }
070 else {
071 return StringPool.BLANK;
072 }
073 }
074
075 protected String description;
076 protected String name;
077 protected int type;
078
079 }