1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    * Permission is hereby granted, free of charge, to any person obtaining a copy
5    * of this software and associated documentation files (the "Software"), to deal
6    * in the Software without restriction, including without limitation the rights
7    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8    * copies of the Software, and to permit persons to whom the Software is
9    * furnished to do so, subject to the following conditions:
10   *
11   * The above copyright notice and this permission notice shall be included in
12   * all copies or substantial portions of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
22  
23  package com.liferay.portal.service;
24  
25  
26  /**
27   * <a href="UserServiceUtil.java.html"><b><i>View Source</i></b></a>
28   *
29   * <p>
30   * ServiceBuilder generated this class. Modifications in this class will be
31   * overwritten the next time is generated.
32   * </p>
33   *
34   * <p>
35   * This class provides static methods for the
36   * <code>com.liferay.portal.service.UserService</code>
37   * bean. The static methods of this class calls the same methods of the bean
38   * instance. It's convenient to be able to just write one line to call a method
39   * on a bean instead of writing a lookup call and a method call.
40   * </p>
41   *
42   * @author Brian Wing Shun Chan
43   *
44   * @see com.liferay.portal.service.UserService
45   *
46   */
47  public class UserServiceUtil {
48      public static void addGroupUsers(long groupId, long[] userIds)
49          throws com.liferay.portal.PortalException,
50              com.liferay.portal.SystemException {
51          getService().addGroupUsers(groupId, userIds);
52      }
53  
54      public static void addOrganizationUsers(long organizationId, long[] userIds)
55          throws com.liferay.portal.PortalException,
56              com.liferay.portal.SystemException {
57          getService().addOrganizationUsers(organizationId, userIds);
58      }
59  
60      public static void addPasswordPolicyUsers(long passwordPolicyId,
61          long[] userIds)
62          throws com.liferay.portal.PortalException,
63              com.liferay.portal.SystemException {
64          getService().addPasswordPolicyUsers(passwordPolicyId, userIds);
65      }
66  
67      public static void addRoleUsers(long roleId, long[] userIds)
68          throws com.liferay.portal.PortalException,
69              com.liferay.portal.SystemException {
70          getService().addRoleUsers(roleId, userIds);
71      }
72  
73      public static void addUserGroupUsers(long userGroupId, long[] userIds)
74          throws com.liferay.portal.PortalException,
75              com.liferay.portal.SystemException {
76          getService().addUserGroupUsers(userGroupId, userIds);
77      }
78  
79      public static com.liferay.portal.model.User addUser(long companyId,
80          boolean autoPassword, java.lang.String password1,
81          java.lang.String password2, boolean autoScreenName,
82          java.lang.String screenName, java.lang.String emailAddress,
83          java.lang.String openId, java.util.Locale locale,
84          java.lang.String firstName, java.lang.String middleName,
85          java.lang.String lastName, int prefixId, int suffixId, boolean male,
86          int birthdayMonth, int birthdayDay, int birthdayYear,
87          java.lang.String jobTitle, long[] groupIds, long[] organizationIds,
88          long[] roleIds, long[] userGroupIds, boolean sendEmail,
89          com.liferay.portal.service.ServiceContext serviceContext)
90          throws com.liferay.portal.PortalException,
91              com.liferay.portal.SystemException {
92          return getService()
93                     .addUser(companyId, autoPassword, password1, password2,
94              autoScreenName, screenName, emailAddress, openId, locale,
95              firstName, middleName, lastName, prefixId, suffixId, male,
96              birthdayMonth, birthdayDay, birthdayYear, jobTitle, groupIds,
97              organizationIds, roleIds, userGroupIds, sendEmail, serviceContext);
98      }
99  
100     public static com.liferay.portal.model.User addUser(long companyId,
101         boolean autoPassword, java.lang.String password1,
102         java.lang.String password2, boolean autoScreenName,
103         java.lang.String screenName, java.lang.String emailAddress,
104         java.lang.String openId, java.util.Locale locale,
105         java.lang.String firstName, java.lang.String middleName,
106         java.lang.String lastName, int prefixId, int suffixId, boolean male,
107         int birthdayMonth, int birthdayDay, int birthdayYear,
108         java.lang.String jobTitle, long[] groupIds, long[] organizationIds,
109         long[] roleIds, long[] userGroupIds, boolean sendEmail,
110         java.util.List<com.liferay.portal.model.Address> addresses,
111         java.util.List<com.liferay.portal.model.EmailAddress> emailAddresses,
112         java.util.List<com.liferay.portal.model.Phone> phones,
113         java.util.List<com.liferay.portal.model.Website> websites,
114         java.util.List<com.liferay.portlet.announcements.model.AnnouncementsDelivery> announcementsDelivers,
115         com.liferay.portal.service.ServiceContext serviceContext)
116         throws com.liferay.portal.PortalException,
117             com.liferay.portal.SystemException {
118         return getService()
119                    .addUser(companyId, autoPassword, password1, password2,
120             autoScreenName, screenName, emailAddress, openId, locale,
121             firstName, middleName, lastName, prefixId, suffixId, male,
122             birthdayMonth, birthdayDay, birthdayYear, jobTitle, groupIds,
123             organizationIds, roleIds, userGroupIds, sendEmail, addresses,
124             emailAddresses, phones, websites, announcementsDelivers,
125             serviceContext);
126     }
127 
128     public static void deletePortrait(long userId)
129         throws com.liferay.portal.PortalException,
130             com.liferay.portal.SystemException {
131         getService().deletePortrait(userId);
132     }
133 
134     public static void deleteRoleUser(long roleId, long userId)
135         throws com.liferay.portal.PortalException,
136             com.liferay.portal.SystemException {
137         getService().deleteRoleUser(roleId, userId);
138     }
139 
140     public static void deleteUser(long userId)
141         throws com.liferay.portal.PortalException,
142             com.liferay.portal.SystemException {
143         getService().deleteUser(userId);
144     }
145 
146     public static long getDefaultUserId(long companyId)
147         throws com.liferay.portal.PortalException,
148             com.liferay.portal.SystemException {
149         return getService().getDefaultUserId(companyId);
150     }
151 
152     public static long[] getGroupUserIds(long groupId)
153         throws com.liferay.portal.SystemException {
154         return getService().getGroupUserIds(groupId);
155     }
156 
157     public static long[] getOrganizationUserIds(long organizationId)
158         throws com.liferay.portal.SystemException {
159         return getService().getOrganizationUserIds(organizationId);
160     }
161 
162     public static long[] getRoleUserIds(long roleId)
163         throws com.liferay.portal.SystemException {
164         return getService().getRoleUserIds(roleId);
165     }
166 
167     public static com.liferay.portal.model.User getUserByEmailAddress(
168         long companyId, java.lang.String emailAddress)
169         throws com.liferay.portal.PortalException,
170             com.liferay.portal.SystemException {
171         return getService().getUserByEmailAddress(companyId, emailAddress);
172     }
173 
174     public static com.liferay.portal.model.User getUserById(long userId)
175         throws com.liferay.portal.PortalException,
176             com.liferay.portal.SystemException {
177         return getService().getUserById(userId);
178     }
179 
180     public static com.liferay.portal.model.User getUserByScreenName(
181         long companyId, java.lang.String screenName)
182         throws com.liferay.portal.PortalException,
183             com.liferay.portal.SystemException {
184         return getService().getUserByScreenName(companyId, screenName);
185     }
186 
187     public static long getUserIdByEmailAddress(long companyId,
188         java.lang.String emailAddress)
189         throws com.liferay.portal.PortalException,
190             com.liferay.portal.SystemException {
191         return getService().getUserIdByEmailAddress(companyId, emailAddress);
192     }
193 
194     public static long getUserIdByScreenName(long companyId,
195         java.lang.String screenName)
196         throws com.liferay.portal.PortalException,
197             com.liferay.portal.SystemException {
198         return getService().getUserIdByScreenName(companyId, screenName);
199     }
200 
201     public static boolean hasGroupUser(long groupId, long userId)
202         throws com.liferay.portal.SystemException {
203         return getService().hasGroupUser(groupId, userId);
204     }
205 
206     public static boolean hasRoleUser(long roleId, long userId)
207         throws com.liferay.portal.SystemException {
208         return getService().hasRoleUser(roleId, userId);
209     }
210 
211     public static void setRoleUsers(long roleId, long[] userIds)
212         throws com.liferay.portal.PortalException,
213             com.liferay.portal.SystemException {
214         getService().setRoleUsers(roleId, userIds);
215     }
216 
217     public static void setUserGroupUsers(long userGroupId, long[] userIds)
218         throws com.liferay.portal.PortalException,
219             com.liferay.portal.SystemException {
220         getService().setUserGroupUsers(userGroupId, userIds);
221     }
222 
223     public static void unsetGroupUsers(long groupId, long[] userIds)
224         throws com.liferay.portal.PortalException,
225             com.liferay.portal.SystemException {
226         getService().unsetGroupUsers(groupId, userIds);
227     }
228 
229     public static void unsetOrganizationUsers(long organizationId,
230         long[] userIds)
231         throws com.liferay.portal.PortalException,
232             com.liferay.portal.SystemException {
233         getService().unsetOrganizationUsers(organizationId, userIds);
234     }
235 
236     public static void unsetPasswordPolicyUsers(long passwordPolicyId,
237         long[] userIds)
238         throws com.liferay.portal.PortalException,
239             com.liferay.portal.SystemException {
240         getService().unsetPasswordPolicyUsers(passwordPolicyId, userIds);
241     }
242 
243     public static void unsetRoleUsers(long roleId, long[] userIds)
244         throws com.liferay.portal.PortalException,
245             com.liferay.portal.SystemException {
246         getService().unsetRoleUsers(roleId, userIds);
247     }
248 
249     public static void unsetUserGroupUsers(long userGroupId, long[] userIds)
250         throws com.liferay.portal.PortalException,
251             com.liferay.portal.SystemException {
252         getService().unsetUserGroupUsers(userGroupId, userIds);
253     }
254 
255     public static com.liferay.portal.model.User updateActive(long userId,
256         boolean active)
257         throws com.liferay.portal.PortalException,
258             com.liferay.portal.SystemException {
259         return getService().updateActive(userId, active);
260     }
261 
262     public static com.liferay.portal.model.User updateAgreedToTermsOfUse(
263         long userId, boolean agreedToTermsOfUse)
264         throws com.liferay.portal.PortalException,
265             com.liferay.portal.SystemException {
266         return getService().updateAgreedToTermsOfUse(userId, agreedToTermsOfUse);
267     }
268 
269     public static void updateEmailAddress(long userId,
270         java.lang.String password, java.lang.String emailAddress1,
271         java.lang.String emailAddress2)
272         throws com.liferay.portal.PortalException,
273             com.liferay.portal.SystemException {
274         getService()
275             .updateEmailAddress(userId, password, emailAddress1, emailAddress2);
276     }
277 
278     public static com.liferay.portal.model.User updateLockout(long userId,
279         boolean lockout)
280         throws com.liferay.portal.PortalException,
281             com.liferay.portal.SystemException {
282         return getService().updateLockout(userId, lockout);
283     }
284 
285     public static void updateOpenId(long userId, java.lang.String openId)
286         throws com.liferay.portal.PortalException,
287             com.liferay.portal.SystemException {
288         getService().updateOpenId(userId, openId);
289     }
290 
291     public static void updateOrganizations(long userId, long[] organizationIds)
292         throws com.liferay.portal.PortalException,
293             com.liferay.portal.SystemException {
294         getService().updateOrganizations(userId, organizationIds);
295     }
296 
297     public static com.liferay.portal.model.User updatePassword(long userId,
298         java.lang.String password1, java.lang.String password2,
299         boolean passwordReset)
300         throws com.liferay.portal.PortalException,
301             com.liferay.portal.SystemException {
302         return getService()
303                    .updatePassword(userId, password1, password2, passwordReset);
304     }
305 
306     public static void updatePortrait(long userId, byte[] bytes)
307         throws com.liferay.portal.PortalException,
308             com.liferay.portal.SystemException {
309         getService().updatePortrait(userId, bytes);
310     }
311 
312     public static void updateReminderQuery(long userId,
313         java.lang.String question, java.lang.String answer)
314         throws com.liferay.portal.PortalException,
315             com.liferay.portal.SystemException {
316         getService().updateReminderQuery(userId, question, answer);
317     }
318 
319     public static void updateScreenName(long userId, java.lang.String screenName)
320         throws com.liferay.portal.PortalException,
321             com.liferay.portal.SystemException {
322         getService().updateScreenName(userId, screenName);
323     }
324 
325     public static com.liferay.portal.model.User updateUser(long userId,
326         java.lang.String oldPassword, java.lang.String newPassword1,
327         java.lang.String newPassword2, boolean passwordReset,
328         java.lang.String reminderQueryQuestion,
329         java.lang.String reminderQueryAnswer, java.lang.String screenName,
330         java.lang.String emailAddress, java.lang.String openId,
331         java.lang.String languageId, java.lang.String timeZoneId,
332         java.lang.String greeting, java.lang.String comments,
333         java.lang.String firstName, java.lang.String middleName,
334         java.lang.String lastName, int prefixId, int suffixId, boolean male,
335         int birthdayMonth, int birthdayDay, int birthdayYear,
336         java.lang.String smsSn, java.lang.String aimSn,
337         java.lang.String facebookSn, java.lang.String icqSn,
338         java.lang.String jabberSn, java.lang.String msnSn,
339         java.lang.String mySpaceSn, java.lang.String skypeSn,
340         java.lang.String twitterSn, java.lang.String ymSn,
341         java.lang.String jobTitle, long[] groupIds, long[] organizationIds,
342         long[] roleIds,
343         java.util.List<com.liferay.portal.model.UserGroupRole> userGroupRoles,
344         long[] userGroupIds,
345         com.liferay.portal.service.ServiceContext serviceContext)
346         throws com.liferay.portal.PortalException,
347             com.liferay.portal.SystemException {
348         return getService()
349                    .updateUser(userId, oldPassword, newPassword1, newPassword2,
350             passwordReset, reminderQueryQuestion, reminderQueryAnswer,
351             screenName, emailAddress, openId, languageId, timeZoneId, greeting,
352             comments, firstName, middleName, lastName, prefixId, suffixId,
353             male, birthdayMonth, birthdayDay, birthdayYear, smsSn, aimSn,
354             facebookSn, icqSn, jabberSn, msnSn, mySpaceSn, skypeSn, twitterSn,
355             ymSn, jobTitle, groupIds, organizationIds, roleIds, userGroupRoles,
356             userGroupIds, serviceContext);
357     }
358 
359     public static com.liferay.portal.model.User updateUser(long userId,
360         java.lang.String oldPassword, java.lang.String newPassword1,
361         java.lang.String newPassword2, boolean passwordReset,
362         java.lang.String reminderQueryQuestion,
363         java.lang.String reminderQueryAnswer, java.lang.String screenName,
364         java.lang.String emailAddress, java.lang.String openId,
365         java.lang.String languageId, java.lang.String timeZoneId,
366         java.lang.String greeting, java.lang.String comments,
367         java.lang.String firstName, java.lang.String middleName,
368         java.lang.String lastName, int prefixId, int suffixId, boolean male,
369         int birthdayMonth, int birthdayDay, int birthdayYear,
370         java.lang.String smsSn, java.lang.String aimSn,
371         java.lang.String facebookSn, java.lang.String icqSn,
372         java.lang.String jabberSn, java.lang.String msnSn,
373         java.lang.String mySpaceSn, java.lang.String skypeSn,
374         java.lang.String twitterSn, java.lang.String ymSn,
375         java.lang.String jobTitle, long[] groupIds, long[] organizationIds,
376         long[] roleIds,
377         java.util.List<com.liferay.portal.model.UserGroupRole> userGroupRoles,
378         long[] userGroupIds,
379         java.util.List<com.liferay.portal.model.Address> addresses,
380         java.util.List<com.liferay.portal.model.EmailAddress> emailAddresses,
381         java.util.List<com.liferay.portal.model.Phone> phones,
382         java.util.List<com.liferay.portal.model.Website> websites,
383         java.util.List<com.liferay.portlet.announcements.model.AnnouncementsDelivery> announcementsDelivers,
384         com.liferay.portal.service.ServiceContext serviceContext)
385         throws com.liferay.portal.PortalException,
386             com.liferay.portal.SystemException {
387         return getService()
388                    .updateUser(userId, oldPassword, newPassword1, newPassword2,
389             passwordReset, reminderQueryQuestion, reminderQueryAnswer,
390             screenName, emailAddress, openId, languageId, timeZoneId, greeting,
391             comments, firstName, middleName, lastName, prefixId, suffixId,
392             male, birthdayMonth, birthdayDay, birthdayYear, smsSn, aimSn,
393             facebookSn, icqSn, jabberSn, msnSn, mySpaceSn, skypeSn, twitterSn,
394             ymSn, jobTitle, groupIds, organizationIds, roleIds, userGroupRoles,
395             userGroupIds, addresses, emailAddresses, phones, websites,
396             announcementsDelivers, serviceContext);
397     }
398 
399     public static UserService getService() {
400         if (_service == null) {
401             throw new RuntimeException("UserService is not set");
402         }
403 
404         return _service;
405     }
406 
407     public void setService(UserService service) {
408         _service = service;
409     }
410 
411     private static UserService _service;
412 }