001 /** 002 * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved. 003 * 004 * This library is free software; you can redistribute it and/or modify it under 005 * the terms of the GNU Lesser General Public License as published by the Free 006 * Software Foundation; either version 2.1 of the License, or (at your option) 007 * any later version. 008 * 009 * This library is distributed in the hope that it will be useful, but WITHOUT 010 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 011 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 012 * details. 013 */ 014 015 package com.liferay.portal.service; 016 017 import aQute.bnd.annotation.ProviderType; 018 019 import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil; 020 import com.liferay.portal.kernel.util.ReferenceRegistry; 021 022 /** 023 * Provides the remote service utility for User. This utility wraps 024 * {@link com.liferay.portal.service.impl.UserServiceImpl} and is the 025 * primary access point for service operations in application layer code running 026 * on a remote server. Methods of this service are expected to have security 027 * checks based on the propagated JAAS credentials because this service can be 028 * accessed remotely. 029 * 030 * @author Brian Wing Shun Chan 031 * @see UserService 032 * @see com.liferay.portal.service.base.UserServiceBaseImpl 033 * @see com.liferay.portal.service.impl.UserServiceImpl 034 * @generated 035 */ 036 @ProviderType 037 public class UserServiceUtil { 038 /* 039 * NOTE FOR DEVELOPERS: 040 * 041 * Never modify this class directly. Add custom service methods to {@link com.liferay.portal.service.impl.UserServiceImpl} and rerun ServiceBuilder to regenerate this class. 042 */ 043 044 /** 045 * Returns the Spring bean ID for this bean. 046 * 047 * @return the Spring bean ID for this bean 048 */ 049 public static java.lang.String getBeanIdentifier() { 050 return getService().getBeanIdentifier(); 051 } 052 053 /** 054 * Sets the Spring bean ID for this bean. 055 * 056 * @param beanIdentifier the Spring bean ID for this bean 057 */ 058 public static void setBeanIdentifier(java.lang.String beanIdentifier) { 059 getService().setBeanIdentifier(beanIdentifier); 060 } 061 062 /** 063 * Adds the users to the group. 064 * 065 * @param groupId the primary key of the group 066 * @param userIds the primary keys of the users 067 * @param serviceContext the service context to be applied (optionally 068 <code>null</code>) 069 * @throws PortalException if a group or user with the primary key could not 070 be found, if the user did not have permission to assign group 071 members, or if the operation was not allowed by the membership 072 policy 073 * @throws SystemException if a system exception occurred 074 */ 075 public static void addGroupUsers(long groupId, long[] userIds, 076 com.liferay.portal.service.ServiceContext serviceContext) 077 throws com.liferay.portal.kernel.exception.PortalException, 078 com.liferay.portal.kernel.exception.SystemException { 079 getService().addGroupUsers(groupId, userIds, serviceContext); 080 } 081 082 /** 083 * Adds the users to the organization. 084 * 085 * @param organizationId the primary key of the organization 086 * @param userIds the primary keys of the users 087 * @throws PortalException if an organization or user with the primary key 088 could not be found, if the user did not have permission to assign 089 organization members, if current user did not have an 090 organization in common with a given user, or if the operation was 091 not allowed by the membership policy 092 * @throws SystemException if a system exception occurred 093 */ 094 public static void addOrganizationUsers(long organizationId, long[] userIds) 095 throws com.liferay.portal.kernel.exception.PortalException, 096 com.liferay.portal.kernel.exception.SystemException { 097 getService().addOrganizationUsers(organizationId, userIds); 098 } 099 100 /** 101 * Assigns the password policy to the users, removing any other currently 102 * assigned password policies. 103 * 104 * @param passwordPolicyId the primary key of the password policy 105 * @param userIds the primary keys of the users 106 * @throws PortalException if the user did not have permission to assign 107 policy members 108 * @throws SystemException if a system exception occurred 109 */ 110 public static void addPasswordPolicyUsers(long passwordPolicyId, 111 long[] userIds) 112 throws com.liferay.portal.kernel.exception.PortalException, 113 com.liferay.portal.kernel.exception.SystemException { 114 getService().addPasswordPolicyUsers(passwordPolicyId, userIds); 115 } 116 117 /** 118 * Adds the users to the role. 119 * 120 * @param roleId the primary key of the role 121 * @param userIds the primary keys of the users 122 * @throws PortalException if a role or user with the primary key could not 123 be found, if the user did not have permission to assign role 124 members, or if the operation was not allowed by the membership 125 policy 126 * @throws SystemException if a system exception occurred 127 */ 128 public static void addRoleUsers(long roleId, long[] userIds) 129 throws com.liferay.portal.kernel.exception.PortalException, 130 com.liferay.portal.kernel.exception.SystemException { 131 getService().addRoleUsers(roleId, userIds); 132 } 133 134 /** 135 * Adds the users to the team. 136 * 137 * @param teamId the primary key of the team 138 * @param userIds the primary keys of the users 139 * @throws PortalException if a team or user with the primary key could not 140 be found or if the user did not have permission to assign team 141 members 142 * @throws SystemException if a system exception occurred 143 */ 144 public static void addTeamUsers(long teamId, long[] userIds) 145 throws com.liferay.portal.kernel.exception.PortalException, 146 com.liferay.portal.kernel.exception.SystemException { 147 getService().addTeamUsers(teamId, userIds); 148 } 149 150 /** 151 * Adds a user. 152 * 153 * <p> 154 * This method handles the creation and bookkeeping of the user including 155 * its resources, metadata, and internal data structures. It is not 156 * necessary to make subsequent calls to any methods to setup default 157 * groups, resources, etc. 158 * </p> 159 * 160 * @param companyId the primary key of the user's company 161 * @param autoPassword whether a password should be automatically generated 162 for the user 163 * @param password1 the user's password 164 * @param password2 the user's password confirmation 165 * @param autoScreenName whether a screen name should be automatically 166 generated for the user 167 * @param screenName the user's screen name 168 * @param emailAddress the user's email address 169 * @param facebookId the user's facebook ID 170 * @param openId the user's OpenID 171 * @param locale the user's locale 172 * @param firstName the user's first name 173 * @param middleName the user's middle name 174 * @param lastName the user's last name 175 * @param prefixId the user's name prefix ID 176 * @param suffixId the user's name suffix ID 177 * @param male whether the user is male 178 * @param birthdayMonth the user's birthday month (0-based, meaning 0 for 179 January) 180 * @param birthdayDay the user's birthday day 181 * @param birthdayYear the user's birthday year 182 * @param jobTitle the user's job title 183 * @param groupIds the primary keys of the user's groups 184 * @param organizationIds the primary keys of the user's organizations 185 * @param roleIds the primary keys of the roles this user possesses 186 * @param userGroupIds the primary keys of the user's user groups 187 * @param sendEmail whether to send the user an email notification about 188 their new account 189 * @param serviceContext the service context to be applied (optionally 190 <code>null</code>). Can set the UUID (with the <code>uuid</code> 191 attribute), asset category IDs, asset tag names, and expando 192 bridge attributes for the user. 193 * @return the new user 194 * @throws PortalException if the user's information was invalid, if the 195 operation was not allowed by the membership policy, if the 196 creator did not have permission to add users, or if the email 197 address was reserved 198 * @throws SystemException if a system exception occurred 199 */ 200 public static com.liferay.portal.model.User addUser(long companyId, 201 boolean autoPassword, java.lang.String password1, 202 java.lang.String password2, boolean autoScreenName, 203 java.lang.String screenName, java.lang.String emailAddress, 204 long facebookId, java.lang.String openId, java.util.Locale locale, 205 java.lang.String firstName, java.lang.String middleName, 206 java.lang.String lastName, int prefixId, int suffixId, boolean male, 207 int birthdayMonth, int birthdayDay, int birthdayYear, 208 java.lang.String jobTitle, long[] groupIds, long[] organizationIds, 209 long[] roleIds, long[] userGroupIds, boolean sendEmail, 210 com.liferay.portal.service.ServiceContext serviceContext) 211 throws com.liferay.portal.kernel.exception.PortalException, 212 com.liferay.portal.kernel.exception.SystemException { 213 return getService() 214 .addUser(companyId, autoPassword, password1, password2, 215 autoScreenName, screenName, emailAddress, facebookId, openId, 216 locale, firstName, middleName, lastName, prefixId, suffixId, male, 217 birthdayMonth, birthdayDay, birthdayYear, jobTitle, groupIds, 218 organizationIds, roleIds, userGroupIds, sendEmail, serviceContext); 219 } 220 221 /** 222 * Adds a user with additional parameters. 223 * 224 * <p> 225 * This method handles the creation and bookkeeping of the user including 226 * its resources, metadata, and internal data structures. It is not 227 * necessary to make subsequent calls to any methods to setup default 228 * groups, resources, etc. 229 * </p> 230 * 231 * @param companyId the primary key of the user's company 232 * @param autoPassword whether a password should be automatically generated 233 for the user 234 * @param password1 the user's password 235 * @param password2 the user's password confirmation 236 * @param autoScreenName whether a screen name should be automatically 237 generated for the user 238 * @param screenName the user's screen name 239 * @param emailAddress the user's email address 240 * @param facebookId the user's facebook ID 241 * @param openId the user's OpenID 242 * @param locale the user's locale 243 * @param firstName the user's first name 244 * @param middleName the user's middle name 245 * @param lastName the user's last name 246 * @param prefixId the user's name prefix ID 247 * @param suffixId the user's name suffix ID 248 * @param male whether the user is male 249 * @param birthdayMonth the user's birthday month (0-based, meaning 0 for 250 January) 251 * @param birthdayDay the user's birthday day 252 * @param birthdayYear the user's birthday year 253 * @param jobTitle the user's job title 254 * @param groupIds the primary keys of the user's groups 255 * @param organizationIds the primary keys of the user's organizations 256 * @param roleIds the primary keys of the roles this user possesses 257 * @param userGroupIds the primary keys of the user's user groups 258 * @param addresses the user's addresses 259 * @param emailAddresses the user's email addresses 260 * @param phones the user's phone numbers 261 * @param websites the user's websites 262 * @param announcementsDelivers the announcements deliveries 263 * @param sendEmail whether to send the user an email notification about 264 their new account 265 * @param serviceContext the service context to be applied (optionally 266 <code>null</code>). Can set the UUID (with the <code>uuid</code> 267 attribute), asset category IDs, asset tag names, and expando 268 bridge attributes for the user. 269 * @return the new user 270 * @throws PortalException if the user's information was invalid, if the 271 creator did not have permission to add users, if the email 272 address was reserved, if the operation was not allowed by the 273 membership policy, or if some other portal exception occurred 274 * @throws SystemException if a system exception occurred 275 */ 276 public static com.liferay.portal.model.User addUser(long companyId, 277 boolean autoPassword, java.lang.String password1, 278 java.lang.String password2, boolean autoScreenName, 279 java.lang.String screenName, java.lang.String emailAddress, 280 long facebookId, java.lang.String openId, java.util.Locale locale, 281 java.lang.String firstName, java.lang.String middleName, 282 java.lang.String lastName, int prefixId, int suffixId, boolean male, 283 int birthdayMonth, int birthdayDay, int birthdayYear, 284 java.lang.String jobTitle, long[] groupIds, long[] organizationIds, 285 long[] roleIds, long[] userGroupIds, 286 java.util.List<com.liferay.portal.model.Address> addresses, 287 java.util.List<com.liferay.portal.model.EmailAddress> emailAddresses, 288 java.util.List<com.liferay.portal.model.Phone> phones, 289 java.util.List<com.liferay.portal.model.Website> websites, 290 java.util.List<com.liferay.portlet.announcements.model.AnnouncementsDelivery> announcementsDelivers, 291 boolean sendEmail, 292 com.liferay.portal.service.ServiceContext serviceContext) 293 throws com.liferay.portal.kernel.exception.PortalException, 294 com.liferay.portal.kernel.exception.SystemException { 295 return getService() 296 .addUser(companyId, autoPassword, password1, password2, 297 autoScreenName, screenName, emailAddress, facebookId, openId, 298 locale, firstName, middleName, lastName, prefixId, suffixId, male, 299 birthdayMonth, birthdayDay, birthdayYear, jobTitle, groupIds, 300 organizationIds, roleIds, userGroupIds, addresses, emailAddresses, 301 phones, websites, announcementsDelivers, sendEmail, serviceContext); 302 } 303 304 /** 305 * Adds the users to the user group. 306 * 307 * @param userGroupId the primary key of the user group 308 * @param userIds the primary keys of the users 309 * @throws PortalException if a user group or user with the primary could 310 could not be found, if the current user did not have permission 311 to assign group members, or if the operation was not allowed by 312 the membership policy 313 * @throws SystemException if a system exception occurred 314 */ 315 public static void addUserGroupUsers(long userGroupId, long[] userIds) 316 throws com.liferay.portal.kernel.exception.PortalException, 317 com.liferay.portal.kernel.exception.SystemException { 318 getService().addUserGroupUsers(userGroupId, userIds); 319 } 320 321 /** 322 * Adds a user with workflow. 323 * 324 * <p> 325 * This method handles the creation and bookkeeping of the user including 326 * its resources, metadata, and internal data structures. It is not 327 * necessary to make subsequent calls to any methods to setup default 328 * groups, resources, etc. 329 * </p> 330 * 331 * @param companyId the primary key of the user's company 332 * @param autoPassword whether a password should be automatically generated 333 for the user 334 * @param password1 the user's password 335 * @param password2 the user's password confirmation 336 * @param autoScreenName whether a screen name should be automatically 337 generated for the user 338 * @param screenName the user's screen name 339 * @param emailAddress the user's email address 340 * @param facebookId the user's facebook ID 341 * @param openId the user's OpenID 342 * @param locale the user's locale 343 * @param firstName the user's first name 344 * @param middleName the user's middle name 345 * @param lastName the user's last name 346 * @param prefixId the user's name prefix ID 347 * @param suffixId the user's name suffix ID 348 * @param male whether the user is male 349 * @param birthdayMonth the user's birthday month (0-based, meaning 0 for 350 January) 351 * @param birthdayDay the user's birthday day 352 * @param birthdayYear the user's birthday year 353 * @param jobTitle the user's job title 354 * @param groupIds the primary keys of the user's groups 355 * @param organizationIds the primary keys of the user's organizations 356 * @param roleIds the primary keys of the roles this user possesses 357 * @param userGroupIds the primary keys of the user's user groups 358 * @param sendEmail whether to send the user an email notification about 359 their new account 360 * @param serviceContext the service context to be applied (optionally 361 <code>null</code>). Can set the UUID (with the <code>uuid</code> 362 attribute), asset category IDs, asset tag names, and expando 363 bridge attributes for the user. 364 * @return the new user 365 * @throws PortalException if the user's information was invalid, if the 366 operation was not allowed by the membership policy, if the 367 creator did not have permission to add users, or if the email 368 address was reserved 369 * @throws SystemException if a system exception occurred 370 */ 371 public static com.liferay.portal.model.User addUserWithWorkflow( 372 long companyId, boolean autoPassword, java.lang.String password1, 373 java.lang.String password2, boolean autoScreenName, 374 java.lang.String screenName, java.lang.String emailAddress, 375 long facebookId, java.lang.String openId, java.util.Locale locale, 376 java.lang.String firstName, java.lang.String middleName, 377 java.lang.String lastName, int prefixId, int suffixId, boolean male, 378 int birthdayMonth, int birthdayDay, int birthdayYear, 379 java.lang.String jobTitle, long[] groupIds, long[] organizationIds, 380 long[] roleIds, long[] userGroupIds, boolean sendEmail, 381 com.liferay.portal.service.ServiceContext serviceContext) 382 throws com.liferay.portal.kernel.exception.PortalException, 383 com.liferay.portal.kernel.exception.SystemException { 384 return getService() 385 .addUserWithWorkflow(companyId, autoPassword, password1, 386 password2, autoScreenName, screenName, emailAddress, facebookId, 387 openId, locale, firstName, middleName, lastName, prefixId, 388 suffixId, male, birthdayMonth, birthdayDay, birthdayYear, jobTitle, 389 groupIds, organizationIds, roleIds, userGroupIds, sendEmail, 390 serviceContext); 391 } 392 393 /** 394 * Adds a user with workflow and additional parameters. 395 * 396 * <p> 397 * This method handles the creation and bookkeeping of the user including 398 * its resources, metadata, and internal data structures. It is not 399 * necessary to make subsequent calls to any methods to setup default 400 * groups, resources, etc. 401 * </p> 402 * 403 * @param companyId the primary key of the user's company 404 * @param autoPassword whether a password should be automatically generated 405 for the user 406 * @param password1 the user's password 407 * @param password2 the user's password confirmation 408 * @param autoScreenName whether a screen name should be automatically 409 generated for the user 410 * @param screenName the user's screen name 411 * @param emailAddress the user's email address 412 * @param facebookId the user's facebook ID 413 * @param openId the user's OpenID 414 * @param locale the user's locale 415 * @param firstName the user's first name 416 * @param middleName the user's middle name 417 * @param lastName the user's last name 418 * @param prefixId the user's name prefix ID 419 * @param suffixId the user's name suffix ID 420 * @param male whether the user is male 421 * @param birthdayMonth the user's birthday month (0-based, meaning 0 for 422 January) 423 * @param birthdayDay the user's birthday day 424 * @param birthdayYear the user's birthday year 425 * @param jobTitle the user's job title 426 * @param groupIds the primary keys of the user's groups 427 * @param organizationIds the primary keys of the user's organizations 428 * @param roleIds the primary keys of the roles this user possesses 429 * @param userGroupIds the primary keys of the user's user groups 430 * @param addresses the user's addresses 431 * @param emailAddresses the user's email addresses 432 * @param phones the user's phone numbers 433 * @param websites the user's websites 434 * @param announcementsDelivers the announcements deliveries 435 * @param sendEmail whether to send the user an email notification about 436 their new account 437 * @param serviceContext the service context to be applied (optionally 438 <code>null</code>). Can set the UUID (with the <code>uuid</code> 439 attribute), asset category IDs, asset tag names, and expando 440 bridge attributes for the user. 441 * @return the new user 442 * @throws PortalException if the user's information was invalid, if the 443 operation was not allowed by the membership policy, if the 444 creator did not have permission to add users, if the email 445 address was reserved, or if some other portal exception occurred 446 * @throws SystemException if a system exception occurred 447 */ 448 public static com.liferay.portal.model.User addUserWithWorkflow( 449 long companyId, boolean autoPassword, java.lang.String password1, 450 java.lang.String password2, boolean autoScreenName, 451 java.lang.String screenName, java.lang.String emailAddress, 452 long facebookId, java.lang.String openId, java.util.Locale locale, 453 java.lang.String firstName, java.lang.String middleName, 454 java.lang.String lastName, int prefixId, int suffixId, boolean male, 455 int birthdayMonth, int birthdayDay, int birthdayYear, 456 java.lang.String jobTitle, long[] groupIds, long[] organizationIds, 457 long[] roleIds, long[] userGroupIds, 458 java.util.List<com.liferay.portal.model.Address> addresses, 459 java.util.List<com.liferay.portal.model.EmailAddress> emailAddresses, 460 java.util.List<com.liferay.portal.model.Phone> phones, 461 java.util.List<com.liferay.portal.model.Website> websites, 462 java.util.List<com.liferay.portlet.announcements.model.AnnouncementsDelivery> announcementsDelivers, 463 boolean sendEmail, 464 com.liferay.portal.service.ServiceContext serviceContext) 465 throws com.liferay.portal.kernel.exception.PortalException, 466 com.liferay.portal.kernel.exception.SystemException { 467 return getService() 468 .addUserWithWorkflow(companyId, autoPassword, password1, 469 password2, autoScreenName, screenName, emailAddress, facebookId, 470 openId, locale, firstName, middleName, lastName, prefixId, 471 suffixId, male, birthdayMonth, birthdayDay, birthdayYear, jobTitle, 472 groupIds, organizationIds, roleIds, userGroupIds, addresses, 473 emailAddresses, phones, websites, announcementsDelivers, sendEmail, 474 serviceContext); 475 } 476 477 /** 478 * Deletes the user's portrait image. 479 * 480 * @param userId the primary key of the user 481 * @throws PortalException if a user with the primary key could not be 482 found, if the user's portrait could not be found, or if the 483 current user did not have permission to update the user 484 * @throws SystemException if a system exception occurred 485 */ 486 public static void deletePortrait(long userId) 487 throws com.liferay.portal.kernel.exception.PortalException, 488 com.liferay.portal.kernel.exception.SystemException { 489 getService().deletePortrait(userId); 490 } 491 492 /** 493 * Removes the user from the role. 494 * 495 * @param roleId the primary key of the role 496 * @param userId the primary key of the user 497 * @throws PortalException if a role or user with the primary key could not 498 be found, or if the current user did not have permission to 499 assign role members 500 * @throws SystemException if a system exception occurred 501 */ 502 public static void deleteRoleUser(long roleId, long userId) 503 throws com.liferay.portal.kernel.exception.PortalException, 504 com.liferay.portal.kernel.exception.SystemException { 505 getService().deleteRoleUser(roleId, userId); 506 } 507 508 /** 509 * Deletes the user. 510 * 511 * @param userId the primary key of the user 512 * @throws PortalException if a user with the primary key could not be found 513 or if the current user did not have permission to delete the user 514 * @throws SystemException if a system exception occurred 515 */ 516 public static void deleteUser(long userId) 517 throws com.liferay.portal.kernel.exception.PortalException, 518 com.liferay.portal.kernel.exception.SystemException { 519 getService().deleteUser(userId); 520 } 521 522 public static java.util.List<com.liferay.portal.model.User> getCompanyUsers( 523 long companyId, int start, int end) 524 throws com.liferay.portal.kernel.exception.PortalException, 525 com.liferay.portal.kernel.exception.SystemException { 526 return getService().getCompanyUsers(companyId, start, end); 527 } 528 529 public static int getCompanyUsersCount(long companyId) 530 throws com.liferay.portal.kernel.exception.PortalException, 531 com.liferay.portal.kernel.exception.SystemException { 532 return getService().getCompanyUsersCount(companyId); 533 } 534 535 public static com.liferay.portal.model.User getCurrentUser() 536 throws com.liferay.portal.kernel.exception.PortalException, 537 com.liferay.portal.kernel.exception.SystemException { 538 return getService().getCurrentUser(); 539 } 540 541 /** 542 * Returns the primary keys of all the users belonging to the group. 543 * 544 * @param groupId the primary key of the group 545 * @return the primary keys of the users belonging to the group 546 * @throws PortalException if the current user did not have permission to 547 view group assignments 548 * @throws SystemException if a system exception occurred 549 */ 550 public static long[] getGroupUserIds(long groupId) 551 throws com.liferay.portal.kernel.exception.PortalException, 552 com.liferay.portal.kernel.exception.SystemException { 553 return getService().getGroupUserIds(groupId); 554 } 555 556 /** 557 * Returns all the users belonging to the group. 558 * 559 * @param groupId the primary key of the group 560 * @return the users belonging to the group 561 * @throws PortalException if the current user did not have permission to 562 view group assignments 563 * @throws SystemException if a system exception occurred 564 */ 565 public static java.util.List<com.liferay.portal.model.User> getGroupUsers( 566 long groupId) 567 throws com.liferay.portal.kernel.exception.PortalException, 568 com.liferay.portal.kernel.exception.SystemException { 569 return getService().getGroupUsers(groupId); 570 } 571 572 /** 573 * Returns the primary keys of all the users belonging to the organization. 574 * 575 * @param organizationId the primary key of the organization 576 * @return the primary keys of the users belonging to the organization 577 * @throws PortalException if the current user did not have permission to 578 view organization assignments 579 * @throws SystemException if a system exception occurred 580 */ 581 public static long[] getOrganizationUserIds(long organizationId) 582 throws com.liferay.portal.kernel.exception.PortalException, 583 com.liferay.portal.kernel.exception.SystemException { 584 return getService().getOrganizationUserIds(organizationId); 585 } 586 587 /** 588 * Returns all the users belonging to the organization. 589 * 590 * @param organizationId the primary key of the organization 591 * @return users belonging to the organization 592 * @throws PortalException if the current user did not have permission to 593 view organization assignments 594 * @throws SystemException if a system exception occurred 595 */ 596 public static java.util.List<com.liferay.portal.model.User> getOrganizationUsers( 597 long organizationId) 598 throws com.liferay.portal.kernel.exception.PortalException, 599 com.liferay.portal.kernel.exception.SystemException { 600 return getService().getOrganizationUsers(organizationId); 601 } 602 603 /** 604 * Returns the primary keys of all the users belonging to the role. 605 * 606 * @param roleId the primary key of the role 607 * @return the primary keys of the users belonging to the role 608 * @throws PortalException if the current user did not have permission to 609 view role members 610 * @throws SystemException if a system exception occurred 611 */ 612 public static long[] getRoleUserIds(long roleId) 613 throws com.liferay.portal.kernel.exception.PortalException, 614 com.liferay.portal.kernel.exception.SystemException { 615 return getService().getRoleUserIds(roleId); 616 } 617 618 /** 619 * Returns the user with the email address. 620 * 621 * @param companyId the primary key of the user's company 622 * @param emailAddress the user's email address 623 * @return the user with the email address 624 * @throws PortalException if a user with the email address could not be 625 found or if the current user did not have permission to view the 626 user 627 * @throws SystemException if a system exception occurred 628 */ 629 public static com.liferay.portal.model.User getUserByEmailAddress( 630 long companyId, java.lang.String emailAddress) 631 throws com.liferay.portal.kernel.exception.PortalException, 632 com.liferay.portal.kernel.exception.SystemException { 633 return getService().getUserByEmailAddress(companyId, emailAddress); 634 } 635 636 /** 637 * Returns the user with the primary key. 638 * 639 * @param userId the primary key of the user 640 * @return the user with the primary key 641 * @throws PortalException if a user with the primary key could not be found 642 or if the current user did not have permission to view the user 643 * @throws SystemException if a system exception occurred 644 */ 645 public static com.liferay.portal.model.User getUserById(long userId) 646 throws com.liferay.portal.kernel.exception.PortalException, 647 com.liferay.portal.kernel.exception.SystemException { 648 return getService().getUserById(userId); 649 } 650 651 /** 652 * Returns the user with the screen name. 653 * 654 * @param companyId the primary key of the user's company 655 * @param screenName the user's screen name 656 * @return the user with the screen name 657 * @throws PortalException if a user with the screen name could not be found 658 or if the current user did not have permission to view the user 659 * @throws SystemException if a system exception occurred 660 */ 661 public static com.liferay.portal.model.User getUserByScreenName( 662 long companyId, java.lang.String screenName) 663 throws com.liferay.portal.kernel.exception.PortalException, 664 com.liferay.portal.kernel.exception.SystemException { 665 return getService().getUserByScreenName(companyId, screenName); 666 } 667 668 public static java.util.List<com.liferay.portal.model.User> getUserGroupUsers( 669 long userGroupId) 670 throws com.liferay.portal.kernel.exception.PortalException, 671 com.liferay.portal.kernel.exception.SystemException { 672 return getService().getUserGroupUsers(userGroupId); 673 } 674 675 /** 676 * Returns the primary key of the user with the email address. 677 * 678 * @param companyId the primary key of the user's company 679 * @param emailAddress the user's email address 680 * @return the primary key of the user with the email address 681 * @throws PortalException if a user with the email address could not be 682 found 683 * @throws SystemException if a system exception occurred 684 */ 685 public static long getUserIdByEmailAddress(long companyId, 686 java.lang.String emailAddress) 687 throws com.liferay.portal.kernel.exception.PortalException, 688 com.liferay.portal.kernel.exception.SystemException { 689 return getService().getUserIdByEmailAddress(companyId, emailAddress); 690 } 691 692 /** 693 * Returns the primary key of the user with the screen name. 694 * 695 * @param companyId the primary key of the user's company 696 * @param screenName the user's screen name 697 * @return the primary key of the user with the screen name 698 * @throws PortalException if a user with the screen name could not be found 699 * @throws SystemException if a system exception occurred 700 */ 701 public static long getUserIdByScreenName(long companyId, 702 java.lang.String screenName) 703 throws com.liferay.portal.kernel.exception.PortalException, 704 com.liferay.portal.kernel.exception.SystemException { 705 return getService().getUserIdByScreenName(companyId, screenName); 706 } 707 708 /** 709 * Returns <code>true</code> if the user is a member of the group. 710 * 711 * @param groupId the primary key of the group 712 * @param userId the primary key of the user 713 * @return <code>true</code> if the user is a member of the group; 714 <code>false</code> otherwise 715 * @throws PortalException if the current user did not have permission to 716 view the user or group members 717 * @throws SystemException if a system exception occurred 718 */ 719 public static boolean hasGroupUser(long groupId, long userId) 720 throws com.liferay.portal.kernel.exception.PortalException, 721 com.liferay.portal.kernel.exception.SystemException { 722 return getService().hasGroupUser(groupId, userId); 723 } 724 725 /** 726 * Returns <code>true</code> if the user is a member of the role. 727 * 728 * @param roleId the primary key of the role 729 * @param userId the primary key of the user 730 * @return <code>true</code> if the user is a member of the role; 731 <code>false</code> otherwise 732 * @throws PortalException if the current user did not have permission to 733 view the user or role members 734 * @throws SystemException if a system exception occurred 735 */ 736 public static boolean hasRoleUser(long roleId, long userId) 737 throws com.liferay.portal.kernel.exception.PortalException, 738 com.liferay.portal.kernel.exception.SystemException { 739 return getService().hasRoleUser(roleId, userId); 740 } 741 742 /** 743 * Returns <code>true</code> if the user has the role with the name, 744 * optionally through inheritance. 745 * 746 * @param companyId the primary key of the role's company 747 * @param name the name of the role (must be a regular role, not an 748 organization, site or provider role) 749 * @param userId the primary key of the user 750 * @param inherited whether to include roles inherited from organizations, 751 sites, etc. 752 * @return <code>true</code> if the user has the role; <code>false</code> 753 otherwise 754 * @throws PortalException if a role with the name could not be found 755 * @throws SystemException if a system exception occurred 756 */ 757 public static boolean hasRoleUser(long companyId, java.lang.String name, 758 long userId, boolean inherited) 759 throws com.liferay.portal.kernel.exception.PortalException, 760 com.liferay.portal.kernel.exception.SystemException { 761 return getService().hasRoleUser(companyId, name, userId, inherited); 762 } 763 764 /** 765 * Sets the users in the role, removing and adding users to the role as 766 * necessary. 767 * 768 * @param roleId the primary key of the role 769 * @param userIds the primary keys of the users 770 * @throws PortalException if the current user did not have permission to 771 assign role members or if the operation was not allowed by the 772 membership policy 773 * @throws SystemException if a system exception occurred 774 */ 775 public static void setRoleUsers(long roleId, long[] userIds) 776 throws com.liferay.portal.kernel.exception.PortalException, 777 com.liferay.portal.kernel.exception.SystemException { 778 getService().setRoleUsers(roleId, userIds); 779 } 780 781 /** 782 * Sets the users in the user group, removing and adding users to the user 783 * group as necessary. 784 * 785 * @param userGroupId the primary key of the user group 786 * @param userIds the primary keys of the users 787 * @throws PortalException if the current user did not have permission to 788 assign group members 789 * @throws SystemException if a system exception occurred 790 */ 791 public static void setUserGroupUsers(long userGroupId, long[] userIds) 792 throws com.liferay.portal.kernel.exception.PortalException, 793 com.liferay.portal.kernel.exception.SystemException { 794 getService().setUserGroupUsers(userGroupId, userIds); 795 } 796 797 /** 798 * Removes the users from the teams of a group. 799 * 800 * @param groupId the primary key of the group 801 * @param userIds the primary keys of the users 802 * @throws PortalException if the current user did not have permission to 803 modify user group assignments 804 * @throws SystemException if a system exception occurred 805 */ 806 public static void unsetGroupTeamsUsers(long groupId, long[] userIds) 807 throws com.liferay.portal.kernel.exception.PortalException, 808 com.liferay.portal.kernel.exception.SystemException { 809 getService().unsetGroupTeamsUsers(groupId, userIds); 810 } 811 812 /** 813 * Removes the users from the group. 814 * 815 * @param groupId the primary key of the group 816 * @param userIds the primary keys of the users 817 * @param serviceContext the service context to be applied (optionally 818 <code>null</code>) 819 * @throws PortalException if the current user did not have permission to 820 modify group assignments or if the operation was not allowed by 821 the membership policy 822 * @throws SystemException if a system exception occurred 823 */ 824 public static void unsetGroupUsers(long groupId, long[] userIds, 825 com.liferay.portal.service.ServiceContext serviceContext) 826 throws com.liferay.portal.kernel.exception.PortalException, 827 com.liferay.portal.kernel.exception.SystemException { 828 getService().unsetGroupUsers(groupId, userIds, serviceContext); 829 } 830 831 /** 832 * Removes the users from the organization. 833 * 834 * @param organizationId the primary key of the organization 835 * @param userIds the primary keys of the users 836 * @throws PortalException if the current user did not have permission to 837 modify organization assignments or if the operation was not 838 allowed by the membership policy 839 * @throws SystemException if a system exception occurred 840 */ 841 public static void unsetOrganizationUsers(long organizationId, 842 long[] userIds) 843 throws com.liferay.portal.kernel.exception.PortalException, 844 com.liferay.portal.kernel.exception.SystemException { 845 getService().unsetOrganizationUsers(organizationId, userIds); 846 } 847 848 /** 849 * Removes the users from the password policy. 850 * 851 * @param passwordPolicyId the primary key of the password policy 852 * @param userIds the primary keys of the users 853 * @throws PortalException if the current user did not have permission to 854 modify policy assignments 855 * @throws SystemException if a system exception occurred 856 */ 857 public static void unsetPasswordPolicyUsers(long passwordPolicyId, 858 long[] userIds) 859 throws com.liferay.portal.kernel.exception.PortalException, 860 com.liferay.portal.kernel.exception.SystemException { 861 getService().unsetPasswordPolicyUsers(passwordPolicyId, userIds); 862 } 863 864 /** 865 * Removes the users from the role. 866 * 867 * @param roleId the primary key of the role 868 * @param userIds the primary keys of the users 869 * @throws PortalException if the current user did not have permission to 870 modify role assignments or if the operation was not allowed by 871 the membership policy 872 * @throws SystemException if a system exception occurred 873 */ 874 public static void unsetRoleUsers(long roleId, long[] userIds) 875 throws com.liferay.portal.kernel.exception.PortalException, 876 com.liferay.portal.kernel.exception.SystemException { 877 getService().unsetRoleUsers(roleId, userIds); 878 } 879 880 /** 881 * Removes the users from the team. 882 * 883 * @param teamId the primary key of the team 884 * @param userIds the primary keys of the users 885 * @throws PortalException if the current user did not have permission to 886 modify team assignments 887 * @throws SystemException if a system exception occurred 888 */ 889 public static void unsetTeamUsers(long teamId, long[] userIds) 890 throws com.liferay.portal.kernel.exception.PortalException, 891 com.liferay.portal.kernel.exception.SystemException { 892 getService().unsetTeamUsers(teamId, userIds); 893 } 894 895 /** 896 * Removes the users from the user group. 897 * 898 * @param userGroupId the primary key of the user group 899 * @param userIds the primary keys of the users 900 * @throws PortalException if the current user did not have permission to 901 modify user group assignments or if the operation was not allowed 902 by the membership policy 903 * @throws SystemException if a system exception occurred 904 */ 905 public static void unsetUserGroupUsers(long userGroupId, long[] userIds) 906 throws com.liferay.portal.kernel.exception.PortalException, 907 com.liferay.portal.kernel.exception.SystemException { 908 getService().unsetUserGroupUsers(userGroupId, userIds); 909 } 910 911 /** 912 * Updates the user's response to the terms of use agreement. 913 * 914 * @param userId the primary key of the user 915 * @param agreedToTermsOfUse whether the user has agree to the terms of use 916 * @return the user 917 * @throws PortalException if the current user did not have permission to 918 update the user's agreement to terms-of-use 919 * @throws SystemException if a system exception occurred 920 */ 921 public static com.liferay.portal.model.User updateAgreedToTermsOfUse( 922 long userId, boolean agreedToTermsOfUse) 923 throws com.liferay.portal.kernel.exception.PortalException, 924 com.liferay.portal.kernel.exception.SystemException { 925 return getService().updateAgreedToTermsOfUse(userId, agreedToTermsOfUse); 926 } 927 928 /** 929 * Updates the user's email address. 930 * 931 * @param userId the primary key of the user 932 * @param password the user's password 933 * @param emailAddress1 the user's new email address 934 * @param emailAddress2 the user's new email address confirmation 935 * @param serviceContext the service context to be applied. Must set the 936 portal URL, main path, primary key of the layout, remote address, 937 remote host, and agent for the user. 938 * @return the user 939 * @throws PortalException if a user with the primary key could not be found 940 or if the current user did not have permission to update the user 941 * @throws SystemException if a system exception occurred 942 */ 943 public static com.liferay.portal.model.User updateEmailAddress( 944 long userId, java.lang.String password, java.lang.String emailAddress1, 945 java.lang.String emailAddress2, 946 com.liferay.portal.service.ServiceContext serviceContext) 947 throws com.liferay.portal.kernel.exception.PortalException, 948 com.liferay.portal.kernel.exception.SystemException { 949 return getService() 950 .updateEmailAddress(userId, password, emailAddress1, 951 emailAddress2, serviceContext); 952 } 953 954 /** 955 * Updates a user account that was automatically created when a guest user 956 * participated in an action (e.g. posting a comment) and only provided his 957 * name and email address. 958 * 959 * @param companyId the primary key of the user's company 960 * @param autoPassword whether a password should be automatically generated 961 for the user 962 * @param password1 the user's password 963 * @param password2 the user's password confirmation 964 * @param autoScreenName whether a screen name should be automatically 965 generated for the user 966 * @param screenName the user's screen name 967 * @param emailAddress the user's email address 968 * @param facebookId the user's facebook ID 969 * @param openId the user's OpenID 970 * @param locale the user's locale 971 * @param firstName the user's first name 972 * @param middleName the user's middle name 973 * @param lastName the user's last name 974 * @param prefixId the user's name prefix ID 975 * @param suffixId the user's name suffix ID 976 * @param male whether the user is male 977 * @param birthdayMonth the user's birthday month (0-based, meaning 0 for 978 January) 979 * @param birthdayDay the user's birthday day 980 * @param birthdayYear the user's birthday year 981 * @param jobTitle the user's job title 982 * @param updateUserInformation whether to update the user's information 983 * @param sendEmail whether to send the user an email notification about 984 their new account 985 * @param serviceContext the service context to be applied (optionally 986 <code>null</code>). Can set the expando bridge attributes for the 987 user. 988 * @return the user 989 * @throws PortalException if the user's information was invalid or if the 990 email address was reserved 991 * @throws SystemException if a system exception occurred 992 */ 993 public static com.liferay.portal.model.User updateIncompleteUser( 994 long companyId, boolean autoPassword, java.lang.String password1, 995 java.lang.String password2, boolean autoScreenName, 996 java.lang.String screenName, java.lang.String emailAddress, 997 long facebookId, java.lang.String openId, java.util.Locale locale, 998 java.lang.String firstName, java.lang.String middleName, 999 java.lang.String lastName, int prefixId, int suffixId, boolean male, 1000 int birthdayMonth, int birthdayDay, int birthdayYear, 1001 java.lang.String jobTitle, boolean updateUserInformation, 1002 boolean sendEmail, 1003 com.liferay.portal.service.ServiceContext serviceContext) 1004 throws com.liferay.portal.kernel.exception.PortalException, 1005 com.liferay.portal.kernel.exception.SystemException { 1006 return getService() 1007 .updateIncompleteUser(companyId, autoPassword, password1, 1008 password2, autoScreenName, screenName, emailAddress, facebookId, 1009 openId, locale, firstName, middleName, lastName, prefixId, 1010 suffixId, male, birthdayMonth, birthdayDay, birthdayYear, jobTitle, 1011 updateUserInformation, sendEmail, serviceContext); 1012 } 1013 1014 /** 1015 * Updates whether the user is locked out from logging in. 1016 * 1017 * @param userId the primary key of the user 1018 * @param lockout whether the user is locked out 1019 * @return the user 1020 * @throws PortalException if the user did not have permission to lock out 1021 the user 1022 * @throws SystemException if a system exception occurred 1023 */ 1024 public static com.liferay.portal.model.User updateLockoutById(long userId, 1025 boolean lockout) 1026 throws com.liferay.portal.kernel.exception.PortalException, 1027 com.liferay.portal.kernel.exception.SystemException { 1028 return getService().updateLockoutById(userId, lockout); 1029 } 1030 1031 /** 1032 * Updates the user's OpenID. 1033 * 1034 * @param userId the primary key of the user 1035 * @param openId the new OpenID 1036 * @return the user 1037 * @throws PortalException if a user with the primary key could not be found 1038 or if the current user did not have permission to update the user 1039 * @throws SystemException if a system exception occurred 1040 */ 1041 public static com.liferay.portal.model.User updateOpenId(long userId, 1042 java.lang.String openId) 1043 throws com.liferay.portal.kernel.exception.PortalException, 1044 com.liferay.portal.kernel.exception.SystemException { 1045 return getService().updateOpenId(userId, openId); 1046 } 1047 1048 /** 1049 * Sets the organizations that the user is in, removing and adding 1050 * organizations as necessary. 1051 * 1052 * @param userId the primary key of the user 1053 * @param organizationIds the primary keys of the organizations 1054 * @param serviceContext the service context to be applied. Must set 1055 whether user indexing is enabled. 1056 * @throws PortalException if a user with the primary key could not be found 1057 or if the current user did not have permission to update the user 1058 * @throws SystemException if a system exception occurred 1059 */ 1060 public static void updateOrganizations(long userId, long[] organizationIds, 1061 com.liferay.portal.service.ServiceContext serviceContext) 1062 throws com.liferay.portal.kernel.exception.PortalException, 1063 com.liferay.portal.kernel.exception.SystemException { 1064 getService().updateOrganizations(userId, organizationIds, serviceContext); 1065 } 1066 1067 /** 1068 * Updates the user's password without tracking or validation of the change. 1069 * 1070 * @param userId the primary key of the user 1071 * @param password1 the user's new password 1072 * @param password2 the user's new password confirmation 1073 * @param passwordReset whether the user should be asked to reset their 1074 password the next time they log in 1075 * @return the user 1076 * @throws PortalException if a user with the primary key could not be found 1077 or if the current user did not have permission to update the user 1078 * @throws SystemException if a system exception occurred 1079 */ 1080 public static com.liferay.portal.model.User updatePassword(long userId, 1081 java.lang.String password1, java.lang.String password2, 1082 boolean passwordReset) 1083 throws com.liferay.portal.kernel.exception.PortalException, 1084 com.liferay.portal.kernel.exception.SystemException { 1085 return getService() 1086 .updatePassword(userId, password1, password2, passwordReset); 1087 } 1088 1089 /** 1090 * Updates the user's portrait image. 1091 * 1092 * @param userId the primary key of the user 1093 * @param bytes the new portrait image data 1094 * @return the user 1095 * @throws PortalException if a user with the primary key could not be 1096 found, if the new portrait was invalid, or if the current user 1097 did not have permission to update the user 1098 * @throws SystemException if a system exception occurred 1099 */ 1100 public static com.liferay.portal.model.User updatePortrait(long userId, 1101 byte[] bytes) 1102 throws com.liferay.portal.kernel.exception.PortalException, 1103 com.liferay.portal.kernel.exception.SystemException { 1104 return getService().updatePortrait(userId, bytes); 1105 } 1106 1107 /** 1108 * Updates the user's password reset question and answer. 1109 * 1110 * @param userId the primary key of the user 1111 * @param question the user's new password reset question 1112 * @param answer the user's new password reset answer 1113 * @return the user 1114 * @throws PortalException if a user with the primary key could not be 1115 found, if the new question or answer were invalid, or if the 1116 current user did not have permission to update the user 1117 * @throws SystemException if a system exception occurred 1118 */ 1119 public static com.liferay.portal.model.User updateReminderQuery( 1120 long userId, java.lang.String question, java.lang.String answer) 1121 throws com.liferay.portal.kernel.exception.PortalException, 1122 com.liferay.portal.kernel.exception.SystemException { 1123 return getService().updateReminderQuery(userId, question, answer); 1124 } 1125 1126 /** 1127 * Updates the user's screen name. 1128 * 1129 * @param userId the primary key of the user 1130 * @param screenName the user's new screen name 1131 * @return the user 1132 * @throws PortalException if a user with the primary key could not be 1133 found, if the new screen name was invalid, or if the current user 1134 did not have permission to update the user 1135 * @throws SystemException if a system exception occurred 1136 */ 1137 public static com.liferay.portal.model.User updateScreenName(long userId, 1138 java.lang.String screenName) 1139 throws com.liferay.portal.kernel.exception.PortalException, 1140 com.liferay.portal.kernel.exception.SystemException { 1141 return getService().updateScreenName(userId, screenName); 1142 } 1143 1144 /** 1145 * Updates the user's workflow status. 1146 * 1147 * @param userId the primary key of the user 1148 * @param status the user's new workflow status 1149 * @return the user 1150 * @throws PortalException if a user with the primary key could not be 1151 found, if the current user was updating her own status to 1152 anything but {@link 1153 com.liferay.portal.kernel.workflow.WorkflowConstants#STATUS_APPROVED}, 1154 or if the current user did not have permission to update the 1155 user's workflow status. 1156 * @throws SystemException if a system exception occurred 1157 * @deprecated As of 7.0.0, replaced by {@link #updateStatus(long, int, 1158 ServiceContext)} 1159 */ 1160 public static com.liferay.portal.model.User updateStatus(long userId, 1161 int status) 1162 throws com.liferay.portal.kernel.exception.PortalException, 1163 com.liferay.portal.kernel.exception.SystemException { 1164 return getService().updateStatus(userId, status); 1165 } 1166 1167 /** 1168 * Updates the user's workflow status. 1169 * 1170 * @param userId the primary key of the user 1171 * @param status the user's new workflow status 1172 * @param serviceContext the service context to be applied. You can specify 1173 an unencrypted custom password (used by an LDAP listener) for the 1174 user via attribute <code>passwordUnencrypted</code>. 1175 * @return the user 1176 * @throws PortalException if a user with the primary key could not be 1177 found, if the current user was updating her own status to 1178 anything but {@link 1179 com.liferay.portal.kernel.workflow.WorkflowConstants#STATUS_APPROVED}, 1180 or if the current user did not have permission to update the 1181 user's workflow status. 1182 * @throws SystemException if a system exception occurred 1183 */ 1184 public static com.liferay.portal.model.User updateStatus(long userId, 1185 int status, com.liferay.portal.service.ServiceContext serviceContext) 1186 throws com.liferay.portal.kernel.exception.PortalException, 1187 com.liferay.portal.kernel.exception.SystemException { 1188 return getService().updateStatus(userId, status, serviceContext); 1189 } 1190 1191 /** 1192 * Updates the user with additional parameters. 1193 * 1194 * @param userId the primary key of the user 1195 * @param oldPassword the user's old password 1196 * @param newPassword1 the user's new password (optionally 1197 <code>null</code>) 1198 * @param newPassword2 the user's new password confirmation (optionally 1199 <code>null</code>) 1200 * @param passwordReset whether the user should be asked to reset their 1201 password the next time they login 1202 * @param reminderQueryQuestion the user's new password reset question 1203 * @param reminderQueryAnswer the user's new password reset answer 1204 * @param screenName the user's new screen name 1205 * @param emailAddress the user's new email address 1206 * @param facebookId the user's new Facebook ID 1207 * @param openId the user's new OpenID 1208 * @param languageId the user's new language ID 1209 * @param timeZoneId the user's new time zone ID 1210 * @param greeting the user's new greeting 1211 * @param comments the user's new comments 1212 * @param firstName the user's new first name 1213 * @param middleName the user's new middle name 1214 * @param lastName the user's new last name 1215 * @param prefixId the user's new name prefix ID 1216 * @param suffixId the user's new name suffix ID 1217 * @param male whether user is male 1218 * @param birthdayMonth the user's new birthday month (0-based, meaning 0 1219 for January) 1220 * @param birthdayDay the user's new birthday day 1221 * @param birthdayYear the user's birthday year 1222 * @param smsSn the user's new SMS screen name 1223 * @param aimSn the user's new AIM screen name 1224 * @param facebookSn the user's new Facebook screen name 1225 * @param icqSn the user's new ICQ screen name 1226 * @param jabberSn the user's new Jabber screen name 1227 * @param msnSn the user's new MSN screen name 1228 * @param mySpaceSn the user's new MySpace screen name 1229 * @param skypeSn the user's new Skype screen name 1230 * @param twitterSn the user's new Twitter screen name 1231 * @param ymSn the user's new Yahoo! Messenger screen name 1232 * @param jobTitle the user's new job title 1233 * @param groupIds the primary keys of the user's groups 1234 * @param organizationIds the primary keys of the user's organizations 1235 * @param roleIds the primary keys of the user's roles 1236 * @param userGroupRoles the user user's group roles 1237 * @param userGroupIds the primary keys of the user's user groups 1238 * @param addresses the user's addresses 1239 * @param emailAddresses the user's email addresses 1240 * @param phones the user's phone numbers 1241 * @param websites the user's websites 1242 * @param announcementsDelivers the announcements deliveries 1243 * @param serviceContext the service context to be applied (optionally 1244 <code>null</code>). Can set the UUID (with the <code>uuid</code> 1245 attribute), asset category IDs, asset tag names, and expando 1246 bridge attributes for the user. 1247 * @return the user 1248 * @throws PortalException if a user with the primary key could not be 1249 found, if the new information was invalid, if the current user 1250 did not have permission to update the user, or if the operation 1251 was not allowed by the membership policy 1252 * @throws SystemException if a system exception occurred 1253 */ 1254 public static com.liferay.portal.model.User updateUser(long userId, 1255 java.lang.String oldPassword, java.lang.String newPassword1, 1256 java.lang.String newPassword2, boolean passwordReset, 1257 java.lang.String reminderQueryQuestion, 1258 java.lang.String reminderQueryAnswer, java.lang.String screenName, 1259 java.lang.String emailAddress, long facebookId, 1260 java.lang.String openId, java.lang.String languageId, 1261 java.lang.String timeZoneId, java.lang.String greeting, 1262 java.lang.String comments, java.lang.String firstName, 1263 java.lang.String middleName, java.lang.String lastName, int prefixId, 1264 int suffixId, boolean male, int birthdayMonth, int birthdayDay, 1265 int birthdayYear, java.lang.String smsSn, java.lang.String aimSn, 1266 java.lang.String facebookSn, java.lang.String icqSn, 1267 java.lang.String jabberSn, java.lang.String msnSn, 1268 java.lang.String mySpaceSn, java.lang.String skypeSn, 1269 java.lang.String twitterSn, java.lang.String ymSn, 1270 java.lang.String jobTitle, long[] groupIds, long[] organizationIds, 1271 long[] roleIds, 1272 java.util.List<com.liferay.portal.model.UserGroupRole> userGroupRoles, 1273 long[] userGroupIds, 1274 java.util.List<com.liferay.portal.model.Address> addresses, 1275 java.util.List<com.liferay.portal.model.EmailAddress> emailAddresses, 1276 java.util.List<com.liferay.portal.model.Phone> phones, 1277 java.util.List<com.liferay.portal.model.Website> websites, 1278 java.util.List<com.liferay.portlet.announcements.model.AnnouncementsDelivery> announcementsDelivers, 1279 com.liferay.portal.service.ServiceContext serviceContext) 1280 throws com.liferay.portal.kernel.exception.PortalException, 1281 com.liferay.portal.kernel.exception.SystemException { 1282 return getService() 1283 .updateUser(userId, oldPassword, newPassword1, newPassword2, 1284 passwordReset, reminderQueryQuestion, reminderQueryAnswer, 1285 screenName, emailAddress, facebookId, openId, languageId, 1286 timeZoneId, greeting, comments, firstName, middleName, lastName, 1287 prefixId, suffixId, male, birthdayMonth, birthdayDay, birthdayYear, 1288 smsSn, aimSn, facebookSn, icqSn, jabberSn, msnSn, mySpaceSn, 1289 skypeSn, twitterSn, ymSn, jobTitle, groupIds, organizationIds, 1290 roleIds, userGroupRoles, userGroupIds, addresses, emailAddresses, 1291 phones, websites, announcementsDelivers, serviceContext); 1292 } 1293 1294 /** 1295 * Updates the user. 1296 * 1297 * @param userId the primary key of the user 1298 * @param oldPassword the user's old password 1299 * @param newPassword1 the user's new password (optionally 1300 <code>null</code>) 1301 * @param newPassword2 the user's new password confirmation (optionally 1302 <code>null</code>) 1303 * @param passwordReset whether the user should be asked to reset their 1304 password the next time they login 1305 * @param reminderQueryQuestion the user's new password reset question 1306 * @param reminderQueryAnswer the user's new password reset answer 1307 * @param screenName the user's new screen name 1308 * @param emailAddress the user's new email address 1309 * @param facebookId the user's new Facebook ID 1310 * @param openId the user's new OpenID 1311 * @param languageId the user's new language ID 1312 * @param timeZoneId the user's new time zone ID 1313 * @param greeting the user's new greeting 1314 * @param comments the user's new comments 1315 * @param firstName the user's new first name 1316 * @param middleName the user's new middle name 1317 * @param lastName the user's new last name 1318 * @param prefixId the user's new name prefix ID 1319 * @param suffixId the user's new name suffix ID 1320 * @param male whether user is male 1321 * @param birthdayMonth the user's new birthday month (0-based, meaning 0 1322 for January) 1323 * @param birthdayDay the user's new birthday day 1324 * @param birthdayYear the user's birthday year 1325 * @param smsSn the user's new SMS screen name 1326 * @param aimSn the user's new AIM screen name 1327 * @param facebookSn the user's new Facebook screen name 1328 * @param icqSn the user's new ICQ screen name 1329 * @param jabberSn the user's new Jabber screen name 1330 * @param msnSn the user's new MSN screen name 1331 * @param mySpaceSn the user's new MySpace screen name 1332 * @param skypeSn the user's new Skype screen name 1333 * @param twitterSn the user's new Twitter screen name 1334 * @param ymSn the user's new Yahoo! Messenger screen name 1335 * @param jobTitle the user's new job title 1336 * @param groupIds the primary keys of the user's groups 1337 * @param organizationIds the primary keys of the user's organizations 1338 * @param roleIds the primary keys of the user's roles 1339 * @param userGroupRoles the user user's group roles 1340 * @param userGroupIds the primary keys of the user's user groups 1341 * @param serviceContext the service context to be applied (optionally 1342 <code>null</code>). Can set the UUID (with the <code>uuid</code> 1343 attribute), asset category IDs, asset tag names, and expando 1344 bridge attributes for the user. 1345 * @return the user 1346 * @throws PortalException if a user with the primary key could not be 1347 found, if the new information was invalid, if the current user 1348 did not have permission to update the user, or if the operation 1349 was not allowed by the membership policy 1350 * @throws SystemException if a system exception occurred 1351 */ 1352 public static com.liferay.portal.model.User updateUser(long userId, 1353 java.lang.String oldPassword, java.lang.String newPassword1, 1354 java.lang.String newPassword2, boolean passwordReset, 1355 java.lang.String reminderQueryQuestion, 1356 java.lang.String reminderQueryAnswer, java.lang.String screenName, 1357 java.lang.String emailAddress, long facebookId, 1358 java.lang.String openId, java.lang.String languageId, 1359 java.lang.String timeZoneId, java.lang.String greeting, 1360 java.lang.String comments, java.lang.String firstName, 1361 java.lang.String middleName, java.lang.String lastName, int prefixId, 1362 int suffixId, boolean male, int birthdayMonth, int birthdayDay, 1363 int birthdayYear, java.lang.String smsSn, java.lang.String aimSn, 1364 java.lang.String facebookSn, java.lang.String icqSn, 1365 java.lang.String jabberSn, java.lang.String msnSn, 1366 java.lang.String mySpaceSn, java.lang.String skypeSn, 1367 java.lang.String twitterSn, java.lang.String ymSn, 1368 java.lang.String jobTitle, long[] groupIds, long[] organizationIds, 1369 long[] roleIds, 1370 java.util.List<com.liferay.portal.model.UserGroupRole> userGroupRoles, 1371 long[] userGroupIds, 1372 com.liferay.portal.service.ServiceContext serviceContext) 1373 throws com.liferay.portal.kernel.exception.PortalException, 1374 com.liferay.portal.kernel.exception.SystemException { 1375 return getService() 1376 .updateUser(userId, oldPassword, newPassword1, newPassword2, 1377 passwordReset, reminderQueryQuestion, reminderQueryAnswer, 1378 screenName, emailAddress, facebookId, openId, languageId, 1379 timeZoneId, greeting, comments, firstName, middleName, lastName, 1380 prefixId, suffixId, male, birthdayMonth, birthdayDay, birthdayYear, 1381 smsSn, aimSn, facebookSn, icqSn, jabberSn, msnSn, mySpaceSn, 1382 skypeSn, twitterSn, ymSn, jobTitle, groupIds, organizationIds, 1383 roleIds, userGroupRoles, userGroupIds, serviceContext); 1384 } 1385 1386 public static UserService getService() { 1387 if (_service == null) { 1388 _service = (UserService)PortalBeanLocatorUtil.locate(UserService.class.getName()); 1389 1390 ReferenceRegistry.registerReference(UserServiceUtil.class, 1391 "_service"); 1392 } 1393 1394 return _service; 1395 } 1396 1397 /** 1398 * @deprecated As of 6.2.0 1399 */ 1400 public void setService(UserService service) { 1401 } 1402 1403 private static UserService _service; 1404 }