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