1
14
15 package com.liferay.portal.service;
16
17 import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
18
19
39 public class UserServiceUtil {
40 public static void addGroupUsers(long groupId, long[] userIds)
41 throws com.liferay.portal.kernel.exception.PortalException,
42 com.liferay.portal.kernel.exception.SystemException {
43 getService().addGroupUsers(groupId, userIds);
44 }
45
46 public static void addOrganizationUsers(long organizationId, long[] userIds)
47 throws com.liferay.portal.kernel.exception.PortalException,
48 com.liferay.portal.kernel.exception.SystemException {
49 getService().addOrganizationUsers(organizationId, userIds);
50 }
51
52 public static void addPasswordPolicyUsers(long passwordPolicyId,
53 long[] userIds)
54 throws com.liferay.portal.kernel.exception.PortalException,
55 com.liferay.portal.kernel.exception.SystemException {
56 getService().addPasswordPolicyUsers(passwordPolicyId, userIds);
57 }
58
59 public static void addRoleUsers(long roleId, long[] userIds)
60 throws com.liferay.portal.kernel.exception.PortalException,
61 com.liferay.portal.kernel.exception.SystemException {
62 getService().addRoleUsers(roleId, userIds);
63 }
64
65 public static void addTeamUsers(long teamId, long[] userIds)
66 throws com.liferay.portal.kernel.exception.PortalException,
67 com.liferay.portal.kernel.exception.SystemException {
68 getService().addTeamUsers(teamId, userIds);
69 }
70
71 public static void addUserGroupUsers(long userGroupId, long[] userIds)
72 throws com.liferay.portal.kernel.exception.PortalException,
73 com.liferay.portal.kernel.exception.SystemException {
74 getService().addUserGroupUsers(userGroupId, userIds);
75 }
76
77 public static com.liferay.portal.model.User addUser(long companyId,
78 boolean autoPassword, java.lang.String password1,
79 java.lang.String password2, boolean autoScreenName,
80 java.lang.String screenName, java.lang.String emailAddress,
81 java.lang.String openId, java.util.Locale locale,
82 java.lang.String firstName, java.lang.String middleName,
83 java.lang.String lastName, int prefixId, int suffixId, boolean male,
84 int birthdayMonth, int birthdayDay, int birthdayYear,
85 java.lang.String jobTitle, long[] groupIds, long[] organizationIds,
86 long[] roleIds, long[] userGroupIds, boolean sendEmail,
87 com.liferay.portal.service.ServiceContext serviceContext)
88 throws com.liferay.portal.kernel.exception.PortalException,
89 com.liferay.portal.kernel.exception.SystemException {
90 return getService()
91 .addUser(companyId, autoPassword, password1, password2,
92 autoScreenName, screenName, emailAddress, openId, locale,
93 firstName, middleName, lastName, prefixId, suffixId, male,
94 birthdayMonth, birthdayDay, birthdayYear, jobTitle, groupIds,
95 organizationIds, roleIds, userGroupIds, sendEmail, serviceContext);
96 }
97
98 public static com.liferay.portal.model.User addUser(long companyId,
99 boolean autoPassword, java.lang.String password1,
100 java.lang.String password2, boolean autoScreenName,
101 java.lang.String screenName, java.lang.String emailAddress,
102 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, openId, locale,
119 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 void updateEmailAddress(long userId,
281 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 getService()
286 .updateEmailAddress(userId, password, emailAddress1, emailAddress2);
287 }
288
289 public static com.liferay.portal.model.User updateLockout(long userId,
290 boolean lockout)
291 throws com.liferay.portal.kernel.exception.PortalException,
292 com.liferay.portal.kernel.exception.SystemException {
293 return getService().updateLockout(userId, lockout);
294 }
295
296 public static void updateOpenId(long userId, java.lang.String openId)
297 throws com.liferay.portal.kernel.exception.PortalException,
298 com.liferay.portal.kernel.exception.SystemException {
299 getService().updateOpenId(userId, openId);
300 }
301
302 public static void updateOrganizations(long userId, long[] organizationIds)
303 throws com.liferay.portal.kernel.exception.PortalException,
304 com.liferay.portal.kernel.exception.SystemException {
305 getService().updateOrganizations(userId, organizationIds);
306 }
307
308 public static com.liferay.portal.model.User updatePassword(long userId,
309 java.lang.String password1, java.lang.String password2,
310 boolean passwordReset)
311 throws com.liferay.portal.kernel.exception.PortalException,
312 com.liferay.portal.kernel.exception.SystemException {
313 return getService()
314 .updatePassword(userId, password1, password2, passwordReset);
315 }
316
317 public static void updatePortrait(long userId, byte[] bytes)
318 throws com.liferay.portal.kernel.exception.PortalException,
319 com.liferay.portal.kernel.exception.SystemException {
320 getService().updatePortrait(userId, bytes);
321 }
322
323 public static void updateReminderQuery(long userId,
324 java.lang.String question, java.lang.String answer)
325 throws com.liferay.portal.kernel.exception.PortalException,
326 com.liferay.portal.kernel.exception.SystemException {
327 getService().updateReminderQuery(userId, question, answer);
328 }
329
330 public static void updateScreenName(long userId, java.lang.String screenName)
331 throws com.liferay.portal.kernel.exception.PortalException,
332 com.liferay.portal.kernel.exception.SystemException {
333 getService().updateScreenName(userId, screenName);
334 }
335
336 public static com.liferay.portal.model.User updateUser(long userId,
337 java.lang.String oldPassword, java.lang.String newPassword1,
338 java.lang.String newPassword2, boolean passwordReset,
339 java.lang.String reminderQueryQuestion,
340 java.lang.String reminderQueryAnswer, java.lang.String screenName,
341 java.lang.String emailAddress, java.lang.String openId,
342 java.lang.String languageId, java.lang.String timeZoneId,
343 java.lang.String greeting, java.lang.String comments,
344 java.lang.String firstName, java.lang.String middleName,
345 java.lang.String lastName, int prefixId, int suffixId, boolean male,
346 int birthdayMonth, int birthdayDay, int birthdayYear,
347 java.lang.String smsSn, java.lang.String aimSn,
348 java.lang.String facebookSn, java.lang.String icqSn,
349 java.lang.String jabberSn, java.lang.String msnSn,
350 java.lang.String mySpaceSn, java.lang.String skypeSn,
351 java.lang.String twitterSn, java.lang.String ymSn,
352 java.lang.String jobTitle, long[] groupIds, long[] organizationIds,
353 long[] roleIds,
354 java.util.List<com.liferay.portal.model.UserGroupRole> userGroupRoles,
355 long[] userGroupIds,
356 com.liferay.portal.service.ServiceContext serviceContext)
357 throws com.liferay.portal.kernel.exception.PortalException,
358 com.liferay.portal.kernel.exception.SystemException {
359 return getService()
360 .updateUser(userId, oldPassword, newPassword1, newPassword2,
361 passwordReset, reminderQueryQuestion, reminderQueryAnswer,
362 screenName, emailAddress, openId, languageId, timeZoneId, greeting,
363 comments, firstName, middleName, lastName, prefixId, suffixId,
364 male, birthdayMonth, birthdayDay, birthdayYear, smsSn, aimSn,
365 facebookSn, icqSn, jabberSn, msnSn, mySpaceSn, skypeSn, twitterSn,
366 ymSn, jobTitle, groupIds, organizationIds, roleIds, userGroupRoles,
367 userGroupIds, serviceContext);
368 }
369
370 public static com.liferay.portal.model.User updateUser(long userId,
371 java.lang.String oldPassword, java.lang.String newPassword1,
372 java.lang.String newPassword2, boolean passwordReset,
373 java.lang.String reminderQueryQuestion,
374 java.lang.String reminderQueryAnswer, java.lang.String screenName,
375 java.lang.String emailAddress, java.lang.String openId,
376 java.lang.String languageId, java.lang.String timeZoneId,
377 java.lang.String greeting, java.lang.String comments,
378 java.lang.String firstName, java.lang.String middleName,
379 java.lang.String lastName, int prefixId, int suffixId, boolean male,
380 int birthdayMonth, int birthdayDay, int birthdayYear,
381 java.lang.String smsSn, java.lang.String aimSn,
382 java.lang.String facebookSn, java.lang.String icqSn,
383 java.lang.String jabberSn, java.lang.String msnSn,
384 java.lang.String mySpaceSn, java.lang.String skypeSn,
385 java.lang.String twitterSn, java.lang.String ymSn,
386 java.lang.String jobTitle, long[] groupIds, long[] organizationIds,
387 long[] roleIds,
388 java.util.List<com.liferay.portal.model.UserGroupRole> userGroupRoles,
389 long[] userGroupIds,
390 java.util.List<com.liferay.portal.model.Address> addresses,
391 java.util.List<com.liferay.portal.model.EmailAddress> emailAddresses,
392 java.util.List<com.liferay.portal.model.Phone> phones,
393 java.util.List<com.liferay.portal.model.Website> websites,
394 java.util.List<com.liferay.portlet.announcements.model.AnnouncementsDelivery> announcementsDelivers,
395 com.liferay.portal.service.ServiceContext serviceContext)
396 throws com.liferay.portal.kernel.exception.PortalException,
397 com.liferay.portal.kernel.exception.SystemException {
398 return getService()
399 .updateUser(userId, oldPassword, newPassword1, newPassword2,
400 passwordReset, reminderQueryQuestion, reminderQueryAnswer,
401 screenName, emailAddress, openId, languageId, timeZoneId, greeting,
402 comments, firstName, middleName, lastName, prefixId, suffixId,
403 male, birthdayMonth, birthdayDay, birthdayYear, smsSn, aimSn,
404 facebookSn, icqSn, jabberSn, msnSn, mySpaceSn, skypeSn, twitterSn,
405 ymSn, jobTitle, groupIds, organizationIds, roleIds, userGroupRoles,
406 userGroupIds, addresses, emailAddresses, phones, websites,
407 announcementsDelivers, serviceContext);
408 }
409
410 public static UserService getService() {
411 if (_service == null) {
412 _service = (UserService)PortalBeanLocatorUtil.locate(UserService.class.getName());
413 }
414
415 return _service;
416 }
417
418 public void setService(UserService service) {
419 _service = service;
420 }
421
422 private static UserService _service;
423 }