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, java.rmi.RemoteException {
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, java.rmi.RemoteException {
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, java.rmi.RemoteException {
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, java.rmi.RemoteException {
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, java.rmi.RemoteException {
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.util.Locale locale, java.lang.String firstName,
84          java.lang.String middleName, java.lang.String lastName, int prefixId,
85          int suffixId, boolean male, int birthdayMonth, int birthdayDay,
86          int birthdayYear, java.lang.String jobTitle, long[] organizationIds,
87          boolean sendEmail)
88          throws com.liferay.portal.PortalException,
89              com.liferay.portal.SystemException, java.rmi.RemoteException {
90          return getService()
91                     .addUser(companyId, autoPassword, password1, password2,
92              autoScreenName, screenName, emailAddress, locale, firstName,
93              middleName, lastName, prefixId, suffixId, male, birthdayMonth,
94              birthdayDay, birthdayYear, jobTitle, organizationIds, sendEmail);
95      }
96  
97      public static void deleteRoleUser(long roleId, long userId)
98          throws com.liferay.portal.PortalException,
99              com.liferay.portal.SystemException, java.rmi.RemoteException {
100         getService().deleteRoleUser(roleId, userId);
101     }
102 
103     public static void deleteUser(long userId)
104         throws com.liferay.portal.PortalException,
105             com.liferay.portal.SystemException, java.rmi.RemoteException {
106         getService().deleteUser(userId);
107     }
108 
109     public static long getDefaultUserId(long companyId)
110         throws com.liferay.portal.PortalException,
111             com.liferay.portal.SystemException, java.rmi.RemoteException {
112         return getService().getDefaultUserId(companyId);
113     }
114 
115     public static long[] getGroupUserIds(long groupId)
116         throws com.liferay.portal.SystemException, java.rmi.RemoteException {
117         return getService().getGroupUserIds(groupId);
118     }
119 
120     public static long[] getOrganizationUserIds(long organizationId)
121         throws com.liferay.portal.SystemException, java.rmi.RemoteException {
122         return getService().getOrganizationUserIds(organizationId);
123     }
124 
125     public static long[] getRoleUserIds(long roleId)
126         throws com.liferay.portal.SystemException, java.rmi.RemoteException {
127         return getService().getRoleUserIds(roleId);
128     }
129 
130     public static com.liferay.portal.model.User getUserByEmailAddress(
131         long companyId, java.lang.String emailAddress)
132         throws com.liferay.portal.PortalException,
133             com.liferay.portal.SystemException, java.rmi.RemoteException {
134         return getService().getUserByEmailAddress(companyId, emailAddress);
135     }
136 
137     public static com.liferay.portal.model.User getUserById(long userId)
138         throws com.liferay.portal.PortalException,
139             com.liferay.portal.SystemException, java.rmi.RemoteException {
140         return getService().getUserById(userId);
141     }
142 
143     public static com.liferay.portal.model.User getUserByScreenName(
144         long companyId, java.lang.String screenName)
145         throws com.liferay.portal.PortalException,
146             com.liferay.portal.SystemException, java.rmi.RemoteException {
147         return getService().getUserByScreenName(companyId, screenName);
148     }
149 
150     public static long getUserIdByEmailAddress(long companyId,
151         java.lang.String emailAddress)
152         throws com.liferay.portal.PortalException,
153             com.liferay.portal.SystemException, java.rmi.RemoteException {
154         return getService().getUserIdByEmailAddress(companyId, emailAddress);
155     }
156 
157     public static long getUserIdByScreenName(long companyId,
158         java.lang.String screenName)
159         throws com.liferay.portal.PortalException,
160             com.liferay.portal.SystemException, java.rmi.RemoteException {
161         return getService().getUserIdByScreenName(companyId, screenName);
162     }
163 
164     public static boolean hasGroupUser(long groupId, long userId)
165         throws com.liferay.portal.SystemException, java.rmi.RemoteException {
166         return getService().hasGroupUser(groupId, userId);
167     }
168 
169     public static boolean hasRoleUser(long roleId, long userId)
170         throws com.liferay.portal.SystemException, java.rmi.RemoteException {
171         return getService().hasRoleUser(roleId, userId);
172     }
173 
174     public static boolean hasRoleUser(long companyId, java.lang.String name,
175         long userId, boolean inherited)
176         throws com.liferay.portal.PortalException,
177             com.liferay.portal.SystemException, java.rmi.RemoteException {
178         return getService().hasRoleUser(companyId, name, userId, inherited);
179     }
180 
181     public static void setRoleUsers(long roleId, long[] userIds)
182         throws com.liferay.portal.PortalException,
183             com.liferay.portal.SystemException, java.rmi.RemoteException {
184         getService().setRoleUsers(roleId, userIds);
185     }
186 
187     public static void setUserGroupUsers(long userGroupId, long[] userIds)
188         throws com.liferay.portal.PortalException,
189             com.liferay.portal.SystemException, java.rmi.RemoteException {
190         getService().setUserGroupUsers(userGroupId, userIds);
191     }
192 
193     public static void unsetGroupUsers(long groupId, long[] userIds)
194         throws com.liferay.portal.PortalException,
195             com.liferay.portal.SystemException, java.rmi.RemoteException {
196         getService().unsetGroupUsers(groupId, userIds);
197     }
198 
199     public static void unsetOrganizationUsers(long organizationId,
200         long[] userIds)
201         throws com.liferay.portal.PortalException,
202             com.liferay.portal.SystemException, java.rmi.RemoteException {
203         getService().unsetOrganizationUsers(organizationId, userIds);
204     }
205 
206     public static void unsetPasswordPolicyUsers(long passwordPolicyId,
207         long[] userIds)
208         throws com.liferay.portal.PortalException,
209             com.liferay.portal.SystemException, java.rmi.RemoteException {
210         getService().unsetPasswordPolicyUsers(passwordPolicyId, userIds);
211     }
212 
213     public static void unsetRoleUsers(long roleId, long[] userIds)
214         throws com.liferay.portal.PortalException,
215             com.liferay.portal.SystemException, java.rmi.RemoteException {
216         getService().unsetRoleUsers(roleId, userIds);
217     }
218 
219     public static void unsetUserGroupUsers(long userGroupId, long[] userIds)
220         throws com.liferay.portal.PortalException,
221             com.liferay.portal.SystemException, java.rmi.RemoteException {
222         getService().unsetUserGroupUsers(userGroupId, userIds);
223     }
224 
225     public static com.liferay.portal.model.User updateActive(long userId,
226         boolean active)
227         throws com.liferay.portal.PortalException,
228             com.liferay.portal.SystemException, java.rmi.RemoteException {
229         return getService().updateActive(userId, active);
230     }
231 
232     public static com.liferay.portal.model.User updateAgreedToTermsOfUse(
233         long userId, boolean agreedToTermsOfUse)
234         throws com.liferay.portal.PortalException,
235             com.liferay.portal.SystemException, java.rmi.RemoteException {
236         return getService().updateAgreedToTermsOfUse(userId, agreedToTermsOfUse);
237     }
238 
239     public static com.liferay.portal.model.User updateLockout(long userId,
240         boolean lockout)
241         throws com.liferay.portal.PortalException,
242             com.liferay.portal.SystemException, java.rmi.RemoteException {
243         return getService().updateLockout(userId, lockout);
244     }
245 
246     public static void updateOpenId(long userId, java.lang.String openId)
247         throws com.liferay.portal.PortalException,
248             com.liferay.portal.SystemException, java.rmi.RemoteException {
249         getService().updateOpenId(userId, openId);
250     }
251 
252     public static void updateOrganizations(long userId, long[] organizationIds)
253         throws com.liferay.portal.PortalException,
254             com.liferay.portal.SystemException, java.rmi.RemoteException {
255         getService().updateOrganizations(userId, organizationIds);
256     }
257 
258     public static com.liferay.portal.model.User updatePassword(long userId,
259         java.lang.String password1, java.lang.String password2,
260         boolean passwordReset)
261         throws com.liferay.portal.PortalException,
262             com.liferay.portal.SystemException, java.rmi.RemoteException {
263         return getService()
264                    .updatePassword(userId, password1, password2, passwordReset);
265     }
266 
267     public static void updatePortrait(long userId, byte[] bytes)
268         throws com.liferay.portal.PortalException,
269             com.liferay.portal.SystemException, java.rmi.RemoteException {
270         getService().updatePortrait(userId, bytes);
271     }
272 
273     public static void updateScreenName(long userId, java.lang.String screenName)
274         throws com.liferay.portal.PortalException,
275             com.liferay.portal.SystemException, java.rmi.RemoteException {
276         getService().updateScreenName(userId, screenName);
277     }
278 
279     public static com.liferay.portal.model.User updateUser(long userId,
280         java.lang.String oldPassword, boolean passwordReset,
281         java.lang.String screenName, java.lang.String emailAddress,
282         java.lang.String languageId, java.lang.String timeZoneId,
283         java.lang.String greeting, java.lang.String comments,
284         java.lang.String firstName, java.lang.String middleName,
285         java.lang.String lastName, int prefixId, int suffixId, boolean male,
286         int birthdayMonth, int birthdayDay, int birthdayYear,
287         java.lang.String smsSn, java.lang.String aimSn,
288         java.lang.String facebookSn, java.lang.String icqSn,
289         java.lang.String jabberSn, java.lang.String msnSn,
290         java.lang.String mySpaceSn, java.lang.String skypeSn,
291         java.lang.String twitterSn, java.lang.String ymSn,
292         java.lang.String jobTitle, long[] organizationIds)
293         throws com.liferay.portal.PortalException,
294             com.liferay.portal.SystemException, java.rmi.RemoteException {
295         return getService()
296                    .updateUser(userId, oldPassword, passwordReset, screenName,
297             emailAddress, languageId, timeZoneId, greeting, comments,
298             firstName, middleName, lastName, prefixId, suffixId, male,
299             birthdayMonth, birthdayDay, birthdayYear, smsSn, aimSn, facebookSn,
300             icqSn, jabberSn, msnSn, mySpaceSn, skypeSn, twitterSn, ymSn,
301             jobTitle, organizationIds);
302     }
303 
304     public static com.liferay.portal.model.User updateUser(long userId,
305         java.lang.String oldPassword, java.lang.String newPassword1,
306         java.lang.String newPassword2, boolean passwordReset,
307         java.lang.String screenName, java.lang.String emailAddress,
308         java.lang.String languageId, java.lang.String timeZoneId,
309         java.lang.String greeting, java.lang.String comments,
310         java.lang.String firstName, java.lang.String middleName,
311         java.lang.String lastName, int prefixId, int suffixId, boolean male,
312         int birthdayMonth, int birthdayDay, int birthdayYear,
313         java.lang.String smsSn, java.lang.String aimSn,
314         java.lang.String facebookSn, java.lang.String icqSn,
315         java.lang.String jabberSn, java.lang.String msnSn,
316         java.lang.String mySpaceSn, java.lang.String skypeSn,
317         java.lang.String twitterSn, java.lang.String ymSn,
318         java.lang.String jobTitle, long[] organizationIds)
319         throws com.liferay.portal.PortalException,
320             com.liferay.portal.SystemException, java.rmi.RemoteException {
321         return getService()
322                    .updateUser(userId, oldPassword, newPassword1, newPassword2,
323             passwordReset, screenName, emailAddress, languageId, timeZoneId,
324             greeting, comments, firstName, middleName, lastName, prefixId,
325             suffixId, male, birthdayMonth, birthdayDay, birthdayYear, smsSn,
326             aimSn, facebookSn, icqSn, jabberSn, msnSn, mySpaceSn, skypeSn,
327             twitterSn, ymSn, jobTitle, organizationIds);
328     }
329 
330     public static UserService getService() {
331         if (_service == null) {
332             throw new RuntimeException("UserService is not set");
333         }
334 
335         return _service;
336     }
337 
338     public void setService(UserService service) {
339         _service = service;
340     }
341 
342     private static UserService _service;
343 }