001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.service;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
020    import com.liferay.portal.kernel.util.ReferenceRegistry;
021    
022    /**
023     * Provides the remote service utility for User. This utility wraps
024     * {@link com.liferay.portal.service.impl.UserServiceImpl} and is the
025     * primary access point for service operations in application layer code running
026     * on a remote server. Methods of this service are expected to have security
027     * checks based on the propagated JAAS credentials because this service can be
028     * accessed remotely.
029     *
030     * @author Brian Wing Shun Chan
031     * @see UserService
032     * @see com.liferay.portal.service.base.UserServiceBaseImpl
033     * @see com.liferay.portal.service.impl.UserServiceImpl
034     * @generated
035     */
036    @ProviderType
037    public class UserServiceUtil {
038            /*
039             * NOTE FOR DEVELOPERS:
040             *
041             * Never modify this class directly. Add custom service methods to {@link com.liferay.portal.service.impl.UserServiceImpl} and rerun ServiceBuilder to regenerate this class.
042             */
043    
044            /**
045            * Returns the Spring bean ID for this bean.
046            *
047            * @return the Spring bean ID for this bean
048            */
049            public static java.lang.String getBeanIdentifier() {
050                    return getService().getBeanIdentifier();
051            }
052    
053            /**
054            * Sets the Spring bean ID for this bean.
055            *
056            * @param beanIdentifier the Spring bean ID for this bean
057            */
058            public static void setBeanIdentifier(java.lang.String beanIdentifier) {
059                    getService().setBeanIdentifier(beanIdentifier);
060            }
061    
062            /**
063            * Adds the users to the group.
064            *
065            * @param groupId the primary key of the group
066            * @param userIds the primary keys of the users
067            * @param serviceContext the service context to be applied (optionally
068            <code>null</code>)
069            * @throws PortalException if a group or user with the primary key could not
070            be found, if the user did not have permission to assign group
071            members, or if the operation was not allowed by the membership
072            policy
073            * @throws SystemException if a system exception occurred
074            */
075            public static void addGroupUsers(long groupId, long[] userIds,
076                    com.liferay.portal.service.ServiceContext serviceContext)
077                    throws com.liferay.portal.kernel.exception.PortalException,
078                            com.liferay.portal.kernel.exception.SystemException {
079                    getService().addGroupUsers(groupId, userIds, serviceContext);
080            }
081    
082            /**
083            * Adds the users to the organization.
084            *
085            * @param organizationId the primary key of the organization
086            * @param userIds the primary keys of the users
087            * @throws PortalException if an organization or user with the primary key
088            could not be found, if the user did not have permission to assign
089            organization members, if current user did not have an
090            organization in common with a given user, or if the operation was
091            not allowed by the membership policy
092            * @throws SystemException if a system exception occurred
093            */
094            public static void addOrganizationUsers(long organizationId, long[] userIds)
095                    throws com.liferay.portal.kernel.exception.PortalException,
096                            com.liferay.portal.kernel.exception.SystemException {
097                    getService().addOrganizationUsers(organizationId, userIds);
098            }
099    
100            /**
101            * Assigns the password policy to the users, removing any other currently
102            * assigned password policies.
103            *
104            * @param passwordPolicyId the primary key of the password policy
105            * @param userIds the primary keys of the users
106            * @throws PortalException if the user did not have permission to assign
107            policy members
108            * @throws SystemException if a system exception occurred
109            */
110            public static void addPasswordPolicyUsers(long passwordPolicyId,
111                    long[] userIds)
112                    throws com.liferay.portal.kernel.exception.PortalException,
113                            com.liferay.portal.kernel.exception.SystemException {
114                    getService().addPasswordPolicyUsers(passwordPolicyId, userIds);
115            }
116    
117            /**
118            * Adds the users to the role.
119            *
120            * @param roleId the primary key of the role
121            * @param userIds the primary keys of the users
122            * @throws PortalException if a role or user with the primary key could not
123            be found, if the user did not have permission to assign role
124            members, or if the operation was not allowed by the membership
125            policy
126            * @throws SystemException if a system exception occurred
127            */
128            public static void addRoleUsers(long roleId, long[] userIds)
129                    throws com.liferay.portal.kernel.exception.PortalException,
130                            com.liferay.portal.kernel.exception.SystemException {
131                    getService().addRoleUsers(roleId, userIds);
132            }
133    
134            /**
135            * Adds the users to the team.
136            *
137            * @param teamId the primary key of the team
138            * @param userIds the primary keys of the users
139            * @throws PortalException if a team or user with the primary key could not
140            be found or if the user did not have permission to assign team
141            members
142            * @throws SystemException if a system exception occurred
143            */
144            public static void addTeamUsers(long teamId, long[] userIds)
145                    throws com.liferay.portal.kernel.exception.PortalException,
146                            com.liferay.portal.kernel.exception.SystemException {
147                    getService().addTeamUsers(teamId, userIds);
148            }
149    
150            /**
151            * Adds a user.
152            *
153            * <p>
154            * This method handles the creation and bookkeeping of the user including
155            * its resources, metadata, and internal data structures. It is not
156            * necessary to make subsequent calls to any methods to setup default
157            * groups, resources, etc.
158            * </p>
159            *
160            * @param companyId the primary key of the user's company
161            * @param autoPassword whether a password should be automatically generated
162            for the user
163            * @param password1 the user's password
164            * @param password2 the user's password confirmation
165            * @param autoScreenName whether a screen name should be automatically
166            generated for the user
167            * @param screenName the user's screen name
168            * @param emailAddress the user's email address
169            * @param facebookId the user's facebook ID
170            * @param openId the user's OpenID
171            * @param locale the user's locale
172            * @param firstName the user's first name
173            * @param middleName the user's middle name
174            * @param lastName the user's last name
175            * @param prefixId the user's name prefix ID
176            * @param suffixId the user's name suffix ID
177            * @param male whether the user is male
178            * @param birthdayMonth the user's birthday month (0-based, meaning 0 for
179            January)
180            * @param birthdayDay the user's birthday day
181            * @param birthdayYear the user's birthday year
182            * @param jobTitle the user's job title
183            * @param groupIds the primary keys of the user's groups
184            * @param organizationIds the primary keys of the user's organizations
185            * @param roleIds the primary keys of the roles this user possesses
186            * @param userGroupIds the primary keys of the user's user groups
187            * @param sendEmail whether to send the user an email notification about
188            their new account
189            * @param serviceContext the service context to be applied (optionally
190            <code>null</code>). Can set the UUID (with the <code>uuid</code>
191            attribute), asset category IDs, asset tag names, and expando
192            bridge attributes for the user.
193            * @return the new user
194            * @throws PortalException if the user's information was invalid, if the
195            operation was not allowed by the membership policy, if the
196            creator did not have permission to add users, or if the email
197            address was reserved
198            * @throws SystemException if a system exception occurred
199            */
200            public static com.liferay.portal.model.User addUser(long companyId,
201                    boolean autoPassword, java.lang.String password1,
202                    java.lang.String password2, boolean autoScreenName,
203                    java.lang.String screenName, java.lang.String emailAddress,
204                    long facebookId, java.lang.String openId, java.util.Locale locale,
205                    java.lang.String firstName, java.lang.String middleName,
206                    java.lang.String lastName, int prefixId, int suffixId, boolean male,
207                    int birthdayMonth, int birthdayDay, int birthdayYear,
208                    java.lang.String jobTitle, long[] groupIds, long[] organizationIds,
209                    long[] roleIds, long[] userGroupIds, boolean sendEmail,
210                    com.liferay.portal.service.ServiceContext serviceContext)
211                    throws com.liferay.portal.kernel.exception.PortalException,
212                            com.liferay.portal.kernel.exception.SystemException {
213                    return getService()
214                                       .addUser(companyId, autoPassword, password1, password2,
215                            autoScreenName, screenName, emailAddress, facebookId, openId,
216                            locale, firstName, middleName, lastName, prefixId, suffixId, male,
217                            birthdayMonth, birthdayDay, birthdayYear, jobTitle, groupIds,
218                            organizationIds, roleIds, userGroupIds, sendEmail, serviceContext);
219            }
220    
221            /**
222            * Adds a user with additional parameters.
223            *
224            * <p>
225            * This method handles the creation and bookkeeping of the user including
226            * its resources, metadata, and internal data structures. It is not
227            * necessary to make subsequent calls to any methods to setup default
228            * groups, resources, etc.
229            * </p>
230            *
231            * @param companyId the primary key of the user's company
232            * @param autoPassword whether a password should be automatically generated
233            for the user
234            * @param password1 the user's password
235            * @param password2 the user's password confirmation
236            * @param autoScreenName whether a screen name should be automatically
237            generated for the user
238            * @param screenName the user's screen name
239            * @param emailAddress the user's email address
240            * @param facebookId the user's facebook ID
241            * @param openId the user's OpenID
242            * @param locale the user's locale
243            * @param firstName the user's first name
244            * @param middleName the user's middle name
245            * @param lastName the user's last name
246            * @param prefixId the user's name prefix ID
247            * @param suffixId the user's name suffix ID
248            * @param male whether the user is male
249            * @param birthdayMonth the user's birthday month (0-based, meaning 0 for
250            January)
251            * @param birthdayDay the user's birthday day
252            * @param birthdayYear the user's birthday year
253            * @param jobTitle the user's job title
254            * @param groupIds the primary keys of the user's groups
255            * @param organizationIds the primary keys of the user's organizations
256            * @param roleIds the primary keys of the roles this user possesses
257            * @param userGroupIds the primary keys of the user's user groups
258            * @param addresses the user's addresses
259            * @param emailAddresses the user's email addresses
260            * @param phones the user's phone numbers
261            * @param websites the user's websites
262            * @param announcementsDelivers the announcements deliveries
263            * @param sendEmail whether to send the user an email notification about
264            their new account
265            * @param serviceContext the service context to be applied (optionally
266            <code>null</code>). Can set the UUID (with the <code>uuid</code>
267            attribute), asset category IDs, asset tag names, and expando
268            bridge attributes for the user.
269            * @return the new user
270            * @throws PortalException if the user's information was invalid, if the
271            creator did not have permission to add users, if the email
272            address was reserved, if the operation was not allowed by the
273            membership policy, or if some other portal exception occurred
274            * @throws SystemException if a system exception occurred
275            */
276            public static com.liferay.portal.model.User addUser(long companyId,
277                    boolean autoPassword, java.lang.String password1,
278                    java.lang.String password2, boolean autoScreenName,
279                    java.lang.String screenName, java.lang.String emailAddress,
280                    long facebookId, java.lang.String openId, java.util.Locale locale,
281                    java.lang.String firstName, java.lang.String middleName,
282                    java.lang.String lastName, int prefixId, int suffixId, boolean male,
283                    int birthdayMonth, int birthdayDay, int birthdayYear,
284                    java.lang.String jobTitle, long[] groupIds, long[] organizationIds,
285                    long[] roleIds, long[] userGroupIds,
286                    java.util.List<com.liferay.portal.model.Address> addresses,
287                    java.util.List<com.liferay.portal.model.EmailAddress> emailAddresses,
288                    java.util.List<com.liferay.portal.model.Phone> phones,
289                    java.util.List<com.liferay.portal.model.Website> websites,
290                    java.util.List<com.liferay.portlet.announcements.model.AnnouncementsDelivery> announcementsDelivers,
291                    boolean sendEmail,
292                    com.liferay.portal.service.ServiceContext serviceContext)
293                    throws com.liferay.portal.kernel.exception.PortalException,
294                            com.liferay.portal.kernel.exception.SystemException {
295                    return getService()
296                                       .addUser(companyId, autoPassword, password1, password2,
297                            autoScreenName, screenName, emailAddress, facebookId, openId,
298                            locale, firstName, middleName, lastName, prefixId, suffixId, male,
299                            birthdayMonth, birthdayDay, birthdayYear, jobTitle, groupIds,
300                            organizationIds, roleIds, userGroupIds, addresses, emailAddresses,
301                            phones, websites, announcementsDelivers, sendEmail, serviceContext);
302            }
303    
304            /**
305            * Adds the users to the user group.
306            *
307            * @param userGroupId the primary key of the user group
308            * @param userIds the primary keys of the users
309            * @throws PortalException if a user group or user with the primary could
310            could not be found, if the current user did not have permission
311            to assign group members, or if the operation was not allowed by
312            the membership policy
313            * @throws SystemException if a system exception occurred
314            */
315            public static void addUserGroupUsers(long userGroupId, long[] userIds)
316                    throws com.liferay.portal.kernel.exception.PortalException,
317                            com.liferay.portal.kernel.exception.SystemException {
318                    getService().addUserGroupUsers(userGroupId, userIds);
319            }
320    
321            /**
322            * Adds a user with workflow.
323            *
324            * <p>
325            * This method handles the creation and bookkeeping of the user including
326            * its resources, metadata, and internal data structures. It is not
327            * necessary to make subsequent calls to any methods to setup default
328            * groups, resources, etc.
329            * </p>
330            *
331            * @param companyId the primary key of the user's company
332            * @param autoPassword whether a password should be automatically generated
333            for the user
334            * @param password1 the user's password
335            * @param password2 the user's password confirmation
336            * @param autoScreenName whether a screen name should be automatically
337            generated for the user
338            * @param screenName the user's screen name
339            * @param emailAddress the user's email address
340            * @param facebookId the user's facebook ID
341            * @param openId the user's OpenID
342            * @param locale the user's locale
343            * @param firstName the user's first name
344            * @param middleName the user's middle name
345            * @param lastName the user's last name
346            * @param prefixId the user's name prefix ID
347            * @param suffixId the user's name suffix ID
348            * @param male whether the user is male
349            * @param birthdayMonth the user's birthday month (0-based, meaning 0 for
350            January)
351            * @param birthdayDay the user's birthday day
352            * @param birthdayYear the user's birthday year
353            * @param jobTitle the user's job title
354            * @param groupIds the primary keys of the user's groups
355            * @param organizationIds the primary keys of the user's organizations
356            * @param roleIds the primary keys of the roles this user possesses
357            * @param userGroupIds the primary keys of the user's user groups
358            * @param sendEmail whether to send the user an email notification about
359            their new account
360            * @param serviceContext the service context to be applied (optionally
361            <code>null</code>). Can set the UUID (with the <code>uuid</code>
362            attribute), asset category IDs, asset tag names, and expando
363            bridge attributes for the user.
364            * @return the new user
365            * @throws PortalException if the user's information was invalid, if the
366            operation was not allowed by the membership policy, if the
367            creator did not have permission to add users, or if the email
368            address was reserved
369            * @throws SystemException if a system exception occurred
370            */
371            public static com.liferay.portal.model.User addUserWithWorkflow(
372                    long companyId, boolean autoPassword, java.lang.String password1,
373                    java.lang.String password2, boolean autoScreenName,
374                    java.lang.String screenName, java.lang.String emailAddress,
375                    long facebookId, java.lang.String openId, java.util.Locale locale,
376                    java.lang.String firstName, java.lang.String middleName,
377                    java.lang.String lastName, int prefixId, int suffixId, boolean male,
378                    int birthdayMonth, int birthdayDay, int birthdayYear,
379                    java.lang.String jobTitle, long[] groupIds, long[] organizationIds,
380                    long[] roleIds, long[] userGroupIds, boolean sendEmail,
381                    com.liferay.portal.service.ServiceContext serviceContext)
382                    throws com.liferay.portal.kernel.exception.PortalException,
383                            com.liferay.portal.kernel.exception.SystemException {
384                    return getService()
385                                       .addUserWithWorkflow(companyId, autoPassword, password1,
386                            password2, autoScreenName, screenName, emailAddress, facebookId,
387                            openId, locale, firstName, middleName, lastName, prefixId,
388                            suffixId, male, birthdayMonth, birthdayDay, birthdayYear, jobTitle,
389                            groupIds, organizationIds, roleIds, userGroupIds, sendEmail,
390                            serviceContext);
391            }
392    
393            /**
394            * Adds a user with workflow and additional parameters.
395            *
396            * <p>
397            * This method handles the creation and bookkeeping of the user including
398            * its resources, metadata, and internal data structures. It is not
399            * necessary to make subsequent calls to any methods to setup default
400            * groups, resources, etc.
401            * </p>
402            *
403            * @param companyId the primary key of the user's company
404            * @param autoPassword whether a password should be automatically generated
405            for the user
406            * @param password1 the user's password
407            * @param password2 the user's password confirmation
408            * @param autoScreenName whether a screen name should be automatically
409            generated for the user
410            * @param screenName the user's screen name
411            * @param emailAddress the user's email address
412            * @param facebookId the user's facebook ID
413            * @param openId the user's OpenID
414            * @param locale the user's locale
415            * @param firstName the user's first name
416            * @param middleName the user's middle name
417            * @param lastName the user's last name
418            * @param prefixId the user's name prefix ID
419            * @param suffixId the user's name suffix ID
420            * @param male whether the user is male
421            * @param birthdayMonth the user's birthday month (0-based, meaning 0 for
422            January)
423            * @param birthdayDay the user's birthday day
424            * @param birthdayYear the user's birthday year
425            * @param jobTitle the user's job title
426            * @param groupIds the primary keys of the user's groups
427            * @param organizationIds the primary keys of the user's organizations
428            * @param roleIds the primary keys of the roles this user possesses
429            * @param userGroupIds the primary keys of the user's user groups
430            * @param addresses the user's addresses
431            * @param emailAddresses the user's email addresses
432            * @param phones the user's phone numbers
433            * @param websites the user's websites
434            * @param announcementsDelivers the announcements deliveries
435            * @param sendEmail whether to send the user an email notification about
436            their new account
437            * @param serviceContext the service context to be applied (optionally
438            <code>null</code>). Can set the UUID (with the <code>uuid</code>
439            attribute), asset category IDs, asset tag names, and expando
440            bridge attributes for the user.
441            * @return the new user
442            * @throws PortalException if the user's information was invalid, if the
443            operation was not allowed by the membership policy, if the
444            creator did not have permission to add users, if the email
445            address was reserved, or if some other portal exception occurred
446            * @throws SystemException if a system exception occurred
447            */
448            public static com.liferay.portal.model.User addUserWithWorkflow(
449                    long companyId, boolean autoPassword, java.lang.String password1,
450                    java.lang.String password2, boolean autoScreenName,
451                    java.lang.String screenName, java.lang.String emailAddress,
452                    long facebookId, java.lang.String openId, java.util.Locale locale,
453                    java.lang.String firstName, java.lang.String middleName,
454                    java.lang.String lastName, int prefixId, int suffixId, boolean male,
455                    int birthdayMonth, int birthdayDay, int birthdayYear,
456                    java.lang.String jobTitle, long[] groupIds, long[] organizationIds,
457                    long[] roleIds, long[] userGroupIds,
458                    java.util.List<com.liferay.portal.model.Address> addresses,
459                    java.util.List<com.liferay.portal.model.EmailAddress> emailAddresses,
460                    java.util.List<com.liferay.portal.model.Phone> phones,
461                    java.util.List<com.liferay.portal.model.Website> websites,
462                    java.util.List<com.liferay.portlet.announcements.model.AnnouncementsDelivery> announcementsDelivers,
463                    boolean sendEmail,
464                    com.liferay.portal.service.ServiceContext serviceContext)
465                    throws com.liferay.portal.kernel.exception.PortalException,
466                            com.liferay.portal.kernel.exception.SystemException {
467                    return getService()
468                                       .addUserWithWorkflow(companyId, autoPassword, password1,
469                            password2, autoScreenName, screenName, emailAddress, facebookId,
470                            openId, locale, firstName, middleName, lastName, prefixId,
471                            suffixId, male, birthdayMonth, birthdayDay, birthdayYear, jobTitle,
472                            groupIds, organizationIds, roleIds, userGroupIds, addresses,
473                            emailAddresses, phones, websites, announcementsDelivers, sendEmail,
474                            serviceContext);
475            }
476    
477            /**
478            * Deletes the user's portrait image.
479            *
480            * @param userId the primary key of the user
481            * @throws PortalException if a user with the primary key could not be
482            found, if the user's portrait could not be found, or if the
483            current user did not have permission to update the user
484            * @throws SystemException if a system exception occurred
485            */
486            public static void deletePortrait(long userId)
487                    throws com.liferay.portal.kernel.exception.PortalException,
488                            com.liferay.portal.kernel.exception.SystemException {
489                    getService().deletePortrait(userId);
490            }
491    
492            /**
493            * Removes the user from the role.
494            *
495            * @param roleId the primary key of the role
496            * @param userId the primary key of the user
497            * @throws PortalException if a role or user with the primary key could not
498            be found, or if the current user did not have permission to
499            assign role members
500            * @throws SystemException if a system exception occurred
501            */
502            public static void deleteRoleUser(long roleId, long userId)
503                    throws com.liferay.portal.kernel.exception.PortalException,
504                            com.liferay.portal.kernel.exception.SystemException {
505                    getService().deleteRoleUser(roleId, userId);
506            }
507    
508            /**
509            * Deletes the user.
510            *
511            * @param userId the primary key of the user
512            * @throws PortalException if a user with the primary key could not be found
513            or if the current user did not have permission to delete the user
514            * @throws SystemException if a system exception occurred
515            */
516            public static void deleteUser(long userId)
517                    throws com.liferay.portal.kernel.exception.PortalException,
518                            com.liferay.portal.kernel.exception.SystemException {
519                    getService().deleteUser(userId);
520            }
521    
522            public static java.util.List<com.liferay.portal.model.User> getCompanyUsers(
523                    long companyId, int start, int end)
524                    throws com.liferay.portal.kernel.exception.PortalException,
525                            com.liferay.portal.kernel.exception.SystemException {
526                    return getService().getCompanyUsers(companyId, start, end);
527            }
528    
529            public static int getCompanyUsersCount(long companyId)
530                    throws com.liferay.portal.kernel.exception.PortalException,
531                            com.liferay.portal.kernel.exception.SystemException {
532                    return getService().getCompanyUsersCount(companyId);
533            }
534    
535            /**
536            * Returns the primary keys of all the users belonging to the group.
537            *
538            * @param groupId the primary key of the group
539            * @return the primary keys of the users belonging to the group
540            * @throws PortalException if the current user did not have permission to
541            view group assignments
542            * @throws SystemException if a system exception occurred
543            */
544            public static long[] getGroupUserIds(long groupId)
545                    throws com.liferay.portal.kernel.exception.PortalException,
546                            com.liferay.portal.kernel.exception.SystemException {
547                    return getService().getGroupUserIds(groupId);
548            }
549    
550            /**
551            * Returns all the users belonging to the group.
552            *
553            * @param groupId the primary key of the group
554            * @return the users belonging to the group
555            * @throws PortalException if the current user did not have permission to
556            view group assignments
557            * @throws SystemException if a system exception occurred
558            */
559            public static java.util.List<com.liferay.portal.model.User> getGroupUsers(
560                    long groupId)
561                    throws com.liferay.portal.kernel.exception.PortalException,
562                            com.liferay.portal.kernel.exception.SystemException {
563                    return getService().getGroupUsers(groupId);
564            }
565    
566            /**
567            * Returns the primary keys of all the users belonging to the organization.
568            *
569            * @param organizationId the primary key of the organization
570            * @return the primary keys of the users belonging to the organization
571            * @throws PortalException if the current user did not have permission to
572            view organization assignments
573            * @throws SystemException if a system exception occurred
574            */
575            public static long[] getOrganizationUserIds(long organizationId)
576                    throws com.liferay.portal.kernel.exception.PortalException,
577                            com.liferay.portal.kernel.exception.SystemException {
578                    return getService().getOrganizationUserIds(organizationId);
579            }
580    
581            /**
582            * Returns all the users belonging to the organization.
583            *
584            * @param organizationId the primary key of the organization
585            * @return users belonging to the organization
586            * @throws PortalException if the current user did not have permission to
587            view organization assignments
588            * @throws SystemException if a system exception occurred
589            */
590            public static java.util.List<com.liferay.portal.model.User> getOrganizationUsers(
591                    long organizationId)
592                    throws com.liferay.portal.kernel.exception.PortalException,
593                            com.liferay.portal.kernel.exception.SystemException {
594                    return getService().getOrganizationUsers(organizationId);
595            }
596    
597            /**
598            * Returns the primary keys of all the users belonging to the role.
599            *
600            * @param roleId the primary key of the role
601            * @return the primary keys of the users belonging to the role
602            * @throws PortalException if the current user did not have permission to
603            view role members
604            * @throws SystemException if a system exception occurred
605            */
606            public static long[] getRoleUserIds(long roleId)
607                    throws com.liferay.portal.kernel.exception.PortalException,
608                            com.liferay.portal.kernel.exception.SystemException {
609                    return getService().getRoleUserIds(roleId);
610            }
611    
612            /**
613            * Returns the user with the email address.
614            *
615            * @param companyId the primary key of the user's company
616            * @param emailAddress the user's email address
617            * @return the user with the email address
618            * @throws PortalException if a user with the email address could not be
619            found or if the current user did not have permission to view the
620            user
621            * @throws SystemException if a system exception occurred
622            */
623            public static com.liferay.portal.model.User getUserByEmailAddress(
624                    long companyId, java.lang.String emailAddress)
625                    throws com.liferay.portal.kernel.exception.PortalException,
626                            com.liferay.portal.kernel.exception.SystemException {
627                    return getService().getUserByEmailAddress(companyId, emailAddress);
628            }
629    
630            /**
631            * Returns the user with the primary key.
632            *
633            * @param userId the primary key of the user
634            * @return the user with the primary key
635            * @throws PortalException if a user with the primary key could not be found
636            or if the current user did not have permission to view the user
637            * @throws SystemException if a system exception occurred
638            */
639            public static com.liferay.portal.model.User getUserById(long userId)
640                    throws com.liferay.portal.kernel.exception.PortalException,
641                            com.liferay.portal.kernel.exception.SystemException {
642                    return getService().getUserById(userId);
643            }
644    
645            /**
646            * Returns the user with the screen name.
647            *
648            * @param companyId the primary key of the user's company
649            * @param screenName the user's screen name
650            * @return the user with the screen name
651            * @throws PortalException if a user with the screen name could not be found
652            or if the current user did not have permission to view the user
653            * @throws SystemException if a system exception occurred
654            */
655            public static com.liferay.portal.model.User getUserByScreenName(
656                    long companyId, java.lang.String screenName)
657                    throws com.liferay.portal.kernel.exception.PortalException,
658                            com.liferay.portal.kernel.exception.SystemException {
659                    return getService().getUserByScreenName(companyId, screenName);
660            }
661    
662            public static java.util.List<com.liferay.portal.model.User> getUserGroupUsers(
663                    long userGroupId)
664                    throws com.liferay.portal.kernel.exception.PortalException,
665                            com.liferay.portal.kernel.exception.SystemException {
666                    return getService().getUserGroupUsers(userGroupId);
667            }
668    
669            /**
670            * Returns the primary key of the user with the email address.
671            *
672            * @param companyId the primary key of the user's company
673            * @param emailAddress the user's email address
674            * @return the primary key of the user with the email address
675            * @throws PortalException if a user with the email address could not be
676            found
677            * @throws SystemException if a system exception occurred
678            */
679            public static long getUserIdByEmailAddress(long companyId,
680                    java.lang.String emailAddress)
681                    throws com.liferay.portal.kernel.exception.PortalException,
682                            com.liferay.portal.kernel.exception.SystemException {
683                    return getService().getUserIdByEmailAddress(companyId, emailAddress);
684            }
685    
686            /**
687            * Returns the primary key of the user with the screen name.
688            *
689            * @param companyId the primary key of the user's company
690            * @param screenName the user's screen name
691            * @return the primary key of the user with the screen name
692            * @throws PortalException if a user with the screen name could not be found
693            * @throws SystemException if a system exception occurred
694            */
695            public static long getUserIdByScreenName(long companyId,
696                    java.lang.String screenName)
697                    throws com.liferay.portal.kernel.exception.PortalException,
698                            com.liferay.portal.kernel.exception.SystemException {
699                    return getService().getUserIdByScreenName(companyId, screenName);
700            }
701    
702            /**
703            * Returns <code>true</code> if the user is a member of the group.
704            *
705            * @param groupId the primary key of the group
706            * @param userId the primary key of the user
707            * @return <code>true</code> if the user is a member of the group;
708            <code>false</code> otherwise
709            * @throws PortalException if the current user did not have permission to
710            view the user or group members
711            * @throws SystemException if a system exception occurred
712            */
713            public static boolean hasGroupUser(long groupId, long userId)
714                    throws com.liferay.portal.kernel.exception.PortalException,
715                            com.liferay.portal.kernel.exception.SystemException {
716                    return getService().hasGroupUser(groupId, userId);
717            }
718    
719            /**
720            * Returns <code>true</code> if the user is a member of the role.
721            *
722            * @param roleId the primary key of the role
723            * @param userId the primary key of the user
724            * @return <code>true</code> if the user is a member of the role;
725            <code>false</code> otherwise
726            * @throws PortalException if the current user did not have permission to
727            view the user or role members
728            * @throws SystemException if a system exception occurred
729            */
730            public static boolean hasRoleUser(long roleId, long userId)
731                    throws com.liferay.portal.kernel.exception.PortalException,
732                            com.liferay.portal.kernel.exception.SystemException {
733                    return getService().hasRoleUser(roleId, userId);
734            }
735    
736            /**
737            * Returns <code>true</code> if the user has the role with the name,
738            * optionally through inheritance.
739            *
740            * @param companyId the primary key of the role's company
741            * @param name the name of the role (must be a regular role, not an
742            organization, site or provider role)
743            * @param userId the primary key of the user
744            * @param inherited whether to include roles inherited from organizations,
745            sites, etc.
746            * @return <code>true</code> if the user has the role; <code>false</code>
747            otherwise
748            * @throws PortalException if a role with the name could not be found
749            * @throws SystemException if a system exception occurred
750            */
751            public static boolean hasRoleUser(long companyId, java.lang.String name,
752                    long userId, boolean inherited)
753                    throws com.liferay.portal.kernel.exception.PortalException,
754                            com.liferay.portal.kernel.exception.SystemException {
755                    return getService().hasRoleUser(companyId, name, userId, inherited);
756            }
757    
758            /**
759            * Sets the users in the role, removing and adding users to the role as
760            * necessary.
761            *
762            * @param roleId the primary key of the role
763            * @param userIds the primary keys of the users
764            * @throws PortalException if the current user did not have permission to
765            assign role members or if the operation was not allowed by the
766            membership policy
767            * @throws SystemException if a system exception occurred
768            */
769            public static void setRoleUsers(long roleId, long[] userIds)
770                    throws com.liferay.portal.kernel.exception.PortalException,
771                            com.liferay.portal.kernel.exception.SystemException {
772                    getService().setRoleUsers(roleId, userIds);
773            }
774    
775            /**
776            * Sets the users in the user group, removing and adding users to the user
777            * group as necessary.
778            *
779            * @param userGroupId the primary key of the user group
780            * @param userIds the primary keys of the users
781            * @throws PortalException if the current user did not have permission to
782            assign group members
783            * @throws SystemException if a system exception occurred
784            */
785            public static void setUserGroupUsers(long userGroupId, long[] userIds)
786                    throws com.liferay.portal.kernel.exception.PortalException,
787                            com.liferay.portal.kernel.exception.SystemException {
788                    getService().setUserGroupUsers(userGroupId, userIds);
789            }
790    
791            /**
792            * Removes the users from the teams of a group.
793            *
794            * @param groupId the primary key of the group
795            * @param userIds the primary keys of the users
796            * @throws PortalException if the current user did not have permission to
797            modify user group assignments
798            * @throws SystemException if a system exception occurred
799            */
800            public static void unsetGroupTeamsUsers(long groupId, long[] userIds)
801                    throws com.liferay.portal.kernel.exception.PortalException,
802                            com.liferay.portal.kernel.exception.SystemException {
803                    getService().unsetGroupTeamsUsers(groupId, userIds);
804            }
805    
806            /**
807            * Removes the users from the group.
808            *
809            * @param groupId the primary key of the group
810            * @param userIds the primary keys of the users
811            * @param serviceContext the service context to be applied (optionally
812            <code>null</code>)
813            * @throws PortalException if the current user did not have permission to
814            modify group assignments or if the operation was not allowed by
815            the membership policy
816            * @throws SystemException if a system exception occurred
817            */
818            public static void unsetGroupUsers(long groupId, long[] userIds,
819                    com.liferay.portal.service.ServiceContext serviceContext)
820                    throws com.liferay.portal.kernel.exception.PortalException,
821                            com.liferay.portal.kernel.exception.SystemException {
822                    getService().unsetGroupUsers(groupId, userIds, serviceContext);
823            }
824    
825            /**
826            * Removes the users from the organization.
827            *
828            * @param organizationId the primary key of the organization
829            * @param userIds the primary keys of the users
830            * @throws PortalException if the current user did not have permission to
831            modify organization assignments or if the operation was not
832            allowed by the membership policy
833            * @throws SystemException if a system exception occurred
834            */
835            public static void unsetOrganizationUsers(long organizationId,
836                    long[] userIds)
837                    throws com.liferay.portal.kernel.exception.PortalException,
838                            com.liferay.portal.kernel.exception.SystemException {
839                    getService().unsetOrganizationUsers(organizationId, userIds);
840            }
841    
842            /**
843            * Removes the users from the password policy.
844            *
845            * @param passwordPolicyId the primary key of the password policy
846            * @param userIds the primary keys of the users
847            * @throws PortalException if the current user did not have permission to
848            modify policy assignments
849            * @throws SystemException if a system exception occurred
850            */
851            public static void unsetPasswordPolicyUsers(long passwordPolicyId,
852                    long[] userIds)
853                    throws com.liferay.portal.kernel.exception.PortalException,
854                            com.liferay.portal.kernel.exception.SystemException {
855                    getService().unsetPasswordPolicyUsers(passwordPolicyId, userIds);
856            }
857    
858            /**
859            * Removes the users from the role.
860            *
861            * @param roleId the primary key of the role
862            * @param userIds the primary keys of the users
863            * @throws PortalException if the current user did not have permission to
864            modify role assignments or if the operation was not allowed by
865            the membership policy
866            * @throws SystemException if a system exception occurred
867            */
868            public static void unsetRoleUsers(long roleId, long[] userIds)
869                    throws com.liferay.portal.kernel.exception.PortalException,
870                            com.liferay.portal.kernel.exception.SystemException {
871                    getService().unsetRoleUsers(roleId, userIds);
872            }
873    
874            /**
875            * Removes the users from the team.
876            *
877            * @param teamId the primary key of the team
878            * @param userIds the primary keys of the users
879            * @throws PortalException if the current user did not have permission to
880            modify team assignments
881            * @throws SystemException if a system exception occurred
882            */
883            public static void unsetTeamUsers(long teamId, long[] userIds)
884                    throws com.liferay.portal.kernel.exception.PortalException,
885                            com.liferay.portal.kernel.exception.SystemException {
886                    getService().unsetTeamUsers(teamId, userIds);
887            }
888    
889            /**
890            * Removes the users from the user group.
891            *
892            * @param userGroupId the primary key of the user group
893            * @param userIds the primary keys of the users
894            * @throws PortalException if the current user did not have permission to
895            modify user group assignments or if the operation was not allowed
896            by the membership policy
897            * @throws SystemException if a system exception occurred
898            */
899            public static void unsetUserGroupUsers(long userGroupId, long[] userIds)
900                    throws com.liferay.portal.kernel.exception.PortalException,
901                            com.liferay.portal.kernel.exception.SystemException {
902                    getService().unsetUserGroupUsers(userGroupId, userIds);
903            }
904    
905            /**
906            * Updates the user's response to the terms of use agreement.
907            *
908            * @param userId the primary key of the user
909            * @param agreedToTermsOfUse whether the user has agree to the terms of use
910            * @return the user
911            * @throws PortalException if the current user did not have permission to
912            update the user's agreement to terms-of-use
913            * @throws SystemException if a system exception occurred
914            */
915            public static com.liferay.portal.model.User updateAgreedToTermsOfUse(
916                    long userId, boolean agreedToTermsOfUse)
917                    throws com.liferay.portal.kernel.exception.PortalException,
918                            com.liferay.portal.kernel.exception.SystemException {
919                    return getService().updateAgreedToTermsOfUse(userId, agreedToTermsOfUse);
920            }
921    
922            /**
923            * Updates the user's email address.
924            *
925            * @param userId the primary key of the user
926            * @param password the user's password
927            * @param emailAddress1 the user's new email address
928            * @param emailAddress2 the user's new email address confirmation
929            * @param serviceContext the service context to be applied. Must set the
930            portal URL, main path, primary key of the layout, remote address,
931            remote host, and agent for the user.
932            * @return the user
933            * @throws PortalException if a user with the primary key could not be found
934            or if the current user did not have permission to update the user
935            * @throws SystemException if a system exception occurred
936            */
937            public static com.liferay.portal.model.User updateEmailAddress(
938                    long userId, java.lang.String password, java.lang.String emailAddress1,
939                    java.lang.String emailAddress2,
940                    com.liferay.portal.service.ServiceContext serviceContext)
941                    throws com.liferay.portal.kernel.exception.PortalException,
942                            com.liferay.portal.kernel.exception.SystemException {
943                    return getService()
944                                       .updateEmailAddress(userId, password, emailAddress1,
945                            emailAddress2, serviceContext);
946            }
947    
948            /**
949            * Updates a user account that was automatically created when a guest user
950            * participated in an action (e.g. posting a comment) and only provided his
951            * name and email address.
952            *
953            * @param companyId the primary key of the user's company
954            * @param autoPassword whether a password should be automatically generated
955            for the user
956            * @param password1 the user's password
957            * @param password2 the user's password confirmation
958            * @param autoScreenName whether a screen name should be automatically
959            generated for the user
960            * @param screenName the user's screen name
961            * @param emailAddress the user's email address
962            * @param facebookId the user's facebook ID
963            * @param openId the user's OpenID
964            * @param locale the user's locale
965            * @param firstName the user's first name
966            * @param middleName the user's middle name
967            * @param lastName the user's last name
968            * @param prefixId the user's name prefix ID
969            * @param suffixId the user's name suffix ID
970            * @param male whether the user is male
971            * @param birthdayMonth the user's birthday month (0-based, meaning 0 for
972            January)
973            * @param birthdayDay the user's birthday day
974            * @param birthdayYear the user's birthday year
975            * @param jobTitle the user's job title
976            * @param updateUserInformation whether to update the user's information
977            * @param sendEmail whether to send the user an email notification about
978            their new account
979            * @param serviceContext the service context to be applied (optionally
980            <code>null</code>). Can set the expando bridge attributes for the
981            user.
982            * @return the user
983            * @throws PortalException if the user's information was invalid or if the
984            email address was reserved
985            * @throws SystemException if a system exception occurred
986            */
987            public static com.liferay.portal.model.User updateIncompleteUser(
988                    long companyId, boolean autoPassword, java.lang.String password1,
989                    java.lang.String password2, boolean autoScreenName,
990                    java.lang.String screenName, java.lang.String emailAddress,
991                    long facebookId, java.lang.String openId, java.util.Locale locale,
992                    java.lang.String firstName, java.lang.String middleName,
993                    java.lang.String lastName, int prefixId, int suffixId, boolean male,
994                    int birthdayMonth, int birthdayDay, int birthdayYear,
995                    java.lang.String jobTitle, boolean updateUserInformation,
996                    boolean sendEmail,
997                    com.liferay.portal.service.ServiceContext serviceContext)
998                    throws com.liferay.portal.kernel.exception.PortalException,
999                            com.liferay.portal.kernel.exception.SystemException {
1000                    return getService()
1001                                       .updateIncompleteUser(companyId, autoPassword, password1,
1002                            password2, autoScreenName, screenName, emailAddress, facebookId,
1003                            openId, locale, firstName, middleName, lastName, prefixId,
1004                            suffixId, male, birthdayMonth, birthdayDay, birthdayYear, jobTitle,
1005                            updateUserInformation, sendEmail, serviceContext);
1006            }
1007    
1008            /**
1009            * Updates whether the user is locked out from logging in.
1010            *
1011            * @param userId the primary key of the user
1012            * @param lockout whether the user is locked out
1013            * @return the user
1014            * @throws PortalException if the user did not have permission to lock out
1015            the user
1016            * @throws SystemException if a system exception occurred
1017            */
1018            public static com.liferay.portal.model.User updateLockoutById(long userId,
1019                    boolean lockout)
1020                    throws com.liferay.portal.kernel.exception.PortalException,
1021                            com.liferay.portal.kernel.exception.SystemException {
1022                    return getService().updateLockoutById(userId, lockout);
1023            }
1024    
1025            /**
1026            * Updates the user's OpenID.
1027            *
1028            * @param userId the primary key of the user
1029            * @param openId the new OpenID
1030            * @return the user
1031            * @throws PortalException if a user with the primary key could not be found
1032            or if the current user did not have permission to update the user
1033            * @throws SystemException if a system exception occurred
1034            */
1035            public static com.liferay.portal.model.User updateOpenId(long userId,
1036                    java.lang.String openId)
1037                    throws com.liferay.portal.kernel.exception.PortalException,
1038                            com.liferay.portal.kernel.exception.SystemException {
1039                    return getService().updateOpenId(userId, openId);
1040            }
1041    
1042            /**
1043            * Sets the organizations that the user is in, removing and adding
1044            * organizations as necessary.
1045            *
1046            * @param userId the primary key of the user
1047            * @param organizationIds the primary keys of the organizations
1048            * @param serviceContext the service context to be applied. Must set
1049            whether user indexing is enabled.
1050            * @throws PortalException if a user with the primary key could not be found
1051            or if the current user did not have permission to update the user
1052            * @throws SystemException if a system exception occurred
1053            */
1054            public static void updateOrganizations(long userId, long[] organizationIds,
1055                    com.liferay.portal.service.ServiceContext serviceContext)
1056                    throws com.liferay.portal.kernel.exception.PortalException,
1057                            com.liferay.portal.kernel.exception.SystemException {
1058                    getService().updateOrganizations(userId, organizationIds, serviceContext);
1059            }
1060    
1061            /**
1062            * Updates the user's password without tracking or validation of the change.
1063            *
1064            * @param userId the primary key of the user
1065            * @param password1 the user's new password
1066            * @param password2 the user's new password confirmation
1067            * @param passwordReset whether the user should be asked to reset their
1068            password the next time they log in
1069            * @return the user
1070            * @throws PortalException if a user with the primary key could not be found
1071            or if the current user did not have permission to update the user
1072            * @throws SystemException if a system exception occurred
1073            */
1074            public static com.liferay.portal.model.User updatePassword(long userId,
1075                    java.lang.String password1, java.lang.String password2,
1076                    boolean passwordReset)
1077                    throws com.liferay.portal.kernel.exception.PortalException,
1078                            com.liferay.portal.kernel.exception.SystemException {
1079                    return getService()
1080                                       .updatePassword(userId, password1, password2, passwordReset);
1081            }
1082    
1083            /**
1084            * Updates the user's portrait image.
1085            *
1086            * @param userId the primary key of the user
1087            * @param bytes the new portrait image data
1088            * @return the user
1089            * @throws PortalException if a user with the primary key could not be
1090            found, if the new portrait was invalid, or if the current user
1091            did not have permission to update the user
1092            * @throws SystemException if a system exception occurred
1093            */
1094            public static com.liferay.portal.model.User updatePortrait(long userId,
1095                    byte[] bytes)
1096                    throws com.liferay.portal.kernel.exception.PortalException,
1097                            com.liferay.portal.kernel.exception.SystemException {
1098                    return getService().updatePortrait(userId, bytes);
1099            }
1100    
1101            /**
1102            * Updates the user's password reset question and answer.
1103            *
1104            * @param userId the primary key of the user
1105            * @param question the user's new password reset question
1106            * @param answer the user's new password reset answer
1107            * @return the user
1108            * @throws PortalException if a user with the primary key could not be
1109            found, if the new question or answer were invalid, or if the
1110            current user did not have permission to update the user
1111            * @throws SystemException if a system exception occurred
1112            */
1113            public static com.liferay.portal.model.User updateReminderQuery(
1114                    long userId, java.lang.String question, java.lang.String answer)
1115                    throws com.liferay.portal.kernel.exception.PortalException,
1116                            com.liferay.portal.kernel.exception.SystemException {
1117                    return getService().updateReminderQuery(userId, question, answer);
1118            }
1119    
1120            /**
1121            * Updates the user's screen name.
1122            *
1123            * @param userId the primary key of the user
1124            * @param screenName the user's new screen name
1125            * @return the user
1126            * @throws PortalException if a user with the primary key could not be
1127            found, if the new screen name was invalid, or if the current user
1128            did not have permission to update the user
1129            * @throws SystemException if a system exception occurred
1130            */
1131            public static com.liferay.portal.model.User updateScreenName(long userId,
1132                    java.lang.String screenName)
1133                    throws com.liferay.portal.kernel.exception.PortalException,
1134                            com.liferay.portal.kernel.exception.SystemException {
1135                    return getService().updateScreenName(userId, screenName);
1136            }
1137    
1138            /**
1139            * Updates the user's workflow status.
1140            *
1141            * @param userId the primary key of the user
1142            * @param status the user's new workflow status
1143            * @return the user
1144            * @throws PortalException if a user with the primary key could not be
1145            found, if the current user was updating her own status to
1146            anything but {@link
1147            com.liferay.portal.kernel.workflow.WorkflowConstants#STATUS_APPROVED},
1148            or if the current user did not have permission to update the
1149            user's workflow status.
1150            * @throws SystemException if a system exception occurred
1151            * @deprecated As of 7.0.0, replaced by {@link #updateStatus(long, int,
1152            ServiceContext)}
1153            */
1154            public static com.liferay.portal.model.User updateStatus(long userId,
1155                    int status)
1156                    throws com.liferay.portal.kernel.exception.PortalException,
1157                            com.liferay.portal.kernel.exception.SystemException {
1158                    return getService().updateStatus(userId, status);
1159            }
1160    
1161            /**
1162            * Updates the user's workflow status.
1163            *
1164            * @param userId the primary key of the user
1165            * @param status the user's new workflow status
1166            * @param serviceContext the service context to be applied. You can specify
1167            an unencrypted custom password (used by an LDAP listener) for the
1168            user via attribute <code>passwordUnencrypted</code>.
1169            * @return the user
1170            * @throws PortalException if a user with the primary key could not be
1171            found, if the current user was updating her own status to
1172            anything but {@link
1173            com.liferay.portal.kernel.workflow.WorkflowConstants#STATUS_APPROVED},
1174            or if the current user did not have permission to update the
1175            user's workflow status.
1176            * @throws SystemException if a system exception occurred
1177            */
1178            public static com.liferay.portal.model.User updateStatus(long userId,
1179                    int status, com.liferay.portal.service.ServiceContext serviceContext)
1180                    throws com.liferay.portal.kernel.exception.PortalException,
1181                            com.liferay.portal.kernel.exception.SystemException {
1182                    return getService().updateStatus(userId, status, serviceContext);
1183            }
1184    
1185            /**
1186            * Updates the user with additional parameters.
1187            *
1188            * @param userId the primary key of the user
1189            * @param oldPassword the user's old password
1190            * @param newPassword1 the user's new password (optionally
1191            <code>null</code>)
1192            * @param newPassword2 the user's new password confirmation (optionally
1193            <code>null</code>)
1194            * @param passwordReset whether the user should be asked to reset their
1195            password the next time they login
1196            * @param reminderQueryQuestion the user's new password reset question
1197            * @param reminderQueryAnswer the user's new password reset answer
1198            * @param screenName the user's new screen name
1199            * @param emailAddress the user's new email address
1200            * @param facebookId the user's new Facebook ID
1201            * @param openId the user's new OpenID
1202            * @param languageId the user's new language ID
1203            * @param timeZoneId the user's new time zone ID
1204            * @param greeting the user's new greeting
1205            * @param comments the user's new comments
1206            * @param firstName the user's new first name
1207            * @param middleName the user's new middle name
1208            * @param lastName the user's new last name
1209            * @param prefixId the user's new name prefix ID
1210            * @param suffixId the user's new name suffix ID
1211            * @param male whether user is male
1212            * @param birthdayMonth the user's new birthday month (0-based, meaning 0
1213            for January)
1214            * @param birthdayDay the user's new birthday day
1215            * @param birthdayYear the user's birthday year
1216            * @param smsSn the user's new SMS screen name
1217            * @param aimSn the user's new AIM screen name
1218            * @param facebookSn the user's new Facebook screen name
1219            * @param icqSn the user's new ICQ screen name
1220            * @param jabberSn the user's new Jabber screen name
1221            * @param msnSn the user's new MSN screen name
1222            * @param mySpaceSn the user's new MySpace screen name
1223            * @param skypeSn the user's new Skype screen name
1224            * @param twitterSn the user's new Twitter screen name
1225            * @param ymSn the user's new Yahoo! Messenger screen name
1226            * @param jobTitle the user's new job title
1227            * @param groupIds the primary keys of the user's groups
1228            * @param organizationIds the primary keys of the user's organizations
1229            * @param roleIds the primary keys of the user's roles
1230            * @param userGroupRoles the user user's group roles
1231            * @param userGroupIds the primary keys of the user's user groups
1232            * @param addresses the user's addresses
1233            * @param emailAddresses the user's email addresses
1234            * @param phones the user's phone numbers
1235            * @param websites the user's websites
1236            * @param announcementsDelivers the announcements deliveries
1237            * @param serviceContext the service context to be applied (optionally
1238            <code>null</code>). Can set the UUID (with the <code>uuid</code>
1239            attribute), asset category IDs, asset tag names, and expando
1240            bridge attributes for the user.
1241            * @return the user
1242            * @throws PortalException if a user with the primary key could not be
1243            found, if the new information was invalid, if the current user
1244            did not have permission to update the user, or if the operation
1245            was not allowed by the membership policy
1246            * @throws SystemException if a system exception occurred
1247            */
1248            public static com.liferay.portal.model.User updateUser(long userId,
1249                    java.lang.String oldPassword, java.lang.String newPassword1,
1250                    java.lang.String newPassword2, boolean passwordReset,
1251                    java.lang.String reminderQueryQuestion,
1252                    java.lang.String reminderQueryAnswer, java.lang.String screenName,
1253                    java.lang.String emailAddress, long facebookId,
1254                    java.lang.String openId, java.lang.String languageId,
1255                    java.lang.String timeZoneId, java.lang.String greeting,
1256                    java.lang.String comments, java.lang.String firstName,
1257                    java.lang.String middleName, java.lang.String lastName, int prefixId,
1258                    int suffixId, boolean male, int birthdayMonth, int birthdayDay,
1259                    int birthdayYear, java.lang.String smsSn, java.lang.String aimSn,
1260                    java.lang.String facebookSn, java.lang.String icqSn,
1261                    java.lang.String jabberSn, java.lang.String msnSn,
1262                    java.lang.String mySpaceSn, java.lang.String skypeSn,
1263                    java.lang.String twitterSn, java.lang.String ymSn,
1264                    java.lang.String jobTitle, long[] groupIds, long[] organizationIds,
1265                    long[] roleIds,
1266                    java.util.List<com.liferay.portal.model.UserGroupRole> userGroupRoles,
1267                    long[] userGroupIds,
1268                    java.util.List<com.liferay.portal.model.Address> addresses,
1269                    java.util.List<com.liferay.portal.model.EmailAddress> emailAddresses,
1270                    java.util.List<com.liferay.portal.model.Phone> phones,
1271                    java.util.List<com.liferay.portal.model.Website> websites,
1272                    java.util.List<com.liferay.portlet.announcements.model.AnnouncementsDelivery> announcementsDelivers,
1273                    com.liferay.portal.service.ServiceContext serviceContext)
1274                    throws com.liferay.portal.kernel.exception.PortalException,
1275                            com.liferay.portal.kernel.exception.SystemException {
1276                    return getService()
1277                                       .updateUser(userId, oldPassword, newPassword1, newPassword2,
1278                            passwordReset, reminderQueryQuestion, reminderQueryAnswer,
1279                            screenName, emailAddress, facebookId, openId, languageId,
1280                            timeZoneId, greeting, comments, firstName, middleName, lastName,
1281                            prefixId, suffixId, male, birthdayMonth, birthdayDay, birthdayYear,
1282                            smsSn, aimSn, facebookSn, icqSn, jabberSn, msnSn, mySpaceSn,
1283                            skypeSn, twitterSn, ymSn, jobTitle, groupIds, organizationIds,
1284                            roleIds, userGroupRoles, userGroupIds, addresses, emailAddresses,
1285                            phones, websites, announcementsDelivers, serviceContext);
1286            }
1287    
1288            /**
1289            * Updates the user.
1290            *
1291            * @param userId the primary key of the user
1292            * @param oldPassword the user's old password
1293            * @param newPassword1 the user's new password (optionally
1294            <code>null</code>)
1295            * @param newPassword2 the user's new password confirmation (optionally
1296            <code>null</code>)
1297            * @param passwordReset whether the user should be asked to reset their
1298            password the next time they login
1299            * @param reminderQueryQuestion the user's new password reset question
1300            * @param reminderQueryAnswer the user's new password reset answer
1301            * @param screenName the user's new screen name
1302            * @param emailAddress the user's new email address
1303            * @param facebookId the user's new Facebook ID
1304            * @param openId the user's new OpenID
1305            * @param languageId the user's new language ID
1306            * @param timeZoneId the user's new time zone ID
1307            * @param greeting the user's new greeting
1308            * @param comments the user's new comments
1309            * @param firstName the user's new first name
1310            * @param middleName the user's new middle name
1311            * @param lastName the user's new last name
1312            * @param prefixId the user's new name prefix ID
1313            * @param suffixId the user's new name suffix ID
1314            * @param male whether user is male
1315            * @param birthdayMonth the user's new birthday month (0-based, meaning 0
1316            for January)
1317            * @param birthdayDay the user's new birthday day
1318            * @param birthdayYear the user's birthday year
1319            * @param smsSn the user's new SMS screen name
1320            * @param aimSn the user's new AIM screen name
1321            * @param facebookSn the user's new Facebook screen name
1322            * @param icqSn the user's new ICQ screen name
1323            * @param jabberSn the user's new Jabber screen name
1324            * @param msnSn the user's new MSN screen name
1325            * @param mySpaceSn the user's new MySpace screen name
1326            * @param skypeSn the user's new Skype screen name
1327            * @param twitterSn the user's new Twitter screen name
1328            * @param ymSn the user's new Yahoo! Messenger screen name
1329            * @param jobTitle the user's new job title
1330            * @param groupIds the primary keys of the user's groups
1331            * @param organizationIds the primary keys of the user's organizations
1332            * @param roleIds the primary keys of the user's roles
1333            * @param userGroupRoles the user user's group roles
1334            * @param userGroupIds the primary keys of the user's user groups
1335            * @param serviceContext the service context to be applied (optionally
1336            <code>null</code>). Can set the UUID (with the <code>uuid</code>
1337            attribute), asset category IDs, asset tag names, and expando
1338            bridge attributes for the user.
1339            * @return the user
1340            * @throws PortalException if a user with the primary key could not be
1341            found, if the new information was invalid, if the current user
1342            did not have permission to update the user, or if the operation
1343            was not allowed by the membership policy
1344            * @throws SystemException if a system exception occurred
1345            */
1346            public static com.liferay.portal.model.User updateUser(long userId,
1347                    java.lang.String oldPassword, java.lang.String newPassword1,
1348                    java.lang.String newPassword2, boolean passwordReset,
1349                    java.lang.String reminderQueryQuestion,
1350                    java.lang.String reminderQueryAnswer, java.lang.String screenName,
1351                    java.lang.String emailAddress, long facebookId,
1352                    java.lang.String openId, java.lang.String languageId,
1353                    java.lang.String timeZoneId, java.lang.String greeting,
1354                    java.lang.String comments, java.lang.String firstName,
1355                    java.lang.String middleName, java.lang.String lastName, int prefixId,
1356                    int suffixId, boolean male, int birthdayMonth, int birthdayDay,
1357                    int birthdayYear, java.lang.String smsSn, java.lang.String aimSn,
1358                    java.lang.String facebookSn, java.lang.String icqSn,
1359                    java.lang.String jabberSn, java.lang.String msnSn,
1360                    java.lang.String mySpaceSn, java.lang.String skypeSn,
1361                    java.lang.String twitterSn, java.lang.String ymSn,
1362                    java.lang.String jobTitle, long[] groupIds, long[] organizationIds,
1363                    long[] roleIds,
1364                    java.util.List<com.liferay.portal.model.UserGroupRole> userGroupRoles,
1365                    long[] userGroupIds,
1366                    com.liferay.portal.service.ServiceContext serviceContext)
1367                    throws com.liferay.portal.kernel.exception.PortalException,
1368                            com.liferay.portal.kernel.exception.SystemException {
1369                    return getService()
1370                                       .updateUser(userId, oldPassword, newPassword1, newPassword2,
1371                            passwordReset, reminderQueryQuestion, reminderQueryAnswer,
1372                            screenName, emailAddress, facebookId, openId, languageId,
1373                            timeZoneId, greeting, comments, firstName, middleName, lastName,
1374                            prefixId, suffixId, male, birthdayMonth, birthdayDay, birthdayYear,
1375                            smsSn, aimSn, facebookSn, icqSn, jabberSn, msnSn, mySpaceSn,
1376                            skypeSn, twitterSn, ymSn, jobTitle, groupIds, organizationIds,
1377                            roleIds, userGroupRoles, userGroupIds, serviceContext);
1378            }
1379    
1380            public static UserService getService() {
1381                    if (_service == null) {
1382                            _service = (UserService)PortalBeanLocatorUtil.locate(UserService.class.getName());
1383    
1384                            ReferenceRegistry.registerReference(UserServiceUtil.class,
1385                                    "_service");
1386                    }
1387    
1388                    return _service;
1389            }
1390    
1391            /**
1392             * @deprecated As of 6.2.0
1393             */
1394            public void setService(UserService service) {
1395            }
1396    
1397            private static UserService _service;
1398    }