001
014
015 package com.liferay.portal.service;
016
017 import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
018 import com.liferay.portal.kernel.util.MethodCache;
019 import com.liferay.portal.kernel.util.ReferenceRegistry;
020
021
034 public class UserServiceUtil {
035
040 public static void addGroupUsers(long groupId, long[] userIds)
041 throws com.liferay.portal.kernel.exception.PortalException,
042 com.liferay.portal.kernel.exception.SystemException {
043 getService().addGroupUsers(groupId, userIds);
044 }
045
046 public static void addOrganizationUsers(long organizationId, long[] userIds)
047 throws com.liferay.portal.kernel.exception.PortalException,
048 com.liferay.portal.kernel.exception.SystemException {
049 getService().addOrganizationUsers(organizationId, userIds);
050 }
051
052 public static void addPasswordPolicyUsers(long passwordPolicyId,
053 long[] userIds)
054 throws com.liferay.portal.kernel.exception.PortalException,
055 com.liferay.portal.kernel.exception.SystemException {
056 getService().addPasswordPolicyUsers(passwordPolicyId, userIds);
057 }
058
059 public static void addRoleUsers(long roleId, long[] userIds)
060 throws com.liferay.portal.kernel.exception.PortalException,
061 com.liferay.portal.kernel.exception.SystemException {
062 getService().addRoleUsers(roleId, userIds);
063 }
064
065 public static void addTeamUsers(long teamId, long[] userIds)
066 throws com.liferay.portal.kernel.exception.PortalException,
067 com.liferay.portal.kernel.exception.SystemException {
068 getService().addTeamUsers(teamId, userIds);
069 }
070
071 public static void addUserGroupUsers(long userGroupId, long[] userIds)
072 throws com.liferay.portal.kernel.exception.PortalException,
073 com.liferay.portal.kernel.exception.SystemException {
074 getService().addUserGroupUsers(userGroupId, userIds);
075 }
076
077 public static com.liferay.portal.model.User addUser(long companyId,
078 boolean autoPassword, java.lang.String password1,
079 java.lang.String password2, boolean autoScreenName,
080 java.lang.String screenName, java.lang.String emailAddress,
081 long facebookId, java.lang.String openId, java.util.Locale locale,
082 java.lang.String firstName, java.lang.String middleName,
083 java.lang.String lastName, int prefixId, int suffixId, boolean male,
084 int birthdayMonth, int birthdayDay, int birthdayYear,
085 java.lang.String jobTitle, long[] groupIds, long[] organizationIds,
086 long[] roleIds, long[] userGroupIds, boolean sendEmail,
087 com.liferay.portal.service.ServiceContext serviceContext)
088 throws com.liferay.portal.kernel.exception.PortalException,
089 com.liferay.portal.kernel.exception.SystemException {
090 return getService()
091 .addUser(companyId, autoPassword, password1, password2,
092 autoScreenName, screenName, emailAddress, facebookId, openId,
093 locale, firstName, middleName, lastName, prefixId, suffixId, male,
094 birthdayMonth, birthdayDay, birthdayYear, jobTitle, groupIds,
095 organizationIds, roleIds, userGroupIds, sendEmail, serviceContext);
096 }
097
098 public static com.liferay.portal.model.User addUser(long companyId,
099 boolean autoPassword, java.lang.String password1,
100 java.lang.String password2, boolean autoScreenName,
101 java.lang.String screenName, java.lang.String emailAddress,
102 long facebookId, java.lang.String openId, java.util.Locale locale,
103 java.lang.String firstName, java.lang.String middleName,
104 java.lang.String lastName, int prefixId, int suffixId, boolean male,
105 int birthdayMonth, int birthdayDay, int birthdayYear,
106 java.lang.String jobTitle, long[] groupIds, long[] organizationIds,
107 long[] roleIds, long[] userGroupIds, boolean sendEmail,
108 java.util.List<com.liferay.portal.model.Address> addresses,
109 java.util.List<com.liferay.portal.model.EmailAddress> emailAddresses,
110 java.util.List<com.liferay.portal.model.Phone> phones,
111 java.util.List<com.liferay.portal.model.Website> websites,
112 java.util.List<com.liferay.portlet.announcements.model.AnnouncementsDelivery> announcementsDelivers,
113 com.liferay.portal.service.ServiceContext serviceContext)
114 throws com.liferay.portal.kernel.exception.PortalException,
115 com.liferay.portal.kernel.exception.SystemException {
116 return getService()
117 .addUser(companyId, autoPassword, password1, password2,
118 autoScreenName, screenName, emailAddress, facebookId, openId,
119 locale, firstName, middleName, lastName, prefixId, suffixId, male,
120 birthdayMonth, birthdayDay, birthdayYear, jobTitle, groupIds,
121 organizationIds, roleIds, userGroupIds, sendEmail, addresses,
122 emailAddresses, phones, websites, announcementsDelivers,
123 serviceContext);
124 }
125
126 public static void deletePortrait(long userId)
127 throws com.liferay.portal.kernel.exception.PortalException,
128 com.liferay.portal.kernel.exception.SystemException {
129 getService().deletePortrait(userId);
130 }
131
132 public static void deleteRoleUser(long roleId, long userId)
133 throws com.liferay.portal.kernel.exception.PortalException,
134 com.liferay.portal.kernel.exception.SystemException {
135 getService().deleteRoleUser(roleId, userId);
136 }
137
138 public static void deleteUser(long userId)
139 throws com.liferay.portal.kernel.exception.PortalException,
140 com.liferay.portal.kernel.exception.SystemException {
141 getService().deleteUser(userId);
142 }
143
144 public static long getDefaultUserId(long companyId)
145 throws com.liferay.portal.kernel.exception.PortalException,
146 com.liferay.portal.kernel.exception.SystemException {
147 return getService().getDefaultUserId(companyId);
148 }
149
150 public static long[] getGroupUserIds(long groupId)
151 throws com.liferay.portal.kernel.exception.SystemException {
152 return getService().getGroupUserIds(groupId);
153 }
154
155 public static long[] getOrganizationUserIds(long organizationId)
156 throws com.liferay.portal.kernel.exception.SystemException {
157 return getService().getOrganizationUserIds(organizationId);
158 }
159
160 public static long[] getRoleUserIds(long roleId)
161 throws com.liferay.portal.kernel.exception.SystemException {
162 return getService().getRoleUserIds(roleId);
163 }
164
165 public static com.liferay.portal.model.User getUserByEmailAddress(
166 long companyId, java.lang.String emailAddress)
167 throws com.liferay.portal.kernel.exception.PortalException,
168 com.liferay.portal.kernel.exception.SystemException {
169 return getService().getUserByEmailAddress(companyId, emailAddress);
170 }
171
172 public static com.liferay.portal.model.User getUserById(long userId)
173 throws com.liferay.portal.kernel.exception.PortalException,
174 com.liferay.portal.kernel.exception.SystemException {
175 return getService().getUserById(userId);
176 }
177
178 public static com.liferay.portal.model.User getUserByScreenName(
179 long companyId, java.lang.String screenName)
180 throws com.liferay.portal.kernel.exception.PortalException,
181 com.liferay.portal.kernel.exception.SystemException {
182 return getService().getUserByScreenName(companyId, screenName);
183 }
184
185 public static long getUserIdByEmailAddress(long companyId,
186 java.lang.String emailAddress)
187 throws com.liferay.portal.kernel.exception.PortalException,
188 com.liferay.portal.kernel.exception.SystemException {
189 return getService().getUserIdByEmailAddress(companyId, emailAddress);
190 }
191
192 public static long getUserIdByScreenName(long companyId,
193 java.lang.String screenName)
194 throws com.liferay.portal.kernel.exception.PortalException,
195 com.liferay.portal.kernel.exception.SystemException {
196 return getService().getUserIdByScreenName(companyId, screenName);
197 }
198
199 public static boolean hasGroupUser(long groupId, long userId)
200 throws com.liferay.portal.kernel.exception.SystemException {
201 return getService().hasGroupUser(groupId, userId);
202 }
203
204 public static boolean hasRoleUser(long roleId, long userId)
205 throws com.liferay.portal.kernel.exception.SystemException {
206 return getService().hasRoleUser(roleId, userId);
207 }
208
209 public static boolean hasRoleUser(long companyId, java.lang.String name,
210 long userId, boolean inherited)
211 throws com.liferay.portal.kernel.exception.PortalException,
212 com.liferay.portal.kernel.exception.SystemException {
213 return getService().hasRoleUser(companyId, name, userId, inherited);
214 }
215
216 public static void setRoleUsers(long roleId, long[] userIds)
217 throws com.liferay.portal.kernel.exception.PortalException,
218 com.liferay.portal.kernel.exception.SystemException {
219 getService().setRoleUsers(roleId, userIds);
220 }
221
222 public static void setUserGroupUsers(long userGroupId, long[] userIds)
223 throws com.liferay.portal.kernel.exception.PortalException,
224 com.liferay.portal.kernel.exception.SystemException {
225 getService().setUserGroupUsers(userGroupId, userIds);
226 }
227
228 public static void unsetGroupUsers(long groupId, long[] userIds)
229 throws com.liferay.portal.kernel.exception.PortalException,
230 com.liferay.portal.kernel.exception.SystemException {
231 getService().unsetGroupUsers(groupId, userIds);
232 }
233
234 public static void unsetOrganizationUsers(long organizationId,
235 long[] userIds)
236 throws com.liferay.portal.kernel.exception.PortalException,
237 com.liferay.portal.kernel.exception.SystemException {
238 getService().unsetOrganizationUsers(organizationId, userIds);
239 }
240
241 public static void unsetPasswordPolicyUsers(long passwordPolicyId,
242 long[] userIds)
243 throws com.liferay.portal.kernel.exception.PortalException,
244 com.liferay.portal.kernel.exception.SystemException {
245 getService().unsetPasswordPolicyUsers(passwordPolicyId, userIds);
246 }
247
248 public static void unsetRoleUsers(long roleId, long[] userIds)
249 throws com.liferay.portal.kernel.exception.PortalException,
250 com.liferay.portal.kernel.exception.SystemException {
251 getService().unsetRoleUsers(roleId, userIds);
252 }
253
254 public static void unsetTeamUsers(long teamId, long[] userIds)
255 throws com.liferay.portal.kernel.exception.PortalException,
256 com.liferay.portal.kernel.exception.SystemException {
257 getService().unsetTeamUsers(teamId, userIds);
258 }
259
260 public static void unsetUserGroupUsers(long userGroupId, long[] userIds)
261 throws com.liferay.portal.kernel.exception.PortalException,
262 com.liferay.portal.kernel.exception.SystemException {
263 getService().unsetUserGroupUsers(userGroupId, userIds);
264 }
265
266 public static com.liferay.portal.model.User updateActive(long userId,
267 boolean active)
268 throws com.liferay.portal.kernel.exception.PortalException,
269 com.liferay.portal.kernel.exception.SystemException {
270 return getService().updateActive(userId, active);
271 }
272
273 public static com.liferay.portal.model.User updateAgreedToTermsOfUse(
274 long userId, boolean agreedToTermsOfUse)
275 throws com.liferay.portal.kernel.exception.PortalException,
276 com.liferay.portal.kernel.exception.SystemException {
277 return getService().updateAgreedToTermsOfUse(userId, agreedToTermsOfUse);
278 }
279
280 public static com.liferay.portal.model.User updateEmailAddress(
281 long userId, java.lang.String password, java.lang.String emailAddress1,
282 java.lang.String emailAddress2)
283 throws com.liferay.portal.kernel.exception.PortalException,
284 com.liferay.portal.kernel.exception.SystemException {
285 return getService()
286 .updateEmailAddress(userId, password, emailAddress1,
287 emailAddress2);
288 }
289
290
293 public static com.liferay.portal.model.User updateLockout(long userId,
294 boolean lockout)
295 throws com.liferay.portal.kernel.exception.PortalException,
296 com.liferay.portal.kernel.exception.SystemException {
297 return getService().updateLockout(userId, lockout);
298 }
299
300 public static com.liferay.portal.model.User updateLockoutById(long userId,
301 boolean lockout)
302 throws com.liferay.portal.kernel.exception.PortalException,
303 com.liferay.portal.kernel.exception.SystemException {
304 return getService().updateLockoutById(userId, lockout);
305 }
306
307 public static com.liferay.portal.model.User updateOpenId(long userId,
308 java.lang.String openId)
309 throws com.liferay.portal.kernel.exception.PortalException,
310 com.liferay.portal.kernel.exception.SystemException {
311 return getService().updateOpenId(userId, openId);
312 }
313
314 public static void updateOrganizations(long userId, long[] organizationIds)
315 throws com.liferay.portal.kernel.exception.PortalException,
316 com.liferay.portal.kernel.exception.SystemException {
317 getService().updateOrganizations(userId, organizationIds);
318 }
319
320 public static com.liferay.portal.model.User updatePassword(long userId,
321 java.lang.String password1, java.lang.String password2,
322 boolean passwordReset)
323 throws com.liferay.portal.kernel.exception.PortalException,
324 com.liferay.portal.kernel.exception.SystemException {
325 return getService()
326 .updatePassword(userId, password1, password2, passwordReset);
327 }
328
329 public static com.liferay.portal.model.User updatePortrait(long userId,
330 byte[] bytes)
331 throws com.liferay.portal.kernel.exception.PortalException,
332 com.liferay.portal.kernel.exception.SystemException {
333 return getService().updatePortrait(userId, bytes);
334 }
335
336 public static com.liferay.portal.model.User updateReminderQuery(
337 long userId, java.lang.String question, java.lang.String answer)
338 throws com.liferay.portal.kernel.exception.PortalException,
339 com.liferay.portal.kernel.exception.SystemException {
340 return getService().updateReminderQuery(userId, question, answer);
341 }
342
343 public static com.liferay.portal.model.User updateScreenName(long userId,
344 java.lang.String screenName)
345 throws com.liferay.portal.kernel.exception.PortalException,
346 com.liferay.portal.kernel.exception.SystemException {
347 return getService().updateScreenName(userId, screenName);
348 }
349
350 public static com.liferay.portal.model.User updateUser(long userId,
351 java.lang.String oldPassword, java.lang.String newPassword1,
352 java.lang.String newPassword2, boolean passwordReset,
353 java.lang.String reminderQueryQuestion,
354 java.lang.String reminderQueryAnswer, java.lang.String screenName,
355 java.lang.String emailAddress, long facebookId,
356 java.lang.String openId, java.lang.String languageId,
357 java.lang.String timeZoneId, java.lang.String greeting,
358 java.lang.String comments, java.lang.String firstName,
359 java.lang.String middleName, java.lang.String lastName, int prefixId,
360 int suffixId, boolean male, int birthdayMonth, int birthdayDay,
361 int birthdayYear, java.lang.String smsSn, java.lang.String aimSn,
362 java.lang.String facebookSn, java.lang.String icqSn,
363 java.lang.String jabberSn, java.lang.String msnSn,
364 java.lang.String mySpaceSn, java.lang.String skypeSn,
365 java.lang.String twitterSn, java.lang.String ymSn,
366 java.lang.String jobTitle, long[] groupIds, long[] organizationIds,
367 long[] roleIds,
368 java.util.List<com.liferay.portal.model.UserGroupRole> userGroupRoles,
369 long[] userGroupIds,
370 com.liferay.portal.service.ServiceContext serviceContext)
371 throws com.liferay.portal.kernel.exception.PortalException,
372 com.liferay.portal.kernel.exception.SystemException {
373 return getService()
374 .updateUser(userId, oldPassword, newPassword1, newPassword2,
375 passwordReset, reminderQueryQuestion, reminderQueryAnswer,
376 screenName, emailAddress, facebookId, openId, languageId,
377 timeZoneId, greeting, comments, firstName, middleName, lastName,
378 prefixId, suffixId, male, birthdayMonth, birthdayDay, birthdayYear,
379 smsSn, aimSn, facebookSn, icqSn, jabberSn, msnSn, mySpaceSn,
380 skypeSn, twitterSn, ymSn, jobTitle, groupIds, organizationIds,
381 roleIds, userGroupRoles, userGroupIds, serviceContext);
382 }
383
384 public static com.liferay.portal.model.User updateUser(long userId,
385 java.lang.String oldPassword, java.lang.String newPassword1,
386 java.lang.String newPassword2, boolean passwordReset,
387 java.lang.String reminderQueryQuestion,
388 java.lang.String reminderQueryAnswer, java.lang.String screenName,
389 java.lang.String emailAddress, long facebookId,
390 java.lang.String openId, java.lang.String languageId,
391 java.lang.String timeZoneId, java.lang.String greeting,
392 java.lang.String comments, java.lang.String firstName,
393 java.lang.String middleName, java.lang.String lastName, int prefixId,
394 int suffixId, boolean male, int birthdayMonth, int birthdayDay,
395 int birthdayYear, java.lang.String smsSn, java.lang.String aimSn,
396 java.lang.String facebookSn, java.lang.String icqSn,
397 java.lang.String jabberSn, java.lang.String msnSn,
398 java.lang.String mySpaceSn, java.lang.String skypeSn,
399 java.lang.String twitterSn, java.lang.String ymSn,
400 java.lang.String jobTitle, long[] groupIds, long[] organizationIds,
401 long[] roleIds,
402 java.util.List<com.liferay.portal.model.UserGroupRole> userGroupRoles,
403 long[] userGroupIds,
404 java.util.List<com.liferay.portal.model.Address> addresses,
405 java.util.List<com.liferay.portal.model.EmailAddress> emailAddresses,
406 java.util.List<com.liferay.portal.model.Phone> phones,
407 java.util.List<com.liferay.portal.model.Website> websites,
408 java.util.List<com.liferay.portlet.announcements.model.AnnouncementsDelivery> announcementsDelivers,
409 com.liferay.portal.service.ServiceContext serviceContext)
410 throws com.liferay.portal.kernel.exception.PortalException,
411 com.liferay.portal.kernel.exception.SystemException {
412 return getService()
413 .updateUser(userId, oldPassword, newPassword1, newPassword2,
414 passwordReset, reminderQueryQuestion, reminderQueryAnswer,
415 screenName, emailAddress, facebookId, openId, languageId,
416 timeZoneId, greeting, comments, firstName, middleName, lastName,
417 prefixId, suffixId, male, birthdayMonth, birthdayDay, birthdayYear,
418 smsSn, aimSn, facebookSn, icqSn, jabberSn, msnSn, mySpaceSn,
419 skypeSn, twitterSn, ymSn, jobTitle, groupIds, organizationIds,
420 roleIds, userGroupRoles, userGroupIds, addresses, emailAddresses,
421 phones, websites, announcementsDelivers, serviceContext);
422 }
423
424 public static UserService getService() {
425 if (_service == null) {
426 _service = (UserService)PortalBeanLocatorUtil.locate(UserService.class.getName());
427
428 ReferenceRegistry.registerReference(UserServiceUtil.class,
429 "_service");
430 MethodCache.remove(UserService.class);
431 }
432
433 return _service;
434 }
435
436 public void setService(UserService service) {
437 MethodCache.remove(UserService.class);
438
439 _service = service;
440
441 ReferenceRegistry.registerReference(UserServiceUtil.class, "_service");
442 MethodCache.remove(UserService.class);
443 }
444
445 private static UserService _service;
446 }