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 boolean hasRoleUser(long companyId, java.lang.String name,
212         long userId, boolean inherited)
213         throws com.liferay.portal.PortalException,
214             com.liferay.portal.SystemException {
215         return getService().hasRoleUser(companyId, name, userId, inherited);
216     }
217 
218     public static void setRoleUsers(long roleId, long[] userIds)
219         throws com.liferay.portal.PortalException,
220             com.liferay.portal.SystemException {
221         getService().setRoleUsers(roleId, userIds);
222     }
223 
224     public static void setUserGroupUsers(long userGroupId, long[] userIds)
225         throws com.liferay.portal.PortalException,
226             com.liferay.portal.SystemException {
227         getService().setUserGroupUsers(userGroupId, userIds);
228     }
229 
230     public static void unsetGroupUsers(long groupId, long[] userIds)
231         throws com.liferay.portal.PortalException,
232             com.liferay.portal.SystemException {
233         getService().unsetGroupUsers(groupId, userIds);
234     }
235 
236     public static void unsetOrganizationUsers(long organizationId,
237         long[] userIds)
238         throws com.liferay.portal.PortalException,
239             com.liferay.portal.SystemException {
240         getService().unsetOrganizationUsers(organizationId, userIds);
241     }
242 
243     public static void unsetPasswordPolicyUsers(long passwordPolicyId,
244         long[] userIds)
245         throws com.liferay.portal.PortalException,
246             com.liferay.portal.SystemException {
247         getService().unsetPasswordPolicyUsers(passwordPolicyId, userIds);
248     }
249 
250     public static void unsetRoleUsers(long roleId, long[] userIds)
251         throws com.liferay.portal.PortalException,
252             com.liferay.portal.SystemException {
253         getService().unsetRoleUsers(roleId, userIds);
254     }
255 
256     public static void unsetUserGroupUsers(long userGroupId, long[] userIds)
257         throws com.liferay.portal.PortalException,
258             com.liferay.portal.SystemException {
259         getService().unsetUserGroupUsers(userGroupId, userIds);
260     }
261 
262     public static com.liferay.portal.model.User updateActive(long userId,
263         boolean active)
264         throws com.liferay.portal.PortalException,
265             com.liferay.portal.SystemException {
266         return getService().updateActive(userId, active);
267     }
268 
269     public static com.liferay.portal.model.User updateAgreedToTermsOfUse(
270         long userId, boolean agreedToTermsOfUse)
271         throws com.liferay.portal.PortalException,
272             com.liferay.portal.SystemException {
273         return getService().updateAgreedToTermsOfUse(userId, agreedToTermsOfUse);
274     }
275 
276     public static void updateEmailAddress(long userId,
277         java.lang.String password, java.lang.String emailAddress1,
278         java.lang.String emailAddress2)
279         throws com.liferay.portal.PortalException,
280             com.liferay.portal.SystemException {
281         getService()
282             .updateEmailAddress(userId, password, emailAddress1, emailAddress2);
283     }
284 
285     public static com.liferay.portal.model.User updateLockout(long userId,
286         boolean lockout)
287         throws com.liferay.portal.PortalException,
288             com.liferay.portal.SystemException {
289         return getService().updateLockout(userId, lockout);
290     }
291 
292     public static void updateOpenId(long userId, java.lang.String openId)
293         throws com.liferay.portal.PortalException,
294             com.liferay.portal.SystemException {
295         getService().updateOpenId(userId, openId);
296     }
297 
298     public static void updateOrganizations(long userId, long[] organizationIds)
299         throws com.liferay.portal.PortalException,
300             com.liferay.portal.SystemException {
301         getService().updateOrganizations(userId, organizationIds);
302     }
303 
304     public static com.liferay.portal.model.User updatePassword(long userId,
305         java.lang.String password1, java.lang.String password2,
306         boolean passwordReset)
307         throws com.liferay.portal.PortalException,
308             com.liferay.portal.SystemException {
309         return getService()
310                    .updatePassword(userId, password1, password2, passwordReset);
311     }
312 
313     public static void updatePortrait(long userId, byte[] bytes)
314         throws com.liferay.portal.PortalException,
315             com.liferay.portal.SystemException {
316         getService().updatePortrait(userId, bytes);
317     }
318 
319     public static void updateReminderQuery(long userId,
320         java.lang.String question, java.lang.String answer)
321         throws com.liferay.portal.PortalException,
322             com.liferay.portal.SystemException {
323         getService().updateReminderQuery(userId, question, answer);
324     }
325 
326     public static void updateScreenName(long userId, java.lang.String screenName)
327         throws com.liferay.portal.PortalException,
328             com.liferay.portal.SystemException {
329         getService().updateScreenName(userId, screenName);
330     }
331 
332     public static com.liferay.portal.model.User updateUser(long userId,
333         java.lang.String oldPassword, java.lang.String newPassword1,
334         java.lang.String newPassword2, boolean passwordReset,
335         java.lang.String reminderQueryQuestion,
336         java.lang.String reminderQueryAnswer, java.lang.String screenName,
337         java.lang.String emailAddress, java.lang.String openId,
338         java.lang.String languageId, java.lang.String timeZoneId,
339         java.lang.String greeting, java.lang.String comments,
340         java.lang.String firstName, java.lang.String middleName,
341         java.lang.String lastName, int prefixId, int suffixId, boolean male,
342         int birthdayMonth, int birthdayDay, int birthdayYear,
343         java.lang.String smsSn, java.lang.String aimSn,
344         java.lang.String facebookSn, java.lang.String icqSn,
345         java.lang.String jabberSn, java.lang.String msnSn,
346         java.lang.String mySpaceSn, java.lang.String skypeSn,
347         java.lang.String twitterSn, java.lang.String ymSn,
348         java.lang.String jobTitle, long[] groupIds, long[] organizationIds,
349         long[] roleIds,
350         java.util.List<com.liferay.portal.model.UserGroupRole> userGroupRoles,
351         long[] userGroupIds,
352         com.liferay.portal.service.ServiceContext serviceContext)
353         throws com.liferay.portal.PortalException,
354             com.liferay.portal.SystemException {
355         return getService()
356                    .updateUser(userId, oldPassword, newPassword1, newPassword2,
357             passwordReset, reminderQueryQuestion, reminderQueryAnswer,
358             screenName, emailAddress, openId, languageId, timeZoneId, greeting,
359             comments, firstName, middleName, lastName, prefixId, suffixId,
360             male, birthdayMonth, birthdayDay, birthdayYear, smsSn, aimSn,
361             facebookSn, icqSn, jabberSn, msnSn, mySpaceSn, skypeSn, twitterSn,
362             ymSn, jobTitle, groupIds, organizationIds, roleIds, userGroupRoles,
363             userGroupIds, serviceContext);
364     }
365 
366     public static com.liferay.portal.model.User updateUser(long userId,
367         java.lang.String oldPassword, java.lang.String newPassword1,
368         java.lang.String newPassword2, boolean passwordReset,
369         java.lang.String reminderQueryQuestion,
370         java.lang.String reminderQueryAnswer, java.lang.String screenName,
371         java.lang.String emailAddress, java.lang.String openId,
372         java.lang.String languageId, java.lang.String timeZoneId,
373         java.lang.String greeting, java.lang.String comments,
374         java.lang.String firstName, java.lang.String middleName,
375         java.lang.String lastName, int prefixId, int suffixId, boolean male,
376         int birthdayMonth, int birthdayDay, int birthdayYear,
377         java.lang.String smsSn, java.lang.String aimSn,
378         java.lang.String facebookSn, java.lang.String icqSn,
379         java.lang.String jabberSn, java.lang.String msnSn,
380         java.lang.String mySpaceSn, java.lang.String skypeSn,
381         java.lang.String twitterSn, java.lang.String ymSn,
382         java.lang.String jobTitle, long[] groupIds, long[] organizationIds,
383         long[] roleIds,
384         java.util.List<com.liferay.portal.model.UserGroupRole> userGroupRoles,
385         long[] userGroupIds,
386         java.util.List<com.liferay.portal.model.Address> addresses,
387         java.util.List<com.liferay.portal.model.EmailAddress> emailAddresses,
388         java.util.List<com.liferay.portal.model.Phone> phones,
389         java.util.List<com.liferay.portal.model.Website> websites,
390         java.util.List<com.liferay.portlet.announcements.model.AnnouncementsDelivery> announcementsDelivers,
391         com.liferay.portal.service.ServiceContext serviceContext)
392         throws com.liferay.portal.PortalException,
393             com.liferay.portal.SystemException {
394         return getService()
395                    .updateUser(userId, oldPassword, newPassword1, newPassword2,
396             passwordReset, reminderQueryQuestion, reminderQueryAnswer,
397             screenName, emailAddress, openId, languageId, timeZoneId, greeting,
398             comments, firstName, middleName, lastName, prefixId, suffixId,
399             male, birthdayMonth, birthdayDay, birthdayYear, smsSn, aimSn,
400             facebookSn, icqSn, jabberSn, msnSn, mySpaceSn, skypeSn, twitterSn,
401             ymSn, jobTitle, groupIds, organizationIds, roleIds, userGroupRoles,
402             userGroupIds, addresses, emailAddresses, phones, websites,
403             announcementsDelivers, serviceContext);
404     }
405 
406     public static UserService getService() {
407         if (_service == null) {
408             throw new RuntimeException("UserService is not set");
409         }
410 
411         return _service;
412     }
413 
414     public void setService(UserService service) {
415         _service = service;
416     }
417 
418     private static UserService _service;
419 }