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