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 void setRoleUsers(long roleId, long[] userIds)
172         throws com.liferay.portal.PortalException,
173             com.liferay.portal.SystemException, java.rmi.RemoteException {
174         getService().setRoleUsers(roleId, userIds);
175     }
176 
177     public static void setUserGroupUsers(long userGroupId, long[] userIds)
178         throws com.liferay.portal.PortalException,
179             com.liferay.portal.SystemException, java.rmi.RemoteException {
180         getService().setUserGroupUsers(userGroupId, userIds);
181     }
182 
183     public static void unsetGroupUsers(long groupId, long[] userIds)
184         throws com.liferay.portal.PortalException,
185             com.liferay.portal.SystemException, java.rmi.RemoteException {
186         getService().unsetGroupUsers(groupId, userIds);
187     }
188 
189     public static void unsetOrganizationUsers(long organizationId,
190         long[] userIds)
191         throws com.liferay.portal.PortalException,
192             com.liferay.portal.SystemException, java.rmi.RemoteException {
193         getService().unsetOrganizationUsers(organizationId, userIds);
194     }
195 
196     public static void unsetPasswordPolicyUsers(long passwordPolicyId,
197         long[] userIds)
198         throws com.liferay.portal.PortalException,
199             com.liferay.portal.SystemException, java.rmi.RemoteException {
200         getService().unsetPasswordPolicyUsers(passwordPolicyId, userIds);
201     }
202 
203     public static void unsetRoleUsers(long roleId, long[] userIds)
204         throws com.liferay.portal.PortalException,
205             com.liferay.portal.SystemException, java.rmi.RemoteException {
206         getService().unsetRoleUsers(roleId, userIds);
207     }
208 
209     public static void unsetUserGroupUsers(long userGroupId, long[] userIds)
210         throws com.liferay.portal.PortalException,
211             com.liferay.portal.SystemException, java.rmi.RemoteException {
212         getService().unsetUserGroupUsers(userGroupId, userIds);
213     }
214 
215     public static com.liferay.portal.model.User updateActive(long userId,
216         boolean active)
217         throws com.liferay.portal.PortalException,
218             com.liferay.portal.SystemException, java.rmi.RemoteException {
219         return getService().updateActive(userId, active);
220     }
221 
222     public static com.liferay.portal.model.User updateAgreedToTermsOfUse(
223         long userId, boolean agreedToTermsOfUse)
224         throws com.liferay.portal.PortalException,
225             com.liferay.portal.SystemException, java.rmi.RemoteException {
226         return getService().updateAgreedToTermsOfUse(userId, agreedToTermsOfUse);
227     }
228 
229     public static com.liferay.portal.model.User updateLockout(long userId,
230         boolean lockout)
231         throws com.liferay.portal.PortalException,
232             com.liferay.portal.SystemException, java.rmi.RemoteException {
233         return getService().updateLockout(userId, lockout);
234     }
235 
236     public static void updateOpenId(long userId, java.lang.String openId)
237         throws com.liferay.portal.PortalException,
238             com.liferay.portal.SystemException, java.rmi.RemoteException {
239         getService().updateOpenId(userId, openId);
240     }
241 
242     public static void updateOrganizations(long userId, long[] organizationIds)
243         throws com.liferay.portal.PortalException,
244             com.liferay.portal.SystemException, java.rmi.RemoteException {
245         getService().updateOrganizations(userId, organizationIds);
246     }
247 
248     public static com.liferay.portal.model.User updatePassword(long userId,
249         java.lang.String password1, java.lang.String password2,
250         boolean passwordReset)
251         throws com.liferay.portal.PortalException,
252             com.liferay.portal.SystemException, java.rmi.RemoteException {
253         return getService()
254                    .updatePassword(userId, password1, password2, passwordReset);
255     }
256 
257     public static void updatePortrait(long userId, byte[] bytes)
258         throws com.liferay.portal.PortalException,
259             com.liferay.portal.SystemException, java.rmi.RemoteException {
260         getService().updatePortrait(userId, bytes);
261     }
262 
263     public static void updateScreenName(long userId, java.lang.String screenName)
264         throws com.liferay.portal.PortalException,
265             com.liferay.portal.SystemException, java.rmi.RemoteException {
266         getService().updateScreenName(userId, screenName);
267     }
268 
269     public static com.liferay.portal.model.User updateUser(long userId,
270         java.lang.String oldPassword, boolean passwordReset,
271         java.lang.String screenName, java.lang.String emailAddress,
272         java.lang.String languageId, java.lang.String timeZoneId,
273         java.lang.String greeting, java.lang.String comments,
274         java.lang.String firstName, java.lang.String middleName,
275         java.lang.String lastName, int prefixId, int suffixId, boolean male,
276         int birthdayMonth, int birthdayDay, int birthdayYear,
277         java.lang.String smsSn, java.lang.String aimSn,
278         java.lang.String facebookSn, java.lang.String icqSn,
279         java.lang.String jabberSn, java.lang.String msnSn,
280         java.lang.String mySpaceSn, java.lang.String skypeSn,
281         java.lang.String twitterSn, java.lang.String ymSn,
282         java.lang.String jobTitle, long[] organizationIds)
283         throws com.liferay.portal.PortalException,
284             com.liferay.portal.SystemException, java.rmi.RemoteException {
285         return getService()
286                    .updateUser(userId, oldPassword, passwordReset, screenName,
287             emailAddress, languageId, timeZoneId, greeting, comments,
288             firstName, middleName, lastName, prefixId, suffixId, male,
289             birthdayMonth, birthdayDay, birthdayYear, smsSn, aimSn, facebookSn,
290             icqSn, jabberSn, msnSn, mySpaceSn, skypeSn, twitterSn, ymSn,
291             jobTitle, organizationIds);
292     }
293 
294     public static com.liferay.portal.model.User updateUser(long userId,
295         java.lang.String oldPassword, java.lang.String newPassword1,
296         java.lang.String newPassword2, boolean passwordReset,
297         java.lang.String screenName, java.lang.String emailAddress,
298         java.lang.String languageId, java.lang.String timeZoneId,
299         java.lang.String greeting, java.lang.String comments,
300         java.lang.String firstName, java.lang.String middleName,
301         java.lang.String lastName, int prefixId, int suffixId, boolean male,
302         int birthdayMonth, int birthdayDay, int birthdayYear,
303         java.lang.String smsSn, java.lang.String aimSn,
304         java.lang.String facebookSn, java.lang.String icqSn,
305         java.lang.String jabberSn, java.lang.String msnSn,
306         java.lang.String mySpaceSn, java.lang.String skypeSn,
307         java.lang.String twitterSn, java.lang.String ymSn,
308         java.lang.String jobTitle, long[] organizationIds)
309         throws com.liferay.portal.PortalException,
310             com.liferay.portal.SystemException, java.rmi.RemoteException {
311         return getService()
312                    .updateUser(userId, oldPassword, newPassword1, newPassword2,
313             passwordReset, screenName, emailAddress, languageId, timeZoneId,
314             greeting, comments, firstName, middleName, lastName, prefixId,
315             suffixId, male, birthdayMonth, birthdayDay, birthdayYear, smsSn,
316             aimSn, facebookSn, icqSn, jabberSn, msnSn, mySpaceSn, skypeSn,
317             twitterSn, ymSn, jobTitle, organizationIds);
318     }
319 
320     public static UserService getService() {
321         if (_service == null) {
322             throw new RuntimeException("UserService is not set");
323         }
324 
325         return _service;
326     }
327 
328     public void setService(UserService service) {
329         _service = service;
330     }
331 
332     private static UserService _service;
333 }