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