1   /**
2    * Copyright (c) 2000-2008 Liferay, Inc. All rights reserved.
3    *
4    * Permission is hereby granted, free of charge, to any person obtaining a copy
5    * of this software and associated documentation files (the "Software"), to deal
6    * in the Software without restriction, including without limitation the rights
7    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8    * copies of the Software, and to permit persons to whom the Software is
9    * furnished to do so, subject to the following conditions:
10   *
11   * The above copyright notice and this permission notice shall be included in
12   * all copies or substantial portions of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
22  
23  package com.liferay.portal.service;
24  
25  
26  /**
27   * <a href="UserLocalServiceUtil.java.html"><b><i>View Source</i></b></a>
28   *
29   * <p>
30   * ServiceBuilder generated this class. Modifications in this class will be
31   * overwritten the next time is generated.
32   * </p>
33   *
34   * <p>
35   * This class provides static methods for the
36   * <code>com.liferay.portal.service.UserLocalService</code>
37   * bean. The static methods of this class calls the same methods of the bean
38   * instance. It's convenient to be able to just write one line to call a method
39   * on a bean instead of writing a lookup call and a method call.
40   * </p>
41   *
42   * <p>
43   * <code>com.liferay.portal.service.UserLocalServiceFactory</code>
44   * is responsible for the lookup of the bean.
45   * </p>
46   *
47   * @author Brian Wing Shun Chan
48   *
49   * @see com.liferay.portal.service.UserLocalService
50   * @see com.liferay.portal.service.UserLocalServiceFactory
51   *
52   */
53  public class UserLocalServiceUtil {
54      public static com.liferay.portal.model.User addUser(
55          com.liferay.portal.model.User user)
56          throws com.liferay.portal.SystemException {
57          UserLocalService userLocalService = UserLocalServiceFactory.getService();
58  
59          return userLocalService.addUser(user);
60      }
61  
62      public static void deleteUser(long userId)
63          throws com.liferay.portal.PortalException,
64              com.liferay.portal.SystemException {
65          UserLocalService userLocalService = UserLocalServiceFactory.getService();
66  
67          userLocalService.deleteUser(userId);
68      }
69  
70      public static void deleteUser(com.liferay.portal.model.User user)
71          throws com.liferay.portal.PortalException,
72              com.liferay.portal.SystemException {
73          UserLocalService userLocalService = UserLocalServiceFactory.getService();
74  
75          userLocalService.deleteUser(user);
76      }
77  
78      public static java.util.List<com.liferay.portal.model.User> dynamicQuery(
79          com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer)
80          throws com.liferay.portal.SystemException {
81          UserLocalService userLocalService = UserLocalServiceFactory.getService();
82  
83          return userLocalService.dynamicQuery(queryInitializer);
84      }
85  
86      public static java.util.List<com.liferay.portal.model.User> dynamicQuery(
87          com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer,
88          int begin, int end) throws com.liferay.portal.SystemException {
89          UserLocalService userLocalService = UserLocalServiceFactory.getService();
90  
91          return userLocalService.dynamicQuery(queryInitializer, begin, end);
92      }
93  
94      public static com.liferay.portal.model.User updateUser(
95          com.liferay.portal.model.User user)
96          throws com.liferay.portal.SystemException {
97          UserLocalService userLocalService = UserLocalServiceFactory.getService();
98  
99          return userLocalService.updateUser(user);
100     }
101 
102     public static void addGroupUsers(long groupId, long[] userIds)
103         throws com.liferay.portal.PortalException,
104             com.liferay.portal.SystemException {
105         UserLocalService userLocalService = UserLocalServiceFactory.getService();
106 
107         userLocalService.addGroupUsers(groupId, userIds);
108     }
109 
110     public static void addOrganizationUsers(long organizationId, long[] userIds)
111         throws com.liferay.portal.PortalException,
112             com.liferay.portal.SystemException {
113         UserLocalService userLocalService = UserLocalServiceFactory.getService();
114 
115         userLocalService.addOrganizationUsers(organizationId, userIds);
116     }
117 
118     public static void addPasswordPolicyUsers(long passwordPolicyId,
119         long[] userIds)
120         throws com.liferay.portal.PortalException,
121             com.liferay.portal.SystemException {
122         UserLocalService userLocalService = UserLocalServiceFactory.getService();
123 
124         userLocalService.addPasswordPolicyUsers(passwordPolicyId, userIds);
125     }
126 
127     public static void addRoleUsers(long roleId, long[] userIds)
128         throws com.liferay.portal.PortalException,
129             com.liferay.portal.SystemException {
130         UserLocalService userLocalService = UserLocalServiceFactory.getService();
131 
132         userLocalService.addRoleUsers(roleId, userIds);
133     }
134 
135     public static void addUserGroupUsers(long userGroupId, long[] userIds)
136         throws com.liferay.portal.PortalException,
137             com.liferay.portal.SystemException {
138         UserLocalService userLocalService = UserLocalServiceFactory.getService();
139 
140         userLocalService.addUserGroupUsers(userGroupId, userIds);
141     }
142 
143     public static com.liferay.portal.model.User addUser(long creatorUserId,
144         long companyId, boolean autoPassword, java.lang.String password1,
145         java.lang.String password2, boolean autoScreenName,
146         java.lang.String screenName, java.lang.String emailAddress,
147         java.util.Locale locale, java.lang.String firstName,
148         java.lang.String middleName, java.lang.String lastName, int prefixId,
149         int suffixId, boolean male, int birthdayMonth, int birthdayDay,
150         int birthdayYear, java.lang.String jobTitle, long[] organizationIds,
151         boolean sendEmail)
152         throws com.liferay.portal.PortalException,
153             com.liferay.portal.SystemException {
154         UserLocalService userLocalService = UserLocalServiceFactory.getService();
155 
156         return userLocalService.addUser(creatorUserId, companyId, autoPassword,
157             password1, password2, autoScreenName, screenName, emailAddress,
158             locale, firstName, middleName, lastName, prefixId, suffixId, male,
159             birthdayMonth, birthdayDay, birthdayYear, jobTitle,
160             organizationIds, sendEmail);
161     }
162 
163     public static int authenticateByEmailAddress(long companyId,
164         java.lang.String emailAddress, java.lang.String password,
165         java.util.Map<String, String[]> headerMap,
166         java.util.Map<String, String[]> parameterMap)
167         throws com.liferay.portal.PortalException,
168             com.liferay.portal.SystemException {
169         UserLocalService userLocalService = UserLocalServiceFactory.getService();
170 
171         return userLocalService.authenticateByEmailAddress(companyId,
172             emailAddress, password, headerMap, parameterMap);
173     }
174 
175     public static int authenticateByScreenName(long companyId,
176         java.lang.String screenName, java.lang.String password,
177         java.util.Map<String, String[]> headerMap,
178         java.util.Map<String, String[]> parameterMap)
179         throws com.liferay.portal.PortalException,
180             com.liferay.portal.SystemException {
181         UserLocalService userLocalService = UserLocalServiceFactory.getService();
182 
183         return userLocalService.authenticateByScreenName(companyId, screenName,
184             password, headerMap, parameterMap);
185     }
186 
187     public static int authenticateByUserId(long companyId, long userId,
188         java.lang.String password, java.util.Map<String, String[]> headerMap,
189         java.util.Map<String, String[]> parameterMap)
190         throws com.liferay.portal.PortalException,
191             com.liferay.portal.SystemException {
192         UserLocalService userLocalService = UserLocalServiceFactory.getService();
193 
194         return userLocalService.authenticateByUserId(companyId, userId,
195             password, headerMap, parameterMap);
196     }
197 
198     public static long authenticateForBasic(long companyId,
199         java.lang.String authType, java.lang.String login,
200         java.lang.String password)
201         throws com.liferay.portal.PortalException,
202             com.liferay.portal.SystemException {
203         UserLocalService userLocalService = UserLocalServiceFactory.getService();
204 
205         return userLocalService.authenticateForBasic(companyId, authType,
206             login, password);
207     }
208 
209     public static boolean authenticateForJAAS(long userId,
210         java.lang.String encPassword)
211         throws com.liferay.portal.PortalException,
212             com.liferay.portal.SystemException {
213         UserLocalService userLocalService = UserLocalServiceFactory.getService();
214 
215         return userLocalService.authenticateForJAAS(userId, encPassword);
216     }
217 
218     public static void checkLockout(com.liferay.portal.model.User user)
219         throws com.liferay.portal.PortalException,
220             com.liferay.portal.SystemException {
221         UserLocalService userLocalService = UserLocalServiceFactory.getService();
222 
223         userLocalService.checkLockout(user);
224     }
225 
226     public static void checkLoginFailure(com.liferay.portal.model.User user)
227         throws com.liferay.portal.PortalException,
228             com.liferay.portal.SystemException {
229         UserLocalService userLocalService = UserLocalServiceFactory.getService();
230 
231         userLocalService.checkLoginFailure(user);
232     }
233 
234     public static void checkLoginFailureByEmailAddress(long companyId,
235         java.lang.String emailAddress)
236         throws com.liferay.portal.PortalException,
237             com.liferay.portal.SystemException {
238         UserLocalService userLocalService = UserLocalServiceFactory.getService();
239 
240         userLocalService.checkLoginFailureByEmailAddress(companyId, emailAddress);
241     }
242 
243     public static void checkLoginFailureById(long userId)
244         throws com.liferay.portal.PortalException,
245             com.liferay.portal.SystemException {
246         UserLocalService userLocalService = UserLocalServiceFactory.getService();
247 
248         userLocalService.checkLoginFailureById(userId);
249     }
250 
251     public static void checkLoginFailureByScreenName(long companyId,
252         java.lang.String screenName)
253         throws com.liferay.portal.PortalException,
254             com.liferay.portal.SystemException {
255         UserLocalService userLocalService = UserLocalServiceFactory.getService();
256 
257         userLocalService.checkLoginFailureByScreenName(companyId, screenName);
258     }
259 
260     public static void checkPasswordExpired(com.liferay.portal.model.User user)
261         throws com.liferay.portal.PortalException,
262             com.liferay.portal.SystemException {
263         UserLocalService userLocalService = UserLocalServiceFactory.getService();
264 
265         userLocalService.checkPasswordExpired(user);
266     }
267 
268     public static void clearOrganizationUsers(long organizationId)
269         throws com.liferay.portal.PortalException,
270             com.liferay.portal.SystemException {
271         UserLocalService userLocalService = UserLocalServiceFactory.getService();
272 
273         userLocalService.clearOrganizationUsers(organizationId);
274     }
275 
276     public static void clearUserGroupUsers(long userGroupId)
277         throws com.liferay.portal.PortalException,
278             com.liferay.portal.SystemException {
279         UserLocalService userLocalService = UserLocalServiceFactory.getService();
280 
281         userLocalService.clearUserGroupUsers(userGroupId);
282     }
283 
284     public static com.liferay.portal.kernel.util.KeyValuePair decryptUserId(
285         long companyId, java.lang.String name, java.lang.String password)
286         throws com.liferay.portal.PortalException,
287             com.liferay.portal.SystemException {
288         UserLocalService userLocalService = UserLocalServiceFactory.getService();
289 
290         return userLocalService.decryptUserId(companyId, name, password);
291     }
292 
293     public static void deletePasswordPolicyUser(long passwordPolicyId,
294         long userId)
295         throws com.liferay.portal.PortalException,
296             com.liferay.portal.SystemException {
297         UserLocalService userLocalService = UserLocalServiceFactory.getService();
298 
299         userLocalService.deletePasswordPolicyUser(passwordPolicyId, userId);
300     }
301 
302     public static void deleteRoleUser(long roleId, long userId)
303         throws com.liferay.portal.PortalException,
304             com.liferay.portal.SystemException {
305         UserLocalService userLocalService = UserLocalServiceFactory.getService();
306 
307         userLocalService.deleteRoleUser(roleId, userId);
308     }
309 
310     public static java.lang.String encryptUserId(java.lang.String name)
311         throws com.liferay.portal.PortalException,
312             com.liferay.portal.SystemException {
313         UserLocalService userLocalService = UserLocalServiceFactory.getService();
314 
315         return userLocalService.encryptUserId(name);
316     }
317 
318     public static com.liferay.portal.model.User getDefaultUser(long companyId)
319         throws com.liferay.portal.PortalException,
320             com.liferay.portal.SystemException {
321         UserLocalService userLocalService = UserLocalServiceFactory.getService();
322 
323         return userLocalService.getDefaultUser(companyId);
324     }
325 
326     public static long getDefaultUserId(long companyId)
327         throws com.liferay.portal.PortalException,
328             com.liferay.portal.SystemException {
329         UserLocalService userLocalService = UserLocalServiceFactory.getService();
330 
331         return userLocalService.getDefaultUserId(companyId);
332     }
333 
334     public static java.util.List<com.liferay.portal.model.User> getGroupUsers(
335         long groupId)
336         throws com.liferay.portal.PortalException,
337             com.liferay.portal.SystemException {
338         UserLocalService userLocalService = UserLocalServiceFactory.getService();
339 
340         return userLocalService.getGroupUsers(groupId);
341     }
342 
343     public static int getGroupUsersCount(long groupId)
344         throws com.liferay.portal.SystemException {
345         UserLocalService userLocalService = UserLocalServiceFactory.getService();
346 
347         return userLocalService.getGroupUsersCount(groupId);
348     }
349 
350     public static int getGroupUsersCount(long groupId, boolean active)
351         throws com.liferay.portal.PortalException,
352             com.liferay.portal.SystemException {
353         UserLocalService userLocalService = UserLocalServiceFactory.getService();
354 
355         return userLocalService.getGroupUsersCount(groupId, active);
356     }
357 
358     public static java.util.List<com.liferay.portal.model.User> getNoAnnouncementsDeliveries(
359         java.lang.String type) throws com.liferay.portal.SystemException {
360         UserLocalService userLocalService = UserLocalServiceFactory.getService();
361 
362         return userLocalService.getNoAnnouncementsDeliveries(type);
363     }
364 
365     public static java.util.List<com.liferay.portal.model.User> getOrganizationUsers(
366         long organizationId)
367         throws com.liferay.portal.PortalException,
368             com.liferay.portal.SystemException {
369         UserLocalService userLocalService = UserLocalServiceFactory.getService();
370 
371         return userLocalService.getOrganizationUsers(organizationId);
372     }
373 
374     public static int getOrganizationUsersCount(long organizationId)
375         throws com.liferay.portal.SystemException {
376         UserLocalService userLocalService = UserLocalServiceFactory.getService();
377 
378         return userLocalService.getOrganizationUsersCount(organizationId);
379     }
380 
381     public static int getOrganizationUsersCount(long organizationId,
382         boolean active)
383         throws com.liferay.portal.PortalException,
384             com.liferay.portal.SystemException {
385         UserLocalService userLocalService = UserLocalServiceFactory.getService();
386 
387         return userLocalService.getOrganizationUsersCount(organizationId, active);
388     }
389 
390     public static java.util.List<com.liferay.portal.model.User> getPermissionUsers(
391         long companyId, long groupId, java.lang.String name,
392         java.lang.String primKey, java.lang.String actionId,
393         java.lang.String firstName, java.lang.String middleName,
394         java.lang.String lastName, java.lang.String emailAddress,
395         boolean andOperator, int begin, int end)
396         throws com.liferay.portal.PortalException,
397             com.liferay.portal.SystemException {
398         UserLocalService userLocalService = UserLocalServiceFactory.getService();
399 
400         return userLocalService.getPermissionUsers(companyId, groupId, name,
401             primKey, actionId, firstName, middleName, lastName, emailAddress,
402             andOperator, begin, end);
403     }
404 
405     public static int getPermissionUsersCount(long companyId, long groupId,
406         java.lang.String name, java.lang.String primKey,
407         java.lang.String actionId, java.lang.String firstName,
408         java.lang.String middleName, java.lang.String lastName,
409         java.lang.String emailAddress, boolean andOperator)
410         throws com.liferay.portal.PortalException,
411             com.liferay.portal.SystemException {
412         UserLocalService userLocalService = UserLocalServiceFactory.getService();
413 
414         return userLocalService.getPermissionUsersCount(companyId, groupId,
415             name, primKey, actionId, firstName, middleName, lastName,
416             emailAddress, andOperator);
417     }
418 
419     public static java.util.List<com.liferay.portal.model.User> getRoleUsers(
420         long roleId)
421         throws com.liferay.portal.PortalException,
422             com.liferay.portal.SystemException {
423         UserLocalService userLocalService = UserLocalServiceFactory.getService();
424 
425         return userLocalService.getRoleUsers(roleId);
426     }
427 
428     public static int getRoleUsersCount(long roleId)
429         throws com.liferay.portal.SystemException {
430         UserLocalService userLocalService = UserLocalServiceFactory.getService();
431 
432         return userLocalService.getRoleUsersCount(roleId);
433     }
434 
435     public static int getRoleUsersCount(long roleId, boolean active)
436         throws com.liferay.portal.PortalException,
437             com.liferay.portal.SystemException {
438         UserLocalService userLocalService = UserLocalServiceFactory.getService();
439 
440         return userLocalService.getRoleUsersCount(roleId, active);
441     }
442 
443     public static java.util.List<com.liferay.portal.model.User> getSocialUsers(
444         long userId, int begin, int end)
445         throws com.liferay.portal.PortalException,
446             com.liferay.portal.SystemException {
447         UserLocalService userLocalService = UserLocalServiceFactory.getService();
448 
449         return userLocalService.getSocialUsers(userId, begin, end);
450     }
451 
452     public static java.util.List<com.liferay.portal.model.User> getSocialUsers(
453         long userId, int type, int begin, int end)
454         throws com.liferay.portal.PortalException,
455             com.liferay.portal.SystemException {
456         UserLocalService userLocalService = UserLocalServiceFactory.getService();
457 
458         return userLocalService.getSocialUsers(userId, type, begin, end);
459     }
460 
461     public static java.util.List<com.liferay.portal.model.User> getSocialUsers(
462         long userId1, long userId2, int type, int begin, int end)
463         throws com.liferay.portal.PortalException,
464             com.liferay.portal.SystemException {
465         UserLocalService userLocalService = UserLocalServiceFactory.getService();
466 
467         return userLocalService.getSocialUsers(userId1, userId2, type, begin,
468             end);
469     }
470 
471     public static int getSocialUsersCount(long userId)
472         throws com.liferay.portal.PortalException,
473             com.liferay.portal.SystemException {
474         UserLocalService userLocalService = UserLocalServiceFactory.getService();
475 
476         return userLocalService.getSocialUsersCount(userId);
477     }
478 
479     public static int getSocialUsersCount(long userId, int type)
480         throws com.liferay.portal.PortalException,
481             com.liferay.portal.SystemException {
482         UserLocalService userLocalService = UserLocalServiceFactory.getService();
483 
484         return userLocalService.getSocialUsersCount(userId, type);
485     }
486 
487     public static int getSocialUsersCount(long userId1, long userId2, int type)
488         throws com.liferay.portal.PortalException,
489             com.liferay.portal.SystemException {
490         UserLocalService userLocalService = UserLocalServiceFactory.getService();
491 
492         return userLocalService.getSocialUsersCount(userId1, userId2, type);
493     }
494 
495     public static java.util.List<com.liferay.portal.model.User> getUserGroupUsers(
496         long userGroupId)
497         throws com.liferay.portal.PortalException,
498             com.liferay.portal.SystemException {
499         UserLocalService userLocalService = UserLocalServiceFactory.getService();
500 
501         return userLocalService.getUserGroupUsers(userGroupId);
502     }
503 
504     public static int getUserGroupUsersCount(long userGroupId)
505         throws com.liferay.portal.SystemException {
506         UserLocalService userLocalService = UserLocalServiceFactory.getService();
507 
508         return userLocalService.getUserGroupUsersCount(userGroupId);
509     }
510 
511     public static int getUserGroupUsersCount(long userGroupId, boolean active)
512         throws com.liferay.portal.PortalException,
513             com.liferay.portal.SystemException {
514         UserLocalService userLocalService = UserLocalServiceFactory.getService();
515 
516         return userLocalService.getUserGroupUsersCount(userGroupId, active);
517     }
518 
519     public static com.liferay.portal.model.User getUserByContactId(
520         long contactId)
521         throws com.liferay.portal.PortalException,
522             com.liferay.portal.SystemException {
523         UserLocalService userLocalService = UserLocalServiceFactory.getService();
524 
525         return userLocalService.getUserByContactId(contactId);
526     }
527 
528     public static com.liferay.portal.model.User getUserByEmailAddress(
529         long companyId, java.lang.String emailAddress)
530         throws com.liferay.portal.PortalException,
531             com.liferay.portal.SystemException {
532         UserLocalService userLocalService = UserLocalServiceFactory.getService();
533 
534         return userLocalService.getUserByEmailAddress(companyId, emailAddress);
535     }
536 
537     public static com.liferay.portal.model.User getUserById(long userId)
538         throws com.liferay.portal.PortalException,
539             com.liferay.portal.SystemException {
540         UserLocalService userLocalService = UserLocalServiceFactory.getService();
541 
542         return userLocalService.getUserById(userId);
543     }
544 
545     public static com.liferay.portal.model.User getUserById(long companyId,
546         long userId)
547         throws com.liferay.portal.PortalException,
548             com.liferay.portal.SystemException {
549         UserLocalService userLocalService = UserLocalServiceFactory.getService();
550 
551         return userLocalService.getUserById(companyId, userId);
552     }
553 
554     public static com.liferay.portal.model.User getUserByPortraitId(
555         long portraitId)
556         throws com.liferay.portal.PortalException,
557             com.liferay.portal.SystemException {
558         UserLocalService userLocalService = UserLocalServiceFactory.getService();
559 
560         return userLocalService.getUserByPortraitId(portraitId);
561     }
562 
563     public static com.liferay.portal.model.User getUserByScreenName(
564         long companyId, java.lang.String screenName)
565         throws com.liferay.portal.PortalException,
566             com.liferay.portal.SystemException {
567         UserLocalService userLocalService = UserLocalServiceFactory.getService();
568 
569         return userLocalService.getUserByScreenName(companyId, screenName);
570     }
571 
572     public static long getUserIdByEmailAddress(long companyId,
573         java.lang.String emailAddress)
574         throws com.liferay.portal.PortalException,
575             com.liferay.portal.SystemException {
576         UserLocalService userLocalService = UserLocalServiceFactory.getService();
577 
578         return userLocalService.getUserIdByEmailAddress(companyId, emailAddress);
579     }
580 
581     public static long getUserIdByScreenName(long companyId,
582         java.lang.String screenName)
583         throws com.liferay.portal.PortalException,
584             com.liferay.portal.SystemException {
585         UserLocalService userLocalService = UserLocalServiceFactory.getService();
586 
587         return userLocalService.getUserIdByScreenName(companyId, screenName);
588     }
589 
590     public static boolean hasGroupUser(long groupId, long userId)
591         throws com.liferay.portal.PortalException,
592             com.liferay.portal.SystemException {
593         UserLocalService userLocalService = UserLocalServiceFactory.getService();
594 
595         return userLocalService.hasGroupUser(groupId, userId);
596     }
597 
598     public static boolean hasOrganizationUser(long organizationId, long userId)
599         throws com.liferay.portal.PortalException,
600             com.liferay.portal.SystemException {
601         UserLocalService userLocalService = UserLocalServiceFactory.getService();
602 
603         return userLocalService.hasOrganizationUser(organizationId, userId);
604     }
605 
606     public static boolean hasPasswordPolicyUser(long passwordPolicyId,
607         long userId)
608         throws com.liferay.portal.PortalException,
609             com.liferay.portal.SystemException {
610         UserLocalService userLocalService = UserLocalServiceFactory.getService();
611 
612         return userLocalService.hasPasswordPolicyUser(passwordPolicyId, userId);
613     }
614 
615     public static boolean hasRoleUser(long roleId, long userId)
616         throws com.liferay.portal.PortalException,
617             com.liferay.portal.SystemException {
618         UserLocalService userLocalService = UserLocalServiceFactory.getService();
619 
620         return userLocalService.hasRoleUser(roleId, userId);
621     }
622 
623     public static boolean hasUserGroupUser(long userGroupId, long userId)
624         throws com.liferay.portal.PortalException,
625             com.liferay.portal.SystemException {
626         UserLocalService userLocalService = UserLocalServiceFactory.getService();
627 
628         return userLocalService.hasUserGroupUser(userGroupId, userId);
629     }
630 
631     public static boolean isPasswordExpired(com.liferay.portal.model.User user)
632         throws com.liferay.portal.PortalException,
633             com.liferay.portal.SystemException {
634         UserLocalService userLocalService = UserLocalServiceFactory.getService();
635 
636         return userLocalService.isPasswordExpired(user);
637     }
638 
639     public static boolean isPasswordExpiringSoon(
640         com.liferay.portal.model.User user)
641         throws com.liferay.portal.PortalException,
642             com.liferay.portal.SystemException {
643         UserLocalService userLocalService = UserLocalServiceFactory.getService();
644 
645         return userLocalService.isPasswordExpiringSoon(user);
646     }
647 
648     public static java.util.List<com.liferay.portal.model.User> search(
649         long companyId, java.lang.String keywords, java.lang.Boolean active,
650         java.util.LinkedHashMap<String, Object> params, int begin, int end,
651         com.liferay.portal.kernel.util.OrderByComparator obc)
652         throws com.liferay.portal.SystemException {
653         UserLocalService userLocalService = UserLocalServiceFactory.getService();
654 
655         return userLocalService.search(companyId, keywords, active, params,
656             begin, end, obc);
657     }
658 
659     public static java.util.List<com.liferay.portal.model.User> search(
660         long companyId, java.lang.String firstName,
661         java.lang.String middleName, java.lang.String lastName,
662         java.lang.String screenName, java.lang.String emailAddress,
663         java.lang.Boolean active,
664         java.util.LinkedHashMap<String, Object> params, boolean andSearch,
665         int begin, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
666         throws com.liferay.portal.SystemException {
667         UserLocalService userLocalService = UserLocalServiceFactory.getService();
668 
669         return userLocalService.search(companyId, firstName, middleName,
670             lastName, screenName, emailAddress, active, params, andSearch,
671             begin, end, obc);
672     }
673 
674     public static int searchCount(long companyId, java.lang.String keywords,
675         java.lang.Boolean active, java.util.LinkedHashMap<String, Object> params)
676         throws com.liferay.portal.SystemException {
677         UserLocalService userLocalService = UserLocalServiceFactory.getService();
678 
679         return userLocalService.searchCount(companyId, keywords, active, params);
680     }
681 
682     public static int searchCount(long companyId, java.lang.String firstName,
683         java.lang.String middleName, java.lang.String lastName,
684         java.lang.String screenName, java.lang.String emailAddress,
685         java.lang.Boolean active,
686         java.util.LinkedHashMap<String, Object> params, boolean andSearch)
687         throws com.liferay.portal.SystemException {
688         UserLocalService userLocalService = UserLocalServiceFactory.getService();
689 
690         return userLocalService.searchCount(companyId, firstName, middleName,
691             lastName, screenName, emailAddress, active, params, andSearch);
692     }
693 
694     public static void sendPassword(long companyId,
695         java.lang.String emailAddress, java.lang.String remoteAddr,
696         java.lang.String remoteHost, java.lang.String userAgent)
697         throws com.liferay.portal.PortalException,
698             com.liferay.portal.SystemException {
699         UserLocalService userLocalService = UserLocalServiceFactory.getService();
700 
701         userLocalService.sendPassword(companyId, emailAddress, remoteAddr,
702             remoteHost, userAgent);
703     }
704 
705     public static void setRoleUsers(long roleId, long[] userIds)
706         throws com.liferay.portal.PortalException,
707             com.liferay.portal.SystemException {
708         UserLocalService userLocalService = UserLocalServiceFactory.getService();
709 
710         userLocalService.setRoleUsers(roleId, userIds);
711     }
712 
713     public static void setUserGroupUsers(long userGroupId, long[] userIds)
714         throws com.liferay.portal.PortalException,
715             com.liferay.portal.SystemException {
716         UserLocalService userLocalService = UserLocalServiceFactory.getService();
717 
718         userLocalService.setUserGroupUsers(userGroupId, userIds);
719     }
720 
721     public static void unsetGroupUsers(long groupId, long[] userIds)
722         throws com.liferay.portal.PortalException,
723             com.liferay.portal.SystemException {
724         UserLocalService userLocalService = UserLocalServiceFactory.getService();
725 
726         userLocalService.unsetGroupUsers(groupId, userIds);
727     }
728 
729     public static void unsetOrganizationUsers(long organizationId,
730         long[] userIds)
731         throws com.liferay.portal.PortalException,
732             com.liferay.portal.SystemException {
733         UserLocalService userLocalService = UserLocalServiceFactory.getService();
734 
735         userLocalService.unsetOrganizationUsers(organizationId, userIds);
736     }
737 
738     public static void unsetPasswordPolicyUsers(long passwordPolicyId,
739         long[] userIds)
740         throws com.liferay.portal.PortalException,
741             com.liferay.portal.SystemException {
742         UserLocalService userLocalService = UserLocalServiceFactory.getService();
743 
744         userLocalService.unsetPasswordPolicyUsers(passwordPolicyId, userIds);
745     }
746 
747     public static void unsetRoleUsers(long roleId, long[] userIds)
748         throws com.liferay.portal.PortalException,
749             com.liferay.portal.SystemException {
750         UserLocalService userLocalService = UserLocalServiceFactory.getService();
751 
752         userLocalService.unsetRoleUsers(roleId, userIds);
753     }
754 
755     public static void unsetUserGroupUsers(long userGroupId, long[] userIds)
756         throws com.liferay.portal.PortalException,
757             com.liferay.portal.SystemException {
758         UserLocalService userLocalService = UserLocalServiceFactory.getService();
759 
760         userLocalService.unsetUserGroupUsers(userGroupId, userIds);
761     }
762 
763     public static com.liferay.portal.model.User updateActive(long userId,
764         boolean active)
765         throws com.liferay.portal.PortalException,
766             com.liferay.portal.SystemException {
767         UserLocalService userLocalService = UserLocalServiceFactory.getService();
768 
769         return userLocalService.updateActive(userId, active);
770     }
771 
772     public static com.liferay.portal.model.User updateAgreedToTermsOfUse(
773         long userId, boolean agreedToTermsOfUse)
774         throws com.liferay.portal.PortalException,
775             com.liferay.portal.SystemException {
776         UserLocalService userLocalService = UserLocalServiceFactory.getService();
777 
778         return userLocalService.updateAgreedToTermsOfUse(userId,
779             agreedToTermsOfUse);
780     }
781 
782     public static com.liferay.portal.model.User updateCreateDate(long userId,
783         java.util.Date createDate)
784         throws com.liferay.portal.PortalException,
785             com.liferay.portal.SystemException {
786         UserLocalService userLocalService = UserLocalServiceFactory.getService();
787 
788         return userLocalService.updateCreateDate(userId, createDate);
789     }
790 
791     public static com.liferay.portal.model.User updateLastLogin(long userId,
792         java.lang.String loginIP)
793         throws com.liferay.portal.PortalException,
794             com.liferay.portal.SystemException {
795         UserLocalService userLocalService = UserLocalServiceFactory.getService();
796 
797         return userLocalService.updateLastLogin(userId, loginIP);
798     }
799 
800     public static com.liferay.portal.model.User updateLockout(
801         com.liferay.portal.model.User user, boolean lockout)
802         throws com.liferay.portal.PortalException,
803             com.liferay.portal.SystemException {
804         UserLocalService userLocalService = UserLocalServiceFactory.getService();
805 
806         return userLocalService.updateLockout(user, lockout);
807     }
808 
809     public static com.liferay.portal.model.User updateLockoutByEmailAddress(
810         long companyId, java.lang.String emailAddress, boolean lockout)
811         throws com.liferay.portal.PortalException,
812             com.liferay.portal.SystemException {
813         UserLocalService userLocalService = UserLocalServiceFactory.getService();
814 
815         return userLocalService.updateLockoutByEmailAddress(companyId,
816             emailAddress, lockout);
817     }
818 
819     public static com.liferay.portal.model.User updateLockoutById(long userId,
820         boolean lockout)
821         throws com.liferay.portal.PortalException,
822             com.liferay.portal.SystemException {
823         UserLocalService userLocalService = UserLocalServiceFactory.getService();
824 
825         return userLocalService.updateLockoutById(userId, lockout);
826     }
827 
828     public static com.liferay.portal.model.User updateLockoutByScreenName(
829         long companyId, java.lang.String screenName, boolean lockout)
830         throws com.liferay.portal.PortalException,
831             com.liferay.portal.SystemException {
832         UserLocalService userLocalService = UserLocalServiceFactory.getService();
833 
834         return userLocalService.updateLockoutByScreenName(companyId,
835             screenName, lockout);
836     }
837 
838     public static com.liferay.portal.model.User updateModifiedDate(
839         long userId, java.util.Date modifiedDate)
840         throws com.liferay.portal.PortalException,
841             com.liferay.portal.SystemException {
842         UserLocalService userLocalService = UserLocalServiceFactory.getService();
843 
844         return userLocalService.updateModifiedDate(userId, modifiedDate);
845     }
846 
847     public static void updateOrganizations(long userId,
848         long[] newOrganizationIds)
849         throws com.liferay.portal.PortalException,
850             com.liferay.portal.SystemException {
851         UserLocalService userLocalService = UserLocalServiceFactory.getService();
852 
853         userLocalService.updateOrganizations(userId, newOrganizationIds);
854     }
855 
856     public static com.liferay.portal.model.User updatePassword(long userId,
857         java.lang.String password1, java.lang.String password2,
858         boolean passwordReset)
859         throws com.liferay.portal.PortalException,
860             com.liferay.portal.SystemException {
861         UserLocalService userLocalService = UserLocalServiceFactory.getService();
862 
863         return userLocalService.updatePassword(userId, password1, password2,
864             passwordReset);
865     }
866 
867     public static com.liferay.portal.model.User updatePassword(long userId,
868         java.lang.String password1, java.lang.String password2,
869         boolean passwordReset, boolean silentUpdate)
870         throws com.liferay.portal.PortalException,
871             com.liferay.portal.SystemException {
872         UserLocalService userLocalService = UserLocalServiceFactory.getService();
873 
874         return userLocalService.updatePassword(userId, password1, password2,
875             passwordReset, silentUpdate);
876     }
877 
878     public static com.liferay.portal.model.User updatePasswordManually(
879         long userId, java.lang.String password, boolean passwordEncrypted,
880         boolean passwordReset, java.util.Date passwordModifiedDate)
881         throws com.liferay.portal.PortalException,
882             com.liferay.portal.SystemException {
883         UserLocalService userLocalService = UserLocalServiceFactory.getService();
884 
885         return userLocalService.updatePasswordManually(userId, password,
886             passwordEncrypted, passwordReset, passwordModifiedDate);
887     }
888 
889     public static void updatePasswordReset(long userId, boolean passwordReset)
890         throws com.liferay.portal.PortalException,
891             com.liferay.portal.SystemException {
892         UserLocalService userLocalService = UserLocalServiceFactory.getService();
893 
894         userLocalService.updatePasswordReset(userId, passwordReset);
895     }
896 
897     public static void updatePortrait(long userId, byte[] bytes)
898         throws com.liferay.portal.PortalException,
899             com.liferay.portal.SystemException {
900         UserLocalService userLocalService = UserLocalServiceFactory.getService();
901 
902         userLocalService.updatePortrait(userId, bytes);
903     }
904 
905     public static void updateScreenName(long userId, java.lang.String screenName)
906         throws com.liferay.portal.PortalException,
907             com.liferay.portal.SystemException {
908         UserLocalService userLocalService = UserLocalServiceFactory.getService();
909 
910         userLocalService.updateScreenName(userId, screenName);
911     }
912 
913     public static com.liferay.portal.model.User updateUser(long userId,
914         java.lang.String oldPassword, boolean passwordReset,
915         java.lang.String screenName, java.lang.String emailAddress,
916         java.lang.String languageId, java.lang.String timeZoneId,
917         java.lang.String greeting, java.lang.String comments,
918         java.lang.String firstName, java.lang.String middleName,
919         java.lang.String lastName, int prefixId, int suffixId, boolean male,
920         int birthdayMonth, int birthdayDay, int birthdayYear,
921         java.lang.String smsSn, java.lang.String aimSn, java.lang.String icqSn,
922         java.lang.String jabberSn, java.lang.String msnSn,
923         java.lang.String skypeSn, java.lang.String ymSn,
924         java.lang.String jobTitle, long[] organizationIds)
925         throws com.liferay.portal.PortalException,
926             com.liferay.portal.SystemException {
927         UserLocalService userLocalService = UserLocalServiceFactory.getService();
928 
929         return userLocalService.updateUser(userId, oldPassword, passwordReset,
930             screenName, emailAddress, languageId, timeZoneId, greeting,
931             comments, firstName, middleName, lastName, prefixId, suffixId,
932             male, birthdayMonth, birthdayDay, birthdayYear, smsSn, aimSn,
933             icqSn, jabberSn, msnSn, skypeSn, ymSn, jobTitle, organizationIds);
934     }
935 
936     public static com.liferay.portal.model.User updateUser(long userId,
937         java.lang.String oldPassword, java.lang.String newPassword1,
938         java.lang.String newPassword2, boolean passwordReset,
939         java.lang.String screenName, java.lang.String emailAddress,
940         java.lang.String languageId, java.lang.String timeZoneId,
941         java.lang.String greeting, java.lang.String comments,
942         java.lang.String firstName, java.lang.String middleName,
943         java.lang.String lastName, int prefixId, int suffixId, boolean male,
944         int birthdayMonth, int birthdayDay, int birthdayYear,
945         java.lang.String smsSn, java.lang.String aimSn, java.lang.String icqSn,
946         java.lang.String jabberSn, java.lang.String msnSn,
947         java.lang.String skypeSn, java.lang.String ymSn,
948         java.lang.String jobTitle, long[] organizationIds)
949         throws com.liferay.portal.PortalException,
950             com.liferay.portal.SystemException {
951         UserLocalService userLocalService = UserLocalServiceFactory.getService();
952 
953         return userLocalService.updateUser(userId, oldPassword, newPassword1,
954             newPassword2, passwordReset, screenName, emailAddress, languageId,
955             timeZoneId, greeting, comments, firstName, middleName, lastName,
956             prefixId, suffixId, male, birthdayMonth, birthdayDay, birthdayYear,
957             smsSn, aimSn, icqSn, jabberSn, msnSn, skypeSn, ymSn, jobTitle,
958             organizationIds);
959     }
960 }