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