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