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