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.portal.service;
\r
17 import java.util.List;
\r
19 import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
\r
20 import com.liferay.portal.kernel.exception.SystemException;
\r
21 import com.liferay.portal.kernel.util.OrderByComparator;
\r
22 import com.liferay.portal.kernel.util.ReferenceRegistry;
\r
23 import com.liferay.portal.model.User;
\r
26 * The utility for the user local service. This utility wraps {@link com.liferay.portal.service.impl.ExtUserLocalServiceImpl} and is the primary access point for service operations in application layer code running on the local server.
\r
29 * This is a local service. Methods of this service will not have security checks based on the propagated JAAS credentials because this service can only be accessed from within the same VM.
\r
32 * @author Brian Wing Shun Chan
\r
33 * @see ExtUserLocalService
\r
34 * @see com.liferay.portal.service.base.ExtUserLocalServiceBaseImpl
\r
35 * @see com.liferay.portal.service.impl.ExtUserLocalServiceImpl
\r
38 public class ExtUserLocalServiceUtil {
\r
40 * NOTE FOR DEVELOPERS:
\r
42 * Never modify this class directly. Add custom service methods to {@link com.liferay.portal.service.impl.ExtUserLocalServiceImpl} and rerun ServiceBuilder to regenerate this class.
\r
46 * Adds the user to the database. Also notifies the appropriate model listeners.
\r
48 * @param user the user
\r
49 * @return the user that was added
\r
50 * @throws SystemException if a system exception occurred
\r
52 public static com.liferay.portal.model.User addUser(
\r
53 com.liferay.portal.model.User user)
\r
54 throws com.liferay.portal.kernel.exception.SystemException {
\r
55 return getService().addUser(user);
\r
59 * Creates a new user with the primary key. Does not add the user to the database.
\r
61 * @param userId the primary key for the new user
\r
62 * @return the new user
\r
64 public static com.liferay.portal.model.User createUser(long userId) {
\r
65 return getService().createUser(userId);
\r
69 * Deletes the user with the primary key from the database. Also notifies the appropriate model listeners.
\r
71 * @param userId the primary key of the user
\r
72 * @return the user that was removed
\r
73 * @throws PortalException if a user with the primary key could not be found
\r
74 * @throws SystemException if a system exception occurred
\r
76 public static com.liferay.portal.model.User deleteUser(long userId)
\r
77 throws com.liferay.portal.kernel.exception.PortalException,
\r
78 com.liferay.portal.kernel.exception.SystemException {
\r
79 return getService().deleteUser(userId);
\r
83 * Deletes the user from the database. Also notifies the appropriate model listeners.
\r
85 * @param user the user
\r
86 * @return the user that was removed
\r
87 * @throws PortalException
\r
88 * @throws SystemException if a system exception occurred
\r
90 public static com.liferay.portal.model.User deleteUser(
\r
91 com.liferay.portal.model.User user)
\r
92 throws com.liferay.portal.kernel.exception.PortalException,
\r
93 com.liferay.portal.kernel.exception.SystemException {
\r
94 return getService().deleteUser(user);
\r
97 public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() {
\r
98 return getService().dynamicQuery();
\r
102 * Performs a dynamic query on the database and returns the matching rows.
\r
104 * @param dynamicQuery the dynamic query
\r
105 * @return the matching rows
\r
106 * @throws SystemException if a system exception occurred
\r
108 @SuppressWarnings("rawtypes")
\r
109 public static java.util.List dynamicQuery(
\r
110 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
\r
111 throws com.liferay.portal.kernel.exception.SystemException {
\r
112 return getService().dynamicQuery(dynamicQuery);
\r
116 * Performs a dynamic query on the database and returns a range of the matching rows.
\r
119 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
\r
122 * @param dynamicQuery the dynamic query
\r
123 * @param start the lower bound of the range of model instances
\r
124 * @param end the upper bound of the range of model instances (not inclusive)
\r
125 * @return the range of matching rows
\r
126 * @throws SystemException if a system exception occurred
\r
128 @SuppressWarnings("rawtypes")
\r
129 public static java.util.List dynamicQuery(
\r
130 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
\r
131 int end) throws com.liferay.portal.kernel.exception.SystemException {
\r
132 return getService().dynamicQuery(dynamicQuery, start, end);
\r
136 * Performs a dynamic query on the database and returns an ordered range of the matching rows.
\r
139 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
\r
142 * @param dynamicQuery the dynamic query
\r
143 * @param start the lower bound of the range of model instances
\r
144 * @param end the upper bound of the range of model instances (not inclusive)
\r
145 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
\r
146 * @return the ordered range of matching rows
\r
147 * @throws SystemException if a system exception occurred
\r
149 @SuppressWarnings("rawtypes")
\r
150 public static java.util.List dynamicQuery(
\r
151 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
\r
153 com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
\r
154 throws com.liferay.portal.kernel.exception.SystemException {
\r
155 return getService()
\r
156 .dynamicQuery(dynamicQuery, start, end, orderByComparator);
\r
160 * Returns the number of rows that match the dynamic query.
\r
162 * @param dynamicQuery the dynamic query
\r
163 * @return the number of rows that match the dynamic query
\r
164 * @throws SystemException if a system exception occurred
\r
166 public static long dynamicQueryCount(
\r
167 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
\r
168 throws com.liferay.portal.kernel.exception.SystemException {
\r
169 return getService().dynamicQueryCount(dynamicQuery);
\r
172 public static com.liferay.portal.model.User fetchUser(long userId)
\r
173 throws com.liferay.portal.kernel.exception.SystemException {
\r
174 return getService().fetchUser(userId);
\r
178 * Returns the user with the primary key.
\r
180 * @param userId the primary key of the user
\r
182 * @throws PortalException if a user with the primary key could not be found
\r
183 * @throws SystemException if a system exception occurred
\r
185 public static com.liferay.portal.model.User getUser(long userId)
\r
186 throws com.liferay.portal.kernel.exception.PortalException,
\r
187 com.liferay.portal.kernel.exception.SystemException {
\r
188 return getService().getUser(userId);
\r
191 public static com.liferay.portal.model.PersistedModel getPersistedModel(
\r
192 java.io.Serializable primaryKeyObj)
\r
193 throws com.liferay.portal.kernel.exception.PortalException,
\r
194 com.liferay.portal.kernel.exception.SystemException {
\r
195 return getService().getPersistedModel(primaryKeyObj);
\r
199 * Returns a range of all the users.
\r
202 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
\r
205 * @param start the lower bound of the range of users
\r
206 * @param end the upper bound of the range of users (not inclusive)
\r
207 * @return the range of users
\r
208 * @throws SystemException if a system exception occurred
\r
210 public static java.util.List<com.liferay.portal.model.User> getUsers(
\r
211 int start, int end)
\r
212 throws com.liferay.portal.kernel.exception.SystemException {
\r
213 return getService().getUsers(start, end);
\r
217 * Returns the number of users.
\r
219 * @return the number of users
\r
220 * @throws SystemException if a system exception occurred
\r
222 public static int getUsersCount()
\r
223 throws com.liferay.portal.kernel.exception.SystemException {
\r
224 return getService().getUsersCount();
\r
228 * Updates the user in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
\r
230 * @param user the user
\r
231 * @return the user that was updated
\r
232 * @throws SystemException if a system exception occurred
\r
234 public static com.liferay.portal.model.User updateUser(
\r
235 com.liferay.portal.model.User user)
\r
236 throws com.liferay.portal.kernel.exception.SystemException {
\r
237 return getService().updateUser(user);
\r
241 * Updates the user in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
\r
243 * @param user the user
\r
244 * @param merge whether to merge the user with the current session. See {@link com.liferay.portal.service.persistence.BatchSession#update(com.liferay.portal.kernel.dao.orm.Session, com.liferay.portal.model.BaseModel, boolean)} for an explanation.
\r
245 * @return the user that was updated
\r
246 * @throws SystemException if a system exception occurred
\r
248 public static com.liferay.portal.model.User updateUser(
\r
249 com.liferay.portal.model.User user, boolean merge)
\r
250 throws com.liferay.portal.kernel.exception.SystemException {
\r
251 return getService().updateUser(user, merge);
\r
255 * Returns the Spring bean ID for this bean.
\r
257 * @return the Spring bean ID for this bean
\r
259 public static java.lang.String getBeanIdentifier() {
\r
260 return getService().getBeanIdentifier();
\r
264 * Sets the Spring bean ID for this bean.
\r
266 * @param beanIdentifier the Spring bean ID for this bean
\r
268 public static void setBeanIdentifier(java.lang.String beanIdentifier) {
\r
269 getService().setBeanIdentifier(beanIdentifier);
\r
272 public static com.liferay.portal.model.User addDefaultAdminUser(
\r
273 long companyId, java.lang.String screenName,
\r
274 java.lang.String emailAddress, java.util.Locale locale,
\r
275 java.lang.String firstName, java.lang.String middleName,
\r
276 java.lang.String lastName)
\r
277 throws com.liferay.portal.kernel.exception.PortalException,
\r
278 com.liferay.portal.kernel.exception.SystemException {
\r
279 return getService()
\r
280 .addDefaultAdminUser(companyId, screenName, emailAddress,
\r
281 locale, firstName, middleName, lastName);
\r
285 * Adds the user to the default groups, unless the user is already in these
\r
286 * groups. The default groups can be specified in
\r
287 * <code>portal.properties</code> with the key
\r
288 * <code>admin.default.group.names</code>.
\r
290 * @param userId the primary key of the user
\r
291 * @throws PortalException if a user with the primary key could not be found
\r
292 * @throws SystemException if a system exception occurred
\r
294 public static void addDefaultGroups(long userId)
\r
295 throws com.liferay.portal.kernel.exception.PortalException,
\r
296 com.liferay.portal.kernel.exception.SystemException {
\r
297 getService().addDefaultGroups(userId);
\r
301 * Adds the user to the default roles, unless the user already has these
\r
302 * roles. The default roles can be specified in
\r
303 * <code>portal.properties</code> with the key
\r
304 * <code>admin.default.role.names</code>.
\r
306 * @param userId the primary key of the user
\r
307 * @throws PortalException if a user with the primary key could not be found
\r
308 * @throws SystemException if a system exception occurred
\r
310 public static void addDefaultRoles(long userId)
\r
311 throws com.liferay.portal.kernel.exception.PortalException,
\r
312 com.liferay.portal.kernel.exception.SystemException {
\r
313 getService().addDefaultRoles(userId);
\r
317 * Adds the user to the default user groups, unless the user is already in
\r
318 * these user groups. The default user groups can be specified in
\r
319 * <code>portal.properties</code> with the property
\r
320 * <code>admin.default.user.group.names</code>.
\r
322 * @param userId the primary key of the user
\r
323 * @throws PortalException if a user with the primary key could not be found
\r
324 * @throws SystemException if a system exception occurred
\r
326 public static void addDefaultUserGroups(long userId)
\r
327 throws com.liferay.portal.kernel.exception.PortalException,
\r
328 com.liferay.portal.kernel.exception.SystemException {
\r
329 getService().addDefaultUserGroups(userId);
\r
333 * Adds the users to the group.
\r
335 * @param groupId the primary key of the group
\r
336 * @param userIds the primary keys of the users
\r
337 * @throws PortalException if a group or user with the primary key could not
\r
339 * @throws SystemException if a system exception occurred
\r
341 public static void addGroupUsers(long groupId, long[] userIds)
\r
342 throws com.liferay.portal.kernel.exception.PortalException,
\r
343 com.liferay.portal.kernel.exception.SystemException {
\r
344 getService().addGroupUsers(groupId, userIds);
\r
348 * Adds the users to the organization.
\r
350 * @param organizationId the primary key of the organization
\r
351 * @param userIds the primary keys of the users
\r
352 * @throws PortalException if an organization or user with the primary key
\r
354 * @throws SystemException if a system exception occurred
\r
356 public static void addOrganizationUsers(long organizationId, long[] userIds)
\r
357 throws com.liferay.portal.kernel.exception.PortalException,
\r
358 com.liferay.portal.kernel.exception.SystemException {
\r
359 getService().addOrganizationUsers(organizationId, userIds);
\r
363 * Assigns the password policy to the users, removing any other currently
\r
364 * assigned password policies.
\r
366 * @param passwordPolicyId the primary key of the password policy
\r
367 * @param userIds the primary keys of the users
\r
368 * @throws SystemException if a system exception occurred
\r
370 public static void addPasswordPolicyUsers(long passwordPolicyId,
\r
372 throws com.liferay.portal.kernel.exception.SystemException {
\r
373 getService().addPasswordPolicyUsers(passwordPolicyId, userIds);
\r
377 * Adds the users to the role.
\r
379 * @param roleId the primary key of the role
\r
380 * @param userIds the primary keys of the users
\r
381 * @throws PortalException if a role or user with the primary key could not
\r
383 * @throws SystemException if a system exception occurred
\r
385 public static void addRoleUsers(long roleId, long[] userIds)
\r
386 throws com.liferay.portal.kernel.exception.PortalException,
\r
387 com.liferay.portal.kernel.exception.SystemException {
\r
388 getService().addRoleUsers(roleId, userIds);
\r
392 * Adds the users to the team.
\r
394 * @param teamId the primary key of the team
\r
395 * @param userIds the primary keys of the users
\r
396 * @throws PortalException if a team or user with the primary key could not
\r
398 * @throws SystemException if a system exception occurred
\r
400 public static void addTeamUsers(long teamId, long[] userIds)
\r
401 throws com.liferay.portal.kernel.exception.PortalException,
\r
402 com.liferay.portal.kernel.exception.SystemException {
\r
403 getService().addTeamUsers(teamId, userIds);
\r
410 * This method handles the creation and bookkeeping of the user including
\r
411 * its resources, metadata, and internal data structures. It is not
\r
412 * necessary to make subsequent calls to any methods to setup default
\r
413 * groups, resources, etc.
\r
416 * @param creatorUserId the primary key of the creator
\r
417 * @param companyId the primary key of the user's company
\r
418 * @param autoPassword whether a password should be automatically generated
\r
420 * @param password1 the user's password
\r
421 * @param password2 the user's password confirmation
\r
422 * @param autoScreenName whether a screen name should be automatically
\r
423 generated for the user
\r
424 * @param screenName the user's screen name
\r
425 * @param emailAddress the user's email address
\r
426 * @param facebookId the user's facebook ID
\r
427 * @param openId the user's OpenID
\r
428 * @param locale the user's locale
\r
429 * @param firstName the user's first name
\r
430 * @param middleName the user's middle name
\r
431 * @param lastName the user's last name
\r
432 * @param prefixId the user's name prefix ID
\r
433 * @param suffixId the user's name suffix ID
\r
434 * @param male whether the user is male
\r
435 * @param birthdayMonth the user's birthday month (0-based, meaning 0 for
\r
437 * @param birthdayDay the user's birthday day
\r
438 * @param birthdayYear the user's birthday year
\r
439 * @param jobTitle the user's job title
\r
440 * @param groupIds the primary keys of the user's groups
\r
441 * @param organizationIds the primary keys of the user's organizations
\r
442 * @param roleIds the primary keys of the roles this user possesses
\r
443 * @param userGroupIds the primary keys of the user's user groups
\r
444 * @param sendEmail whether to send the user an email notification about
\r
446 * @param serviceContext the user's service context (optionally
\r
447 <code>null</code>). Can set the universally unique identifier
\r
448 (with the <code>uuid</code> attribute), asset category IDs, asset
\r
449 tag names, and expando bridge attributes for the user.
\r
450 * @return the new user
\r
451 * @throws PortalException if the user's information was invalid
\r
452 * @throws SystemException if a system exception occurred
\r
454 public static com.liferay.portal.model.User addUser(long creatorUserId,
\r
455 long companyId, boolean autoPassword, java.lang.String password1,
\r
456 java.lang.String password2, boolean autoScreenName,
\r
457 java.lang.String screenName, java.lang.String emailAddress,
\r
458 long facebookId, java.lang.String openId, java.util.Locale locale,
\r
459 java.lang.String firstName, java.lang.String middleName,
\r
460 java.lang.String lastName, int prefixId, int suffixId, boolean male,
\r
461 int birthdayMonth, int birthdayDay, int birthdayYear,
\r
462 java.lang.String jobTitle, long[] groupIds, long[] organizationIds,
\r
463 long[] roleIds, long[] userGroupIds, boolean sendEmail,
\r
464 com.liferay.portal.service.ServiceContext serviceContext)
\r
465 throws com.liferay.portal.kernel.exception.PortalException,
\r
466 com.liferay.portal.kernel.exception.SystemException {
\r
467 return getService()
\r
468 .addUser(creatorUserId, companyId, autoPassword, password1,
\r
469 password2, autoScreenName, screenName, emailAddress, facebookId,
\r
470 openId, locale, firstName, middleName, lastName, prefixId,
\r
471 suffixId, male, birthdayMonth, birthdayDay, birthdayYear, jobTitle,
\r
472 groupIds, organizationIds, roleIds, userGroupIds, sendEmail,
\r
477 * Adds the users to the user group.
\r
479 * @param userGroupId the primary key of the user group
\r
480 * @param userIds the primary keys of the users
\r
481 * @throws PortalException if a user group or user with the primary could
\r
483 * @throws SystemException if a system exception occurred
\r
485 public static void addUserGroupUsers(long userGroupId, long[] userIds)
\r
486 throws com.liferay.portal.kernel.exception.PortalException,
\r
487 com.liferay.portal.kernel.exception.SystemException {
\r
488 getService().addUserGroupUsers(userGroupId, userIds);
\r
492 * Adds a user with workflow.
\r
495 * This method handles the creation and bookkeeping of the user including
\r
496 * its resources, metadata, and internal data structures. It is not
\r
497 * necessary to make subsequent calls to any methods to setup default
\r
498 * groups, resources, etc.
\r
501 * @param creatorUserId the primary key of the creator
\r
502 * @param companyId the primary key of the user's company
\r
503 * @param autoPassword whether a password should be automatically generated
\r
505 * @param password1 the user's password
\r
506 * @param password2 the user's password confirmation
\r
507 * @param autoScreenName whether a screen name should be automatically
\r
508 generated for the user
\r
509 * @param screenName the user's screen name
\r
510 * @param emailAddress the user's email address
\r
511 * @param facebookId the user's facebook ID
\r
512 * @param openId the user's OpenID
\r
513 * @param locale the user's locale
\r
514 * @param firstName the user's first name
\r
515 * @param middleName the user's middle name
\r
516 * @param lastName the user's last name
\r
517 * @param prefixId the user's name prefix ID
\r
518 * @param suffixId the user's name suffix ID
\r
519 * @param male whether the user is male
\r
520 * @param birthdayMonth the user's birthday month (0-based, meaning 0 for
\r
522 * @param birthdayDay the user's birthday day
\r
523 * @param birthdayYear the user's birthday year
\r
524 * @param jobTitle the user's job title
\r
525 * @param groupIds the primary keys of the user's groups
\r
526 * @param organizationIds the primary keys of the user's organizations
\r
527 * @param roleIds the primary keys of the roles this user possesses
\r
528 * @param userGroupIds the primary keys of the user's user groups
\r
529 * @param sendEmail whether to send the user an email notification about
\r
531 * @param serviceContext the user's service context (optionally
\r
532 <code>null</code>). Can set the universally unique identifier
\r
533 (with the <code>uuid</code> attribute), asset category IDs, asset
\r
534 tag names, and expando bridge attributes for the user.
\r
535 * @return the new user
\r
536 * @throws PortalException if the user's information was invalid
\r
537 * @throws SystemException if a system exception occurred
\r
539 public static com.liferay.portal.model.User addUserWithWorkflow(
\r
540 long creatorUserId, long companyId, boolean autoPassword,
\r
541 java.lang.String password1, java.lang.String password2,
\r
542 boolean autoScreenName, java.lang.String screenName,
\r
543 java.lang.String emailAddress, long facebookId,
\r
544 java.lang.String openId, java.util.Locale locale,
\r
545 java.lang.String firstName, java.lang.String middleName,
\r
546 java.lang.String lastName, int prefixId, int suffixId, boolean male,
\r
547 int birthdayMonth, int birthdayDay, int birthdayYear,
\r
548 java.lang.String jobTitle, long[] groupIds, long[] organizationIds,
\r
549 long[] roleIds, long[] userGroupIds, boolean sendEmail,
\r
550 com.liferay.portal.service.ServiceContext serviceContext)
\r
551 throws com.liferay.portal.kernel.exception.PortalException,
\r
552 com.liferay.portal.kernel.exception.SystemException {
\r
553 return getService()
\r
554 .addUserWithWorkflow(creatorUserId, companyId, autoPassword,
\r
555 password1, password2, autoScreenName, screenName, emailAddress,
\r
556 facebookId, openId, locale, firstName, middleName, lastName,
\r
557 prefixId, suffixId, male, birthdayMonth, birthdayDay, birthdayYear,
\r
558 jobTitle, groupIds, organizationIds, roleIds, userGroupIds,
\r
559 sendEmail, serviceContext);
\r
563 * Attempts to authenticate the user by their email address and password,
\r
564 * while using the AuthPipeline.
\r
566 * @param companyId the primary key of the user's company
\r
567 * @param emailAddress the user's email address
\r
568 * @param password the user's password
\r
569 * @param headerMap the header map from the authentication request
\r
570 * @param parameterMap the parameter map from the authentication request
\r
571 * @param resultsMap the map of authentication results (may be nil). After
\r
572 a succesful authentication the user's primary key will be placed
\r
573 under the key <code>userId</code>.
\r
574 * @return the authentication status. This can be {@link
\r
575 com.liferay.portal.security.auth.Authenticator#FAILURE}
\r
576 indicating that the user's credentials are invalid, {@link
\r
577 com.liferay.portal.security.auth.Authenticator#SUCCESS}
\r
578 indicating a successful login, or {@link
\r
579 com.liferay.portal.security.auth.Authenticator#DNE} indicating
\r
580 that a user with that login does not exist.
\r
581 * @throws PortalException if <code>emailAddress</code> or
\r
582 <code>password</code> was <code>null</code>
\r
583 * @throws SystemException if a system exception occurred
\r
584 * @see com.liferay.portal.security.auth.AuthPipeline
\r
586 public static int authenticateByEmailAddress(long companyId,
\r
587 java.lang.String emailAddress, java.lang.String password,
\r
588 java.util.Map<java.lang.String, java.lang.String[]> headerMap,
\r
589 java.util.Map<java.lang.String, java.lang.String[]> parameterMap,
\r
590 java.util.Map<java.lang.String, java.lang.Object> resultsMap)
\r
591 throws com.liferay.portal.kernel.exception.PortalException,
\r
592 com.liferay.portal.kernel.exception.SystemException {
\r
593 return getService()
\r
594 .authenticateByEmailAddress(companyId, emailAddress,
\r
595 password, headerMap, parameterMap, resultsMap);
\r
599 * Attempts to authenticate the user by their screen name and password,
\r
600 * while using the AuthPipeline.
\r
602 * @param companyId the primary key of the user's company
\r
603 * @param screenName the user's screen name
\r
604 * @param password the user's password
\r
605 * @param headerMap the header map from the authentication request
\r
606 * @param parameterMap the parameter map from the authentication request
\r
607 * @param resultsMap the map of authentication results (may be nil). After
\r
608 a succesful authentication the user's primary key will be placed
\r
609 under the key <code>userId</code>.
\r
610 * @return the authentication status. This can be {@link
\r
611 com.liferay.portal.security.auth.Authenticator#FAILURE}
\r
612 indicating that the user's credentials are invalid, {@link
\r
613 com.liferay.portal.security.auth.Authenticator#SUCCESS}
\r
614 indicating a successful login, or {@link
\r
615 com.liferay.portal.security.auth.Authenticator#DNE} indicating
\r
616 that a user with that login does not exist.
\r
617 * @throws PortalException if <code>screenName</code> or
\r
618 <code>password</code> was <code>null</code>
\r
619 * @throws SystemException if a system exception occurred
\r
620 * @see com.liferay.portal.security.auth.AuthPipeline
\r
622 public static int authenticateByScreenName(long companyId,
\r
623 java.lang.String screenName, java.lang.String password,
\r
624 java.util.Map<java.lang.String, java.lang.String[]> headerMap,
\r
625 java.util.Map<java.lang.String, java.lang.String[]> parameterMap,
\r
626 java.util.Map<java.lang.String, java.lang.Object> resultsMap)
\r
627 throws com.liferay.portal.kernel.exception.PortalException,
\r
628 com.liferay.portal.kernel.exception.SystemException {
\r
629 return getService()
\r
630 .authenticateByScreenName(companyId, screenName, password,
\r
631 headerMap, parameterMap, resultsMap);
\r
635 * Attempts to authenticate the user by their primary key and password,
\r
636 * while using the AuthPipeline.
\r
638 * @param companyId the primary key of the user's company
\r
639 * @param userId the user's primary key
\r
640 * @param password the user's password
\r
641 * @param headerMap the header map from the authentication request
\r
642 * @param parameterMap the parameter map from the authentication request
\r
643 * @param resultsMap the map of authentication results (may be nil). After
\r
644 a succesful authentication the user's primary key will be placed
\r
645 under the key <code>userId</code>.
\r
646 * @return the authentication status. This can be {@link
\r
647 com.liferay.portal.security.auth.Authenticator#FAILURE}
\r
648 indicating that the user's credentials are invalid, {@link
\r
649 com.liferay.portal.security.auth.Authenticator#SUCCESS}
\r
650 indicating a successful login, or {@link
\r
651 com.liferay.portal.security.auth.Authenticator#DNE} indicating
\r
652 that a user with that login does not exist.
\r
653 * @throws PortalException if <code>userId</code> or <code>password</code>
\r
654 was <code>null</code>
\r
655 * @throws SystemException if a system exception occurred
\r
656 * @see com.liferay.portal.security.auth.AuthPipeline
\r
658 public static int authenticateByUserId(long companyId, long userId,
\r
659 java.lang.String password,
\r
660 java.util.Map<java.lang.String, java.lang.String[]> headerMap,
\r
661 java.util.Map<java.lang.String, java.lang.String[]> parameterMap,
\r
662 java.util.Map<java.lang.String, java.lang.Object> resultsMap)
\r
663 throws com.liferay.portal.kernel.exception.PortalException,
\r
664 com.liferay.portal.kernel.exception.SystemException {
\r
665 return getService()
\r
666 .authenticateByUserId(companyId, userId, password,
\r
667 headerMap, parameterMap, resultsMap);
\r
671 * Attempts to authenticate the user using HTTP basic access authentication,
\r
672 * without using the AuthPipeline. Primarily used for authenticating users
\r
673 * of <code>tunnel-web</code>.
\r
676 * Authentication type specifies what <code>login</code> contains.The valid
\r
682 * <code>CompanyConstants.AUTH_TYPE_EA</code> - <code>login</code> is the
\r
683 * user's email address
\r
686 * <code>CompanyConstants.AUTH_TYPE_SN</code> - <code>login</code> is the
\r
687 * user's screen name
\r
690 * <code>CompanyConstants.AUTH_TYPE_ID</code> - <code>login</code> is the
\r
691 * user's primary key
\r
695 * @param companyId the primary key of the user's company
\r
696 * @param authType the type of authentication to perform
\r
697 * @param login either the user's email address, screen name, or primary
\r
698 key depending on the value of <code>authType</code>
\r
699 * @param password the user's password
\r
700 * @return the authentication status. This can be {@link
\r
701 com.liferay.portal.security.auth.Authenticator#FAILURE}
\r
702 indicating that the user's credentials are invalid, {@link
\r
703 com.liferay.portal.security.auth.Authenticator#SUCCESS}
\r
704 indicating a successful login, or {@link
\r
705 com.liferay.portal.security.auth.Authenticator#DNE} indicating
\r
706 that a user with that login does not exist.
\r
707 * @throws PortalException if a portal exception occurred
\r
708 * @throws SystemException if a system exception occurred
\r
710 public static long authenticateForBasic(long companyId,
\r
711 java.lang.String authType, java.lang.String login,
\r
712 java.lang.String password)
\r
713 throws com.liferay.portal.kernel.exception.PortalException,
\r
714 com.liferay.portal.kernel.exception.SystemException {
\r
715 return getService()
\r
716 .authenticateForBasic(companyId, authType, login, password);
\r
720 * Attempts to authenticate the user using HTTP digest access
\r
721 * authentication, without using the AuthPipeline. Primarily used for
\r
722 * authenticating users of <code>tunnel-web</code>.
\r
724 * @param companyId the primary key of the user's company
\r
725 * @param username either the user's email address, screen name, or primary
\r
727 * @param realm unused
\r
728 * @param nonce the number used once
\r
729 * @param method the request method
\r
730 * @param uri the request URI
\r
731 * @param response the authentication response hash
\r
732 * @return the user's primary key if authentication is succesful;
\r
733 <code>0</code> otherwise
\r
734 * @throws PortalException if a portal exception occurred
\r
735 * @throws SystemException if a system exception occurred
\r
737 public static long authenticateForDigest(long companyId,
\r
738 java.lang.String username, java.lang.String realm,
\r
739 java.lang.String nonce, java.lang.String method, java.lang.String uri,
\r
740 java.lang.String response)
\r
741 throws com.liferay.portal.kernel.exception.PortalException,
\r
742 com.liferay.portal.kernel.exception.SystemException {
\r
743 return getService()
\r
744 .authenticateForDigest(companyId, username, realm, nonce,
\r
745 method, uri, response);
\r
749 * Attempts to authenticate the user using JAAS credentials, without using
\r
750 * the AuthPipeline.
\r
752 * @param userId the primary key of the user
\r
753 * @param encPassword the encrypted password
\r
754 * @return <code>true</code> if authentication is successful;
\r
755 <code>false</code> otherwise
\r
757 public static boolean authenticateForJAAS(long userId,
\r
758 java.lang.String encPassword) {
\r
759 return getService().authenticateForJAAS(userId, encPassword);
\r
763 * Checks if the user is currently locked out based on the password policy,
\r
764 * and performs maintenance on the user's lockout and failed login data.
\r
766 * @param user the user
\r
767 * @throws PortalException if the user was determined to still be locked out
\r
768 * @throws SystemException if a system exception occurred
\r
770 public static void checkLockout(com.liferay.portal.model.User user)
\r
771 throws com.liferay.portal.kernel.exception.PortalException,
\r
772 com.liferay.portal.kernel.exception.SystemException {
\r
773 getService().checkLockout(user);
\r
777 * Adds a failed login attempt to the user and updates the user's last
\r
778 * failed login date.
\r
780 * @param user the user
\r
781 * @throws SystemException if a system exception occurred
\r
783 public static void checkLoginFailure(com.liferay.portal.model.User user)
\r
784 throws com.liferay.portal.kernel.exception.SystemException {
\r
785 getService().checkLoginFailure(user);
\r
789 * Adds a failed login attempt to the user with the email address and
\r
790 * updates the user's last failed login date.
\r
792 * @param companyId the primary key of the user's company
\r
793 * @param emailAddress the user's email address
\r
794 * @throws PortalException if a user with the email address could not be
\r
796 * @throws SystemException if a system exception occurred
\r
798 public static void checkLoginFailureByEmailAddress(long companyId,
\r
799 java.lang.String emailAddress)
\r
800 throws com.liferay.portal.kernel.exception.PortalException,
\r
801 com.liferay.portal.kernel.exception.SystemException {
\r
802 getService().checkLoginFailureByEmailAddress(companyId, emailAddress);
\r
806 * Adds a failed login attempt to the user and updates the user's last
\r
807 * failed login date.
\r
809 * @param userId the primary key of the user
\r
810 * @throws PortalException if a user with the primary key could not be found
\r
811 * @throws SystemException if a system exception occurred
\r
813 public static void checkLoginFailureById(long userId)
\r
814 throws com.liferay.portal.kernel.exception.PortalException,
\r
815 com.liferay.portal.kernel.exception.SystemException {
\r
816 getService().checkLoginFailureById(userId);
\r
820 * Adds a failed login attempt to the user with the screen name and updates
\r
821 * the user's last failed login date.
\r
823 * @param companyId the primary key of the user's company
\r
824 * @param screenName the user's screen name
\r
825 * @throws PortalException if a user with the screen name could not be found
\r
826 * @throws SystemException if a system exception occurred
\r
828 public static void checkLoginFailureByScreenName(long companyId,
\r
829 java.lang.String screenName)
\r
830 throws com.liferay.portal.kernel.exception.PortalException,
\r
831 com.liferay.portal.kernel.exception.SystemException {
\r
832 getService().checkLoginFailureByScreenName(companyId, screenName);
\r
836 * Checks if the user's password is expired based on the password policy,
\r
837 * and performs maintenance on the user's grace login and password reset
\r
840 * @param user the user
\r
841 * @throws PortalException if the user's password has expired and the grace
\r
842 login limit has been exceeded
\r
843 * @throws SystemException if a system exception occurred
\r
845 public static void checkPasswordExpired(com.liferay.portal.model.User user)
\r
846 throws com.liferay.portal.kernel.exception.PortalException,
\r
847 com.liferay.portal.kernel.exception.SystemException {
\r
848 getService().checkPasswordExpired(user);
\r
852 * Removes all the users from the organization.
\r
854 * @param organizationId the primary key of the organization
\r
855 * @throws SystemException if a system exception occurred
\r
857 public static void clearOrganizationUsers(long organizationId)
\r
858 throws com.liferay.portal.kernel.exception.SystemException {
\r
859 getService().clearOrganizationUsers(organizationId);
\r
863 * Removes all the users from the user group.
\r
865 * @param userGroupId the primary key of the user group
\r
866 * @throws SystemException if a system exception occurred
\r
868 public static void clearUserGroupUsers(long userGroupId)
\r
869 throws com.liferay.portal.kernel.exception.SystemException {
\r
870 getService().clearUserGroupUsers(userGroupId);
\r
874 * Completes the user's registration by generating a password and sending
\r
875 * the confirmation email.
\r
877 * @param user the user
\r
878 * @param serviceContext the user's service context. Can set whether a
\r
879 password should be generated (with the <code>autoPassword</code>
\r
880 attribute) and whether the confirmation email should be sent
\r
881 (with the <code>sendEmail</code> attribute) for the user.
\r
882 * @throws PortalException if a portal exception occurred
\r
883 * @throws SystemException if a system exception occurred
\r
885 public static void completeUserRegistration(
\r
886 com.liferay.portal.model.User user,
\r
887 com.liferay.portal.service.ServiceContext serviceContext)
\r
888 throws com.liferay.portal.kernel.exception.PortalException,
\r
889 com.liferay.portal.kernel.exception.SystemException {
\r
890 getService().completeUserRegistration(user, serviceContext);
\r
894 * Decrypts the user's primary key and password from their encrypted forms.
\r
895 * Used for decrypting a user's credentials from the values stored in an
\r
896 * automatic login cookie.
\r
898 * @param companyId the primary key of the user's company
\r
899 * @param name the encrypted primary key of the user
\r
900 * @param password the encrypted password of the user
\r
901 * @return the user's primary key and password
\r
902 * @throws PortalException if a user with the primary key could not be found
\r
903 or if the user's password was incorrect
\r
904 * @throws SystemException if a system exception occurred
\r
906 public static com.liferay.portal.kernel.util.KeyValuePair decryptUserId(
\r
907 long companyId, java.lang.String name, java.lang.String password)
\r
908 throws com.liferay.portal.kernel.exception.PortalException,
\r
909 com.liferay.portal.kernel.exception.SystemException {
\r
910 return getService().decryptUserId(companyId, name, password);
\r
914 * Deletes the user's portrait image.
\r
916 * @param userId the primary key of the user
\r
917 * @throws PortalException if a user with the primary key could not be found
\r
918 or if the user's portrait could not be found
\r
919 * @throws SystemException if a system exception occurred
\r
921 public static void deletePortrait(long userId)
\r
922 throws com.liferay.portal.kernel.exception.PortalException,
\r
923 com.liferay.portal.kernel.exception.SystemException {
\r
924 getService().deletePortrait(userId);
\r
928 * Removes the user from the role.
\r
930 * @param roleId the primary key of the role
\r
931 * @param userId the primary key of the user
\r
932 * @throws PortalException if a role or user with the primary key could not
\r
934 * @throws SystemException if a system exception occurred
\r
936 public static void deleteRoleUser(long roleId, long userId)
\r
937 throws com.liferay.portal.kernel.exception.PortalException,
\r
938 com.liferay.portal.kernel.exception.SystemException {
\r
939 getService().deleteRoleUser(roleId, userId);
\r
943 * Removes the user from the user group.
\r
945 * @param userGroupId the primary key of the user group
\r
946 * @param userId the primary key of the user
\r
947 * @throws PortalException if a portal exception occurred
\r
948 * @throws SystemException if a system exception occurred
\r
950 public static void deleteUserGroupUser(long userGroupId, long userId)
\r
951 throws com.liferay.portal.kernel.exception.PortalException,
\r
952 com.liferay.portal.kernel.exception.SystemException {
\r
953 getService().deleteUserGroupUser(userGroupId, userId);
\r
957 * Encrypts the primary key of the user. Used when encrypting the user's
\r
958 * credentials for storage in an automatic login cookie.
\r
960 * @param name the primary key of the user
\r
961 * @return the user's encrypted primary key
\r
962 * @throws PortalException if a user with the primary key could not be found
\r
963 * @throws SystemException if a system exception occurred
\r
965 public static java.lang.String encryptUserId(java.lang.String name)
\r
966 throws com.liferay.portal.kernel.exception.PortalException,
\r
967 com.liferay.portal.kernel.exception.SystemException {
\r
968 return getService().encryptUserId(name);
\r
972 * Returns the user with the email address.
\r
974 * @param companyId the primary key of the user's company
\r
975 * @param emailAddress the user's email address
\r
976 * @return the user with the email address, or <code>null</code> if a user
\r
977 with the email address could not be found
\r
978 * @throws SystemException if a system exception occurred
\r
980 public static com.liferay.portal.model.User fetchUserByEmailAddress(
\r
981 long companyId, java.lang.String emailAddress)
\r
982 throws com.liferay.portal.kernel.exception.SystemException {
\r
983 return getService().fetchUserByEmailAddress(companyId, emailAddress);
\r
987 * Returns the user with the primary key.
\r
989 * @param userId the primary key of the user
\r
990 * @return the user with the primary key, or <code>null</code> if a user
\r
991 with the primary key could not be found
\r
992 * @throws SystemException if a system exception occurred
\r
994 public static com.liferay.portal.model.User fetchUserById(long userId)
\r
995 throws com.liferay.portal.kernel.exception.SystemException {
\r
996 return getService().fetchUserById(userId);
\r
1000 * Returns the user with the screen name.
\r
1002 * @param companyId the primary key of the user's company
\r
1003 * @param screenName the user's screen name
\r
1004 * @return the user with the screen name, or <code>null</code> if a user
\r
1005 with the screen name could not be found
\r
1006 * @throws SystemException if a system exception occurred
\r
1008 public static com.liferay.portal.model.User fetchUserByScreenName(
\r
1009 long companyId, java.lang.String screenName)
\r
1010 throws com.liferay.portal.kernel.exception.SystemException {
\r
1011 return getService().fetchUserByScreenName(companyId, screenName);
\r
1014 public static List<com.liferay.portal.model.User> findUsersByEmail(String email)
\r
1015 throws com.liferay.portal.kernel.exception.SystemException {
\r
1016 return getService().findUsersByEmail(email);
\r
1021 * Returns a range of all the users belonging to the company.
\r
1024 * Useful when paginating results. Returns a maximum of <code>end -
\r
1025 * start</code> instances. <code>start</code> and <code>end</code> are not
\r
1026 * primary keys, they are indexes in the result set. Thus, <code>0</code>
\r
1027 * refers to the first result in the set. Setting both <code>start</code>
\r
1028 * and <code>end</code> to {@link
\r
1029 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
\r
1033 * @param companyId the primary key of the company
\r
1034 * @param start the lower bound of the range of users
\r
1035 * @param end the upper bound of the range of users (not inclusive)
\r
1036 * @return the range of users belonging to the company
\r
1037 * @throws SystemException if a system exception occurred
\r
1039 public static java.util.List<com.liferay.portal.model.User> getCompanyUsers(
\r
1040 long companyId, int start, int end)
\r
1041 throws com.liferay.portal.kernel.exception.SystemException {
\r
1042 return getService().getCompanyUsers(companyId, start, end);
\r
1046 * Returns the number of users belonging to the company.
\r
1048 * @param companyId the primary key of the company
\r
1049 * @return the number of users belonging to the company
\r
1050 * @throws SystemException if a system exception occurred
\r
1052 public static int getCompanyUsersCount(long companyId)
\r
1053 throws com.liferay.portal.kernel.exception.SystemException {
\r
1054 return getService().getCompanyUsersCount(companyId);
\r
1058 * Returns the default user for the company.
\r
1060 * @param companyId the primary key of the company
\r
1061 * @return the default user for the company
\r
1062 * @throws PortalException if a default user for the company could not be
\r
1064 * @throws SystemException if a system exception occurred
\r
1066 public static com.liferay.portal.model.User getDefaultUser(long companyId)
\r
1067 throws com.liferay.portal.kernel.exception.PortalException,
\r
1068 com.liferay.portal.kernel.exception.SystemException {
\r
1069 return getService().getDefaultUser(companyId);
\r
1073 * Returns the primary key of the default user for the company.
\r
1075 * @param companyId the primary key of the company
\r
1076 * @return the primary key of the default user for the company
\r
1077 * @throws PortalException if a default user for the company could not be
\r
1079 * @throws SystemException if a system exception occurred
\r
1081 public static long getDefaultUserId(long companyId)
\r
1082 throws com.liferay.portal.kernel.exception.PortalException,
\r
1083 com.liferay.portal.kernel.exception.SystemException {
\r
1084 return getService().getDefaultUserId(companyId);
\r
1088 * Returns the primary keys of all the users belonging to the group.
\r
1090 * @param groupId the primary key of the group
\r
1091 * @return the primary keys of the users belonging to the group
\r
1092 * @throws SystemException if a system exception occurred
\r
1094 public static long[] getGroupUserIds(long groupId)
\r
1095 throws com.liferay.portal.kernel.exception.SystemException {
\r
1096 return getService().getGroupUserIds(groupId);
\r
1100 * Returns all the users belonging to the group.
\r
1102 * @param groupId the primary key of the group
\r
1103 * @return the users belonging to the group
\r
1104 * @throws SystemException if a system exception occurred
\r
1106 public static java.util.List<com.liferay.portal.model.User> getGroupUsers(
\r
1108 throws com.liferay.portal.kernel.exception.SystemException {
\r
1109 return getService().getGroupUsers(groupId);
\r
1113 * Returns the number of users belonging to the group.
\r
1115 * @param groupId the primary key of the group
\r
1116 * @return the number of users belonging to the group
\r
1117 * @throws SystemException if a system exception occurred
\r
1119 public static int getGroupUsersCount(long groupId)
\r
1120 throws com.liferay.portal.kernel.exception.SystemException {
\r
1121 return getService().getGroupUsersCount(groupId);
\r
1125 * Returns the number of users with the status belonging to the group.
\r
1127 * @param groupId the primary key of the group
\r
1128 * @param status the workflow status
\r
1129 * @return the number of users with the status belonging to the group
\r
1130 * @throws PortalException if a group with the primary key could not be
\r
1132 * @throws SystemException if a system exception occurred
\r
1134 public static int getGroupUsersCount(long groupId, int status)
\r
1135 throws com.liferay.portal.kernel.exception.PortalException,
\r
1136 com.liferay.portal.kernel.exception.SystemException {
\r
1137 return getService().getGroupUsersCount(groupId, status);
\r
1141 * Returns all the users who have not had any announcements of the type
\r
1142 * delivered, excluding the default user.
\r
1144 * @param type the type of announcement
\r
1145 * @return the users who have not had any annoucements of the type delivered
\r
1146 * @throws SystemException if a system exception occurred
\r
1148 public static java.util.List<com.liferay.portal.model.User> getNoAnnouncementsDeliveries(
\r
1149 java.lang.String type)
\r
1150 throws com.liferay.portal.kernel.exception.SystemException {
\r
1151 return getService().getNoAnnouncementsDeliveries(type);
\r
1155 * Returns all the users who do not have any contacts.
\r
1157 * @return the users who do not have any contacts
\r
1158 * @throws SystemException if a system exception occurred
\r
1160 public static java.util.List<com.liferay.portal.model.User> getNoContacts()
\r
1161 throws com.liferay.portal.kernel.exception.SystemException {
\r
1162 return getService().getNoContacts();
\r
1166 * Returns all the users who do not belong to any groups, excluding the
\r
1169 * @return the users who do not belong to any groups
\r
1170 * @throws SystemException if a system exception occurred
\r
1172 public static java.util.List<com.liferay.portal.model.User> getNoGroups()
\r
1173 throws com.liferay.portal.kernel.exception.SystemException {
\r
1174 return getService().getNoGroups();
\r
1178 * Returns the primary keys of all the users belonging to the organization.
\r
1180 * @param organizationId the primary key of the organization
\r
1181 * @return the primary keys of the users belonging to the organization
\r
1182 * @throws SystemException if a system exception occurred
\r
1184 public static long[] getOrganizationUserIds(long organizationId)
\r
1185 throws com.liferay.portal.kernel.exception.SystemException {
\r
1186 return getService().getOrganizationUserIds(organizationId);
\r
1190 * Returns all the users belonging to the organization.
\r
1192 * @param organizationId the primary key of the organization
\r
1193 * @return the users belonging to the organization
\r
1194 * @throws SystemException if a system exception occurred
\r
1196 public static java.util.List<com.liferay.portal.model.User> getOrganizationUsers(
\r
1197 long organizationId)
\r
1198 throws com.liferay.portal.kernel.exception.SystemException {
\r
1199 return getService().getOrganizationUsers(organizationId);
\r
1202 public static List<User> getOrganizationUsers(long organizationId,
\r
1203 int start, int stop) throws SystemException {
\r
1204 return getService().getOrganizationUsers(organizationId, start, stop);
\r
1207 public static List<User> getOrganizationUsers(long organizationId,
\r
1208 int start, int stop, OrderByComparator orderComp) throws SystemException {
\r
1209 return getService().getOrganizationUsers(organizationId, start, stop, orderComp);
\r
1213 * Returns the number of users belonging to the organization.
\r
1215 * @param organizationId the primary key of the organization
\r
1216 * @return the number of users belonging to the organization
\r
1217 * @throws SystemException if a system exception occurred
\r
1219 public static int getOrganizationUsersCount(long organizationId)
\r
1220 throws com.liferay.portal.kernel.exception.SystemException {
\r
1221 return getService().getOrganizationUsersCount(organizationId);
\r
1225 * Returns the number of users with the status belonging to the
\r
1228 * @param organizationId the primary key of the organization
\r
1229 * @param status the workflow status
\r
1230 * @return the number of users with the status belonging to the organization
\r
1231 * @throws PortalException if an organization with the primary key could not
\r
1233 * @throws SystemException if a system exception occurred
\r
1235 public static int getOrganizationUsersCount(long organizationId, int status)
\r
1236 throws com.liferay.portal.kernel.exception.PortalException,
\r
1237 com.liferay.portal.kernel.exception.SystemException {
\r
1238 return getService().getOrganizationUsersCount(organizationId, status);
\r
1242 * Returns the primary keys of all the users belonging to the role.
\r
1244 * @param roleId the primary key of the role
\r
1245 * @return the primary keys of the users belonging to the role
\r
1246 * @throws SystemException if a system exception occurred
\r
1248 public static long[] getRoleUserIds(long roleId)
\r
1249 throws com.liferay.portal.kernel.exception.SystemException {
\r
1250 return getService().getRoleUserIds(roleId);
\r
1254 * Returns all the users belonging to the role.
\r
1256 * @param roleId the primary key of the role
\r
1257 * @return the users belonging to the role
\r
1258 * @throws SystemException if a system exception occurred
\r
1260 public static java.util.List<com.liferay.portal.model.User> getRoleUsers(
\r
1261 long roleId) throws com.liferay.portal.kernel.exception.SystemException {
\r
1262 return getService().getRoleUsers(roleId);
\r
1266 * Returns a range of all the users belonging to the role.
\r
1269 * Useful when paginating results. Returns a maximum of <code>end -
\r
1270 * start</code> instances. <code>start</code> and <code>end</code> are not
\r
1271 * primary keys, they are indexes in the result set. Thus, <code>0</code>
\r
1272 * refers to the first result in the set. Setting both <code>start</code>
\r
1273 * and <code>end</code> to {@link
\r
1274 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
\r
1278 * @param roleId the primary key of the role
\r
1279 * @param start the lower bound of the range of users
\r
1280 * @param end the upper bound of the range of users (not inclusive)
\r
1281 * @return the range of users belonging to the role
\r
1282 * @throws SystemException if a system exception occurred
\r
1284 public static java.util.List<com.liferay.portal.model.User> getRoleUsers(
\r
1285 long roleId, int start, int end)
\r
1286 throws com.liferay.portal.kernel.exception.SystemException {
\r
1287 return getService().getRoleUsers(roleId, start, end);
\r
1291 * Returns the number of users belonging to the role.
\r
1293 * @param roleId the primary key of the role
\r
1294 * @return the number of users belonging to the role
\r
1295 * @throws SystemException if a system exception occurred
\r
1297 public static int getRoleUsersCount(long roleId)
\r
1298 throws com.liferay.portal.kernel.exception.SystemException {
\r
1299 return getService().getRoleUsersCount(roleId);
\r
1303 * Returns the number of users with the status belonging to the role.
\r
1305 * @param roleId the primary key of the role
\r
1306 * @param status the workflow status
\r
1307 * @return the number of users with the status belonging to the role
\r
1308 * @throws PortalException if an role with the primary key could not be
\r
1310 * @throws SystemException if a system exception occurred
\r
1312 public static int getRoleUsersCount(long roleId, int status)
\r
1313 throws com.liferay.portal.kernel.exception.PortalException,
\r
1314 com.liferay.portal.kernel.exception.SystemException {
\r
1315 return getService().getRoleUsersCount(roleId, status);
\r
1319 * Returns an ordered range of all the users with a social relation of the
\r
1320 * type with the user.
\r
1323 * Useful when paginating results. Returns a maximum of <code>end -
\r
1324 * start</code> instances. <code>start</code> and <code>end</code> are not
\r
1325 * primary keys, they are indexes in the result set. Thus, <code>0</code>
\r
1326 * refers to the first result in the set. Setting both <code>start</code>
\r
1327 * and <code>end</code> to {@link
\r
1328 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
\r
1332 * @param userId the primary key of the user
\r
1333 * @param type the type of social relation. The possible types can be found
\r
1335 com.liferay.portlet.social.model.SocialRelationConstants}.
\r
1336 * @param start the lower bound of the range of users
\r
1337 * @param end the upper bound of the range of users (not inclusive)
\r
1338 * @param obc the comparator to order the users by (optionally
\r
1339 <code>null</code>)
\r
1340 * @return the ordered range of users with a social relation of the type
\r
1342 * @throws PortalException if a user with the primary key could not be found
\r
1343 * @throws SystemException if a system exception occurred
\r
1345 public static java.util.List<com.liferay.portal.model.User> getSocialUsers(
\r
1346 long userId, int type, int start, int end,
\r
1347 com.liferay.portal.kernel.util.OrderByComparator obc)
\r
1348 throws com.liferay.portal.kernel.exception.PortalException,
\r
1349 com.liferay.portal.kernel.exception.SystemException {
\r
1350 return getService().getSocialUsers(userId, type, start, end, obc);
\r
1354 * Returns an ordered range of all the users with a social relation with the
\r
1358 * Useful when paginating results. Returns a maximum of <code>end -
\r
1359 * start</code> instances. <code>start</code> and <code>end</code> are not
\r
1360 * primary keys, they are indexes in the result set. Thus, <code>0</code>
\r
1361 * refers to the first result in the set. Setting both <code>start</code>
\r
1362 * and <code>end</code> to {@link
\r
1363 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
\r
1367 * @param userId the primary key of the user
\r
1368 * @param start the lower bound of the range of users
\r
1369 * @param end the upper bound of the range of users (not inclusive)
\r
1370 * @param obc the comparator to order the users by (optionally
\r
1371 <code>null</code>)
\r
1372 * @return the ordered range of users with a social relation with the user
\r
1373 * @throws PortalException if a user with the primary key could not be found
\r
1374 * @throws SystemException if a system exception occurred
\r
1376 public static java.util.List<com.liferay.portal.model.User> getSocialUsers(
\r
1377 long userId, int start, int end,
\r
1378 com.liferay.portal.kernel.util.OrderByComparator obc)
\r
1379 throws com.liferay.portal.kernel.exception.PortalException,
\r
1380 com.liferay.portal.kernel.exception.SystemException {
\r
1381 return getService().getSocialUsers(userId, start, end, obc);
\r
1385 * Returns an ordered range of all the users with a mutual social relation
\r
1386 * of the type with both of the given users.
\r
1389 * Useful when paginating results. Returns a maximum of <code>end -
\r
1390 * start</code> instances. <code>start</code> and <code>end</code> are not
\r
1391 * primary keys, they are indexes in the result set. Thus, <code>0</code>
\r
1392 * refers to the first result in the set. Setting both <code>start</code>
\r
1393 * and <code>end</code> to {@link
\r
1394 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
\r
1398 * @param userId1 the primary key of the first user
\r
1399 * @param userId2 the primary key of the second user
\r
1400 * @param type the type of social relation. The possible types can be found
\r
1402 com.liferay.portlet.social.model.SocialRelationConstants}.
\r
1403 * @param start the lower bound of the range of users
\r
1404 * @param end the upper bound of the range of users (not inclusive)
\r
1405 * @param obc the comparator to order the users by (optionally
\r
1406 <code>null</code>)
\r
1407 * @return the ordered range of users with a mutual social relation of the
\r
1408 type with the user
\r
1409 * @throws PortalException if a user with the primary key could not be found
\r
1410 * @throws SystemException if a system exception occurred
\r
1412 public static java.util.List<com.liferay.portal.model.User> getSocialUsers(
\r
1413 long userId1, long userId2, int type, int start, int end,
\r
1414 com.liferay.portal.kernel.util.OrderByComparator obc)
\r
1415 throws com.liferay.portal.kernel.exception.PortalException,
\r
1416 com.liferay.portal.kernel.exception.SystemException {
\r
1417 return getService()
\r
1418 .getSocialUsers(userId1, userId2, type, start, end, obc);
\r
1422 * Returns an ordered range of all the users with a mutual social relation
\r
1423 * with both of the given users.
\r
1426 * Useful when paginating results. Returns a maximum of <code>end -
\r
1427 * start</code> instances. <code>start</code> and <code>end</code> are not
\r
1428 * primary keys, they are indexes in the result set. Thus, <code>0</code>
\r
1429 * refers to the first result in the set. Setting both <code>start</code>
\r
1430 * and <code>end</code> to {@link
\r
1431 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
\r
1435 * @param userId1 the primary key of the first user
\r
1436 * @param userId2 the primary key of the second user
\r
1437 * @param start the lower bound of the range of users
\r
1438 * @param end the upper bound of the range of users (not inclusive)
\r
1439 * @param obc the comparator to order the users by (optionally
\r
1440 <code>null</code>)
\r
1441 * @return the ordered range of users with a mutual social relation with the
\r
1443 * @throws PortalException if a user with the primary key could not be found
\r
1444 * @throws SystemException if a system exception occurred
\r
1446 public static java.util.List<com.liferay.portal.model.User> getSocialUsers(
\r
1447 long userId1, long userId2, int start, int end,
\r
1448 com.liferay.portal.kernel.util.OrderByComparator obc)
\r
1449 throws com.liferay.portal.kernel.exception.PortalException,
\r
1450 com.liferay.portal.kernel.exception.SystemException {
\r
1451 return getService().getSocialUsers(userId1, userId2, start, end, obc);
\r
1455 * Returns the number of users with a social relation with the user.
\r
1457 * @param userId the primary key of the user
\r
1458 * @return the number of users with a social relation with the user
\r
1459 * @throws PortalException if a user with the primary key could not be found
\r
1460 * @throws SystemException if a system exception occurred
\r
1462 public static int getSocialUsersCount(long userId)
\r
1463 throws com.liferay.portal.kernel.exception.PortalException,
\r
1464 com.liferay.portal.kernel.exception.SystemException {
\r
1465 return getService().getSocialUsersCount(userId);
\r
1469 * Returns the number of users with a social relation of the type with the
\r
1472 * @param userId the primary key of the user
\r
1473 * @param type the type of social relation. The possible types can be found
\r
1475 com.liferay.portlet.social.model.SocialRelationConstants}.
\r
1476 * @return the number of users with a social relation of the type with the
\r
1478 * @throws PortalException if a user with the primary key could not be found
\r
1479 * @throws SystemException if a system exception occurred
\r
1481 public static int getSocialUsersCount(long userId, int type)
\r
1482 throws com.liferay.portal.kernel.exception.PortalException,
\r
1483 com.liferay.portal.kernel.exception.SystemException {
\r
1484 return getService().getSocialUsersCount(userId, type);
\r
1488 * Returns the number of users with a mutual social relation with both of
\r
1489 * the given users.
\r
1491 * @param userId1 the primary key of the first user
\r
1492 * @param userId2 the primary key of the second user
\r
1493 * @return the number of users with a mutual social relation with the user
\r
1494 * @throws PortalException if a user with the primary key could not be found
\r
1495 * @throws SystemException if a system exception occurred
\r
1497 public static int getSocialUsersCount(long userId1, long userId2)
\r
1498 throws com.liferay.portal.kernel.exception.PortalException,
\r
1499 com.liferay.portal.kernel.exception.SystemException {
\r
1500 return getService().getSocialUsersCount(userId1, userId2);
\r
1504 * Returns the number of users with a mutual social relation of the type
\r
1505 * with both of the given users.
\r
1507 * @param userId1 the primary key of the first user
\r
1508 * @param userId2 the primary key of the second user
\r
1509 * @param type the type of social relation. The possible types can be found
\r
1511 com.liferay.portlet.social.model.SocialRelationConstants}.
\r
1512 * @return the number of users with a mutual social relation of the type
\r
1514 * @throws PortalException if a user with the primary key could not be found
\r
1515 * @throws SystemException if a system exception occurred
\r
1517 public static int getSocialUsersCount(long userId1, long userId2, int type)
\r
1518 throws com.liferay.portal.kernel.exception.PortalException,
\r
1519 com.liferay.portal.kernel.exception.SystemException {
\r
1520 return getService().getSocialUsersCount(userId1, userId2, type);
\r
1524 * Returns the user with the contact ID.
\r
1526 * @param contactId the user's contact ID
\r
1527 * @return the user with the contact ID
\r
1528 * @throws PortalException if a user with the contact ID could not be found
\r
1529 * @throws SystemException if a system exception occurred
\r
1531 public static com.liferay.portal.model.User getUserByContactId(
\r
1533 throws com.liferay.portal.kernel.exception.PortalException,
\r
1534 com.liferay.portal.kernel.exception.SystemException {
\r
1535 return getService().getUserByContactId(contactId);
\r
1539 * Returns the user with the email address.
\r
1541 * @param companyId the primary key of the user's company
\r
1542 * @param emailAddress the user's email address
\r
1543 * @return the user with the email address
\r
1544 * @throws PortalException if a user with the email address could not be
\r
1546 * @throws SystemException if a system exception occurred
\r
1548 public static com.liferay.portal.model.User getUserByEmailAddress(
\r
1549 long companyId, java.lang.String emailAddress)
\r
1550 throws com.liferay.portal.kernel.exception.PortalException,
\r
1551 com.liferay.portal.kernel.exception.SystemException {
\r
1552 return getService().getUserByEmailAddress(companyId, emailAddress);
\r
1556 * Returns the user with the Facebook ID.
\r
1558 * @param companyId the primary key of the user's company
\r
1559 * @param facebookId the user's Facebook ID
\r
1560 * @return the user with the Facebook ID
\r
1561 * @throws PortalException if a user with the Facebook ID could not be found
\r
1562 * @throws SystemException if a system exception occurred
\r
1564 public static com.liferay.portal.model.User getUserByFacebookId(
\r
1565 long companyId, long facebookId)
\r
1566 throws com.liferay.portal.kernel.exception.PortalException,
\r
1567 com.liferay.portal.kernel.exception.SystemException {
\r
1568 return getService().getUserByFacebookId(companyId, facebookId);
\r
1572 * Returns the user with the primary key.
\r
1574 * @param userId the primary key of the user
\r
1575 * @return the user with the primary key
\r
1576 * @throws PortalException if a user with the primary key could not be found
\r
1577 * @throws SystemException if a system exception occurred
\r
1579 public static com.liferay.portal.model.User getUserById(long userId)
\r
1580 throws com.liferay.portal.kernel.exception.PortalException,
\r
1581 com.liferay.portal.kernel.exception.SystemException {
\r
1582 return getService().getUserById(userId);
\r
1586 * Returns the user with the primary key from the company.
\r
1588 * @param companyId the primary key of the user's company
\r
1589 * @param userId the primary key of the user
\r
1590 * @return the user with the primary key
\r
1591 * @throws PortalException if a user with the primary key from the company
\r
1592 could not be found
\r
1593 * @throws SystemException if a system exception occurred
\r
1595 public static com.liferay.portal.model.User getUserById(long companyId,
\r
1597 throws com.liferay.portal.kernel.exception.PortalException,
\r
1598 com.liferay.portal.kernel.exception.SystemException {
\r
1599 return getService().getUserById(companyId, userId);
\r
1603 * Returns the user with the OpenID.
\r
1605 * @param companyId the primary key of the user's company
\r
1606 * @param openId the user's OpenID
\r
1607 * @return the user with the OpenID
\r
1608 * @throws PortalException if a user with the OpenID could not be found
\r
1609 * @throws SystemException if a system exception occurred
\r
1611 public static com.liferay.portal.model.User getUserByOpenId(
\r
1612 long companyId, java.lang.String openId)
\r
1613 throws com.liferay.portal.kernel.exception.PortalException,
\r
1614 com.liferay.portal.kernel.exception.SystemException {
\r
1615 return getService().getUserByOpenId(companyId, openId);
\r
1619 * Returns the user with the portrait ID.
\r
1621 * @param portraitId the user's portrait ID
\r
1622 * @return the user with the portrait ID
\r
1623 * @throws PortalException if a user with the portrait ID could not be found
\r
1624 * @throws SystemException if a system exception occurred
\r
1626 public static com.liferay.portal.model.User getUserByPortraitId(
\r
1628 throws com.liferay.portal.kernel.exception.PortalException,
\r
1629 com.liferay.portal.kernel.exception.SystemException {
\r
1630 return getService().getUserByPortraitId(portraitId);
\r
1634 * Returns the user with the screen name.
\r
1636 * @param companyId the primary key of the user's company
\r
1637 * @param screenName the user's screen name
\r
1638 * @return the user with the screen name
\r
1639 * @throws PortalException if a user with the screen name could not be found
\r
1640 * @throws SystemException if a system exception occurred
\r
1642 public static com.liferay.portal.model.User getUserByScreenName(
\r
1643 long companyId, java.lang.String screenName)
\r
1644 throws com.liferay.portal.kernel.exception.PortalException,
\r
1645 com.liferay.portal.kernel.exception.SystemException {
\r
1646 return getService().getUserByScreenName(companyId, screenName);
\r
1650 * Returns the user with the universally unique identifier.
\r
1652 * @param uuid the user's universally unique identifier
\r
1653 * @return the user with the universally unique identifier
\r
1654 * @throws PortalException if a user with the universally unique identifier
\r
1655 could not be found
\r
1656 * @throws SystemException if a system exception occurred
\r
1658 public static com.liferay.portal.model.User getUserByUuid(
\r
1659 java.lang.String uuid)
\r
1660 throws com.liferay.portal.kernel.exception.PortalException,
\r
1661 com.liferay.portal.kernel.exception.SystemException {
\r
1662 return getService().getUserByUuid(uuid);
\r
1666 * Returns all the users belonging to the user group.
\r
1668 * @param userGroupId the primary key of the user group
\r
1669 * @return the users belonging to the user group
\r
1670 * @throws SystemException if a system exception occurred
\r
1672 public static java.util.List<com.liferay.portal.model.User> getUserGroupUsers(
\r
1674 throws com.liferay.portal.kernel.exception.SystemException {
\r
1675 return getService().getUserGroupUsers(userGroupId);
\r
1679 * Returns the number of users belonging to the user group.
\r
1681 * @param userGroupId the primary key of the user group
\r
1682 * @return the number of users belonging to the user group
\r
1683 * @throws SystemException if a system exception occurred
\r
1685 public static int getUserGroupUsersCount(long userGroupId)
\r
1686 throws com.liferay.portal.kernel.exception.SystemException {
\r
1687 return getService().getUserGroupUsersCount(userGroupId);
\r
1691 * Returns the number of users with the status belonging to the user group.
\r
1693 * @param userGroupId the primary key of the user group
\r
1694 * @param status the workflow status
\r
1695 * @return the number of users with the status belonging to the user group
\r
1696 * @throws PortalException if a user group with the primary key could not be
\r
1698 * @throws SystemException if a system exception occurred
\r
1700 public static int getUserGroupUsersCount(long userGroupId, int status)
\r
1701 throws com.liferay.portal.kernel.exception.PortalException,
\r
1702 com.liferay.portal.kernel.exception.SystemException {
\r
1703 return getService().getUserGroupUsersCount(userGroupId, status);
\r
1707 * Returns the primary key of the user with the email address.
\r
1709 * @param companyId the primary key of the user's company
\r
1710 * @param emailAddress the user's email address
\r
1711 * @return the primary key of the user with the email address
\r
1712 * @throws PortalException if a user with the email address could not be
\r
1714 * @throws SystemException if a system exception occurred
\r
1716 public static long getUserIdByEmailAddress(long companyId,
\r
1717 java.lang.String emailAddress)
\r
1718 throws com.liferay.portal.kernel.exception.PortalException,
\r
1719 com.liferay.portal.kernel.exception.SystemException {
\r
1720 return getService().getUserIdByEmailAddress(companyId, emailAddress);
\r
1724 * Returns the primary key of the user with the screen name.
\r
1726 * @param companyId the primary key of the user's company
\r
1727 * @param screenName the user's screen name
\r
1728 * @return the primary key of the user with the screen name
\r
1729 * @throws PortalException if a user with the screen name could not be found
\r
1730 * @throws SystemException if a system exception occurred
\r
1732 public static long getUserIdByScreenName(long companyId,
\r
1733 java.lang.String screenName)
\r
1734 throws com.liferay.portal.kernel.exception.PortalException,
\r
1735 com.liferay.portal.kernel.exception.SystemException {
\r
1736 return getService().getUserIdByScreenName(companyId, screenName);
\r
1740 * Returns <code>true</code> if the user is a member of the group.
\r
1742 * @param groupId the primary key of the group
\r
1743 * @param userId the primary key of the user
\r
1744 * @return <code>true</code> if the user is a member of the group;
\r
1745 <code>false</code> otherwise
\r
1746 * @throws SystemException if a system exception occurred
\r
1748 public static boolean hasGroupUser(long groupId, long userId)
\r
1749 throws com.liferay.portal.kernel.exception.SystemException {
\r
1750 return getService().hasGroupUser(groupId, userId);
\r
1754 * Returns <code>true</code> if the user is a member of the organization.
\r
1756 * @param organizationId the primary key of the organization
\r
1757 * @param userId the primary key of the user
\r
1758 * @return <code>true</code> if the user is a member of the organization;
\r
1759 <code>false</code> otherwise
\r
1760 * @throws SystemException if a system exception occurred
\r
1762 public static boolean hasOrganizationUser(long organizationId, long userId)
\r
1763 throws com.liferay.portal.kernel.exception.SystemException {
\r
1764 return getService().hasOrganizationUser(organizationId, userId);
\r
1768 * Returns <code>true</code> if the password policy has been assigned to the
\r
1771 * @param passwordPolicyId the primary key of the password policy
\r
1772 * @param userId the primary key of the user
\r
1773 * @return <code>true</code> if the password policy is assigned to the user;
\r
1774 <code>false</code> otherwise
\r
1775 * @throws SystemException if a system exception occurred
\r
1777 public static boolean hasPasswordPolicyUser(long passwordPolicyId,
\r
1778 long userId) throws com.liferay.portal.kernel.exception.SystemException {
\r
1779 return getService().hasPasswordPolicyUser(passwordPolicyId, userId);
\r
1783 * Returns <code>true</code> if the user is a member of the role.
\r
1785 * @param roleId the primary key of the role
\r
1786 * @param userId the primary key of the user
\r
1787 * @return <code>true</code> if the user is a member of the role;
\r
1788 <code>false</code> otherwise
\r
1789 * @throws SystemException if a system exception occurred
\r
1791 public static boolean hasRoleUser(long roleId, long userId)
\r
1792 throws com.liferay.portal.kernel.exception.SystemException {
\r
1793 return getService().hasRoleUser(roleId, userId);
\r
1797 * Returns <code>true</code> if the user has the role with the name,
\r
1798 * optionally through inheritance.
\r
1800 * @param companyId the primary key of the role's company
\r
1801 * @param name the name of the role (must be a regular role, not an
\r
1802 organization, site or provider role)
\r
1803 * @param userId the primary key of the user
\r
1804 * @param inherited whether to include roles inherited from organizations,
\r
1806 * @return <code>true</code> if the user has the role; <code>false</code>
\r
1808 * @throws PortalException if a role with the name could not be found
\r
1809 * @throws SystemException if a system exception occurred
\r
1811 public static boolean hasRoleUser(long companyId, java.lang.String name,
\r
1812 long userId, boolean inherited)
\r
1813 throws com.liferay.portal.kernel.exception.PortalException,
\r
1814 com.liferay.portal.kernel.exception.SystemException {
\r
1815 return getService().hasRoleUser(companyId, name, userId, inherited);
\r
1819 * Returns <code>true</code> if the user is a member of the team.
\r
1821 * @param teamId the primary key of the team
\r
1822 * @param userId the primary key of the user
\r
1823 * @return <code>true</code> if the user is a member of the team;
\r
1824 <code>false</code> otherwise
\r
1825 * @throws SystemException if a system exception occurred
\r
1827 public static boolean hasTeamUser(long teamId, long userId)
\r
1828 throws com.liferay.portal.kernel.exception.SystemException {
\r
1829 return getService().hasTeamUser(teamId, userId);
\r
1833 * Returns <code>true</code> if the user is a member of the user group.
\r
1835 * @param userGroupId the primary key of the user group
\r
1836 * @param userId the primary key of the user
\r
1837 * @return <code>true</code> if the user is a member of the user group;
\r
1838 <code>false</code> otherwise
\r
1839 * @throws SystemException if a system exception occurred
\r
1841 public static boolean hasUserGroupUser(long userGroupId, long userId)
\r
1842 throws com.liferay.portal.kernel.exception.SystemException {
\r
1843 return getService().hasUserGroupUser(userGroupId, userId);
\r
1847 * Returns <code>true</code> if the user's password is expired.
\r
1849 * @param user the user
\r
1850 * @return <code>true</code> if the user's password is expired;
\r
1851 <code>false</code> otherwise
\r
1852 * @throws PortalException if the password policy for the user could not be
\r
1854 * @throws SystemException if a system exception occurred
\r
1856 public static boolean isPasswordExpired(com.liferay.portal.model.User user)
\r
1857 throws com.liferay.portal.kernel.exception.PortalException,
\r
1858 com.liferay.portal.kernel.exception.SystemException {
\r
1859 return getService().isPasswordExpired(user);
\r
1863 * Returns <code>true</code> if the user's password is expiring soon.
\r
1865 * @param user the user
\r
1866 * @return <code>true</code> if the user's password is expiring soon;
\r
1867 <code>false</code> otherwise
\r
1868 * @throws PortalException if the password policy for the user could not be
\r
1870 * @throws SystemException if a system exception occurred
\r
1872 public static boolean isPasswordExpiringSoon(
\r
1873 com.liferay.portal.model.User user)
\r
1874 throws com.liferay.portal.kernel.exception.PortalException,
\r
1875 com.liferay.portal.kernel.exception.SystemException {
\r
1876 return getService().isPasswordExpiringSoon(user);
\r
1879 public static com.liferay.portal.model.User loadGetDefaultUser(
\r
1881 throws com.liferay.portal.kernel.exception.PortalException,
\r
1882 com.liferay.portal.kernel.exception.SystemException {
\r
1883 return getService().loadGetDefaultUser(companyId);
\r
1887 * Returns an ordered range of all the users who match the keywords and
\r
1888 * status, without using the indexer. It is preferable to use the indexed
\r
1889 * version {@link #search(long, String, int, LinkedHashMap, int, int, Sort)}
\r
1890 * instead of this method wherever possible for performance reasons.
\r
1893 * Useful when paginating results. Returns a maximum of <code>end -
\r
1894 * start</code> instances. <code>start</code> and <code>end</code> are not
\r
1895 * primary keys, they are indexes in the result set. Thus, <code>0</code>
\r
1896 * refers to the first result in the set. Setting both <code>start</code>
\r
1897 * and <code>end</code> to {@link
\r
1898 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
\r
1902 * @param companyId the primary key of the user's company
\r
1903 * @param keywords the keywords (space separated), which may occur in the
\r
1904 user's first name, middle name, last name, screen name, or email
\r
1906 * @param status the workflow status
\r
1907 * @param params the finder parameters (optionally <code>null</code>). For
\r
1908 more information see {@link
\r
1909 com.liferay.portal.service.persistence.UserFinder}.
\r
1910 * @param start the lower bound of the range of users
\r
1911 * @param end the upper bound of the range of users (not inclusive)
\r
1912 * @param obc the comparator to order the users by (optionally
\r
1913 <code>null</code>)
\r
1914 * @return the matching users
\r
1915 * @throws SystemException if a system exception occurred
\r
1916 * @see com.liferay.portal.service.persistence.UserFinder
\r
1918 public static java.util.List<com.liferay.portal.model.User> search(
\r
1919 long companyId, java.lang.String keywords, int status,
\r
1920 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
\r
1921 int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
\r
1922 throws com.liferay.portal.kernel.exception.SystemException {
\r
1923 return getService()
\r
1924 .search(companyId, keywords, status, params, start, end, obc);
\r
1928 * Returns an ordered range of all the users who match the keywords and
\r
1929 * status, using the indexer. It is preferable to use this method instead of
\r
1930 * the non-indexed version whenever possible for performance reasons.
\r
1933 * Useful when paginating results. Returns a maximum of <code>end -
\r
1934 * start</code> instances. <code>start</code> and <code>end</code> are not
\r
1935 * primary keys, they are indexes in the result set. Thus, <code>0</code>
\r
1936 * refers to the first result in the set. Setting both <code>start</code>
\r
1937 * and <code>end</code> to {@link
\r
1938 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
\r
1942 * @param companyId the primary key of the user's company
\r
1943 * @param keywords the keywords (space separated), which may occur in the
\r
1944 user's first name, middle name, last name, screen name, or email
\r
1946 * @param status the workflow status
\r
1947 * @param params the indexer parameters (optionally <code>null</code>). For
\r
1948 more information see {@link
\r
1949 com.liferay.portlet.usersadmin.util.UserIndexer}.
\r
1950 * @param start the lower bound of the range of users
\r
1951 * @param end the upper bound of the range of users (not inclusive)
\r
1952 * @param sort the field and direction to sort by (optionally
\r
1953 <code>null</code>)
\r
1954 * @return the matching users
\r
1955 * @throws SystemException if a system exception occurred
\r
1956 * @see com.liferay.portlet.usersadmin.util.UserIndexer
\r
1958 public static com.liferay.portal.kernel.search.Hits search(long companyId,
\r
1959 java.lang.String keywords, int status,
\r
1960 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
\r
1961 int start, int end, com.liferay.portal.kernel.search.Sort sort)
\r
1962 throws com.liferay.portal.kernel.exception.SystemException {
\r
1963 return getService()
\r
1964 .search(companyId, keywords, status, params, start, end, sort);
\r
1968 * Returns an ordered range of all the users with the status, and whose
\r
1969 * first name, middle name, last name, screen name, and email address match
\r
1970 * the keywords specified for them, without using the indexer. It is
\r
1971 * preferable to use the indexed version {@link #search(long, String,
\r
1972 * String, String, String, String, int, LinkedHashMap, boolean, int, int,
\r
1973 * Sort)} instead of this method wherever possible for performance reasons.
\r
1976 * Useful when paginating results. Returns a maximum of <code>end -
\r
1977 * start</code> instances. <code>start</code> and <code>end</code> are not
\r
1978 * primary keys, they are indexes in the result set. Thus, <code>0</code>
\r
1979 * refers to the first result in the set. Setting both <code>start</code>
\r
1980 * and <code>end</code> to {@link
\r
1981 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
\r
1985 * @param companyId the primary key of the user's company
\r
1986 * @param firstName the first name keywords (space separated)
\r
1987 * @param middleName the middle name keywords
\r
1988 * @param lastName the last name keywords
\r
1989 * @param screenName the screen name keywords
\r
1990 * @param emailAddress the email address keywords
\r
1991 * @param status the workflow status
\r
1992 * @param params the finder parameters (optionally <code>null</code>). For
\r
1993 more information see {@link
\r
1994 com.liferay.portal.service.persistence.UserFinder}.
\r
1995 * @param andSearch whether every field must match its keywords, or just
\r
1996 one field. For example, "users with the first name 'bob' and
\r
1997 last name 'smith'" vs "users with the first name 'bob'
\r
1998 or the last name 'smith'".
\r
1999 * @param start the lower bound of the range of users
\r
2000 * @param end the upper bound of the range of users (not inclusive)
\r
2001 * @param obc the comparator to order the users by (optionally
\r
2002 <code>null</code>)
\r
2003 * @return the matching users
\r
2004 * @throws SystemException if a system exception occurred
\r
2005 * @see com.liferay.portal.service.persistence.UserFinder
\r
2007 public static java.util.List<com.liferay.portal.model.User> search(
\r
2008 long companyId, java.lang.String firstName,
\r
2009 java.lang.String middleName, java.lang.String lastName,
\r
2010 java.lang.String screenName, java.lang.String emailAddress, int status,
\r
2011 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
\r
2012 boolean andSearch, int start, int end,
\r
2013 com.liferay.portal.kernel.util.OrderByComparator obc)
\r
2014 throws com.liferay.portal.kernel.exception.SystemException {
\r
2015 return getService()
\r
2016 .search(companyId, firstName, middleName, lastName,
\r
2017 screenName, emailAddress, status, params, andSearch, start, end, obc);
\r
2021 * Returns an ordered range of all the users with the status, and whose
\r
2022 * first name, middle name, last name, screen name, and email address match
\r
2023 * the keywords specified for them, using the indexer. It is preferable to
\r
2024 * use this method instead of the non-indexed version whenever possible for
\r
2025 * performance reasons.
\r
2028 * Useful when paginating results. Returns a maximum of <code>end -
\r
2029 * start</code> instances. <code>start</code> and <code>end</code> are not
\r
2030 * primary keys, they are indexes in the result set. Thus, <code>0</code>
\r
2031 * refers to the first result in the set. Setting both <code>start</code>
\r
2032 * and <code>end</code> to {@link
\r
2033 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
\r
2037 * @param companyId the primary key of the user's company
\r
2038 * @param firstName the first name keywords (space separated)
\r
2039 * @param middleName the middle name keywords
\r
2040 * @param lastName the last name keywords
\r
2041 * @param screenName the screen name keywords
\r
2042 * @param emailAddress the email address keywords
\r
2043 * @param status the workflow status
\r
2044 * @param params the indexer parameters (optionally <code>null</code>). For
\r
2045 more information see {@link
\r
2046 com.liferay.portlet.usersadmin.util.UserIndexer}.
\r
2047 * @param andSearch whether every field must match its keywords, or just
\r
2048 one field. For example, "users with the first name 'bob' and
\r
2049 last name 'smith'" vs "users with the first name 'bob'
\r
2050 or the last name 'smith'".
\r
2051 * @param start the lower bound of the range of users
\r
2052 * @param end the upper bound of the range of users (not inclusive)
\r
2053 * @param sort the field and direction to sort by (optionally
\r
2054 <code>null</code>)
\r
2055 * @return the matching users
\r
2056 * @throws SystemException if a system exception occurred
\r
2057 * @see com.liferay.portlet.usersadmin.util.UserIndexer
\r
2059 public static com.liferay.portal.kernel.search.Hits search(long companyId,
\r
2060 java.lang.String firstName, java.lang.String middleName,
\r
2061 java.lang.String lastName, java.lang.String screenName,
\r
2062 java.lang.String emailAddress, int status,
\r
2063 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
\r
2064 boolean andSearch, int start, int end,
\r
2065 com.liferay.portal.kernel.search.Sort sort)
\r
2066 throws com.liferay.portal.kernel.exception.SystemException {
\r
2067 return getService()
\r
2068 .search(companyId, firstName, middleName, lastName,
\r
2069 screenName, emailAddress, status, params, andSearch, start, end,
\r
2074 * Returns the number of users who match the keywords and status.
\r
2076 * @param companyId the primary key of the user's company
\r
2077 * @param keywords the keywords (space separated), which may occur in the
\r
2078 user's first name, middle name, last name, screen name, or email
\r
2080 * @param status the workflow status
\r
2081 * @param params the finder parameters (optionally <code>null</code>). For
\r
2082 more information see {@link
\r
2083 com.liferay.portal.service.persistence.UserFinder}.
\r
2084 * @return the number matching users
\r
2085 * @throws SystemException if a system exception occurred
\r
2087 public static int searchCount(long companyId, java.lang.String keywords,
\r
2089 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params)
\r
2090 throws com.liferay.portal.kernel.exception.SystemException {
\r
2091 return getService().searchCount(companyId, keywords, status, params);
\r
2095 * Returns the number of users with the status, and whose first name, middle
\r
2096 * name, last name, screen name, and email address match the keywords
\r
2097 * specified for them.
\r
2099 * @param companyId the primary key of the user's company
\r
2100 * @param firstName the first name keywords (space separated)
\r
2101 * @param middleName the middle name keywords
\r
2102 * @param lastName the last name keywords
\r
2103 * @param screenName the screen name keywords
\r
2104 * @param emailAddress the email address keywords
\r
2105 * @param status the workflow status
\r
2106 * @param params the finder parameters (optionally <code>null</code>). For
\r
2107 more information see {@link
\r
2108 com.liferay.portal.service.persistence.UserFinder}.
\r
2109 * @param andSearch whether every field must match its keywords, or just
\r
2110 one field. For example, "users with the first name 'bob' and
\r
2111 last name 'smith'" vs "users with the first name 'bob'
\r
2112 or the last name 'smith'".
\r
2113 * @return the number of matching users
\r
2114 * @throws SystemException if a system exception occurred
\r
2116 public static int searchCount(long companyId, java.lang.String firstName,
\r
2117 java.lang.String middleName, java.lang.String lastName,
\r
2118 java.lang.String screenName, java.lang.String emailAddress, int status,
\r
2119 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
\r
2120 boolean andSearch)
\r
2121 throws com.liferay.portal.kernel.exception.SystemException {
\r
2122 return getService()
\r
2123 .searchCount(companyId, firstName, middleName, lastName,
\r
2124 screenName, emailAddress, status, params, andSearch);
\r
2128 * Sends an email address verification to the user.
\r
2130 * @param user the verification email recipient
\r
2131 * @param emailAddress the recipient's email address
\r
2132 * @param serviceContext the service context. Must set the portal URL, main
\r
2133 path, primary key of the layout, remote address, remote host, and
\r
2134 agent for the user.
\r
2135 * @throws PortalException if a portal exception occurred
\r
2136 * @throws SystemException if a system exception occurred
\r
2138 public static void sendEmailAddressVerification(
\r
2139 com.liferay.portal.model.User user, java.lang.String emailAddress,
\r
2140 com.liferay.portal.service.ServiceContext serviceContext)
\r
2141 throws com.liferay.portal.kernel.exception.PortalException,
\r
2142 com.liferay.portal.kernel.exception.SystemException {
\r
2144 .sendEmailAddressVerification(user, emailAddress, serviceContext);
\r
2148 * Sends the password email to the user with the email address. The content
\r
2149 * of this email can be specified in <code>portal.properties</code> with the
\r
2150 * <code>admin.email.password</code> keys.
\r
2152 * @param companyId the primary key of the user's company
\r
2153 * @param emailAddress the user's email address
\r
2154 * @param fromName the name of the individual that the email should be from
\r
2155 * @param fromAddress the address of the individual that the email should
\r
2157 * @param subject the email subject. If <code>null</code>, the subject
\r
2158 specified in <code>portal.properties</code> will be used.
\r
2159 * @param body the email body. If <code>null</code>, the body specified in
\r
2160 <code>portal.properties</code> will be used.
\r
2161 * @param serviceContext the user's service context
\r
2162 * @throws PortalException if a user with the email address could not be
\r
2164 * @throws SystemException if a system exception occurred
\r
2166 public static void sendPassword(long companyId,
\r
2167 java.lang.String emailAddress, java.lang.String fromName,
\r
2168 java.lang.String fromAddress, java.lang.String subject,
\r
2169 java.lang.String body,
\r
2170 com.liferay.portal.service.ServiceContext serviceContext)
\r
2171 throws com.liferay.portal.kernel.exception.PortalException,
\r
2172 com.liferay.portal.kernel.exception.SystemException {
\r
2174 .sendPassword(companyId, emailAddress, fromName, fromAddress,
\r
2175 subject, body, serviceContext);
\r
2179 * Sets the users in the role, removing and adding users to the role as
\r
2182 * @param roleId the primary key of the role
\r
2183 * @param userIds the primary keys of the users
\r
2184 * @throws PortalException if a portal exception occurred
\r
2185 * @throws SystemException if a system exception occurred
\r
2187 public static void setRoleUsers(long roleId, long[] userIds)
\r
2188 throws com.liferay.portal.kernel.exception.PortalException,
\r
2189 com.liferay.portal.kernel.exception.SystemException {
\r
2190 getService().setRoleUsers(roleId, userIds);
\r
2194 * Sets the users in the user group, removing and adding users to the user
\r
2195 * group as necessary.
\r
2197 * @param userGroupId the primary key of the user group
\r
2198 * @param userIds the primary keys of the users
\r
2199 * @throws PortalException if a portal exception occurred
\r
2200 * @throws SystemException if a system exception occurred
\r
2202 public static void setUserGroupUsers(long userGroupId, long[] userIds)
\r
2203 throws com.liferay.portal.kernel.exception.PortalException,
\r
2204 com.liferay.portal.kernel.exception.SystemException {
\r
2205 getService().setUserGroupUsers(userGroupId, userIds);
\r
2209 * Removes the users from the teams of a group.
\r
2211 * @param groupId the primary key of the group
\r
2212 * @param userIds the primary keys of the users
\r
2213 * @throws PortalException if a portal exception occurred
\r
2214 * @throws SystemException if a system exception occurred
\r
2216 public static void unsetGroupTeamsUsers(long groupId, long[] userIds)
\r
2217 throws com.liferay.portal.kernel.exception.PortalException,
\r
2218 com.liferay.portal.kernel.exception.SystemException {
\r
2219 getService().unsetGroupTeamsUsers(groupId, userIds);
\r
2223 * Removes the users from the group.
\r
2225 * @param groupId the primary key of the group
\r
2226 * @param userIds the primary keys of the users
\r
2227 * @throws PortalException if a portal exception occurred
\r
2228 * @throws SystemException if a system exception occurred
\r
2230 public static void unsetGroupUsers(long groupId, long[] userIds,
\r
2231 com.liferay.portal.service.ServiceContext serviceContext)
\r
2232 throws com.liferay.portal.kernel.exception.PortalException,
\r
2233 com.liferay.portal.kernel.exception.SystemException {
\r
2234 getService().unsetGroupUsers(groupId, userIds, serviceContext);
\r
2238 * Removes the users from the organization.
\r
2240 * @param organizationId the primary key of the organization
\r
2241 * @param userIds the primary keys of the users
\r
2242 * @throws PortalException if a portal exception occurred
\r
2243 * @throws SystemException if a system exception occurred
\r
2245 public static void unsetOrganizationUsers(long organizationId,
\r
2247 throws com.liferay.portal.kernel.exception.PortalException,
\r
2248 com.liferay.portal.kernel.exception.SystemException {
\r
2249 getService().unsetOrganizationUsers(organizationId, userIds);
\r
2253 * Removes the users from the password policy.
\r
2255 * @param passwordPolicyId the primary key of the password policy
\r
2256 * @param userIds the primary keys of the users
\r
2257 * @throws SystemException if a system exception occurred
\r
2259 public static void unsetPasswordPolicyUsers(long passwordPolicyId,
\r
2261 throws com.liferay.portal.kernel.exception.SystemException {
\r
2262 getService().unsetPasswordPolicyUsers(passwordPolicyId, userIds);
\r
2266 * Removes the users from the role.
\r
2268 * @param roleId the primary key of the role
\r
2269 * @param users the users
\r
2270 * @throws PortalException if a portal exception occurred
\r
2271 * @throws SystemException if a system exception occurred
\r
2273 public static void unsetRoleUsers(long roleId,
\r
2274 java.util.List<com.liferay.portal.model.User> users)
\r
2275 throws com.liferay.portal.kernel.exception.PortalException,
\r
2276 com.liferay.portal.kernel.exception.SystemException {
\r
2277 getService().unsetRoleUsers(roleId, users);
\r
2281 * Removes the users from the role.
\r
2283 * @param roleId the primary key of the role
\r
2284 * @param userIds the primary keys of the users
\r
2285 * @throws PortalException if a portal exception occurred
\r
2286 * @throws SystemException if a system exception occurred
\r
2288 public static void unsetRoleUsers(long roleId, long[] userIds)
\r
2289 throws com.liferay.portal.kernel.exception.PortalException,
\r
2290 com.liferay.portal.kernel.exception.SystemException {
\r
2291 getService().unsetRoleUsers(roleId, userIds);
\r
2295 * Removes the users from the team.
\r
2297 * @param teamId the primary key of the team
\r
2298 * @param userIds the primary keys of the users
\r
2299 * @throws PortalException if a portal exception occurred
\r
2300 * @throws SystemException if a system exception occurred
\r
2302 public static void unsetTeamUsers(long teamId, long[] userIds)
\r
2303 throws com.liferay.portal.kernel.exception.PortalException,
\r
2304 com.liferay.portal.kernel.exception.SystemException {
\r
2305 getService().unsetTeamUsers(teamId, userIds);
\r
2309 * Removes the users from the user group.
\r
2311 * @param userGroupId the primary key of the user group
\r
2312 * @param userIds the primary keys of the users
\r
2313 * @throws PortalException if a portal exception occurred
\r
2314 * @throws SystemException if a system exception occurred
\r
2316 public static void unsetUserGroupUsers(long userGroupId, long[] userIds)
\r
2317 throws com.liferay.portal.kernel.exception.PortalException,
\r
2318 com.liferay.portal.kernel.exception.SystemException {
\r
2319 getService().unsetUserGroupUsers(userGroupId, userIds);
\r
2323 * Updates whether the user has agreed to the terms of use.
\r
2325 * @param userId the primary key of the user
\r
2326 * @param agreedToTermsOfUse whether the user has agreet to the terms of
\r
2328 * @return the user
\r
2329 * @throws PortalException if a user with the primary key could not be found
\r
2330 * @throws SystemException if a system exception occurred
\r
2332 public static com.liferay.portal.model.User updateAgreedToTermsOfUse(
\r
2333 long userId, boolean agreedToTermsOfUse)
\r
2334 throws com.liferay.portal.kernel.exception.PortalException,
\r
2335 com.liferay.portal.kernel.exception.SystemException {
\r
2336 return getService().updateAgreedToTermsOfUse(userId, agreedToTermsOfUse);
\r
2340 * Updates the user's asset with the new asset categories and tag names,
\r
2341 * removing and adding asset categories and tag names as necessary.
\r
2343 * @param userId the primary key of the user
\r
2344 * @param user ID the primary key of the user
\r
2345 * @param assetCategoryIds the primary key's of the new asset categories
\r
2346 * @param assetTagNames the new asset tag names
\r
2347 * @throws PortalException if a user with the primary key could not be found
\r
2348 * @throws SystemException if a system exception occurred
\r
2350 public static void updateAsset(long userId,
\r
2351 com.liferay.portal.model.User user, long[] assetCategoryIds,
\r
2352 java.lang.String[] assetTagNames)
\r
2353 throws com.liferay.portal.kernel.exception.PortalException,
\r
2354 com.liferay.portal.kernel.exception.SystemException {
\r
2355 getService().updateAsset(userId, user, assetCategoryIds, assetTagNames);
\r
2359 * Updates the user's creation date.
\r
2361 * @param userId the primary key of the user
\r
2362 * @param createDate the new creation date
\r
2363 * @return the user
\r
2364 * @throws PortalException if a user with the primary key could not be found
\r
2365 * @throws SystemException if a system exception occurred
\r
2367 public static com.liferay.portal.model.User updateCreateDate(long userId,
\r
2368 java.util.Date createDate)
\r
2369 throws com.liferay.portal.kernel.exception.PortalException,
\r
2370 com.liferay.portal.kernel.exception.SystemException {
\r
2371 return getService().updateCreateDate(userId, createDate);
\r
2375 * Updates the user's email address.
\r
2377 * @param userId the primary key of the user
\r
2378 * @param password the user's password
\r
2379 * @param emailAddress1 the user's new email address
\r
2380 * @param emailAddress2 the user's new email address confirmation
\r
2381 * @return the user
\r
2382 * @throws PortalException if a user with the primary key could not be found
\r
2383 * @throws SystemException if a system exception occurred
\r
2385 public static com.liferay.portal.model.User updateEmailAddress(
\r
2386 long userId, java.lang.String password, java.lang.String emailAddress1,
\r
2387 java.lang.String emailAddress2)
\r
2388 throws com.liferay.portal.kernel.exception.PortalException,
\r
2389 com.liferay.portal.kernel.exception.SystemException {
\r
2390 return getService()
\r
2391 .updateEmailAddress(userId, password, emailAddress1,
\r
2396 * Updates the user's email address or sends verification email.
\r
2398 * @param userId the primary key of the user
\r
2399 * @param password the user's password
\r
2400 * @param emailAddress1 the user's new email address
\r
2401 * @param emailAddress2 the user's new email address confirmation
\r
2402 * @return the user
\r
2403 * @throws PortalException if a user with the primary key could not be found
\r
2404 * @throws SystemException if a system exception occurred
\r
2406 public static com.liferay.portal.model.User updateEmailAddress(
\r
2407 long userId, java.lang.String password, java.lang.String emailAddress1,
\r
2408 java.lang.String emailAddress2,
\r
2409 com.liferay.portal.service.ServiceContext serviceContext)
\r
2410 throws com.liferay.portal.kernel.exception.PortalException,
\r
2411 com.liferay.portal.kernel.exception.SystemException {
\r
2412 return getService()
\r
2413 .updateEmailAddress(userId, password, emailAddress1,
\r
2414 emailAddress2, serviceContext);
\r
2418 * Updates whether the user has verified email address.
\r
2420 * @param userId the primary key of the user
\r
2421 * @param emailAddressVerified whether the user has verified email address
\r
2422 * @return the user
\r
2423 * @throws PortalException if a user with the primary key could not be found
\r
2424 * @throws SystemException if a system exception occurred
\r
2426 public static com.liferay.portal.model.User updateEmailAddressVerified(
\r
2427 long userId, boolean emailAddressVerified)
\r
2428 throws com.liferay.portal.kernel.exception.PortalException,
\r
2429 com.liferay.portal.kernel.exception.SystemException {
\r
2430 return getService()
\r
2431 .updateEmailAddressVerified(userId, emailAddressVerified);
\r
2435 * Updates the user's Facebook ID.
\r
2437 * @param userId the primary key of the user
\r
2438 * @param facebookId the user's new Facebook ID
\r
2439 * @return the user
\r
2440 * @throws PortalException if a user with the primary key could not be found
\r
2441 * @throws SystemException if a system exception occurred
\r
2443 public static com.liferay.portal.model.User updateFacebookId(long userId,
\r
2445 throws com.liferay.portal.kernel.exception.PortalException,
\r
2446 com.liferay.portal.kernel.exception.SystemException {
\r
2447 return getService().updateFacebookId(userId, facebookId);
\r
2451 * Sets the groups the user is in, removing and adding groups as necessary.
\r
2453 * @param userId the primary key of the user
\r
2454 * @param newGroupIds the primary keys of the groups
\r
2455 * @throws PortalException if a portal exception occurred
\r
2456 * @throws SystemException if a system exception occurred
\r
2458 public static void updateGroups(long userId, long[] newGroupIds,
\r
2459 com.liferay.portal.service.ServiceContext serviceContext)
\r
2460 throws com.liferay.portal.kernel.exception.PortalException,
\r
2461 com.liferay.portal.kernel.exception.SystemException {
\r
2462 getService().updateGroups(userId, newGroupIds, serviceContext);
\r
2466 * Updates a user account that was automatically created when a guest user
\r
2467 * participated in an action (e.g. posting a comment) and only provided his
\r
2468 * name and email address.
\r
2470 * @param creatorUserId the primary key of the creator
\r
2471 * @param companyId the primary key of the user's company
\r
2472 * @param autoPassword whether a password should be automatically generated
\r
2474 * @param password1 the user's password
\r
2475 * @param password2 the user's password confirmation
\r
2476 * @param autoScreenName whether a screen name should be automatically
\r
2477 generated for the user
\r
2478 * @param screenName the user's screen name
\r
2479 * @param emailAddress the user's email address
\r
2480 * @param facebookId the user's facebook ID
\r
2481 * @param openId the user's OpenID
\r
2482 * @param locale the user's locale
\r
2483 * @param firstName the user's first name
\r
2484 * @param middleName the user's middle name
\r
2485 * @param lastName the user's last name
\r
2486 * @param prefixId the user's name prefix ID
\r
2487 * @param suffixId the user's name suffix ID
\r
2488 * @param male whether the user is male
\r
2489 * @param birthdayMonth the user's birthday month (0-based, meaning 0 for
\r
2491 * @param birthdayDay the user's birthday day
\r
2492 * @param birthdayYear the user's birthday year
\r
2493 * @param jobTitle the user's job title
\r
2494 * @param updateUserInformation whether to update the user's information
\r
2495 * @param sendEmail whether to send the user an email notification about
\r
2497 * @param serviceContext the user's service context (optionally
\r
2498 <code>null</code>). Can set expando bridge attributes for the
\r
2500 * @return the user
\r
2501 * @throws PortalException if the user's information was invalid
\r
2502 * @throws SystemException if a system exception occurred
\r
2504 public static com.liferay.portal.model.User updateIncompleteUser(
\r
2505 long creatorUserId, long companyId, boolean autoPassword,
\r
2506 java.lang.String password1, java.lang.String password2,
\r
2507 boolean autoScreenName, java.lang.String screenName,
\r
2508 java.lang.String emailAddress, long facebookId,
\r
2509 java.lang.String openId, java.util.Locale locale,
\r
2510 java.lang.String firstName, java.lang.String middleName,
\r
2511 java.lang.String lastName, int prefixId, int suffixId, boolean male,
\r
2512 int birthdayMonth, int birthdayDay, int birthdayYear,
\r
2513 java.lang.String jobTitle, boolean updateUserInformation,
\r
2514 boolean sendEmail,
\r
2515 com.liferay.portal.service.ServiceContext serviceContext)
\r
2516 throws com.liferay.portal.kernel.exception.PortalException,
\r
2517 com.liferay.portal.kernel.exception.SystemException {
\r
2518 return getService()
\r
2519 .updateIncompleteUser(creatorUserId, companyId,
\r
2520 autoPassword, password1, password2, autoScreenName, screenName,
\r
2521 emailAddress, facebookId, openId, locale, firstName, middleName,
\r
2522 lastName, prefixId, suffixId, male, birthdayMonth, birthdayDay,
\r
2523 birthdayYear, jobTitle, updateUserInformation, sendEmail,
\r
2528 * Updates the user's job title.
\r
2530 * @param userId the primary key of the user
\r
2531 * @param jobTitle the user's job title
\r
2532 * @return the user
\r
2533 * @throws PortalException if a user with the primary key could not be found
\r
2534 or if a contact could not be found matching the user's contact ID
\r
2535 * @throws SystemException if a system exception occurred
\r
2537 public static com.liferay.portal.model.User updateJobTitle(long userId,
\r
2538 java.lang.String jobTitle)
\r
2539 throws com.liferay.portal.kernel.exception.PortalException,
\r
2540 com.liferay.portal.kernel.exception.SystemException {
\r
2541 return getService().updateJobTitle(userId, jobTitle);
\r
2545 * Updates the user's last login with the current time and the IP address.
\r
2547 * @param userId the primary key of the user
\r
2548 * @param loginIP the IP address the user logged in from
\r
2549 * @return the user
\r
2550 * @throws PortalException if a user with the primary key could not be found
\r
2551 * @throws SystemException if a system exception occurred
\r
2553 public static com.liferay.portal.model.User updateLastLogin(long userId,
\r
2554 java.lang.String loginIP)
\r
2555 throws com.liferay.portal.kernel.exception.PortalException,
\r
2556 com.liferay.portal.kernel.exception.SystemException {
\r
2557 return getService().updateLastLogin(userId, loginIP);
\r
2561 * Updates whether the user is locked out from logging in.
\r
2563 * @param user the user
\r
2564 * @param lockout whether the user is locked out
\r
2565 * @return the user
\r
2566 * @throws PortalException if a portal exception occurred
\r
2567 * @throws SystemException if a system exception occurred
\r
2569 public static com.liferay.portal.model.User updateLockout(
\r
2570 com.liferay.portal.model.User user, boolean lockout)
\r
2571 throws com.liferay.portal.kernel.exception.PortalException,
\r
2572 com.liferay.portal.kernel.exception.SystemException {
\r
2573 return getService().updateLockout(user, lockout);
\r
2577 * Updates whether the user is locked out from logging in.
\r
2579 * @param companyId the primary key of the user's company
\r
2580 * @param emailAddress the user's email address
\r
2581 * @param lockout whether the user is locked out
\r
2582 * @return the user
\r
2583 * @throws PortalException if a user with the email address could not be
\r
2585 * @throws SystemException if a system exception occurred
\r
2587 public static com.liferay.portal.model.User updateLockoutByEmailAddress(
\r
2588 long companyId, java.lang.String emailAddress, boolean lockout)
\r
2589 throws com.liferay.portal.kernel.exception.PortalException,
\r
2590 com.liferay.portal.kernel.exception.SystemException {
\r
2591 return getService()
\r
2592 .updateLockoutByEmailAddress(companyId, emailAddress, lockout);
\r
2596 * Updates whether the user is locked out from logging in.
\r
2598 * @param userId the primary key of the user
\r
2599 * @param lockout whether the user is locked out
\r
2600 * @return the user
\r
2601 * @throws PortalException if a user with the primary key could not be found
\r
2602 * @throws SystemException if a system exception occurred
\r
2604 public static com.liferay.portal.model.User updateLockoutById(long userId,
\r
2606 throws com.liferay.portal.kernel.exception.PortalException,
\r
2607 com.liferay.portal.kernel.exception.SystemException {
\r
2608 return getService().updateLockoutById(userId, lockout);
\r
2612 * Updates whether the user is locked out from logging in.
\r
2614 * @param companyId the primary key of the user's company
\r
2615 * @param screenName the user's screen name
\r
2616 * @param lockout whether the user is locked out
\r
2617 * @return the user
\r
2618 * @throws PortalException if a user with the screen name could not be found
\r
2619 * @throws SystemException if a system exception occurred
\r
2621 public static com.liferay.portal.model.User updateLockoutByScreenName(
\r
2622 long companyId, java.lang.String screenName, boolean lockout)
\r
2623 throws com.liferay.portal.kernel.exception.PortalException,
\r
2624 com.liferay.portal.kernel.exception.SystemException {
\r
2625 return getService()
\r
2626 .updateLockoutByScreenName(companyId, screenName, lockout);
\r
2630 * Updates the user's modified date.
\r
2632 * @param userId the primary key of the user
\r
2633 * @param modifiedDate the new modified date
\r
2634 * @return the user
\r
2635 * @throws PortalException if a user with the primary key could not be found
\r
2636 * @throws SystemException if a system exception occurred
\r
2638 public static com.liferay.portal.model.User updateModifiedDate(
\r
2639 long userId, java.util.Date modifiedDate)
\r
2640 throws com.liferay.portal.kernel.exception.PortalException,
\r
2641 com.liferay.portal.kernel.exception.SystemException {
\r
2642 return getService().updateModifiedDate(userId, modifiedDate);
\r
2646 * Updates the user's OpenID.
\r
2648 * @param userId the primary key of the user
\r
2649 * @param openId the new OpenID
\r
2650 * @return the user
\r
2651 * @throws PortalException if a user with the primary key could not be found
\r
2652 * @throws SystemException if a system exception occurred
\r
2654 public static com.liferay.portal.model.User updateOpenId(long userId,
\r
2655 java.lang.String openId)
\r
2656 throws com.liferay.portal.kernel.exception.PortalException,
\r
2657 com.liferay.portal.kernel.exception.SystemException {
\r
2658 return getService().updateOpenId(userId, openId);
\r
2662 * Sets the organizations that the user is in, removing and adding
\r
2663 * organizations as necessary.
\r
2665 * @param userId the primary key of the user
\r
2666 * @param newOrganizationIds the primary keys of the organizations
\r
2667 * @throws PortalException if a user with the primary key could not be found
\r
2668 * @throws SystemException if a system exception occurred
\r
2670 public static void updateOrganizations(long userId,
\r
2671 long[] newOrganizationIds,
\r
2672 com.liferay.portal.service.ServiceContext serviceContext)
\r
2673 throws com.liferay.portal.kernel.exception.PortalException,
\r
2674 com.liferay.portal.kernel.exception.SystemException {
\r
2676 .updateOrganizations(userId, newOrganizationIds, serviceContext);
\r
2680 * Updates the user's password without tracking or validation of the change.
\r
2682 * @param userId the primary key of the user
\r
2683 * @param password1 the user's new password
\r
2684 * @param password2 the user's new password confirmation
\r
2685 * @param passwordReset whether the user should be asked to reset their
\r
2686 password the next time they log in
\r
2687 * @return the user
\r
2688 * @throws PortalException if a user with the primary key could not be found
\r
2689 * @throws SystemException if a system exception occurred
\r
2691 public static com.liferay.portal.model.User updatePassword(long userId,
\r
2692 java.lang.String password1, java.lang.String password2,
\r
2693 boolean passwordReset)
\r
2694 throws com.liferay.portal.kernel.exception.PortalException,
\r
2695 com.liferay.portal.kernel.exception.SystemException {
\r
2696 return getService()
\r
2697 .updatePassword(userId, password1, password2, passwordReset);
\r
2701 * Updates the user's password, optionally with tracking and validation of
\r
2704 * @param userId the primary key of the user
\r
2705 * @param password1 the user's new password
\r
2706 * @param password2 the user's new password confirmation
\r
2707 * @param passwordReset whether the user should be asked to reset their
\r
2708 password the next time they login
\r
2709 * @param silentUpdate whether the password should be updated without being
\r
2710 tracked, or validated. Primarily used for password imports.
\r
2711 * @return the user
\r
2712 * @throws PortalException if a user with the primary key could not be found
\r
2713 * @throws SystemException if a system exception occurred
\r
2715 public static com.liferay.portal.model.User updatePassword(long userId,
\r
2716 java.lang.String password1, java.lang.String password2,
\r
2717 boolean passwordReset, boolean silentUpdate)
\r
2718 throws com.liferay.portal.kernel.exception.PortalException,
\r
2719 com.liferay.portal.kernel.exception.SystemException {
\r
2720 return getService()
\r
2721 .updatePassword(userId, password1, password2, passwordReset,
\r
2726 * Updates the user's password with manually input information. This method
\r
2727 * should only be used when performing maintenance.
\r
2729 * @param userId the primary key of the user
\r
2730 * @param password the user's new password
\r
2731 * @param passwordEncrypted the user's new encrypted password
\r
2732 * @param passwordReset whether the user should be asked to reset their
\r
2733 password the next time they login
\r
2734 * @param passwordModifiedDate the new password modified date
\r
2735 * @return the user
\r
2736 * @throws PortalException if a user with the primary key could not be found
\r
2737 * @throws SystemException if a system exception occurred
\r
2739 public static com.liferay.portal.model.User updatePasswordManually(
\r
2740 long userId, java.lang.String password, boolean passwordEncrypted,
\r
2741 boolean passwordReset, java.util.Date passwordModifiedDate)
\r
2742 throws com.liferay.portal.kernel.exception.PortalException,
\r
2743 com.liferay.portal.kernel.exception.SystemException {
\r
2744 return getService()
\r
2745 .updatePasswordManually(userId, password, passwordEncrypted,
\r
2746 passwordReset, passwordModifiedDate);
\r
2750 * Updates whether the user should be asked to reset their password the next
\r
2751 * time they login.
\r
2753 * @param userId the primary key of the user
\r
2754 * @param passwordReset whether the user should be asked to reset their
\r
2755 password the next time they login
\r
2756 * @return the user
\r
2757 * @throws PortalException if a user with the primary key could not be found
\r
2758 * @throws SystemException if a system exception occurred
\r
2760 public static com.liferay.portal.model.User updatePasswordReset(
\r
2761 long userId, boolean passwordReset)
\r
2762 throws com.liferay.portal.kernel.exception.PortalException,
\r
2763 com.liferay.portal.kernel.exception.SystemException {
\r
2764 return getService().updatePasswordReset(userId, passwordReset);
\r
2768 * Updates the user's portrait image.
\r
2770 * @param userId the primary key of the user
\r
2771 * @param bytes the new portrait image data
\r
2772 * @return the user
\r
2773 * @throws PortalException if a user with the primary key could not be found
\r
2774 or if the new portrait was invalid
\r
2775 * @throws SystemException if a system exception occurred
\r
2777 public static com.liferay.portal.model.User updatePortrait(long userId,
\r
2779 throws com.liferay.portal.kernel.exception.PortalException,
\r
2780 com.liferay.portal.kernel.exception.SystemException {
\r
2781 return getService().updatePortrait(userId, bytes);
\r
2785 * Updates the user's password reset question and answer.
\r
2787 * @param userId the primary key of the user
\r
2788 * @param question the user's new password reset question
\r
2789 * @param answer the user's new password reset answer
\r
2790 * @return the user
\r
2791 * @throws PortalException if a user with the primary key could not be found
\r
2792 or if the new question or answer were invalid
\r
2793 * @throws SystemException if a system exception occurred
\r
2795 public static com.liferay.portal.model.User updateReminderQuery(
\r
2796 long userId, java.lang.String question, java.lang.String answer)
\r
2797 throws com.liferay.portal.kernel.exception.PortalException,
\r
2798 com.liferay.portal.kernel.exception.SystemException {
\r
2799 return getService().updateReminderQuery(userId, question, answer);
\r
2803 * Updates the user's screen name.
\r
2805 * @param userId the primary key of the user
\r
2806 * @param screenName the user's new screen name
\r
2807 * @return the user
\r
2808 * @throws PortalException if a user with the primary key could not be found
\r
2809 or if the new screen name was invalid
\r
2810 * @throws SystemException if a system exception occurred
\r
2812 public static com.liferay.portal.model.User updateScreenName(long userId,
\r
2813 java.lang.String screenName)
\r
2814 throws com.liferay.portal.kernel.exception.PortalException,
\r
2815 com.liferay.portal.kernel.exception.SystemException {
\r
2816 return getService().updateScreenName(userId, screenName);
\r
2820 * Updates the user's workflow status.
\r
2822 * @param userId the primary key of the user
\r
2823 * @param status the user's new workflow status
\r
2824 * @return the user
\r
2825 * @throws PortalException if a user with the primary key could not be found
\r
2826 * @throws SystemException if a system exception occurred
\r
2828 public static com.liferay.portal.model.User updateStatus(long userId,
\r
2830 throws com.liferay.portal.kernel.exception.PortalException,
\r
2831 com.liferay.portal.kernel.exception.SystemException {
\r
2832 return getService().updateStatus(userId, status);
\r
2836 * Updates the user.
\r
2838 * @param userId the primary key of the user
\r
2839 * @param oldPassword the user's old password
\r
2840 * @param newPassword1 the user's new password (optionally
\r
2841 <code>null</code>)
\r
2842 * @param newPassword2 the user's new password confirmation (optionally
\r
2843 <code>null</code>)
\r
2844 * @param passwordReset whether the user should be asked to reset their
\r
2845 password the next time they login
\r
2846 * @param reminderQueryQuestion the user's new password reset question
\r
2847 * @param reminderQueryAnswer the user's new password reset answer
\r
2848 * @param screenName the user's new screen name
\r
2849 * @param emailAddress the user's new email address
\r
2850 * @param facebookId the user's new Facebook ID
\r
2851 * @param openId the user's new OpenID
\r
2852 * @param languageId the user's new language ID
\r
2853 * @param timeZoneId the user's new time zone ID
\r
2854 * @param greeting the user's new greeting
\r
2855 * @param comments the user's new comments
\r
2856 * @param firstName the user's new first name
\r
2857 * @param middleName the user's new middle name
\r
2858 * @param lastName the user's new last name
\r
2859 * @param prefixId the user's new name prefix ID
\r
2860 * @param suffixId the user's new name suffix ID
\r
2861 * @param male whether user is male
\r
2862 * @param birthdayMonth the user's new birthday month (0-based, meaning 0
\r
2864 * @param birthdayDay the user's new birthday day
\r
2865 * @param birthdayYear the user's birthday year
\r
2866 * @param smsSn the user's new SMS screen name
\r
2867 * @param aimSn the user's new AIM screen name
\r
2868 * @param facebookSn the user's new Facebook screen name
\r
2869 * @param icqSn the user's new ICQ screen name
\r
2870 * @param jabberSn the user's new Jabber screen name
\r
2871 * @param msnSn the user's new MSN screen name
\r
2872 * @param mySpaceSn the user's new MySpace screen name
\r
2873 * @param skypeSn the user's new Skype screen name
\r
2874 * @param twitterSn the user's new Twitter screen name
\r
2875 * @param ymSn the user's new Yahoo! Messenger screen name
\r
2876 * @param jobTitle the user's new job title
\r
2877 * @param groupIds the primary keys of the user's groups
\r
2878 * @param organizationIds the primary keys of the user's organizations
\r
2879 * @param roleIds the primary keys of the user's roles
\r
2880 * @param userGroupRoles the user user's group roles
\r
2881 * @param userGroupIds the primary keys of the user's user groups
\r
2882 * @param serviceContext the user's service context (optionally
\r
2883 <code>null</code>). Can set the universally unique identifier
\r
2884 (with the <code>uuid</code> attribute), asset category IDs, asset
\r
2885 tag names, and expando bridge attributes for the user.
\r
2886 * @return the user
\r
2887 * @throws PortalException if a user with the primary key could not be found
\r
2888 or if the new information was invalid
\r
2889 * @throws SystemException if a system exception occurred
\r
2891 public static com.liferay.portal.model.User updateUser(long userId,
\r
2892 java.lang.String oldPassword, java.lang.String newPassword1,
\r
2893 java.lang.String newPassword2, boolean passwordReset,
\r
2894 java.lang.String reminderQueryQuestion,
\r
2895 java.lang.String reminderQueryAnswer, java.lang.String screenName,
\r
2896 java.lang.String emailAddress, long facebookId,
\r
2897 java.lang.String openId, java.lang.String languageId,
\r
2898 java.lang.String timeZoneId, java.lang.String greeting,
\r
2899 java.lang.String comments, java.lang.String firstName,
\r
2900 java.lang.String middleName, java.lang.String lastName, int prefixId,
\r
2901 int suffixId, boolean male, int birthdayMonth, int birthdayDay,
\r
2902 int birthdayYear, java.lang.String smsSn, java.lang.String aimSn,
\r
2903 java.lang.String facebookSn, java.lang.String icqSn,
\r
2904 java.lang.String jabberSn, java.lang.String msnSn,
\r
2905 java.lang.String mySpaceSn, java.lang.String skypeSn,
\r
2906 java.lang.String twitterSn, java.lang.String ymSn,
\r
2907 java.lang.String jobTitle, long[] groupIds, long[] organizationIds,
\r
2909 java.util.List<com.liferay.portal.model.UserGroupRole> userGroupRoles,
\r
2910 long[] userGroupIds,
\r
2911 com.liferay.portal.service.ServiceContext serviceContext)
\r
2912 throws com.liferay.portal.kernel.exception.PortalException,
\r
2913 com.liferay.portal.kernel.exception.SystemException {
\r
2914 return getService()
\r
2915 .updateUser(userId, oldPassword, newPassword1, newPassword2,
\r
2916 passwordReset, reminderQueryQuestion, reminderQueryAnswer,
\r
2917 screenName, emailAddress, facebookId, openId, languageId,
\r
2918 timeZoneId, greeting, comments, firstName, middleName, lastName,
\r
2919 prefixId, suffixId, male, birthdayMonth, birthdayDay, birthdayYear,
\r
2920 smsSn, aimSn, facebookSn, icqSn, jabberSn, msnSn, mySpaceSn,
\r
2921 skypeSn, twitterSn, ymSn, jobTitle, groupIds, organizationIds,
\r
2922 roleIds, userGroupRoles, userGroupIds, serviceContext);
\r
2926 * Verifies the email address of the ticket.
\r
2928 * @param ticketKey the ticket key
\r
2929 * @throws PortalException if a ticket matching the ticket key could not be
\r
2930 found, if the ticket has expired, if the ticket is an email
\r
2931 address ticket, or if the email address is invalid
\r
2932 * @throws SystemException if a system exception occurred
\r
2934 public static void verifyEmailAddress(java.lang.String ticketKey)
\r
2935 throws com.liferay.portal.kernel.exception.PortalException,
\r
2936 com.liferay.portal.kernel.exception.SystemException {
\r
2937 getService().verifyEmailAddress(ticketKey);
\r
2940 public static ExtUserLocalService getService() {
\r
2941 if (_service == null) {
\r
2942 _service = (ExtUserLocalService)PortalBeanLocatorUtil.locate(ExtUserLocalService.class.getName());
\r
2944 ReferenceRegistry.registerReference(ExtUserLocalServiceUtil.class,
\r
2954 public void setService(ExtUserLocalService service) {
\r
2957 private static ExtUserLocalService _service;
\r