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, int prefixId, int 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, int prefixId, int 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, int prefixId, int 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, int prefixId, int 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 /** 499 * Returns the primary keys of all the users belonging to the group. 500 * 501 * @param groupId the primary key of the group 502 * @return the primary keys of the users belonging to the group 503 * @throws PortalException if the current user did not have permission to 504 view group assignments 505 */ 506 public static long[] getGroupUserIds(long groupId) 507 throws com.liferay.portal.kernel.exception.PortalException { 508 return getService().getGroupUserIds(groupId); 509 } 510 511 /** 512 * Returns all the users belonging to the group. 513 * 514 * @param groupId the primary key of the group 515 * @return the users belonging to the group 516 * @throws PortalException if the current user did not have permission to 517 view group assignments 518 */ 519 public static java.util.List<com.liferay.portal.model.User> getGroupUsers( 520 long groupId) 521 throws com.liferay.portal.kernel.exception.PortalException { 522 return getService().getGroupUsers(groupId); 523 } 524 525 /** 526 * Returns the primary keys of all the users belonging to the organization. 527 * 528 * @param organizationId the primary key of the organization 529 * @return the primary keys of the users belonging to the organization 530 * @throws PortalException if the current user did not have permission to 531 view organization assignments 532 */ 533 public static long[] getOrganizationUserIds(long organizationId) 534 throws com.liferay.portal.kernel.exception.PortalException { 535 return getService().getOrganizationUserIds(organizationId); 536 } 537 538 /** 539 * Returns all the users belonging to the organization. 540 * 541 * @param organizationId the primary key of the organization 542 * @return users belonging to the organization 543 * @throws PortalException if the current user did not have permission to 544 view organization assignments 545 */ 546 public static java.util.List<com.liferay.portal.model.User> getOrganizationUsers( 547 long organizationId) 548 throws com.liferay.portal.kernel.exception.PortalException { 549 return getService().getOrganizationUsers(organizationId); 550 } 551 552 /** 553 * Returns the primary keys of all the users belonging to the role. 554 * 555 * @param roleId the primary key of the role 556 * @return the primary keys of the users belonging to the role 557 * @throws PortalException if the current user did not have permission to 558 view role members 559 */ 560 public static long[] getRoleUserIds(long roleId) 561 throws com.liferay.portal.kernel.exception.PortalException { 562 return getService().getRoleUserIds(roleId); 563 } 564 565 /** 566 * Returns the user with the email address. 567 * 568 * @param companyId the primary key of the user's company 569 * @param emailAddress the user's email address 570 * @return the user with the email address 571 * @throws PortalException if a user with the email address could not be 572 found or if the current user did not have permission to view the 573 user 574 */ 575 public static com.liferay.portal.model.User getUserByEmailAddress( 576 long companyId, java.lang.String emailAddress) 577 throws com.liferay.portal.kernel.exception.PortalException { 578 return getService().getUserByEmailAddress(companyId, emailAddress); 579 } 580 581 /** 582 * Returns the user with the primary key. 583 * 584 * @param userId the primary key of the user 585 * @return the user with the primary key 586 * @throws PortalException if a user with the primary key could not be found 587 or if the current user did not have permission to view the user 588 */ 589 public static com.liferay.portal.model.User getUserById(long userId) 590 throws com.liferay.portal.kernel.exception.PortalException { 591 return getService().getUserById(userId); 592 } 593 594 /** 595 * Returns the user with the screen name. 596 * 597 * @param companyId the primary key of the user's company 598 * @param screenName the user's screen name 599 * @return the user with the screen name 600 * @throws PortalException if a user with the screen name could not be found 601 or if the current user did not have permission to view the user 602 */ 603 public static com.liferay.portal.model.User getUserByScreenName( 604 long companyId, java.lang.String screenName) 605 throws com.liferay.portal.kernel.exception.PortalException { 606 return getService().getUserByScreenName(companyId, screenName); 607 } 608 609 public static java.util.List<com.liferay.portal.model.User> getUserGroupUsers( 610 long userGroupId) 611 throws com.liferay.portal.kernel.exception.PortalException { 612 return getService().getUserGroupUsers(userGroupId); 613 } 614 615 /** 616 * Returns the primary key of the user with the email address. 617 * 618 * @param companyId the primary key of the user's company 619 * @param emailAddress the user's email address 620 * @return the primary key of the user with the email address 621 * @throws PortalException if a user with the email address could not be 622 found 623 */ 624 public static long getUserIdByEmailAddress(long companyId, 625 java.lang.String emailAddress) 626 throws com.liferay.portal.kernel.exception.PortalException { 627 return getService().getUserIdByEmailAddress(companyId, emailAddress); 628 } 629 630 /** 631 * Returns the primary key of the user with the screen name. 632 * 633 * @param companyId the primary key of the user's company 634 * @param screenName the user's screen name 635 * @return the primary key of the user with the screen name 636 * @throws PortalException if a user with the screen name could not be found 637 */ 638 public static long getUserIdByScreenName(long companyId, 639 java.lang.String screenName) 640 throws com.liferay.portal.kernel.exception.PortalException { 641 return getService().getUserIdByScreenName(companyId, screenName); 642 } 643 644 /** 645 * Returns <code>true</code> if the user is a member of the group. 646 * 647 * @param groupId the primary key of the group 648 * @param userId the primary key of the user 649 * @return <code>true</code> if the user is a member of the group; 650 <code>false</code> otherwise 651 * @throws PortalException if the current user did not have permission to 652 view the user or group members 653 */ 654 public static boolean hasGroupUser(long groupId, long userId) 655 throws com.liferay.portal.kernel.exception.PortalException { 656 return getService().hasGroupUser(groupId, userId); 657 } 658 659 /** 660 * Returns <code>true</code> if the user has the role with the name, 661 * optionally through inheritance. 662 * 663 * @param companyId the primary key of the role's company 664 * @param name the name of the role (must be a regular role, not an 665 organization, site or provider role) 666 * @param userId the primary key of the user 667 * @param inherited whether to include roles inherited from organizations, 668 sites, etc. 669 * @return <code>true</code> if the user has the role; <code>false</code> 670 otherwise 671 * @throws PortalException if a role with the name could not be found 672 */ 673 public static boolean hasRoleUser(long companyId, java.lang.String name, 674 long userId, boolean inherited) 675 throws com.liferay.portal.kernel.exception.PortalException { 676 return getService().hasRoleUser(companyId, name, userId, inherited); 677 } 678 679 /** 680 * Returns <code>true</code> if the user is a member of the role. 681 * 682 * @param roleId the primary key of the role 683 * @param userId the primary key of the user 684 * @return <code>true</code> if the user is a member of the role; 685 <code>false</code> otherwise 686 * @throws PortalException if the current user did not have permission to 687 view the user or role members 688 */ 689 public static boolean hasRoleUser(long roleId, long userId) 690 throws com.liferay.portal.kernel.exception.PortalException { 691 return getService().hasRoleUser(roleId, userId); 692 } 693 694 public static boolean sendPasswordByEmailAddress(long companyId, 695 java.lang.String emailAddress) 696 throws com.liferay.portal.kernel.exception.PortalException { 697 return getService().sendPasswordByEmailAddress(companyId, emailAddress); 698 } 699 700 public static boolean sendPasswordByScreenName(long companyId, 701 java.lang.String screenName) 702 throws com.liferay.portal.kernel.exception.PortalException { 703 return getService().sendPasswordByScreenName(companyId, screenName); 704 } 705 706 public static boolean sendPasswordByUserId(long userId) 707 throws com.liferay.portal.kernel.exception.PortalException { 708 return getService().sendPasswordByUserId(userId); 709 } 710 711 /** 712 * Sets the Spring bean ID for this bean. 713 * 714 * @param beanIdentifier the Spring bean ID for this bean 715 */ 716 public static void setBeanIdentifier(java.lang.String beanIdentifier) { 717 getService().setBeanIdentifier(beanIdentifier); 718 } 719 720 /** 721 * Sets the users in the role, removing and adding users to the role as 722 * necessary. 723 * 724 * @param roleId the primary key of the role 725 * @param userIds the primary keys of the users 726 * @throws PortalException if the current user did not have permission to 727 assign role members or if the operation was not allowed by the 728 membership policy 729 */ 730 public static void setRoleUsers(long roleId, long[] userIds) 731 throws com.liferay.portal.kernel.exception.PortalException { 732 getService().setRoleUsers(roleId, userIds); 733 } 734 735 /** 736 * Sets the users in the user group, removing and adding users to the user 737 * group as necessary. 738 * 739 * @param userGroupId the primary key of the user group 740 * @param userIds the primary keys of the users 741 * @throws PortalException if the current user did not have permission to 742 assign group members 743 */ 744 public static void setUserGroupUsers(long userGroupId, long[] userIds) 745 throws com.liferay.portal.kernel.exception.PortalException { 746 getService().setUserGroupUsers(userGroupId, userIds); 747 } 748 749 /** 750 * Removes the users from the teams of a group. 751 * 752 * @param groupId the primary key of the group 753 * @param userIds the primary keys of the users 754 * @throws PortalException if the current user did not have permission to 755 modify user group assignments 756 */ 757 public static void unsetGroupTeamsUsers(long groupId, long[] userIds) 758 throws com.liferay.portal.kernel.exception.PortalException { 759 getService().unsetGroupTeamsUsers(groupId, userIds); 760 } 761 762 /** 763 * Removes the users from the group. 764 * 765 * @param groupId the primary key of the group 766 * @param userIds the primary keys of the users 767 * @param serviceContext the service context to be applied (optionally 768 <code>null</code>) 769 * @throws PortalException if the current user did not have permission to 770 modify group assignments or if the operation was not allowed by 771 the membership policy 772 */ 773 public static void unsetGroupUsers(long groupId, long[] userIds, 774 com.liferay.portal.service.ServiceContext serviceContext) 775 throws com.liferay.portal.kernel.exception.PortalException { 776 getService().unsetGroupUsers(groupId, userIds, serviceContext); 777 } 778 779 /** 780 * Removes the users from the organization. 781 * 782 * @param organizationId the primary key of the organization 783 * @param userIds the primary keys of the users 784 * @throws PortalException if the current user did not have permission to 785 modify organization assignments or if the operation was not 786 allowed by the membership policy 787 */ 788 public static void unsetOrganizationUsers(long organizationId, 789 long[] userIds) 790 throws com.liferay.portal.kernel.exception.PortalException { 791 getService().unsetOrganizationUsers(organizationId, userIds); 792 } 793 794 /** 795 * Removes the users from the password policy. 796 * 797 * @param passwordPolicyId the primary key of the password policy 798 * @param userIds the primary keys of the users 799 * @throws PortalException if the current user did not have permission to 800 modify policy assignments 801 */ 802 public static void unsetPasswordPolicyUsers(long passwordPolicyId, 803 long[] userIds) 804 throws com.liferay.portal.kernel.exception.PortalException { 805 getService().unsetPasswordPolicyUsers(passwordPolicyId, userIds); 806 } 807 808 /** 809 * Removes the users from the role. 810 * 811 * @param roleId the primary key of the role 812 * @param userIds the primary keys of the users 813 * @throws PortalException if the current user did not have permission to 814 modify role assignments or if the operation was not allowed by 815 the membership policy 816 */ 817 public static void unsetRoleUsers(long roleId, long[] userIds) 818 throws com.liferay.portal.kernel.exception.PortalException { 819 getService().unsetRoleUsers(roleId, userIds); 820 } 821 822 /** 823 * Removes the users from the team. 824 * 825 * @param teamId the primary key of the team 826 * @param userIds the primary keys of the users 827 * @throws PortalException if the current user did not have permission to 828 modify team assignments 829 */ 830 public static void unsetTeamUsers(long teamId, long[] userIds) 831 throws com.liferay.portal.kernel.exception.PortalException { 832 getService().unsetTeamUsers(teamId, userIds); 833 } 834 835 /** 836 * Removes the users from the user group. 837 * 838 * @param userGroupId the primary key of the user group 839 * @param userIds the primary keys of the users 840 * @throws PortalException if the current user did not have permission to 841 modify user group assignments or if the operation was not allowed 842 by the membership policy 843 */ 844 public static void unsetUserGroupUsers(long userGroupId, long[] userIds) 845 throws com.liferay.portal.kernel.exception.PortalException { 846 getService().unsetUserGroupUsers(userGroupId, userIds); 847 } 848 849 /** 850 * Updates the user's response to the terms of use agreement. 851 * 852 * @param userId the primary key of the user 853 * @param agreedToTermsOfUse whether the user has agree to the terms of use 854 * @return the user 855 * @throws PortalException if the current user did not have permission to 856 update the user's agreement to terms-of-use 857 */ 858 public static com.liferay.portal.model.User updateAgreedToTermsOfUse( 859 long userId, boolean agreedToTermsOfUse) 860 throws com.liferay.portal.kernel.exception.PortalException { 861 return getService().updateAgreedToTermsOfUse(userId, agreedToTermsOfUse); 862 } 863 864 /** 865 * Updates the user's email address. 866 * 867 * @param userId the primary key of the user 868 * @param password the user's password 869 * @param emailAddress1 the user's new email address 870 * @param emailAddress2 the user's new email address confirmation 871 * @param serviceContext the service context to be applied. Must set the 872 portal URL, main path, primary key of the layout, remote address, 873 remote host, and agent for the user. 874 * @return the user 875 * @throws PortalException if a user with the primary key could not be found 876 or if the current user did not have permission to update the user 877 */ 878 public static com.liferay.portal.model.User updateEmailAddress( 879 long userId, java.lang.String password, java.lang.String emailAddress1, 880 java.lang.String emailAddress2, 881 com.liferay.portal.service.ServiceContext serviceContext) 882 throws com.liferay.portal.kernel.exception.PortalException { 883 return getService() 884 .updateEmailAddress(userId, password, emailAddress1, 885 emailAddress2, serviceContext); 886 } 887 888 /** 889 * Updates a user account that was automatically created when a guest user 890 * participated in an action (e.g. posting a comment) and only provided his 891 * name and email address. 892 * 893 * @param companyId the primary key of the user's company 894 * @param autoPassword whether a password should be automatically generated 895 for the user 896 * @param password1 the user's password 897 * @param password2 the user's password confirmation 898 * @param autoScreenName whether a screen name should be automatically 899 generated for the user 900 * @param screenName the user's screen name 901 * @param emailAddress the user's email address 902 * @param facebookId the user's facebook ID 903 * @param openId the user's OpenID 904 * @param locale the user's locale 905 * @param firstName the user's first name 906 * @param middleName the user's middle name 907 * @param lastName the user's last name 908 * @param prefixId the user's name prefix ID 909 * @param suffixId the user's name suffix ID 910 * @param male whether the user is male 911 * @param birthdayMonth the user's birthday month (0-based, meaning 0 for 912 January) 913 * @param birthdayDay the user's birthday day 914 * @param birthdayYear the user's birthday year 915 * @param jobTitle the user's job title 916 * @param updateUserInformation whether to update the user's information 917 * @param sendEmail whether to send the user an email notification about 918 their new account 919 * @param serviceContext the service context to be applied (optionally 920 <code>null</code>). Can set the expando bridge attributes for the 921 user. 922 * @return the user 923 * @throws PortalException if the user's information was invalid or if the 924 email address was reserved 925 */ 926 public static com.liferay.portal.model.User updateIncompleteUser( 927 long companyId, boolean autoPassword, java.lang.String password1, 928 java.lang.String password2, boolean autoScreenName, 929 java.lang.String screenName, java.lang.String emailAddress, 930 long facebookId, java.lang.String openId, java.util.Locale locale, 931 java.lang.String firstName, java.lang.String middleName, 932 java.lang.String lastName, int prefixId, int suffixId, boolean male, 933 int birthdayMonth, int birthdayDay, int birthdayYear, 934 java.lang.String jobTitle, boolean updateUserInformation, 935 boolean sendEmail, 936 com.liferay.portal.service.ServiceContext serviceContext) 937 throws com.liferay.portal.kernel.exception.PortalException { 938 return getService() 939 .updateIncompleteUser(companyId, autoPassword, password1, 940 password2, autoScreenName, screenName, emailAddress, facebookId, 941 openId, locale, firstName, middleName, lastName, prefixId, 942 suffixId, male, birthdayMonth, birthdayDay, birthdayYear, jobTitle, 943 updateUserInformation, sendEmail, serviceContext); 944 } 945 946 /** 947 * Updates whether the user is locked out from logging in. 948 * 949 * @param userId the primary key of the user 950 * @param lockout whether the user is locked out 951 * @return the user 952 * @throws PortalException if the user did not have permission to lock out 953 the user 954 */ 955 public static com.liferay.portal.model.User updateLockoutById(long userId, 956 boolean lockout) 957 throws com.liferay.portal.kernel.exception.PortalException { 958 return getService().updateLockoutById(userId, lockout); 959 } 960 961 /** 962 * Updates the user's OpenID. 963 * 964 * @param userId the primary key of the user 965 * @param openId the new OpenID 966 * @return the user 967 * @throws PortalException if a user with the primary key could not be found 968 or if the current user did not have permission to update the user 969 */ 970 public static com.liferay.portal.model.User updateOpenId(long userId, 971 java.lang.String openId) 972 throws com.liferay.portal.kernel.exception.PortalException { 973 return getService().updateOpenId(userId, openId); 974 } 975 976 /** 977 * Sets the organizations that the user is in, removing and adding 978 * organizations as necessary. 979 * 980 * @param userId the primary key of the user 981 * @param organizationIds the primary keys of the organizations 982 * @param serviceContext the service context to be applied. Must set 983 whether user indexing is enabled. 984 * @throws PortalException if a user with the primary key could not be found 985 or if the current user did not have permission to update the user 986 */ 987 public static void updateOrganizations(long userId, long[] organizationIds, 988 com.liferay.portal.service.ServiceContext serviceContext) 989 throws com.liferay.portal.kernel.exception.PortalException { 990 getService().updateOrganizations(userId, organizationIds, serviceContext); 991 } 992 993 /** 994 * Updates the user's password without tracking or validation of the change. 995 * 996 * @param userId the primary key of the user 997 * @param password1 the user's new password 998 * @param password2 the user's new password confirmation 999 * @param passwordReset whether the user should be asked to reset their 1000 password the next time they log in 1001 * @return the user 1002 * @throws PortalException if a user with the primary key could not be found 1003 or if the current user did not have permission to update the user 1004 */ 1005 public static com.liferay.portal.model.User updatePassword(long userId, 1006 java.lang.String password1, java.lang.String password2, 1007 boolean passwordReset) 1008 throws com.liferay.portal.kernel.exception.PortalException { 1009 return getService() 1010 .updatePassword(userId, password1, password2, passwordReset); 1011 } 1012 1013 /** 1014 * Updates the user's portrait image. 1015 * 1016 * @param userId the primary key of the user 1017 * @param bytes the new portrait image data 1018 * @return the user 1019 * @throws PortalException if a user with the primary key could not be 1020 found, if the new portrait was invalid, or if the current user 1021 did not have permission to update the user 1022 */ 1023 public static com.liferay.portal.model.User updatePortrait(long userId, 1024 byte[] bytes) 1025 throws com.liferay.portal.kernel.exception.PortalException { 1026 return getService().updatePortrait(userId, bytes); 1027 } 1028 1029 /** 1030 * Updates the user's password reset question and answer. 1031 * 1032 * @param userId the primary key of the user 1033 * @param question the user's new password reset question 1034 * @param answer the user's new password reset answer 1035 * @return the user 1036 * @throws PortalException if a user with the primary key could not be 1037 found, if the new question or answer were invalid, or if the 1038 current user did not have permission to update the user 1039 */ 1040 public static com.liferay.portal.model.User updateReminderQuery( 1041 long userId, java.lang.String question, java.lang.String answer) 1042 throws com.liferay.portal.kernel.exception.PortalException { 1043 return getService().updateReminderQuery(userId, question, answer); 1044 } 1045 1046 /** 1047 * Updates the user's screen name. 1048 * 1049 * @param userId the primary key of the user 1050 * @param screenName the user's new screen name 1051 * @return the user 1052 * @throws PortalException if a user with the primary key could not be 1053 found, if the new screen name was invalid, or if the current user 1054 did not have permission to update the user 1055 */ 1056 public static com.liferay.portal.model.User updateScreenName(long userId, 1057 java.lang.String screenName) 1058 throws com.liferay.portal.kernel.exception.PortalException { 1059 return getService().updateScreenName(userId, screenName); 1060 } 1061 1062 /** 1063 * Updates the user's workflow status. 1064 * 1065 * @param userId the primary key of the user 1066 * @param status the user's new workflow status 1067 * @return the user 1068 * @throws PortalException if a user with the primary key could not be 1069 found, if the current user was updating her own status to 1070 anything but {@link 1071 com.liferay.portal.kernel.workflow.WorkflowConstants#STATUS_APPROVED}, 1072 or if the current user did not have permission to update the 1073 user's workflow status. 1074 * @deprecated As of 7.0.0, replaced by {@link #updateStatus(long, int, 1075 ServiceContext)} 1076 */ 1077 @Deprecated 1078 public static com.liferay.portal.model.User updateStatus(long userId, 1079 int status) throws com.liferay.portal.kernel.exception.PortalException { 1080 return getService().updateStatus(userId, status); 1081 } 1082 1083 /** 1084 * Updates the user's workflow status. 1085 * 1086 * @param userId the primary key of the user 1087 * @param status the user's new workflow status 1088 * @param serviceContext the service context to be applied. You can specify 1089 an unencrypted custom password (used by an LDAP listener) for the 1090 user via attribute <code>passwordUnencrypted</code>. 1091 * @return the user 1092 * @throws PortalException if a user with the primary key could not be 1093 found, if the current user was updating her own status to 1094 anything but {@link 1095 com.liferay.portal.kernel.workflow.WorkflowConstants#STATUS_APPROVED}, 1096 or if the current user did not have permission to update the 1097 user's workflow status. 1098 */ 1099 public static com.liferay.portal.model.User updateStatus(long userId, 1100 int status, com.liferay.portal.service.ServiceContext serviceContext) 1101 throws com.liferay.portal.kernel.exception.PortalException { 1102 return getService().updateStatus(userId, status, serviceContext); 1103 } 1104 1105 /** 1106 * Updates the user with additional parameters. 1107 * 1108 * @param userId the primary key of the user 1109 * @param oldPassword the user's old password 1110 * @param newPassword1 the user's new password (optionally 1111 <code>null</code>) 1112 * @param newPassword2 the user's new password confirmation (optionally 1113 <code>null</code>) 1114 * @param passwordReset whether the user should be asked to reset their 1115 password the next time they login 1116 * @param reminderQueryQuestion the user's new password reset question 1117 * @param reminderQueryAnswer the user's new password reset answer 1118 * @param screenName the user's new screen name 1119 * @param emailAddress the user's new email address 1120 * @param facebookId the user's new Facebook ID 1121 * @param openId the user's new OpenID 1122 * @param languageId the user's new language ID 1123 * @param timeZoneId the user's new time zone ID 1124 * @param greeting the user's new greeting 1125 * @param comments the user's new comments 1126 * @param firstName the user's new first name 1127 * @param middleName the user's new middle name 1128 * @param lastName the user's new last name 1129 * @param prefixId the user's new name prefix ID 1130 * @param suffixId the user's new name suffix ID 1131 * @param male whether user is male 1132 * @param birthdayMonth the user's new birthday month (0-based, meaning 1133 0 for January) 1134 * @param birthdayDay the user's new birthday day 1135 * @param birthdayYear the user's birthday year 1136 * @param smsSn the user's new SMS screen name 1137 * @param aimSn the user's new AIM screen name 1138 * @param facebookSn the user's new Facebook screen name 1139 * @param icqSn the user's new ICQ screen name 1140 * @param jabberSn the user's new Jabber screen name 1141 * @param msnSn the user's new MSN screen name 1142 * @param mySpaceSn the user's new MySpace screen name 1143 * @param skypeSn the user's new Skype screen name 1144 * @param twitterSn the user's new Twitter screen name 1145 * @param ymSn the user's new Yahoo! Messenger screen name 1146 * @param jobTitle the user's new job title 1147 * @param groupIds the primary keys of the user's groups 1148 * @param organizationIds the primary keys of the user's organizations 1149 * @param roleIds the primary keys of the user's roles 1150 * @param userGroupRoles the user user's group roles 1151 * @param userGroupIds the primary keys of the user's user groups 1152 * @param addresses the user's addresses 1153 * @param emailAddresses the user's email addresses 1154 * @param phones the user's phone numbers 1155 * @param websites the user's websites 1156 * @param announcementsDelivers the announcements deliveries 1157 * @param serviceContext the service context to be applied (optionally 1158 <code>null</code>). Can set the UUID (with the 1159 <code>uuid</code> attribute), asset category IDs, asset tag 1160 names, and expando bridge attributes for the user. 1161 * @return the user 1162 * @throws PortalException if a user with the primary key could not be 1163 found, if the new information was invalid, if the current 1164 user did not have permission to update the user, or if the 1165 operation was not allowed by the membership policy 1166 * @deprecated As of 7.0.0, replaced by {@link #updateUser(long, String, 1167 String, String, boolean, String, String, String, String, 1168 long, String, String, String, String, String, String, String, 1169 String, int, int, boolean, int, int, int, String, String, 1170 String, String, String, String, String, String, String, 1171 String, String, long[], long[], long[], java.util.List, 1172 long[], java.util.List, java.util.List, java.util.List, 1173 java.util.List, java.util.List, boolean, byte[], 1174 com.liferay.portal.service.ServiceContext)} 1175 */ 1176 @Deprecated 1177 public static com.liferay.portal.model.User updateUser(long userId, 1178 java.lang.String oldPassword, java.lang.String newPassword1, 1179 java.lang.String newPassword2, boolean passwordReset, 1180 java.lang.String reminderQueryQuestion, 1181 java.lang.String reminderQueryAnswer, java.lang.String screenName, 1182 java.lang.String emailAddress, long facebookId, 1183 java.lang.String openId, java.lang.String languageId, 1184 java.lang.String timeZoneId, java.lang.String greeting, 1185 java.lang.String comments, java.lang.String firstName, 1186 java.lang.String middleName, java.lang.String lastName, int prefixId, 1187 int suffixId, boolean male, int birthdayMonth, int birthdayDay, 1188 int birthdayYear, java.lang.String smsSn, java.lang.String aimSn, 1189 java.lang.String facebookSn, java.lang.String icqSn, 1190 java.lang.String jabberSn, java.lang.String msnSn, 1191 java.lang.String mySpaceSn, java.lang.String skypeSn, 1192 java.lang.String twitterSn, java.lang.String ymSn, 1193 java.lang.String jobTitle, long[] groupIds, long[] organizationIds, 1194 long[] roleIds, 1195 java.util.List<com.liferay.portal.model.UserGroupRole> userGroupRoles, 1196 long[] userGroupIds, 1197 java.util.List<com.liferay.portal.model.Address> addresses, 1198 java.util.List<com.liferay.portal.model.EmailAddress> emailAddresses, 1199 java.util.List<com.liferay.portal.model.Phone> phones, 1200 java.util.List<com.liferay.portal.model.Website> websites, 1201 java.util.List<com.liferay.portlet.announcements.model.AnnouncementsDelivery> announcementsDelivers, 1202 com.liferay.portal.service.ServiceContext serviceContext) 1203 throws com.liferay.portal.kernel.exception.PortalException { 1204 return getService() 1205 .updateUser(userId, oldPassword, newPassword1, newPassword2, 1206 passwordReset, reminderQueryQuestion, reminderQueryAnswer, 1207 screenName, emailAddress, facebookId, openId, languageId, 1208 timeZoneId, greeting, comments, firstName, middleName, lastName, 1209 prefixId, suffixId, male, birthdayMonth, birthdayDay, birthdayYear, 1210 smsSn, aimSn, facebookSn, icqSn, jabberSn, msnSn, mySpaceSn, 1211 skypeSn, twitterSn, ymSn, jobTitle, groupIds, organizationIds, 1212 roleIds, userGroupRoles, userGroupIds, addresses, emailAddresses, 1213 phones, websites, announcementsDelivers, serviceContext); 1214 } 1215 1216 /** 1217 * Updates the user. 1218 * 1219 * @param userId the primary key of the user 1220 * @param oldPassword the user's old password 1221 * @param newPassword1 the user's new password (optionally 1222 <code>null</code>) 1223 * @param newPassword2 the user's new password confirmation (optionally 1224 <code>null</code>) 1225 * @param passwordReset whether the user should be asked to reset their 1226 password the next time they login 1227 * @param reminderQueryQuestion the user's new password reset question 1228 * @param reminderQueryAnswer the user's new password reset answer 1229 * @param screenName the user's new screen name 1230 * @param emailAddress the user's new email address 1231 * @param facebookId the user's new Facebook ID 1232 * @param openId the user's new OpenID 1233 * @param languageId the user's new language ID 1234 * @param timeZoneId the user's new time zone ID 1235 * @param greeting the user's new greeting 1236 * @param comments the user's new comments 1237 * @param firstName the user's new first name 1238 * @param middleName the user's new middle name 1239 * @param lastName the user's new last name 1240 * @param prefixId the user's new name prefix ID 1241 * @param suffixId the user's new name suffix ID 1242 * @param male whether user is male 1243 * @param birthdayMonth the user's new birthday month (0-based, meaning 0 1244 for January) 1245 * @param birthdayDay the user's new birthday day 1246 * @param birthdayYear the user's birthday year 1247 * @param smsSn the user's new SMS screen name 1248 * @param aimSn the user's new AIM screen name 1249 * @param facebookSn the user's new Facebook screen name 1250 * @param icqSn the user's new ICQ screen name 1251 * @param jabberSn the user's new Jabber screen name 1252 * @param msnSn the user's new MSN screen name 1253 * @param mySpaceSn the user's new MySpace screen name 1254 * @param skypeSn the user's new Skype screen name 1255 * @param twitterSn the user's new Twitter screen name 1256 * @param ymSn the user's new Yahoo! Messenger screen name 1257 * @param jobTitle the user's new job title 1258 * @param groupIds the primary keys of the user's groups 1259 * @param organizationIds the primary keys of the user's organizations 1260 * @param roleIds the primary keys of the user's roles 1261 * @param userGroupRoles the user user's group roles 1262 * @param userGroupIds the primary keys of the user's user groups 1263 * @param serviceContext the service context to be applied (optionally 1264 <code>null</code>). Can set the UUID (with the <code>uuid</code> 1265 attribute), asset category IDs, asset tag names, and expando 1266 bridge attributes for the user. 1267 * @return the user 1268 * @throws PortalException if a user with the primary key could not be 1269 found, if the new information was invalid, if the current user 1270 did not have permission to update the user, or if the operation 1271 was not allowed by the membership policy 1272 */ 1273 public static com.liferay.portal.model.User updateUser(long userId, 1274 java.lang.String oldPassword, java.lang.String newPassword1, 1275 java.lang.String newPassword2, boolean passwordReset, 1276 java.lang.String reminderQueryQuestion, 1277 java.lang.String reminderQueryAnswer, java.lang.String screenName, 1278 java.lang.String emailAddress, long facebookId, 1279 java.lang.String openId, java.lang.String languageId, 1280 java.lang.String timeZoneId, java.lang.String greeting, 1281 java.lang.String comments, java.lang.String firstName, 1282 java.lang.String middleName, java.lang.String lastName, int prefixId, 1283 int suffixId, boolean male, int birthdayMonth, int birthdayDay, 1284 int birthdayYear, java.lang.String smsSn, java.lang.String aimSn, 1285 java.lang.String facebookSn, java.lang.String icqSn, 1286 java.lang.String jabberSn, java.lang.String msnSn, 1287 java.lang.String mySpaceSn, java.lang.String skypeSn, 1288 java.lang.String twitterSn, java.lang.String ymSn, 1289 java.lang.String jobTitle, long[] groupIds, long[] organizationIds, 1290 long[] roleIds, 1291 java.util.List<com.liferay.portal.model.UserGroupRole> userGroupRoles, 1292 long[] userGroupIds, 1293 com.liferay.portal.service.ServiceContext serviceContext) 1294 throws com.liferay.portal.kernel.exception.PortalException { 1295 return getService() 1296 .updateUser(userId, oldPassword, newPassword1, newPassword2, 1297 passwordReset, reminderQueryQuestion, reminderQueryAnswer, 1298 screenName, emailAddress, facebookId, openId, languageId, 1299 timeZoneId, greeting, comments, firstName, middleName, lastName, 1300 prefixId, suffixId, male, birthdayMonth, birthdayDay, birthdayYear, 1301 smsSn, aimSn, facebookSn, icqSn, jabberSn, msnSn, mySpaceSn, 1302 skypeSn, twitterSn, ymSn, jobTitle, groupIds, organizationIds, 1303 roleIds, userGroupRoles, userGroupIds, serviceContext); 1304 } 1305 1306 /** 1307 * Updates the user with additional parameters. 1308 * 1309 * @param userId the primary key of the user 1310 * @param oldPassword the user's old password 1311 * @param newPassword1 the user's new password (optionally 1312 <code>null</code>) 1313 * @param newPassword2 the user's new password confirmation (optionally 1314 <code>null</code>) 1315 * @param passwordReset whether the user should be asked to reset their 1316 password the next time they login 1317 * @param reminderQueryQuestion the user's new password reset question 1318 * @param reminderQueryAnswer the user's new password reset answer 1319 * @param screenName the user's new screen name 1320 * @param emailAddress the user's new email address 1321 * @param facebookId the user's new Facebook ID 1322 * @param openId the user's new OpenID 1323 * @param portrait whether to update the user's portrait image 1324 * @param portraitBytes the new portrait image data 1325 * @param languageId the user's new language ID 1326 * @param timeZoneId the user's new time zone ID 1327 * @param greeting the user's new greeting 1328 * @param comments the user's new comments 1329 * @param firstName the user's new first name 1330 * @param middleName the user's new middle name 1331 * @param lastName the user's new last name 1332 * @param prefixId the user's new name prefix ID 1333 * @param suffixId the user's new name suffix ID 1334 * @param male whether user is male 1335 * @param birthdayMonth the user's new birthday month (0-based, meaning 0 1336 for January) 1337 * @param birthdayDay the user's new birthday day 1338 * @param birthdayYear the user's birthday year 1339 * @param smsSn the user's new SMS screen name 1340 * @param aimSn the user's new AIM screen name 1341 * @param facebookSn the user's new Facebook screen name 1342 * @param icqSn the user's new ICQ screen name 1343 * @param jabberSn the user's new Jabber screen name 1344 * @param msnSn the user's new MSN screen name 1345 * @param mySpaceSn the user's new MySpace screen name 1346 * @param skypeSn the user's new Skype screen name 1347 * @param twitterSn the user's new Twitter screen name 1348 * @param ymSn the user's new Yahoo! Messenger screen name 1349 * @param jobTitle the user's new job title 1350 * @param groupIds the primary keys of the user's groups 1351 * @param organizationIds the primary keys of the user's organizations 1352 * @param roleIds the primary keys of the user's roles 1353 * @param userGroupRoles the user user's group roles 1354 * @param userGroupIds the primary keys of the user's user groups 1355 * @param addresses the user's addresses 1356 * @param emailAddresses the user's email addresses 1357 * @param phones the user's phone numbers 1358 * @param websites the user's websites 1359 * @param announcementsDelivers the announcements deliveries 1360 * @param serviceContext the service context to be applied (optionally 1361 <code>null</code>). Can set the UUID (with the <code>uuid</code> 1362 attribute), asset category IDs, asset tag names, and expando 1363 bridge attributes for the user. 1364 * @return the user 1365 * @throws PortalException if a user with the primary key could not be 1366 found, if the new information was invalid, if the current user 1367 did not have permission to update the user, or if the operation 1368 was not allowed by the membership policy 1369 */ 1370 public static com.liferay.portal.model.User updateUser(long userId, 1371 java.lang.String oldPassword, java.lang.String newPassword1, 1372 java.lang.String newPassword2, boolean passwordReset, 1373 java.lang.String reminderQueryQuestion, 1374 java.lang.String reminderQueryAnswer, java.lang.String screenName, 1375 java.lang.String emailAddress, long facebookId, 1376 java.lang.String openId, boolean portrait, byte[] portraitBytes, 1377 java.lang.String languageId, java.lang.String timeZoneId, 1378 java.lang.String greeting, java.lang.String comments, 1379 java.lang.String firstName, java.lang.String middleName, 1380 java.lang.String lastName, int prefixId, int suffixId, boolean male, 1381 int birthdayMonth, int birthdayDay, int birthdayYear, 1382 java.lang.String smsSn, java.lang.String aimSn, 1383 java.lang.String facebookSn, java.lang.String icqSn, 1384 java.lang.String jabberSn, java.lang.String msnSn, 1385 java.lang.String mySpaceSn, java.lang.String skypeSn, 1386 java.lang.String twitterSn, java.lang.String ymSn, 1387 java.lang.String jobTitle, long[] groupIds, long[] organizationIds, 1388 long[] roleIds, 1389 java.util.List<com.liferay.portal.model.UserGroupRole> userGroupRoles, 1390 long[] userGroupIds, 1391 java.util.List<com.liferay.portal.model.Address> addresses, 1392 java.util.List<com.liferay.portal.model.EmailAddress> emailAddresses, 1393 java.util.List<com.liferay.portal.model.Phone> phones, 1394 java.util.List<com.liferay.portal.model.Website> websites, 1395 java.util.List<com.liferay.portlet.announcements.model.AnnouncementsDelivery> announcementsDelivers, 1396 com.liferay.portal.service.ServiceContext serviceContext) 1397 throws com.liferay.portal.kernel.exception.PortalException { 1398 return getService() 1399 .updateUser(userId, oldPassword, newPassword1, newPassword2, 1400 passwordReset, reminderQueryQuestion, reminderQueryAnswer, 1401 screenName, emailAddress, facebookId, openId, portrait, 1402 portraitBytes, languageId, timeZoneId, greeting, comments, 1403 firstName, middleName, lastName, prefixId, suffixId, male, 1404 birthdayMonth, birthdayDay, birthdayYear, smsSn, aimSn, facebookSn, 1405 icqSn, jabberSn, msnSn, mySpaceSn, skypeSn, twitterSn, ymSn, 1406 jobTitle, groupIds, organizationIds, roleIds, userGroupRoles, 1407 userGroupIds, addresses, emailAddresses, phones, websites, 1408 announcementsDelivers, serviceContext); 1409 } 1410 1411 public static UserService getService() { 1412 if (_service == null) { 1413 _service = (UserService)PortalBeanLocatorUtil.locate(UserService.class.getName()); 1414 1415 ReferenceRegistry.registerReference(UserServiceUtil.class, 1416 "_service"); 1417 } 1418 1419 return _service; 1420 } 1421 1422 /** 1423 * @deprecated As of 6.2.0 1424 */ 1425 @Deprecated 1426 public void setService(UserService service) { 1427 } 1428 1429 private static UserService _service; 1430 }