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