1
14
15 package com.liferay.portal.service;
16
17 import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
18 import com.liferay.portal.kernel.util.MethodCache;
19 import com.liferay.portal.kernel.util.ReferenceRegistry;
20
21
41 public class UserServiceUtil {
42 public static void addGroupUsers(long groupId, long[] userIds)
43 throws com.liferay.portal.PortalException,
44 com.liferay.portal.SystemException {
45 getService().addGroupUsers(groupId, userIds);
46 }
47
48 public static void addOrganizationUsers(long organizationId, long[] userIds)
49 throws com.liferay.portal.PortalException,
50 com.liferay.portal.SystemException {
51 getService().addOrganizationUsers(organizationId, userIds);
52 }
53
54 public static void addPasswordPolicyUsers(long passwordPolicyId,
55 long[] userIds)
56 throws com.liferay.portal.PortalException,
57 com.liferay.portal.SystemException {
58 getService().addPasswordPolicyUsers(passwordPolicyId, userIds);
59 }
60
61 public static void addRoleUsers(long roleId, long[] userIds)
62 throws com.liferay.portal.PortalException,
63 com.liferay.portal.SystemException {
64 getService().addRoleUsers(roleId, userIds);
65 }
66
67 public static void addUserGroupUsers(long userGroupId, long[] userIds)
68 throws com.liferay.portal.PortalException,
69 com.liferay.portal.SystemException {
70 getService().addUserGroupUsers(userGroupId, userIds);
71 }
72
73 public static com.liferay.portal.model.User addUser(long companyId,
74 boolean autoPassword, java.lang.String password1,
75 java.lang.String password2, boolean autoScreenName,
76 java.lang.String screenName, java.lang.String emailAddress,
77 java.lang.String openId, java.util.Locale locale,
78 java.lang.String firstName, java.lang.String middleName,
79 java.lang.String lastName, int prefixId, int suffixId, boolean male,
80 int birthdayMonth, int birthdayDay, int birthdayYear,
81 java.lang.String jobTitle, long[] groupIds, long[] organizationIds,
82 long[] roleIds, long[] userGroupIds, boolean sendEmail,
83 com.liferay.portal.service.ServiceContext serviceContext)
84 throws com.liferay.portal.PortalException,
85 com.liferay.portal.SystemException {
86 return getService()
87 .addUser(companyId, autoPassword, password1, password2,
88 autoScreenName, screenName, emailAddress, openId, locale,
89 firstName, middleName, lastName, prefixId, suffixId, male,
90 birthdayMonth, birthdayDay, birthdayYear, jobTitle, groupIds,
91 organizationIds, roleIds, userGroupIds, sendEmail, serviceContext);
92 }
93
94 public static com.liferay.portal.model.User addUser(long companyId,
95 boolean autoPassword, java.lang.String password1,
96 java.lang.String password2, boolean autoScreenName,
97 java.lang.String screenName, java.lang.String emailAddress,
98 java.lang.String openId, java.util.Locale locale,
99 java.lang.String firstName, java.lang.String middleName,
100 java.lang.String lastName, int prefixId, int suffixId, boolean male,
101 int birthdayMonth, int birthdayDay, int birthdayYear,
102 java.lang.String jobTitle, long[] groupIds, long[] organizationIds,
103 long[] roleIds, long[] userGroupIds, boolean sendEmail,
104 java.util.List<com.liferay.portal.model.Address> addresses,
105 java.util.List<com.liferay.portal.model.EmailAddress> emailAddresses,
106 java.util.List<com.liferay.portal.model.Phone> phones,
107 java.util.List<com.liferay.portal.model.Website> websites,
108 java.util.List<com.liferay.portlet.announcements.model.AnnouncementsDelivery> announcementsDelivers,
109 com.liferay.portal.service.ServiceContext serviceContext)
110 throws com.liferay.portal.PortalException,
111 com.liferay.portal.SystemException {
112 return getService()
113 .addUser(companyId, autoPassword, password1, password2,
114 autoScreenName, screenName, emailAddress, openId, locale,
115 firstName, middleName, lastName, prefixId, suffixId, male,
116 birthdayMonth, birthdayDay, birthdayYear, jobTitle, groupIds,
117 organizationIds, roleIds, userGroupIds, sendEmail, addresses,
118 emailAddresses, phones, websites, announcementsDelivers,
119 serviceContext);
120 }
121
122 public static void deletePortrait(long userId)
123 throws com.liferay.portal.PortalException,
124 com.liferay.portal.SystemException {
125 getService().deletePortrait(userId);
126 }
127
128 public static void deleteRoleUser(long roleId, long userId)
129 throws com.liferay.portal.PortalException,
130 com.liferay.portal.SystemException {
131 getService().deleteRoleUser(roleId, userId);
132 }
133
134 public static void deleteUser(long userId)
135 throws com.liferay.portal.PortalException,
136 com.liferay.portal.SystemException {
137 getService().deleteUser(userId);
138 }
139
140 public static long getDefaultUserId(long companyId)
141 throws com.liferay.portal.PortalException,
142 com.liferay.portal.SystemException {
143 return getService().getDefaultUserId(companyId);
144 }
145
146 public static long[] getGroupUserIds(long groupId)
147 throws com.liferay.portal.SystemException {
148 return getService().getGroupUserIds(groupId);
149 }
150
151 public static long[] getOrganizationUserIds(long organizationId)
152 throws com.liferay.portal.SystemException {
153 return getService().getOrganizationUserIds(organizationId);
154 }
155
156 public static long[] getRoleUserIds(long roleId)
157 throws com.liferay.portal.SystemException {
158 return getService().getRoleUserIds(roleId);
159 }
160
161 public static com.liferay.portal.model.User getUserByEmailAddress(
162 long companyId, java.lang.String emailAddress)
163 throws com.liferay.portal.PortalException,
164 com.liferay.portal.SystemException {
165 return getService().getUserByEmailAddress(companyId, emailAddress);
166 }
167
168 public static com.liferay.portal.model.User getUserById(long userId)
169 throws com.liferay.portal.PortalException,
170 com.liferay.portal.SystemException {
171 return getService().getUserById(userId);
172 }
173
174 public static com.liferay.portal.model.User getUserByScreenName(
175 long companyId, java.lang.String screenName)
176 throws com.liferay.portal.PortalException,
177 com.liferay.portal.SystemException {
178 return getService().getUserByScreenName(companyId, screenName);
179 }
180
181 public static long getUserIdByEmailAddress(long companyId,
182 java.lang.String emailAddress)
183 throws com.liferay.portal.PortalException,
184 com.liferay.portal.SystemException {
185 return getService().getUserIdByEmailAddress(companyId, emailAddress);
186 }
187
188 public static long getUserIdByScreenName(long companyId,
189 java.lang.String screenName)
190 throws com.liferay.portal.PortalException,
191 com.liferay.portal.SystemException {
192 return getService().getUserIdByScreenName(companyId, screenName);
193 }
194
195 public static boolean hasGroupUser(long groupId, long userId)
196 throws com.liferay.portal.SystemException {
197 return getService().hasGroupUser(groupId, userId);
198 }
199
200 public static boolean hasRoleUser(long roleId, long userId)
201 throws com.liferay.portal.SystemException {
202 return getService().hasRoleUser(roleId, userId);
203 }
204
205 public static boolean hasRoleUser(long companyId, java.lang.String name,
206 long userId, boolean inherited)
207 throws com.liferay.portal.PortalException,
208 com.liferay.portal.SystemException {
209 return getService().hasRoleUser(companyId, name, userId, inherited);
210 }
211
212 public static void setRoleUsers(long roleId, long[] userIds)
213 throws com.liferay.portal.PortalException,
214 com.liferay.portal.SystemException {
215 getService().setRoleUsers(roleId, userIds);
216 }
217
218 public static void setUserGroupUsers(long userGroupId, long[] userIds)
219 throws com.liferay.portal.PortalException,
220 com.liferay.portal.SystemException {
221 getService().setUserGroupUsers(userGroupId, userIds);
222 }
223
224 public static void unsetGroupUsers(long groupId, long[] userIds)
225 throws com.liferay.portal.PortalException,
226 com.liferay.portal.SystemException {
227 getService().unsetGroupUsers(groupId, userIds);
228 }
229
230 public static void unsetOrganizationUsers(long organizationId,
231 long[] userIds)
232 throws com.liferay.portal.PortalException,
233 com.liferay.portal.SystemException {
234 getService().unsetOrganizationUsers(organizationId, userIds);
235 }
236
237 public static void unsetPasswordPolicyUsers(long passwordPolicyId,
238 long[] userIds)
239 throws com.liferay.portal.PortalException,
240 com.liferay.portal.SystemException {
241 getService().unsetPasswordPolicyUsers(passwordPolicyId, userIds);
242 }
243
244 public static void unsetRoleUsers(long roleId, long[] userIds)
245 throws com.liferay.portal.PortalException,
246 com.liferay.portal.SystemException {
247 getService().unsetRoleUsers(roleId, userIds);
248 }
249
250 public static void unsetUserGroupUsers(long userGroupId, long[] userIds)
251 throws com.liferay.portal.PortalException,
252 com.liferay.portal.SystemException {
253 getService().unsetUserGroupUsers(userGroupId, userIds);
254 }
255
256 public static com.liferay.portal.model.User updateActive(long userId,
257 boolean active)
258 throws com.liferay.portal.PortalException,
259 com.liferay.portal.SystemException {
260 return getService().updateActive(userId, active);
261 }
262
263 public static com.liferay.portal.model.User updateAgreedToTermsOfUse(
264 long userId, boolean agreedToTermsOfUse)
265 throws com.liferay.portal.PortalException,
266 com.liferay.portal.SystemException {
267 return getService().updateAgreedToTermsOfUse(userId, agreedToTermsOfUse);
268 }
269
270 public static void updateEmailAddress(long userId,
271 java.lang.String password, java.lang.String emailAddress1,
272 java.lang.String emailAddress2)
273 throws com.liferay.portal.PortalException,
274 com.liferay.portal.SystemException {
275 getService()
276 .updateEmailAddress(userId, password, emailAddress1, emailAddress2);
277 }
278
279 public static com.liferay.portal.model.User updateLockout(long userId,
280 boolean lockout)
281 throws com.liferay.portal.PortalException,
282 com.liferay.portal.SystemException {
283 return getService().updateLockout(userId, lockout);
284 }
285
286 public static void updateOpenId(long userId, java.lang.String openId)
287 throws com.liferay.portal.PortalException,
288 com.liferay.portal.SystemException {
289 getService().updateOpenId(userId, openId);
290 }
291
292 public static void updateOrganizations(long userId, long[] organizationIds)
293 throws com.liferay.portal.PortalException,
294 com.liferay.portal.SystemException {
295 getService().updateOrganizations(userId, organizationIds);
296 }
297
298 public static com.liferay.portal.model.User updatePassword(long userId,
299 java.lang.String password1, java.lang.String password2,
300 boolean passwordReset)
301 throws com.liferay.portal.PortalException,
302 com.liferay.portal.SystemException {
303 return getService()
304 .updatePassword(userId, password1, password2, passwordReset);
305 }
306
307 public static void updatePortrait(long userId, byte[] bytes)
308 throws com.liferay.portal.PortalException,
309 com.liferay.portal.SystemException {
310 getService().updatePortrait(userId, bytes);
311 }
312
313 public static void updateReminderQuery(long userId,
314 java.lang.String question, java.lang.String answer)
315 throws com.liferay.portal.PortalException,
316 com.liferay.portal.SystemException {
317 getService().updateReminderQuery(userId, question, answer);
318 }
319
320 public static void updateScreenName(long userId, java.lang.String screenName)
321 throws com.liferay.portal.PortalException,
322 com.liferay.portal.SystemException {
323 getService().updateScreenName(userId, screenName);
324 }
325
326 public static com.liferay.portal.model.User updateUser(long userId,
327 java.lang.String oldPassword, java.lang.String newPassword1,
328 java.lang.String newPassword2, boolean passwordReset,
329 java.lang.String reminderQueryQuestion,
330 java.lang.String reminderQueryAnswer, java.lang.String screenName,
331 java.lang.String emailAddress, java.lang.String openId,
332 java.lang.String languageId, java.lang.String timeZoneId,
333 java.lang.String greeting, java.lang.String comments,
334 java.lang.String firstName, java.lang.String middleName,
335 java.lang.String lastName, int prefixId, int suffixId, boolean male,
336 int birthdayMonth, int birthdayDay, int birthdayYear,
337 java.lang.String smsSn, java.lang.String aimSn,
338 java.lang.String facebookSn, java.lang.String icqSn,
339 java.lang.String jabberSn, java.lang.String msnSn,
340 java.lang.String mySpaceSn, java.lang.String skypeSn,
341 java.lang.String twitterSn, java.lang.String ymSn,
342 java.lang.String jobTitle, long[] groupIds, long[] organizationIds,
343 long[] roleIds,
344 java.util.List<com.liferay.portal.model.UserGroupRole> userGroupRoles,
345 long[] userGroupIds,
346 com.liferay.portal.service.ServiceContext serviceContext)
347 throws com.liferay.portal.PortalException,
348 com.liferay.portal.SystemException {
349 return getService()
350 .updateUser(userId, oldPassword, newPassword1, newPassword2,
351 passwordReset, reminderQueryQuestion, reminderQueryAnswer,
352 screenName, emailAddress, openId, languageId, timeZoneId, greeting,
353 comments, firstName, middleName, lastName, prefixId, suffixId,
354 male, birthdayMonth, birthdayDay, birthdayYear, smsSn, aimSn,
355 facebookSn, icqSn, jabberSn, msnSn, mySpaceSn, skypeSn, twitterSn,
356 ymSn, jobTitle, groupIds, organizationIds, roleIds, userGroupRoles,
357 userGroupIds, serviceContext);
358 }
359
360 public static com.liferay.portal.model.User updateUser(long userId,
361 java.lang.String oldPassword, java.lang.String newPassword1,
362 java.lang.String newPassword2, boolean passwordReset,
363 java.lang.String reminderQueryQuestion,
364 java.lang.String reminderQueryAnswer, java.lang.String screenName,
365 java.lang.String emailAddress, java.lang.String openId,
366 java.lang.String languageId, java.lang.String timeZoneId,
367 java.lang.String greeting, java.lang.String comments,
368 java.lang.String firstName, java.lang.String middleName,
369 java.lang.String lastName, int prefixId, int suffixId, boolean male,
370 int birthdayMonth, int birthdayDay, int birthdayYear,
371 java.lang.String smsSn, java.lang.String aimSn,
372 java.lang.String facebookSn, java.lang.String icqSn,
373 java.lang.String jabberSn, java.lang.String msnSn,
374 java.lang.String mySpaceSn, java.lang.String skypeSn,
375 java.lang.String twitterSn, java.lang.String ymSn,
376 java.lang.String jobTitle, long[] groupIds, long[] organizationIds,
377 long[] roleIds,
378 java.util.List<com.liferay.portal.model.UserGroupRole> userGroupRoles,
379 long[] userGroupIds,
380 java.util.List<com.liferay.portal.model.Address> addresses,
381 java.util.List<com.liferay.portal.model.EmailAddress> emailAddresses,
382 java.util.List<com.liferay.portal.model.Phone> phones,
383 java.util.List<com.liferay.portal.model.Website> websites,
384 java.util.List<com.liferay.portlet.announcements.model.AnnouncementsDelivery> announcementsDelivers,
385 com.liferay.portal.service.ServiceContext serviceContext)
386 throws com.liferay.portal.PortalException,
387 com.liferay.portal.SystemException {
388 return getService()
389 .updateUser(userId, oldPassword, newPassword1, newPassword2,
390 passwordReset, reminderQueryQuestion, reminderQueryAnswer,
391 screenName, emailAddress, openId, languageId, timeZoneId, greeting,
392 comments, firstName, middleName, lastName, prefixId, suffixId,
393 male, birthdayMonth, birthdayDay, birthdayYear, smsSn, aimSn,
394 facebookSn, icqSn, jabberSn, msnSn, mySpaceSn, skypeSn, twitterSn,
395 ymSn, jobTitle, groupIds, organizationIds, roleIds, userGroupRoles,
396 userGroupIds, addresses, emailAddresses, phones, websites,
397 announcementsDelivers, serviceContext);
398 }
399
400 public static UserService getService() {
401 if (_service == null) {
402 _service = (UserService)PortalBeanLocatorUtil.locate(UserService.class.getName());
403
404 ReferenceRegistry.registerReference(UserServiceUtil.class,
405 "_service");
406 MethodCache.remove(UserService.class);
407 }
408
409 return _service;
410 }
411
412 public void setService(UserService service) {
413 MethodCache.remove(UserService.class);
414
415 _service = service;
416
417 ReferenceRegistry.registerReference(UserServiceUtil.class, "_service");
418 MethodCache.remove(UserService.class);
419 }
420
421 private static UserService _service;
422 }