2 * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
\r
4 * This library is free software; you can redistribute it and/or modify it under
\r
5 * the terms of the GNU Lesser General Public License as published by the Free
\r
6 * Software Foundation; either version 2.1 of the License, or (at your option)
\r
9 * This library is distributed in the hope that it will be useful, but WITHOUT
\r
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
\r
11 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
\r
15 package com.liferay.portlet.useradmin.search;
\r
17 import com.liferay.portal.kernel.dao.search.DisplayTerms;
\r
18 import com.liferay.portal.kernel.util.GetterUtil;
\r
19 import com.liferay.portal.kernel.util.ParamUtil;
\r
20 import com.liferay.portal.kernel.util.Validator;
\r
21 import com.liferay.portal.kernel.workflow.WorkflowConstants;
\r
23 import javax.portlet.PortletRequest;
\r
26 * @author Brian Wing Shun Chan
\r
28 public class UserDisplayTerms extends DisplayTerms {
\r
30 public static final String EMAIL_ADDRESS = "emailAddress";
\r
32 public static final String FIRST_NAME = "firstName";
\r
34 public static final String LAST_NAME = "lastName";
\r
36 public static final String MIDDLE_NAME = "middleName";
\r
38 public static final String ORGANIZATION_ID = "organizationId";
\r
40 public static final String ROLE_ID = "roleId";
\r
42 public static final String SCREEN_NAME = "screenName";
\r
44 public static final String STATUS = "status";
\r
46 public static final String USER_GROUP_ID = "userGroupId";
\r
48 public static final String COLLEGE_ID = "collegeId";
\r
50 public static final String CLASSE_ID = "classeId";
\r
52 public static final String ENSEIGNEMENT_ID = "enseignementId";
\r
54 public UserDisplayTerms(PortletRequest portletRequest) {
\r
55 super(portletRequest);
\r
57 String statusString = ParamUtil.getString(portletRequest, STATUS);
\r
59 if (Validator.isNotNull(statusString)) {
\r
60 status = GetterUtil.getInteger(statusString);
\r
63 emailAddress = ParamUtil.getString(portletRequest, EMAIL_ADDRESS);
\r
64 firstName = ParamUtil.getString(portletRequest, FIRST_NAME);
\r
65 lastName = ParamUtil.getString(portletRequest, LAST_NAME);
\r
66 middleName = ParamUtil.getString(portletRequest, MIDDLE_NAME);
\r
67 organizationId = ParamUtil.getLong(portletRequest, ORGANIZATION_ID);
\r
68 roleId = ParamUtil.getLong(portletRequest, ROLE_ID);
\r
69 screenName = ParamUtil.getString(portletRequest, SCREEN_NAME);
\r
70 userGroupId = ParamUtil.getLong(portletRequest, USER_GROUP_ID);
\r
73 collegeId = ParamUtil.getLong(portletRequest, COLLEGE_ID);
\r
74 classeId = ParamUtil.getLong(portletRequest, CLASSE_ID);
\r
76 organizationId = collegeId;
\r
79 organizationId = classeId;
\r
81 enseignementid = ParamUtil.getLong(portletRequest, ENSEIGNEMENT_ID);
\r
84 public String getEmailAddress() {
\r
85 return emailAddress;
\r
88 public String getFirstName() {
\r
92 public String getLastName() {
\r
96 public String getMiddleName() {
\r
100 public long getOrganizationId() {
\r
101 return organizationId;
\r
104 public long getRoleId() {
\r
108 public String getScreenName() {
\r
112 public int getStatus() {
\r
116 public long getUserGroupId() {
\r
117 return userGroupId;
\r
120 public long getCollegeId() {
\r
124 public long getClasseId() {
\r
128 public long getEnseignementId() {
\r
129 return enseignementid;
\r
132 public boolean isActive() {
\r
133 if (status == WorkflowConstants.STATUS_APPROVED) {
\r
141 public void setStatus(int status) {
\r
142 this.status = status;
\r
145 protected String emailAddress;
\r
146 protected String firstName;
\r
147 protected String lastName;
\r
148 protected String middleName;
\r
149 protected long organizationId;
\r
150 protected long roleId;
\r
151 protected String screenName;
\r
152 protected int status;
\r
153 protected long userGroupId;
\r
154 protected long collegeId;
\r
155 protected long classeId;
\r
156 protected long enseignementid;
\r