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