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