001    /**
002     * Copyright (c) 2000-present 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.kernel.service;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.announcements.kernel.model.AnnouncementsDelivery;
020    
021    import com.liferay.portal.kernel.exception.PortalException;
022    import com.liferay.portal.kernel.exception.SystemException;
023    import com.liferay.portal.kernel.jsonwebservice.JSONWebService;
024    import com.liferay.portal.kernel.model.Address;
025    import com.liferay.portal.kernel.model.EmailAddress;
026    import com.liferay.portal.kernel.model.Phone;
027    import com.liferay.portal.kernel.model.User;
028    import com.liferay.portal.kernel.model.UserGroupRole;
029    import com.liferay.portal.kernel.model.Website;
030    import com.liferay.portal.kernel.security.access.control.AccessControlled;
031    import com.liferay.portal.kernel.transaction.Isolation;
032    import com.liferay.portal.kernel.transaction.Propagation;
033    import com.liferay.portal.kernel.transaction.Transactional;
034    
035    import java.util.List;
036    import java.util.Locale;
037    
038    /**
039     * Provides the remote service interface for User. Methods of this
040     * service are expected to have security checks based on the propagated JAAS
041     * credentials because this service can be accessed remotely.
042     *
043     * @author Brian Wing Shun Chan
044     * @see UserServiceUtil
045     * @see com.liferay.portal.service.base.UserServiceBaseImpl
046     * @see com.liferay.portal.service.impl.UserServiceImpl
047     * @generated
048     */
049    @AccessControlled
050    @JSONWebService
051    @ProviderType
052    @Transactional(isolation = Isolation.PORTAL, rollbackFor =  {
053            PortalException.class, SystemException.class})
054    public interface UserService extends BaseService {
055            /*
056             * NOTE FOR DEVELOPERS:
057             *
058             * Never modify or reference this interface directly. Always use {@link UserServiceUtil} to access the user remote service. Add custom service methods to {@link com.liferay.portal.service.impl.UserServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface.
059             */
060    
061            /**
062            * Adds the users to the group.
063            *
064            * @param groupId the primary key of the group
065            * @param userIds the primary keys of the users
066            * @param serviceContext the service context to be applied (optionally
067            <code>null</code>)
068            */
069            public void addGroupUsers(long groupId, long[] userIds,
070                    com.liferay.portal.kernel.service.ServiceContext serviceContext)
071                    throws PortalException;
072    
073            /**
074            * Adds the users to the organization.
075            *
076            * @param organizationId the primary key of the organization
077            * @param userIds the primary keys of the users
078            */
079            public void addOrganizationUsers(long organizationId, long[] userIds)
080                    throws PortalException;
081    
082            /**
083            * Assigns the password policy to the users, removing any other currently
084            * assigned password policies.
085            *
086            * @param passwordPolicyId the primary key of the password policy
087            * @param userIds the primary keys of the users
088            */
089            public void addPasswordPolicyUsers(long passwordPolicyId, long[] userIds)
090                    throws PortalException;
091    
092            /**
093            * Adds the users to the role.
094            *
095            * @param roleId the primary key of the role
096            * @param userIds the primary keys of the users
097            */
098            public void addRoleUsers(long roleId, long[] userIds)
099                    throws PortalException;
100    
101            /**
102            * Adds the users to the team.
103            *
104            * @param teamId the primary key of the team
105            * @param userIds the primary keys of the users
106            */
107            public void addTeamUsers(long teamId, long[] userIds)
108                    throws PortalException;
109    
110            /**
111            * Adds a user with additional parameters.
112            *
113            * <p>
114            * This method handles the creation and bookkeeping of the user including
115            * its resources, metadata, and internal data structures. It is not
116            * necessary to make subsequent calls to any methods to setup default
117            * groups, resources, etc.
118            * </p>
119            *
120            * @param companyId the primary key of the user's company
121            * @param autoPassword whether a password should be automatically generated
122            for the user
123            * @param password1 the user's password
124            * @param password2 the user's password confirmation
125            * @param autoScreenName whether a screen name should be automatically
126            generated for the user
127            * @param screenName the user's screen name
128            * @param emailAddress the user's email address
129            * @param facebookId the user's facebook ID
130            * @param openId the user's OpenID
131            * @param locale the user's locale
132            * @param firstName the user's first name
133            * @param middleName the user's middle name
134            * @param lastName the user's last name
135            * @param prefixId the user's name prefix ID
136            * @param suffixId the user's name suffix ID
137            * @param male whether the user is male
138            * @param birthdayMonth the user's birthday month (0-based, meaning 0 for
139            January)
140            * @param birthdayDay the user's birthday day
141            * @param birthdayYear the user's birthday year
142            * @param jobTitle the user's job title
143            * @param groupIds the primary keys of the user's groups
144            * @param organizationIds the primary keys of the user's organizations
145            * @param roleIds the primary keys of the roles this user possesses
146            * @param userGroupIds the primary keys of the user's user groups
147            * @param addresses the user's addresses
148            * @param emailAddresses the user's email addresses
149            * @param phones the user's phone numbers
150            * @param websites the user's websites
151            * @param announcementsDelivers the announcements deliveries
152            * @param sendEmail whether to send the user an email notification about
153            their new account
154            * @param serviceContext the service context to be applied (optionally
155            <code>null</code>). Can set the UUID (with the <code>uuid</code>
156            attribute), asset category IDs, asset tag names, and expando
157            bridge attributes for the user.
158            * @return the new user
159            */
160            public User addUser(long companyId, boolean autoPassword,
161                    java.lang.String password1, java.lang.String password2,
162                    boolean autoScreenName, java.lang.String screenName,
163                    java.lang.String emailAddress, long facebookId,
164                    java.lang.String openId, Locale locale, java.lang.String firstName,
165                    java.lang.String middleName, java.lang.String lastName, long prefixId,
166                    long suffixId, boolean male, int birthdayMonth, int birthdayDay,
167                    int birthdayYear, java.lang.String jobTitle, long[] groupIds,
168                    long[] organizationIds, long[] roleIds, long[] userGroupIds,
169                    List<Address> addresses, List<EmailAddress> emailAddresses,
170                    List<Phone> phones, List<Website> websites,
171                    List<AnnouncementsDelivery> announcementsDelivers, boolean sendEmail,
172                    com.liferay.portal.kernel.service.ServiceContext serviceContext)
173                    throws PortalException;
174    
175            /**
176            * Adds a user.
177            *
178            * <p>
179            * This method handles the creation and bookkeeping of the user including
180            * its resources, metadata, and internal data structures. It is not
181            * necessary to make subsequent calls to any methods to setup default
182            * groups, resources, etc.
183            * </p>
184            *
185            * @param companyId the primary key of the user's company
186            * @param autoPassword whether a password should be automatically generated
187            for the user
188            * @param password1 the user's password
189            * @param password2 the user's password confirmation
190            * @param autoScreenName whether a screen name should be automatically
191            generated for the user
192            * @param screenName the user's screen name
193            * @param emailAddress the user's email address
194            * @param facebookId the user's facebook ID
195            * @param openId the user's OpenID
196            * @param locale the user's locale
197            * @param firstName the user's first name
198            * @param middleName the user's middle name
199            * @param lastName the user's last name
200            * @param prefixId the user's name prefix ID
201            * @param suffixId the user's name suffix ID
202            * @param male whether the user is male
203            * @param birthdayMonth the user's birthday month (0-based, meaning 0 for
204            January)
205            * @param birthdayDay the user's birthday day
206            * @param birthdayYear the user's birthday year
207            * @param jobTitle the user's job title
208            * @param groupIds the primary keys of the user's groups
209            * @param organizationIds the primary keys of the user's organizations
210            * @param roleIds the primary keys of the roles this user possesses
211            * @param userGroupIds the primary keys of the user's user groups
212            * @param sendEmail whether to send the user an email notification about
213            their new account
214            * @param serviceContext the service context to be applied (optionally
215            <code>null</code>). Can set the UUID (with the <code>uuid</code>
216            attribute), asset category IDs, asset tag names, and expando
217            bridge attributes for the user.
218            * @return the new user
219            */
220            public User addUser(long companyId, boolean autoPassword,
221                    java.lang.String password1, java.lang.String password2,
222                    boolean autoScreenName, java.lang.String screenName,
223                    java.lang.String emailAddress, long facebookId,
224                    java.lang.String openId, Locale locale, java.lang.String firstName,
225                    java.lang.String middleName, java.lang.String lastName, long prefixId,
226                    long suffixId, boolean male, int birthdayMonth, int birthdayDay,
227                    int birthdayYear, java.lang.String jobTitle, long[] groupIds,
228                    long[] organizationIds, long[] roleIds, long[] userGroupIds,
229                    boolean sendEmail,
230                    com.liferay.portal.kernel.service.ServiceContext serviceContext)
231                    throws PortalException;
232    
233            /**
234            * Adds the users to the user group.
235            *
236            * @param userGroupId the primary key of the user group
237            * @param userIds the primary keys of the users
238            */
239            public void addUserGroupUsers(long userGroupId, long[] userIds)
240                    throws PortalException;
241    
242            /**
243            * Adds a user with workflow and additional parameters.
244            *
245            * <p>
246            * This method handles the creation and bookkeeping of the user including
247            * its resources, metadata, and internal data structures. It is not
248            * necessary to make subsequent calls to any methods to setup default
249            * groups, resources, etc.
250            * </p>
251            *
252            * @param companyId the primary key of the user's company
253            * @param autoPassword whether a password should be automatically generated
254            for the user
255            * @param password1 the user's password
256            * @param password2 the user's password confirmation
257            * @param autoScreenName whether a screen name should be automatically
258            generated for the user
259            * @param screenName the user's screen name
260            * @param emailAddress the user's email address
261            * @param facebookId the user's facebook ID
262            * @param openId the user's OpenID
263            * @param locale the user's locale
264            * @param firstName the user's first name
265            * @param middleName the user's middle name
266            * @param lastName the user's last name
267            * @param prefixId the user's name prefix ID
268            * @param suffixId the user's name suffix ID
269            * @param male whether the user is male
270            * @param birthdayMonth the user's birthday month (0-based, meaning 0 for
271            January)
272            * @param birthdayDay the user's birthday day
273            * @param birthdayYear the user's birthday year
274            * @param jobTitle the user's job title
275            * @param groupIds the primary keys of the user's groups
276            * @param organizationIds the primary keys of the user's organizations
277            * @param roleIds the primary keys of the roles this user possesses
278            * @param userGroupIds the primary keys of the user's user groups
279            * @param addresses the user's addresses
280            * @param emailAddresses the user's email addresses
281            * @param phones the user's phone numbers
282            * @param websites the user's websites
283            * @param announcementsDelivers the announcements deliveries
284            * @param sendEmail whether to send the user an email notification about
285            their new account
286            * @param serviceContext the service context to be applied (optionally
287            <code>null</code>). Can set the UUID (with the <code>uuid</code>
288            attribute), asset category IDs, asset tag names, and expando
289            bridge attributes for the user.
290            * @return the new user
291            */
292            public User addUserWithWorkflow(long companyId, boolean autoPassword,
293                    java.lang.String password1, java.lang.String password2,
294                    boolean autoScreenName, java.lang.String screenName,
295                    java.lang.String emailAddress, long facebookId,
296                    java.lang.String openId, Locale locale, java.lang.String firstName,
297                    java.lang.String middleName, java.lang.String lastName, long prefixId,
298                    long suffixId, boolean male, int birthdayMonth, int birthdayDay,
299                    int birthdayYear, java.lang.String jobTitle, long[] groupIds,
300                    long[] organizationIds, long[] roleIds, long[] userGroupIds,
301                    List<Address> addresses, List<EmailAddress> emailAddresses,
302                    List<Phone> phones, List<Website> websites,
303                    List<AnnouncementsDelivery> announcementsDelivers, boolean sendEmail,
304                    com.liferay.portal.kernel.service.ServiceContext serviceContext)
305                    throws PortalException;
306    
307            /**
308            * Adds a user with workflow.
309            *
310            * <p>
311            * This method handles the creation and bookkeeping of the user including
312            * its resources, metadata, and internal data structures. It is not
313            * necessary to make subsequent calls to any methods to setup default
314            * groups, resources, etc.
315            * </p>
316            *
317            * @param companyId the primary key of the user's company
318            * @param autoPassword whether a password should be automatically generated
319            for the user
320            * @param password1 the user's password
321            * @param password2 the user's password confirmation
322            * @param autoScreenName whether a screen name should be automatically
323            generated for the user
324            * @param screenName the user's screen name
325            * @param emailAddress the user's email address
326            * @param facebookId the user's facebook ID
327            * @param openId the user's OpenID
328            * @param locale the user's locale
329            * @param firstName the user's first name
330            * @param middleName the user's middle name
331            * @param lastName the user's last name
332            * @param prefixId the user's name prefix ID
333            * @param suffixId the user's name suffix ID
334            * @param male whether the user is male
335            * @param birthdayMonth the user's birthday month (0-based, meaning 0 for
336            January)
337            * @param birthdayDay the user's birthday day
338            * @param birthdayYear the user's birthday year
339            * @param jobTitle the user's job title
340            * @param groupIds the primary keys of the user's groups
341            * @param organizationIds the primary keys of the user's organizations
342            * @param roleIds the primary keys of the roles this user possesses
343            * @param userGroupIds the primary keys of the user's user groups
344            * @param sendEmail whether to send the user an email notification about
345            their new account
346            * @param serviceContext the service context to be applied (optionally
347            <code>null</code>). Can set the UUID (with the <code>uuid</code>
348            attribute), asset category IDs, asset tag names, and expando
349            bridge attributes for the user.
350            * @return the new user
351            */
352            public User addUserWithWorkflow(long companyId, boolean autoPassword,
353                    java.lang.String password1, java.lang.String password2,
354                    boolean autoScreenName, java.lang.String screenName,
355                    java.lang.String emailAddress, long facebookId,
356                    java.lang.String openId, Locale locale, java.lang.String firstName,
357                    java.lang.String middleName, java.lang.String lastName, long prefixId,
358                    long suffixId, boolean male, int birthdayMonth, int birthdayDay,
359                    int birthdayYear, java.lang.String jobTitle, long[] groupIds,
360                    long[] organizationIds, long[] roleIds, long[] userGroupIds,
361                    boolean sendEmail,
362                    com.liferay.portal.kernel.service.ServiceContext serviceContext)
363                    throws PortalException;
364    
365            /**
366            * Deletes the user's portrait image.
367            *
368            * @param userId the primary key of the user
369            */
370            public void deletePortrait(long userId) throws PortalException;
371    
372            /**
373            * Removes the user from the role.
374            *
375            * @param roleId the primary key of the role
376            * @param userId the primary key of the user
377            */
378            public void deleteRoleUser(long roleId, long userId)
379                    throws PortalException;
380    
381            /**
382            * Deletes the user.
383            *
384            * @param userId the primary key of the user
385            */
386            public void deleteUser(long userId) throws PortalException;
387    
388            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
389            public List<User> getCompanyUsers(long companyId, int start, int end)
390                    throws PortalException;
391    
392            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
393            public int getCompanyUsersCount(long companyId) throws PortalException;
394    
395            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
396            public User getCurrentUser() throws PortalException;
397    
398            /**
399            * Returns the primary keys of all the users belonging to the group.
400            *
401            * @param groupId the primary key of the group
402            * @return the primary keys of the users belonging to the group
403            */
404            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
405            public long[] getGroupUserIds(long groupId) throws PortalException;
406    
407            /**
408            * Returns all the users belonging to the group.
409            *
410            * @param groupId the primary key of the group
411            * @return the users belonging to the group
412            */
413            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
414            public List<User> getGroupUsers(long groupId) throws PortalException;
415    
416            /**
417            * Returns the OSGi service identifier.
418            *
419            * @return the OSGi service identifier
420            */
421            public java.lang.String getOSGiServiceIdentifier();
422    
423            /**
424            * Returns the primary keys of all the users belonging to the organization.
425            *
426            * @param organizationId the primary key of the organization
427            * @return the primary keys of the users belonging to the organization
428            */
429            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
430            public long[] getOrganizationUserIds(long organizationId)
431                    throws PortalException;
432    
433            /**
434            * Returns all the users belonging to the organization.
435            *
436            * @param organizationId the primary key of the organization
437            * @return users belonging to the organization
438            */
439            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
440            public List<User> getOrganizationUsers(long organizationId)
441                    throws PortalException;
442    
443            /**
444            * Returns the primary keys of all the users belonging to the role.
445            *
446            * @param roleId the primary key of the role
447            * @return the primary keys of the users belonging to the role
448            */
449            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
450            public long[] getRoleUserIds(long roleId) throws PortalException;
451    
452            /**
453            * Returns the user with the email address.
454            *
455            * @param companyId the primary key of the user's company
456            * @param emailAddress the user's email address
457            * @return the user with the email address
458            */
459            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
460            public User getUserByEmailAddress(long companyId,
461                    java.lang.String emailAddress) throws PortalException;
462    
463            /**
464            * Returns the user with the primary key.
465            *
466            * @param userId the primary key of the user
467            * @return the user with the primary key
468            */
469            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
470            public User getUserById(long userId) throws PortalException;
471    
472            /**
473            * Returns the user with the screen name.
474            *
475            * @param companyId the primary key of the user's company
476            * @param screenName the user's screen name
477            * @return the user with the screen name
478            */
479            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
480            public User getUserByScreenName(long companyId, java.lang.String screenName)
481                    throws PortalException;
482    
483            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
484            public List<User> getUserGroupUsers(long userGroupId)
485                    throws PortalException;
486    
487            /**
488            * Returns the primary key of the user with the email address.
489            *
490            * @param companyId the primary key of the user's company
491            * @param emailAddress the user's email address
492            * @return the primary key of the user with the email address
493            */
494            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
495            public long getUserIdByEmailAddress(long companyId,
496                    java.lang.String emailAddress) throws PortalException;
497    
498            /**
499            * Returns the primary key of the user with the screen name.
500            *
501            * @param companyId the primary key of the user's company
502            * @param screenName the user's screen name
503            * @return the primary key of the user with the screen name
504            */
505            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
506            public long getUserIdByScreenName(long companyId,
507                    java.lang.String screenName) throws PortalException;
508    
509            /**
510            * Returns <code>true</code> if the user is a member of the group.
511            *
512            * @param groupId the primary key of the group
513            * @param userId the primary key of the user
514            * @return <code>true</code> if the user is a member of the group;
515            <code>false</code> otherwise
516            */
517            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
518            public boolean hasGroupUser(long groupId, long userId)
519                    throws PortalException;
520    
521            /**
522            * Returns <code>true</code> if the user has the role with the name,
523            * optionally through inheritance.
524            *
525            * @param companyId the primary key of the role's company
526            * @param name the name of the role (must be a regular role, not an
527            organization, site or provider role)
528            * @param userId the primary key of the user
529            * @param inherited whether to include roles inherited from organizations,
530            sites, etc.
531            * @return <code>true</code> if the user has the role; <code>false</code>
532            otherwise
533            */
534            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
535            public boolean hasRoleUser(long companyId, java.lang.String name,
536                    long userId, boolean inherited) throws PortalException;
537    
538            /**
539            * Returns <code>true</code> if the user is a member of the role.
540            *
541            * @param roleId the primary key of the role
542            * @param userId the primary key of the user
543            * @return <code>true</code> if the user is a member of the role;
544            <code>false</code> otherwise
545            */
546            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
547            public boolean hasRoleUser(long roleId, long userId)
548                    throws PortalException;
549    
550            /**
551            * Sends a password notification email to the user matching the email
552            * address. The portal's settings determine whether a password is sent
553            * explicitly or whether a link for resetting the user's password is sent.
554            * The method sends the email asynchronously and returns before the email is
555            * sent.
556            *
557            * <p>
558            * The content of the notification email is specified with the
559            * <code>admin.email.password</code> portal property keys. They can be
560            * overridden via a <code>portal-ext.properties</code> file or modified
561            * through the Portal Settings UI.
562            * </p>
563            *
564            * @param companyId the primary key of the user's company
565            * @param emailAddress the user's email address
566            * @return <code>true</code> if the notification email includes a new
567            password; <code>false</code> if the notification email only
568            contains a reset link
569            */
570            public boolean sendPasswordByEmailAddress(long companyId,
571                    java.lang.String emailAddress) throws PortalException;
572    
573            /**
574            * Sends a password notification email to the user matching the screen name.
575            * The portal's settings determine whether a password is sent explicitly or
576            * whether a link for resetting the user's password is sent. The method
577            * sends the email asynchronously and returns before the email is sent.
578            *
579            * <p>
580            * The content of the notification email is specified with the
581            * <code>admin.email.password</code> portal property keys. They can be
582            * overridden via a <code>portal-ext.properties</code> file or modified
583            * through the Portal Settings UI.
584            * </p>
585            *
586            * @param companyId the primary key of the user's company
587            * @param screenName the user's screen name
588            * @return <code>true</code> if the notification email includes a new
589            password; <code>false</code> if the notification email only
590            contains a reset link
591            */
592            public boolean sendPasswordByScreenName(long companyId,
593                    java.lang.String screenName) throws PortalException;
594    
595            /**
596            * Sends a password notification email to the user matching the ID. The
597            * portal's settings determine whether a password is sent explicitly or
598            * whether a link for resetting the user's password is sent. The method
599            * sends the email asynchronously and returns before the email is sent.
600            *
601            * <p>
602            * The content of the notification email is specified with the
603            * <code>admin.email.password</code> portal property keys. They can be
604            * overridden via a <code>portal-ext.properties</code> file or modified
605            * through the Portal Settings UI.
606            * </p>
607            *
608            * @param userId the user's primary key
609            * @return <code>true</code> if the notification email includes a new
610            password; <code>false</code> if the notification email only
611            contains a reset link
612            */
613            public boolean sendPasswordByUserId(long userId) throws PortalException;
614    
615            /**
616            * Sets the users in the role, removing and adding users to the role as
617            * necessary.
618            *
619            * @param roleId the primary key of the role
620            * @param userIds the primary keys of the users
621            */
622            public void setRoleUsers(long roleId, long[] userIds)
623                    throws PortalException;
624    
625            /**
626            * Sets the users in the user group, removing and adding users to the user
627            * group as necessary.
628            *
629            * @param userGroupId the primary key of the user group
630            * @param userIds the primary keys of the users
631            */
632            public void setUserGroupUsers(long userGroupId, long[] userIds)
633                    throws PortalException;
634    
635            /**
636            * Removes the users from the teams of a group.
637            *
638            * @param groupId the primary key of the group
639            * @param userIds the primary keys of the users
640            */
641            public void unsetGroupTeamsUsers(long groupId, long[] userIds)
642                    throws PortalException;
643    
644            /**
645            * Removes the users from the group.
646            *
647            * @param groupId the primary key of the group
648            * @param userIds the primary keys of the users
649            * @param serviceContext the service context to be applied (optionally
650            <code>null</code>)
651            */
652            public void unsetGroupUsers(long groupId, long[] userIds,
653                    com.liferay.portal.kernel.service.ServiceContext serviceContext)
654                    throws PortalException;
655    
656            /**
657            * Removes the users from the organization.
658            *
659            * @param organizationId the primary key of the organization
660            * @param userIds the primary keys of the users
661            */
662            public void unsetOrganizationUsers(long organizationId, long[] userIds)
663                    throws PortalException;
664    
665            /**
666            * Removes the users from the password policy.
667            *
668            * @param passwordPolicyId the primary key of the password policy
669            * @param userIds the primary keys of the users
670            */
671            public void unsetPasswordPolicyUsers(long passwordPolicyId, long[] userIds)
672                    throws PortalException;
673    
674            /**
675            * Removes the users from the role.
676            *
677            * @param roleId the primary key of the role
678            * @param userIds the primary keys of the users
679            */
680            public void unsetRoleUsers(long roleId, long[] userIds)
681                    throws PortalException;
682    
683            /**
684            * Removes the users from the team.
685            *
686            * @param teamId the primary key of the team
687            * @param userIds the primary keys of the users
688            */
689            public void unsetTeamUsers(long teamId, long[] userIds)
690                    throws PortalException;
691    
692            /**
693            * Removes the users from the user group.
694            *
695            * @param userGroupId the primary key of the user group
696            * @param userIds the primary keys of the users
697            */
698            public void unsetUserGroupUsers(long userGroupId, long[] userIds)
699                    throws PortalException;
700    
701            /**
702            * Updates the user's response to the terms of use agreement.
703            *
704            * @param userId the primary key of the user
705            * @param agreedToTermsOfUse whether the user has agree to the terms of use
706            * @return the user
707            */
708            public User updateAgreedToTermsOfUse(long userId, boolean agreedToTermsOfUse)
709                    throws PortalException;
710    
711            /**
712            * Updates the user's email address.
713            *
714            * @param userId the primary key of the user
715            * @param password the user's password
716            * @param emailAddress1 the user's new email address
717            * @param emailAddress2 the user's new email address confirmation
718            * @param serviceContext the service context to be applied. Must set the
719            portal URL, main path, primary key of the layout, remote address,
720            remote host, and agent for the user.
721            * @return the user
722            */
723            public User updateEmailAddress(long userId, java.lang.String password,
724                    java.lang.String emailAddress1, java.lang.String emailAddress2,
725                    com.liferay.portal.kernel.service.ServiceContext serviceContext)
726                    throws PortalException;
727    
728            /**
729            * Updates a user account that was automatically created when a guest user
730            * participated in an action (e.g. posting a comment) and only provided his
731            * name and email address.
732            *
733            * @param companyId the primary key of the user's company
734            * @param autoPassword whether a password should be automatically generated
735            for the user
736            * @param password1 the user's password
737            * @param password2 the user's password confirmation
738            * @param autoScreenName whether a screen name should be automatically
739            generated for the user
740            * @param screenName the user's screen name
741            * @param emailAddress the user's email address
742            * @param facebookId the user's facebook ID
743            * @param openId the user's OpenID
744            * @param locale the user's locale
745            * @param firstName the user's first name
746            * @param middleName the user's middle name
747            * @param lastName the user's last name
748            * @param prefixId the user's name prefix ID
749            * @param suffixId the user's name suffix ID
750            * @param male whether the user is male
751            * @param birthdayMonth the user's birthday month (0-based, meaning 0 for
752            January)
753            * @param birthdayDay the user's birthday day
754            * @param birthdayYear the user's birthday year
755            * @param jobTitle the user's job title
756            * @param updateUserInformation whether to update the user's information
757            * @param sendEmail whether to send the user an email notification about
758            their new account
759            * @param serviceContext the service context to be applied (optionally
760            <code>null</code>). Can set the expando bridge attributes for the
761            user.
762            * @return the user
763            */
764            public User updateIncompleteUser(long companyId, boolean autoPassword,
765                    java.lang.String password1, java.lang.String password2,
766                    boolean autoScreenName, java.lang.String screenName,
767                    java.lang.String emailAddress, long facebookId,
768                    java.lang.String openId, Locale locale, java.lang.String firstName,
769                    java.lang.String middleName, java.lang.String lastName, long prefixId,
770                    long suffixId, boolean male, int birthdayMonth, int birthdayDay,
771                    int birthdayYear, java.lang.String jobTitle,
772                    boolean updateUserInformation, boolean sendEmail,
773                    com.liferay.portal.kernel.service.ServiceContext serviceContext)
774                    throws PortalException;
775    
776            /**
777            * Updates whether the user is locked out from logging in.
778            *
779            * @param userId the primary key of the user
780            * @param lockout whether the user is locked out
781            * @return the user
782            */
783            public User updateLockoutById(long userId, boolean lockout)
784                    throws PortalException;
785    
786            /**
787            * Updates the user's OpenID.
788            *
789            * @param userId the primary key of the user
790            * @param openId the new OpenID
791            * @return the user
792            */
793            public User updateOpenId(long userId, java.lang.String openId)
794                    throws PortalException;
795    
796            /**
797            * Sets the organizations that the user is in, removing and adding
798            * organizations as necessary.
799            *
800            * @param userId the primary key of the user
801            * @param organizationIds the primary keys of the organizations
802            * @param serviceContext the service context to be applied. Must set whether
803            user indexing is enabled.
804            */
805            public void updateOrganizations(long userId, long[] organizationIds,
806                    com.liferay.portal.kernel.service.ServiceContext serviceContext)
807                    throws PortalException;
808    
809            /**
810            * Updates the user's password without tracking or validation of the change.
811            *
812            * @param userId the primary key of the user
813            * @param password1 the user's new password
814            * @param password2 the user's new password confirmation
815            * @param passwordReset whether the user should be asked to reset their
816            password the next time they log in
817            * @return the user
818            */
819            public User updatePassword(long userId, java.lang.String password1,
820                    java.lang.String password2, boolean passwordReset)
821                    throws PortalException;
822    
823            /**
824            * Updates the user's portrait image.
825            *
826            * @param userId the primary key of the user
827            * @param bytes the new portrait image data
828            * @return the user
829            */
830            public User updatePortrait(long userId, byte[] bytes)
831                    throws PortalException;
832    
833            /**
834            * Updates the user's password reset question and answer.
835            *
836            * @param userId the primary key of the user
837            * @param question the user's new password reset question
838            * @param answer the user's new password reset answer
839            * @return the user
840            */
841            public User updateReminderQuery(long userId, java.lang.String question,
842                    java.lang.String answer) throws PortalException;
843    
844            /**
845            * Updates the user's screen name.
846            *
847            * @param userId the primary key of the user
848            * @param screenName the user's new screen name
849            * @return the user
850            */
851            public User updateScreenName(long userId, java.lang.String screenName)
852                    throws PortalException;
853    
854            /**
855            * Updates the user's workflow status.
856            *
857            * @param userId the primary key of the user
858            * @param status the user's new workflow status
859            * @return the user
860            * @deprecated As of 7.0.0, replaced by {@link #updateStatus(long, int,
861            ServiceContext)}
862            */
863            @java.lang.Deprecated
864            public User updateStatus(long userId, int status) throws PortalException;
865    
866            /**
867            * Updates the user's workflow status.
868            *
869            * @param userId the primary key of the user
870            * @param status the user's new workflow status
871            * @param serviceContext the service context to be applied. You can specify
872            an unencrypted custom password (used by an LDAP listener) for the
873            user via attribute <code>passwordUnencrypted</code>.
874            * @return the user
875            */
876            public User updateStatus(long userId, int status,
877                    com.liferay.portal.kernel.service.ServiceContext serviceContext)
878                    throws PortalException;
879    
880            /**
881            * Updates the user with additional parameters.
882            *
883            * @param userId the primary key of the user
884            * @param oldPassword the user's old password
885            * @param newPassword1 the user's new password (optionally
886            <code>null</code>)
887            * @param newPassword2 the user's new password confirmation (optionally
888            <code>null</code>)
889            * @param passwordReset whether the user should be asked to reset their
890            password the next time they login
891            * @param reminderQueryQuestion the user's new password reset question
892            * @param reminderQueryAnswer the user's new password reset answer
893            * @param screenName the user's new screen name
894            * @param emailAddress the user's new email address
895            * @param facebookId the user's new Facebook ID
896            * @param openId the user's new OpenID
897            * @param languageId the user's new language ID
898            * @param timeZoneId the user's new time zone ID
899            * @param greeting the user's new greeting
900            * @param comments the user's new comments
901            * @param firstName the user's new first name
902            * @param middleName the user's new middle name
903            * @param lastName the user's new last name
904            * @param prefixId the user's new name prefix ID
905            * @param suffixId the user's new name suffix ID
906            * @param male whether user is male
907            * @param birthdayMonth the user's new birthday month (0-based, meaning
908            0 for January)
909            * @param birthdayDay the user's new birthday day
910            * @param birthdayYear the user's birthday year
911            * @param smsSn the user's new SMS screen name
912            * @param facebookSn the user's new Facebook screen name
913            * @param jabberSn the user's new Jabber screen name
914            * @param skypeSn the user's new Skype screen name
915            * @param twitterSn the user's new Twitter screen name
916            * @param jobTitle the user's new job title
917            * @param groupIds the primary keys of the user's groups
918            * @param organizationIds the primary keys of the user's organizations
919            * @param roleIds the primary keys of the user's roles
920            * @param userGroupRoles the user user's group roles
921            * @param userGroupIds the primary keys of the user's user groups
922            * @param addresses the user's addresses
923            * @param emailAddresses the user's email addresses
924            * @param phones the user's phone numbers
925            * @param websites the user's websites
926            * @param announcementsDelivers the announcements deliveries
927            * @param serviceContext the service context to be applied (optionally
928            <code>null</code>). Can set the UUID (with the
929            <code>uuid</code> attribute), asset category IDs, asset tag
930            names, and expando bridge attributes for the user.
931            * @return the user
932            * @deprecated As of 7.0.0, replaced by {@link #updateUser(long, String,
933            String, String, boolean, String, String, String, String,
934            long, String, boolean, byte[], String, String, String,
935            String, String, String, String, long, long, boolean, int,
936            int, int, String, String, String, String, String, String,
937            long[], long[], long[], List, long[], List, List, List, List,
938            List, ServiceContext)}
939            */
940            @java.lang.Deprecated
941            public User updateUser(long userId, java.lang.String oldPassword,
942                    java.lang.String newPassword1, java.lang.String newPassword2,
943                    boolean passwordReset, java.lang.String reminderQueryQuestion,
944                    java.lang.String reminderQueryAnswer, java.lang.String screenName,
945                    java.lang.String emailAddress, long facebookId,
946                    java.lang.String openId, java.lang.String languageId,
947                    java.lang.String timeZoneId, java.lang.String greeting,
948                    java.lang.String comments, java.lang.String firstName,
949                    java.lang.String middleName, java.lang.String lastName, long prefixId,
950                    long suffixId, boolean male, int birthdayMonth, int birthdayDay,
951                    int birthdayYear, java.lang.String smsSn, java.lang.String facebookSn,
952                    java.lang.String jabberSn, java.lang.String skypeSn,
953                    java.lang.String twitterSn, java.lang.String jobTitle, long[] groupIds,
954                    long[] organizationIds, long[] roleIds,
955                    List<UserGroupRole> userGroupRoles, long[] userGroupIds,
956                    List<Address> addresses, List<EmailAddress> emailAddresses,
957                    List<Phone> phones, List<Website> websites,
958                    List<AnnouncementsDelivery> announcementsDelivers,
959                    com.liferay.portal.kernel.service.ServiceContext serviceContext)
960                    throws PortalException;
961    
962            /**
963            * Updates the user.
964            *
965            * @param userId the primary key of the user
966            * @param oldPassword the user's old password
967            * @param newPassword1 the user's new password (optionally
968            <code>null</code>)
969            * @param newPassword2 the user's new password confirmation (optionally
970            <code>null</code>)
971            * @param passwordReset whether the user should be asked to reset their
972            password the next time they login
973            * @param reminderQueryQuestion the user's new password reset question
974            * @param reminderQueryAnswer the user's new password reset answer
975            * @param screenName the user's new screen name
976            * @param emailAddress the user's new email address
977            * @param facebookId the user's new Facebook ID
978            * @param openId the user's new OpenID
979            * @param languageId the user's new language ID
980            * @param timeZoneId the user's new time zone ID
981            * @param greeting the user's new greeting
982            * @param comments the user's new comments
983            * @param firstName the user's new first name
984            * @param middleName the user's new middle name
985            * @param lastName the user's new last name
986            * @param prefixId the user's new name prefix ID
987            * @param suffixId the user's new name suffix ID
988            * @param male whether user is male
989            * @param birthdayMonth the user's new birthday month (0-based, meaning 0
990            for January)
991            * @param birthdayDay the user's new birthday day
992            * @param birthdayYear the user's birthday year
993            * @param smsSn the user's new SMS screen name
994            * @param facebookSn the user's new Facebook screen name
995            * @param jabberSn the user's new Jabber screen name
996            * @param skypeSn the user's new Skype screen name
997            * @param twitterSn the user's new Twitter screen name
998            * @param jobTitle the user's new job title
999            * @param groupIds the primary keys of the user's groups
1000            * @param organizationIds the primary keys of the user's organizations
1001            * @param roleIds the primary keys of the user's roles
1002            * @param userGroupRoles the user user's group roles
1003            * @param userGroupIds the primary keys of the user's user groups
1004            * @param serviceContext the service context to be applied (optionally
1005            <code>null</code>). Can set the UUID (with the <code>uuid</code>
1006            attribute), asset category IDs, asset tag names, and expando
1007            bridge attributes for the user.
1008            * @return the user
1009            */
1010            public User updateUser(long userId, java.lang.String oldPassword,
1011                    java.lang.String newPassword1, java.lang.String newPassword2,
1012                    boolean passwordReset, java.lang.String reminderQueryQuestion,
1013                    java.lang.String reminderQueryAnswer, java.lang.String screenName,
1014                    java.lang.String emailAddress, long facebookId,
1015                    java.lang.String openId, java.lang.String languageId,
1016                    java.lang.String timeZoneId, java.lang.String greeting,
1017                    java.lang.String comments, java.lang.String firstName,
1018                    java.lang.String middleName, java.lang.String lastName, long prefixId,
1019                    long suffixId, boolean male, int birthdayMonth, int birthdayDay,
1020                    int birthdayYear, java.lang.String smsSn, java.lang.String facebookSn,
1021                    java.lang.String jabberSn, java.lang.String skypeSn,
1022                    java.lang.String twitterSn, java.lang.String jobTitle, long[] groupIds,
1023                    long[] organizationIds, long[] roleIds,
1024                    List<UserGroupRole> userGroupRoles, long[] userGroupIds,
1025                    com.liferay.portal.kernel.service.ServiceContext serviceContext)
1026                    throws PortalException;
1027    
1028            /**
1029            * Updates the user with additional parameters.
1030            *
1031            * @param userId the primary key of the user
1032            * @param oldPassword the user's old password
1033            * @param newPassword1 the user's new password (optionally
1034            <code>null</code>)
1035            * @param newPassword2 the user's new password confirmation (optionally
1036            <code>null</code>)
1037            * @param passwordReset whether the user should be asked to reset their
1038            password the next time they login
1039            * @param reminderQueryQuestion the user's new password reset question
1040            * @param reminderQueryAnswer the user's new password reset answer
1041            * @param screenName the user's new screen name
1042            * @param emailAddress the user's new email address
1043            * @param facebookId the user's new Facebook ID
1044            * @param openId the user's new OpenID
1045            * @param portrait whether to update the user's portrait image
1046            * @param portraitBytes the new portrait image data
1047            * @param languageId the user's new language ID
1048            * @param timeZoneId the user's new time zone ID
1049            * @param greeting the user's new greeting
1050            * @param comments the user's new comments
1051            * @param firstName the user's new first name
1052            * @param middleName the user's new middle name
1053            * @param lastName the user's new last name
1054            * @param prefixId the user's new name prefix ID
1055            * @param suffixId the user's new name suffix ID
1056            * @param male whether user is male
1057            * @param birthdayMonth the user's new birthday month (0-based, meaning 0
1058            for January)
1059            * @param birthdayDay the user's new birthday day
1060            * @param birthdayYear the user's birthday year
1061            * @param smsSn the user's new SMS screen name
1062            * @param facebookSn the user's new Facebook screen name
1063            * @param jabberSn the user's new Jabber screen name
1064            * @param skypeSn the user's new Skype screen name
1065            * @param twitterSn the user's new Twitter screen name
1066            * @param jobTitle the user's new job title
1067            * @param groupIds the primary keys of the user's groups
1068            * @param organizationIds the primary keys of the user's organizations
1069            * @param roleIds the primary keys of the user's roles
1070            * @param userGroupRoles the user user's group roles
1071            * @param userGroupIds the primary keys of the user's user groups
1072            * @param addresses the user's addresses
1073            * @param emailAddresses the user's email addresses
1074            * @param phones the user's phone numbers
1075            * @param websites the user's websites
1076            * @param announcementsDelivers the announcements deliveries
1077            * @param serviceContext the service context to be applied (optionally
1078            <code>null</code>). Can set the UUID (with the <code>uuid</code>
1079            attribute), asset category IDs, asset tag names, and expando
1080            bridge attributes for the user.
1081            * @return the user
1082            */
1083            public User updateUser(long userId, java.lang.String oldPassword,
1084                    java.lang.String newPassword1, java.lang.String newPassword2,
1085                    boolean passwordReset, java.lang.String reminderQueryQuestion,
1086                    java.lang.String reminderQueryAnswer, java.lang.String screenName,
1087                    java.lang.String emailAddress, long facebookId,
1088                    java.lang.String openId, boolean portrait, byte[] portraitBytes,
1089                    java.lang.String languageId, java.lang.String timeZoneId,
1090                    java.lang.String greeting, java.lang.String comments,
1091                    java.lang.String firstName, java.lang.String middleName,
1092                    java.lang.String lastName, long prefixId, long suffixId, boolean male,
1093                    int birthdayMonth, int birthdayDay, int birthdayYear,
1094                    java.lang.String smsSn, java.lang.String facebookSn,
1095                    java.lang.String jabberSn, java.lang.String skypeSn,
1096                    java.lang.String twitterSn, java.lang.String jobTitle, long[] groupIds,
1097                    long[] organizationIds, long[] roleIds,
1098                    List<UserGroupRole> userGroupRoles, long[] userGroupIds,
1099                    List<Address> addresses, List<EmailAddress> emailAddresses,
1100                    List<Phone> phones, List<Website> websites,
1101                    List<AnnouncementsDelivery> announcementsDelivers,
1102                    com.liferay.portal.kernel.service.ServiceContext serviceContext)
1103                    throws PortalException;
1104    }