001 /** 002 * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved. 003 * 004 * This library is free software; you can redistribute it and/or modify it under 005 * the terms of the GNU Lesser General Public License as published by the Free 006 * Software Foundation; either version 2.1 of the License, or (at your option) 007 * any later version. 008 * 009 * This library is distributed in the hope that it will be useful, but WITHOUT 010 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 011 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 012 * details. 013 */ 014 015 package com.liferay.portal.service; 016 017 import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil; 018 import com.liferay.portal.kernel.util.ReferenceRegistry; 019 020 /** 021 * Provides the local service utility for User. This utility wraps 022 * {@link com.liferay.portal.service.impl.UserLocalServiceImpl} and is the 023 * primary access point for service operations in application layer code running 024 * on the local server. Methods of this service will not have security checks 025 * based on the propagated JAAS credentials because this service can only be 026 * accessed from within the same VM. 027 * 028 * @author Brian Wing Shun Chan 029 * @see UserLocalService 030 * @see com.liferay.portal.service.base.UserLocalServiceBaseImpl 031 * @see com.liferay.portal.service.impl.UserLocalServiceImpl 032 * @generated 033 */ 034 public class UserLocalServiceUtil { 035 /* 036 * NOTE FOR DEVELOPERS: 037 * 038 * Never modify this class directly. Add custom service methods to {@link com.liferay.portal.service.impl.UserLocalServiceImpl} and rerun ServiceBuilder to regenerate this class. 039 */ 040 041 /** 042 * Adds the user to the database. Also notifies the appropriate model listeners. 043 * 044 * @param user the user 045 * @return the user that was added 046 * @throws SystemException if a system exception occurred 047 */ 048 public static com.liferay.portal.model.User addUser( 049 com.liferay.portal.model.User user) 050 throws com.liferay.portal.kernel.exception.SystemException { 051 return getService().addUser(user); 052 } 053 054 /** 055 * Creates a new user with the primary key. Does not add the user to the database. 056 * 057 * @param userId the primary key for the new user 058 * @return the new user 059 */ 060 public static com.liferay.portal.model.User createUser(long userId) { 061 return getService().createUser(userId); 062 } 063 064 /** 065 * Deletes the user with the primary key from the database. Also notifies the appropriate model listeners. 066 * 067 * @param userId the primary key of the user 068 * @return the user that was removed 069 * @throws PortalException if a user with the primary key could not be found 070 * @throws SystemException if a system exception occurred 071 */ 072 public static com.liferay.portal.model.User deleteUser(long userId) 073 throws com.liferay.portal.kernel.exception.PortalException, 074 com.liferay.portal.kernel.exception.SystemException { 075 return getService().deleteUser(userId); 076 } 077 078 /** 079 * Deletes the user from the database. Also notifies the appropriate model listeners. 080 * 081 * @param user the user 082 * @return the user that was removed 083 * @throws PortalException 084 * @throws SystemException if a system exception occurred 085 */ 086 public static com.liferay.portal.model.User deleteUser( 087 com.liferay.portal.model.User user) 088 throws com.liferay.portal.kernel.exception.PortalException, 089 com.liferay.portal.kernel.exception.SystemException { 090 return getService().deleteUser(user); 091 } 092 093 public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() { 094 return getService().dynamicQuery(); 095 } 096 097 /** 098 * Performs a dynamic query on the database and returns the matching rows. 099 * 100 * @param dynamicQuery the dynamic query 101 * @return the matching rows 102 * @throws SystemException if a system exception occurred 103 */ 104 @SuppressWarnings("rawtypes") 105 public static java.util.List dynamicQuery( 106 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) 107 throws com.liferay.portal.kernel.exception.SystemException { 108 return getService().dynamicQuery(dynamicQuery); 109 } 110 111 /** 112 * Performs a dynamic query on the database and returns a range of the matching rows. 113 * 114 * <p> 115 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.UserModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 116 * </p> 117 * 118 * @param dynamicQuery the dynamic query 119 * @param start the lower bound of the range of model instances 120 * @param end the upper bound of the range of model instances (not inclusive) 121 * @return the range of matching rows 122 * @throws SystemException if a system exception occurred 123 */ 124 @SuppressWarnings("rawtypes") 125 public static java.util.List dynamicQuery( 126 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 127 int end) throws com.liferay.portal.kernel.exception.SystemException { 128 return getService().dynamicQuery(dynamicQuery, start, end); 129 } 130 131 /** 132 * Performs a dynamic query on the database and returns an ordered range of the matching rows. 133 * 134 * <p> 135 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.UserModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 136 * </p> 137 * 138 * @param dynamicQuery the dynamic query 139 * @param start the lower bound of the range of model instances 140 * @param end the upper bound of the range of model instances (not inclusive) 141 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 142 * @return the ordered range of matching rows 143 * @throws SystemException if a system exception occurred 144 */ 145 @SuppressWarnings("rawtypes") 146 public static java.util.List dynamicQuery( 147 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 148 int end, 149 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 150 throws com.liferay.portal.kernel.exception.SystemException { 151 return getService() 152 .dynamicQuery(dynamicQuery, start, end, orderByComparator); 153 } 154 155 /** 156 * Returns the number of rows that match the dynamic query. 157 * 158 * @param dynamicQuery the dynamic query 159 * @return the number of rows that match the dynamic query 160 * @throws SystemException if a system exception occurred 161 */ 162 public static long dynamicQueryCount( 163 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) 164 throws com.liferay.portal.kernel.exception.SystemException { 165 return getService().dynamicQueryCount(dynamicQuery); 166 } 167 168 /** 169 * Returns the number of rows that match the dynamic query. 170 * 171 * @param dynamicQuery the dynamic query 172 * @param projection the projection to apply to the query 173 * @return the number of rows that match the dynamic query 174 * @throws SystemException if a system exception occurred 175 */ 176 public static long dynamicQueryCount( 177 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, 178 com.liferay.portal.kernel.dao.orm.Projection projection) 179 throws com.liferay.portal.kernel.exception.SystemException { 180 return getService().dynamicQueryCount(dynamicQuery, projection); 181 } 182 183 public static com.liferay.portal.model.User fetchUser(long userId) 184 throws com.liferay.portal.kernel.exception.SystemException { 185 return getService().fetchUser(userId); 186 } 187 188 /** 189 * Returns the user with the matching UUID and company. 190 * 191 * @param uuid the user's UUID 192 * @param companyId the primary key of the company 193 * @return the matching user, or <code>null</code> if a matching user could not be found 194 * @throws SystemException if a system exception occurred 195 */ 196 public static com.liferay.portal.model.User fetchUserByUuidAndCompanyId( 197 java.lang.String uuid, long companyId) 198 throws com.liferay.portal.kernel.exception.SystemException { 199 return getService().fetchUserByUuidAndCompanyId(uuid, companyId); 200 } 201 202 /** 203 * Returns the user with the primary key. 204 * 205 * @param userId the primary key of the user 206 * @return the user 207 * @throws PortalException if a user with the primary key could not be found 208 * @throws SystemException if a system exception occurred 209 */ 210 public static com.liferay.portal.model.User getUser(long userId) 211 throws com.liferay.portal.kernel.exception.PortalException, 212 com.liferay.portal.kernel.exception.SystemException { 213 return getService().getUser(userId); 214 } 215 216 public static com.liferay.portal.model.PersistedModel getPersistedModel( 217 java.io.Serializable primaryKeyObj) 218 throws com.liferay.portal.kernel.exception.PortalException, 219 com.liferay.portal.kernel.exception.SystemException { 220 return getService().getPersistedModel(primaryKeyObj); 221 } 222 223 /** 224 * Returns the user with the matching UUID and company. 225 * 226 * @param uuid the user's UUID 227 * @param companyId the primary key of the company 228 * @return the matching user 229 * @throws PortalException if a matching user could not be found 230 * @throws SystemException if a system exception occurred 231 */ 232 public static com.liferay.portal.model.User getUserByUuidAndCompanyId( 233 java.lang.String uuid, long companyId) 234 throws com.liferay.portal.kernel.exception.PortalException, 235 com.liferay.portal.kernel.exception.SystemException { 236 return getService().getUserByUuidAndCompanyId(uuid, companyId); 237 } 238 239 /** 240 * Returns a range of all the users. 241 * 242 * <p> 243 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.UserModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 244 * </p> 245 * 246 * @param start the lower bound of the range of users 247 * @param end the upper bound of the range of users (not inclusive) 248 * @return the range of users 249 * @throws SystemException if a system exception occurred 250 */ 251 public static java.util.List<com.liferay.portal.model.User> getUsers( 252 int start, int end) 253 throws com.liferay.portal.kernel.exception.SystemException { 254 return getService().getUsers(start, end); 255 } 256 257 /** 258 * Returns the number of users. 259 * 260 * @return the number of users 261 * @throws SystemException if a system exception occurred 262 */ 263 public static int getUsersCount() 264 throws com.liferay.portal.kernel.exception.SystemException { 265 return getService().getUsersCount(); 266 } 267 268 /** 269 * Updates the user in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 270 * 271 * @param user the user 272 * @return the user that was updated 273 * @throws SystemException if a system exception occurred 274 */ 275 public static com.liferay.portal.model.User updateUser( 276 com.liferay.portal.model.User user) 277 throws com.liferay.portal.kernel.exception.SystemException { 278 return getService().updateUser(user); 279 } 280 281 /** 282 * @throws SystemException if a system exception occurred 283 */ 284 public static void addGroupUser(long groupId, long userId) 285 throws com.liferay.portal.kernel.exception.SystemException { 286 getService().addGroupUser(groupId, userId); 287 } 288 289 /** 290 * @throws SystemException if a system exception occurred 291 */ 292 public static void addGroupUser(long groupId, 293 com.liferay.portal.model.User user) 294 throws com.liferay.portal.kernel.exception.SystemException { 295 getService().addGroupUser(groupId, user); 296 } 297 298 /** 299 * @throws PortalException 300 * @throws SystemException if a system exception occurred 301 */ 302 public static void addGroupUsers(long groupId, long[] userIds) 303 throws com.liferay.portal.kernel.exception.PortalException, 304 com.liferay.portal.kernel.exception.SystemException { 305 getService().addGroupUsers(groupId, userIds); 306 } 307 308 /** 309 * @throws PortalException 310 * @throws SystemException if a system exception occurred 311 */ 312 public static void addGroupUsers(long groupId, 313 java.util.List<com.liferay.portal.model.User> Users) 314 throws com.liferay.portal.kernel.exception.PortalException, 315 com.liferay.portal.kernel.exception.SystemException { 316 getService().addGroupUsers(groupId, Users); 317 } 318 319 /** 320 * @throws SystemException if a system exception occurred 321 */ 322 public static void clearGroupUsers(long groupId) 323 throws com.liferay.portal.kernel.exception.SystemException { 324 getService().clearGroupUsers(groupId); 325 } 326 327 /** 328 * @throws SystemException if a system exception occurred 329 */ 330 public static void deleteGroupUser(long groupId, long userId) 331 throws com.liferay.portal.kernel.exception.SystemException { 332 getService().deleteGroupUser(groupId, userId); 333 } 334 335 /** 336 * @throws SystemException if a system exception occurred 337 */ 338 public static void deleteGroupUser(long groupId, 339 com.liferay.portal.model.User user) 340 throws com.liferay.portal.kernel.exception.SystemException { 341 getService().deleteGroupUser(groupId, user); 342 } 343 344 /** 345 * @throws SystemException if a system exception occurred 346 */ 347 public static void deleteGroupUsers(long groupId, long[] userIds) 348 throws com.liferay.portal.kernel.exception.SystemException { 349 getService().deleteGroupUsers(groupId, userIds); 350 } 351 352 /** 353 * @throws SystemException if a system exception occurred 354 */ 355 public static void deleteGroupUsers(long groupId, 356 java.util.List<com.liferay.portal.model.User> Users) 357 throws com.liferay.portal.kernel.exception.SystemException { 358 getService().deleteGroupUsers(groupId, Users); 359 } 360 361 /** 362 * @throws SystemException if a system exception occurred 363 */ 364 public static java.util.List<com.liferay.portal.model.User> getGroupUsers( 365 long groupId) 366 throws com.liferay.portal.kernel.exception.SystemException { 367 return getService().getGroupUsers(groupId); 368 } 369 370 /** 371 * @throws SystemException if a system exception occurred 372 */ 373 public static java.util.List<com.liferay.portal.model.User> getGroupUsers( 374 long groupId, int start, int end) 375 throws com.liferay.portal.kernel.exception.SystemException { 376 return getService().getGroupUsers(groupId, start, end); 377 } 378 379 /** 380 * @throws SystemException if a system exception occurred 381 */ 382 public static java.util.List<com.liferay.portal.model.User> getGroupUsers( 383 long groupId, int start, int end, 384 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 385 throws com.liferay.portal.kernel.exception.SystemException { 386 return getService().getGroupUsers(groupId, start, end, orderByComparator); 387 } 388 389 /** 390 * @throws SystemException if a system exception occurred 391 */ 392 public static int getGroupUsersCount(long groupId) 393 throws com.liferay.portal.kernel.exception.SystemException { 394 return getService().getGroupUsersCount(groupId); 395 } 396 397 /** 398 * @throws SystemException if a system exception occurred 399 */ 400 public static boolean hasGroupUser(long groupId, long userId) 401 throws com.liferay.portal.kernel.exception.SystemException { 402 return getService().hasGroupUser(groupId, userId); 403 } 404 405 /** 406 * @throws SystemException if a system exception occurred 407 */ 408 public static boolean hasGroupUsers(long groupId) 409 throws com.liferay.portal.kernel.exception.SystemException { 410 return getService().hasGroupUsers(groupId); 411 } 412 413 /** 414 * @throws SystemException if a system exception occurred 415 */ 416 public static void setGroupUsers(long groupId, long[] userIds) 417 throws com.liferay.portal.kernel.exception.SystemException { 418 getService().setGroupUsers(groupId, userIds); 419 } 420 421 /** 422 * @throws SystemException if a system exception occurred 423 */ 424 public static void addOrganizationUser(long organizationId, long userId) 425 throws com.liferay.portal.kernel.exception.SystemException { 426 getService().addOrganizationUser(organizationId, userId); 427 } 428 429 /** 430 * @throws SystemException if a system exception occurred 431 */ 432 public static void addOrganizationUser(long organizationId, 433 com.liferay.portal.model.User user) 434 throws com.liferay.portal.kernel.exception.SystemException { 435 getService().addOrganizationUser(organizationId, user); 436 } 437 438 /** 439 * @throws PortalException 440 * @throws SystemException if a system exception occurred 441 */ 442 public static void addOrganizationUsers(long organizationId, long[] userIds) 443 throws com.liferay.portal.kernel.exception.PortalException, 444 com.liferay.portal.kernel.exception.SystemException { 445 getService().addOrganizationUsers(organizationId, userIds); 446 } 447 448 /** 449 * @throws PortalException 450 * @throws SystemException if a system exception occurred 451 */ 452 public static void addOrganizationUsers(long organizationId, 453 java.util.List<com.liferay.portal.model.User> Users) 454 throws com.liferay.portal.kernel.exception.PortalException, 455 com.liferay.portal.kernel.exception.SystemException { 456 getService().addOrganizationUsers(organizationId, Users); 457 } 458 459 /** 460 * @throws SystemException if a system exception occurred 461 */ 462 public static void clearOrganizationUsers(long organizationId) 463 throws com.liferay.portal.kernel.exception.SystemException { 464 getService().clearOrganizationUsers(organizationId); 465 } 466 467 /** 468 * @throws SystemException if a system exception occurred 469 */ 470 public static void deleteOrganizationUser(long organizationId, long userId) 471 throws com.liferay.portal.kernel.exception.SystemException { 472 getService().deleteOrganizationUser(organizationId, userId); 473 } 474 475 /** 476 * @throws SystemException if a system exception occurred 477 */ 478 public static void deleteOrganizationUser(long organizationId, 479 com.liferay.portal.model.User user) 480 throws com.liferay.portal.kernel.exception.SystemException { 481 getService().deleteOrganizationUser(organizationId, user); 482 } 483 484 /** 485 * @throws SystemException if a system exception occurred 486 */ 487 public static void deleteOrganizationUsers(long organizationId, 488 long[] userIds) 489 throws com.liferay.portal.kernel.exception.SystemException { 490 getService().deleteOrganizationUsers(organizationId, userIds); 491 } 492 493 /** 494 * @throws SystemException if a system exception occurred 495 */ 496 public static void deleteOrganizationUsers(long organizationId, 497 java.util.List<com.liferay.portal.model.User> Users) 498 throws com.liferay.portal.kernel.exception.SystemException { 499 getService().deleteOrganizationUsers(organizationId, Users); 500 } 501 502 /** 503 * @throws SystemException if a system exception occurred 504 */ 505 public static java.util.List<com.liferay.portal.model.User> getOrganizationUsers( 506 long organizationId) 507 throws com.liferay.portal.kernel.exception.SystemException { 508 return getService().getOrganizationUsers(organizationId); 509 } 510 511 /** 512 * @throws SystemException if a system exception occurred 513 */ 514 public static java.util.List<com.liferay.portal.model.User> getOrganizationUsers( 515 long organizationId, int start, int end) 516 throws com.liferay.portal.kernel.exception.SystemException { 517 return getService().getOrganizationUsers(organizationId, start, end); 518 } 519 520 /** 521 * @throws SystemException if a system exception occurred 522 */ 523 public static java.util.List<com.liferay.portal.model.User> getOrganizationUsers( 524 long organizationId, int start, int end, 525 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 526 throws com.liferay.portal.kernel.exception.SystemException { 527 return getService() 528 .getOrganizationUsers(organizationId, start, end, 529 orderByComparator); 530 } 531 532 /** 533 * @throws SystemException if a system exception occurred 534 */ 535 public static int getOrganizationUsersCount(long organizationId) 536 throws com.liferay.portal.kernel.exception.SystemException { 537 return getService().getOrganizationUsersCount(organizationId); 538 } 539 540 /** 541 * @throws SystemException if a system exception occurred 542 */ 543 public static boolean hasOrganizationUser(long organizationId, long userId) 544 throws com.liferay.portal.kernel.exception.SystemException { 545 return getService().hasOrganizationUser(organizationId, userId); 546 } 547 548 /** 549 * @throws SystemException if a system exception occurred 550 */ 551 public static boolean hasOrganizationUsers(long organizationId) 552 throws com.liferay.portal.kernel.exception.SystemException { 553 return getService().hasOrganizationUsers(organizationId); 554 } 555 556 /** 557 * @throws SystemException if a system exception occurred 558 */ 559 public static void setOrganizationUsers(long organizationId, long[] userIds) 560 throws com.liferay.portal.kernel.exception.SystemException { 561 getService().setOrganizationUsers(organizationId, userIds); 562 } 563 564 /** 565 * @throws SystemException if a system exception occurred 566 */ 567 public static void addRoleUser(long roleId, long userId) 568 throws com.liferay.portal.kernel.exception.SystemException { 569 getService().addRoleUser(roleId, userId); 570 } 571 572 /** 573 * @throws SystemException if a system exception occurred 574 */ 575 public static void addRoleUser(long roleId, 576 com.liferay.portal.model.User user) 577 throws com.liferay.portal.kernel.exception.SystemException { 578 getService().addRoleUser(roleId, user); 579 } 580 581 /** 582 * @throws PortalException 583 * @throws SystemException if a system exception occurred 584 */ 585 public static void addRoleUsers(long roleId, long[] userIds) 586 throws com.liferay.portal.kernel.exception.PortalException, 587 com.liferay.portal.kernel.exception.SystemException { 588 getService().addRoleUsers(roleId, userIds); 589 } 590 591 /** 592 * @throws PortalException 593 * @throws SystemException if a system exception occurred 594 */ 595 public static void addRoleUsers(long roleId, 596 java.util.List<com.liferay.portal.model.User> Users) 597 throws com.liferay.portal.kernel.exception.PortalException, 598 com.liferay.portal.kernel.exception.SystemException { 599 getService().addRoleUsers(roleId, Users); 600 } 601 602 /** 603 * @throws SystemException if a system exception occurred 604 */ 605 public static void clearRoleUsers(long roleId) 606 throws com.liferay.portal.kernel.exception.SystemException { 607 getService().clearRoleUsers(roleId); 608 } 609 610 /** 611 * @throws PortalException 612 * @throws SystemException if a system exception occurred 613 */ 614 public static void deleteRoleUser(long roleId, long userId) 615 throws com.liferay.portal.kernel.exception.PortalException, 616 com.liferay.portal.kernel.exception.SystemException { 617 getService().deleteRoleUser(roleId, userId); 618 } 619 620 /** 621 * @throws PortalException 622 * @throws SystemException if a system exception occurred 623 */ 624 public static void deleteRoleUser(long roleId, 625 com.liferay.portal.model.User user) 626 throws com.liferay.portal.kernel.exception.PortalException, 627 com.liferay.portal.kernel.exception.SystemException { 628 getService().deleteRoleUser(roleId, user); 629 } 630 631 /** 632 * @throws SystemException if a system exception occurred 633 */ 634 public static void deleteRoleUsers(long roleId, long[] userIds) 635 throws com.liferay.portal.kernel.exception.SystemException { 636 getService().deleteRoleUsers(roleId, userIds); 637 } 638 639 /** 640 * @throws SystemException if a system exception occurred 641 */ 642 public static void deleteRoleUsers(long roleId, 643 java.util.List<com.liferay.portal.model.User> Users) 644 throws com.liferay.portal.kernel.exception.SystemException { 645 getService().deleteRoleUsers(roleId, Users); 646 } 647 648 /** 649 * @throws SystemException if a system exception occurred 650 */ 651 public static java.util.List<com.liferay.portal.model.User> getRoleUsers( 652 long roleId) throws com.liferay.portal.kernel.exception.SystemException { 653 return getService().getRoleUsers(roleId); 654 } 655 656 /** 657 * @throws SystemException if a system exception occurred 658 */ 659 public static java.util.List<com.liferay.portal.model.User> getRoleUsers( 660 long roleId, int start, int end) 661 throws com.liferay.portal.kernel.exception.SystemException { 662 return getService().getRoleUsers(roleId, start, end); 663 } 664 665 /** 666 * @throws SystemException if a system exception occurred 667 */ 668 public static java.util.List<com.liferay.portal.model.User> getRoleUsers( 669 long roleId, int start, int end, 670 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 671 throws com.liferay.portal.kernel.exception.SystemException { 672 return getService().getRoleUsers(roleId, start, end, orderByComparator); 673 } 674 675 /** 676 * @throws SystemException if a system exception occurred 677 */ 678 public static int getRoleUsersCount(long roleId) 679 throws com.liferay.portal.kernel.exception.SystemException { 680 return getService().getRoleUsersCount(roleId); 681 } 682 683 /** 684 * @throws SystemException if a system exception occurred 685 */ 686 public static boolean hasRoleUser(long roleId, long userId) 687 throws com.liferay.portal.kernel.exception.SystemException { 688 return getService().hasRoleUser(roleId, userId); 689 } 690 691 /** 692 * @throws SystemException if a system exception occurred 693 */ 694 public static boolean hasRoleUsers(long roleId) 695 throws com.liferay.portal.kernel.exception.SystemException { 696 return getService().hasRoleUsers(roleId); 697 } 698 699 /** 700 * @throws PortalException 701 * @throws SystemException if a system exception occurred 702 */ 703 public static void setRoleUsers(long roleId, long[] userIds) 704 throws com.liferay.portal.kernel.exception.PortalException, 705 com.liferay.portal.kernel.exception.SystemException { 706 getService().setRoleUsers(roleId, userIds); 707 } 708 709 /** 710 * @throws SystemException if a system exception occurred 711 */ 712 public static void addTeamUser(long teamId, long userId) 713 throws com.liferay.portal.kernel.exception.SystemException { 714 getService().addTeamUser(teamId, userId); 715 } 716 717 /** 718 * @throws SystemException if a system exception occurred 719 */ 720 public static void addTeamUser(long teamId, 721 com.liferay.portal.model.User user) 722 throws com.liferay.portal.kernel.exception.SystemException { 723 getService().addTeamUser(teamId, user); 724 } 725 726 /** 727 * @throws PortalException 728 * @throws SystemException if a system exception occurred 729 */ 730 public static void addTeamUsers(long teamId, long[] userIds) 731 throws com.liferay.portal.kernel.exception.PortalException, 732 com.liferay.portal.kernel.exception.SystemException { 733 getService().addTeamUsers(teamId, userIds); 734 } 735 736 /** 737 * @throws PortalException 738 * @throws SystemException if a system exception occurred 739 */ 740 public static void addTeamUsers(long teamId, 741 java.util.List<com.liferay.portal.model.User> Users) 742 throws com.liferay.portal.kernel.exception.PortalException, 743 com.liferay.portal.kernel.exception.SystemException { 744 getService().addTeamUsers(teamId, Users); 745 } 746 747 /** 748 * @throws SystemException if a system exception occurred 749 */ 750 public static void clearTeamUsers(long teamId) 751 throws com.liferay.portal.kernel.exception.SystemException { 752 getService().clearTeamUsers(teamId); 753 } 754 755 /** 756 * @throws SystemException if a system exception occurred 757 */ 758 public static void deleteTeamUser(long teamId, long userId) 759 throws com.liferay.portal.kernel.exception.SystemException { 760 getService().deleteTeamUser(teamId, userId); 761 } 762 763 /** 764 * @throws SystemException if a system exception occurred 765 */ 766 public static void deleteTeamUser(long teamId, 767 com.liferay.portal.model.User user) 768 throws com.liferay.portal.kernel.exception.SystemException { 769 getService().deleteTeamUser(teamId, user); 770 } 771 772 /** 773 * @throws SystemException if a system exception occurred 774 */ 775 public static void deleteTeamUsers(long teamId, long[] userIds) 776 throws com.liferay.portal.kernel.exception.SystemException { 777 getService().deleteTeamUsers(teamId, userIds); 778 } 779 780 /** 781 * @throws SystemException if a system exception occurred 782 */ 783 public static void deleteTeamUsers(long teamId, 784 java.util.List<com.liferay.portal.model.User> Users) 785 throws com.liferay.portal.kernel.exception.SystemException { 786 getService().deleteTeamUsers(teamId, Users); 787 } 788 789 /** 790 * @throws SystemException if a system exception occurred 791 */ 792 public static java.util.List<com.liferay.portal.model.User> getTeamUsers( 793 long teamId) throws com.liferay.portal.kernel.exception.SystemException { 794 return getService().getTeamUsers(teamId); 795 } 796 797 /** 798 * @throws SystemException if a system exception occurred 799 */ 800 public static java.util.List<com.liferay.portal.model.User> getTeamUsers( 801 long teamId, int start, int end) 802 throws com.liferay.portal.kernel.exception.SystemException { 803 return getService().getTeamUsers(teamId, start, end); 804 } 805 806 /** 807 * @throws SystemException if a system exception occurred 808 */ 809 public static java.util.List<com.liferay.portal.model.User> getTeamUsers( 810 long teamId, int start, int end, 811 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 812 throws com.liferay.portal.kernel.exception.SystemException { 813 return getService().getTeamUsers(teamId, start, end, orderByComparator); 814 } 815 816 /** 817 * @throws SystemException if a system exception occurred 818 */ 819 public static int getTeamUsersCount(long teamId) 820 throws com.liferay.portal.kernel.exception.SystemException { 821 return getService().getTeamUsersCount(teamId); 822 } 823 824 /** 825 * @throws SystemException if a system exception occurred 826 */ 827 public static boolean hasTeamUser(long teamId, long userId) 828 throws com.liferay.portal.kernel.exception.SystemException { 829 return getService().hasTeamUser(teamId, userId); 830 } 831 832 /** 833 * @throws SystemException if a system exception occurred 834 */ 835 public static boolean hasTeamUsers(long teamId) 836 throws com.liferay.portal.kernel.exception.SystemException { 837 return getService().hasTeamUsers(teamId); 838 } 839 840 /** 841 * @throws SystemException if a system exception occurred 842 */ 843 public static void setTeamUsers(long teamId, long[] userIds) 844 throws com.liferay.portal.kernel.exception.SystemException { 845 getService().setTeamUsers(teamId, userIds); 846 } 847 848 /** 849 * @throws SystemException if a system exception occurred 850 */ 851 public static void addUserGroupUser(long userGroupId, long userId) 852 throws com.liferay.portal.kernel.exception.SystemException { 853 getService().addUserGroupUser(userGroupId, userId); 854 } 855 856 /** 857 * @throws SystemException if a system exception occurred 858 */ 859 public static void addUserGroupUser(long userGroupId, 860 com.liferay.portal.model.User user) 861 throws com.liferay.portal.kernel.exception.SystemException { 862 getService().addUserGroupUser(userGroupId, user); 863 } 864 865 /** 866 * @throws PortalException 867 * @throws SystemException if a system exception occurred 868 */ 869 public static void addUserGroupUsers(long userGroupId, long[] userIds) 870 throws com.liferay.portal.kernel.exception.PortalException, 871 com.liferay.portal.kernel.exception.SystemException { 872 getService().addUserGroupUsers(userGroupId, userIds); 873 } 874 875 /** 876 * @throws PortalException 877 * @throws SystemException if a system exception occurred 878 */ 879 public static void addUserGroupUsers(long userGroupId, 880 java.util.List<com.liferay.portal.model.User> Users) 881 throws com.liferay.portal.kernel.exception.PortalException, 882 com.liferay.portal.kernel.exception.SystemException { 883 getService().addUserGroupUsers(userGroupId, Users); 884 } 885 886 /** 887 * @throws SystemException if a system exception occurred 888 */ 889 public static void clearUserGroupUsers(long userGroupId) 890 throws com.liferay.portal.kernel.exception.SystemException { 891 getService().clearUserGroupUsers(userGroupId); 892 } 893 894 /** 895 * @throws PortalException 896 * @throws SystemException if a system exception occurred 897 */ 898 public static void deleteUserGroupUser(long userGroupId, long userId) 899 throws com.liferay.portal.kernel.exception.PortalException, 900 com.liferay.portal.kernel.exception.SystemException { 901 getService().deleteUserGroupUser(userGroupId, userId); 902 } 903 904 /** 905 * @throws PortalException 906 * @throws SystemException if a system exception occurred 907 */ 908 public static void deleteUserGroupUser(long userGroupId, 909 com.liferay.portal.model.User user) 910 throws com.liferay.portal.kernel.exception.PortalException, 911 com.liferay.portal.kernel.exception.SystemException { 912 getService().deleteUserGroupUser(userGroupId, user); 913 } 914 915 /** 916 * @throws SystemException if a system exception occurred 917 */ 918 public static void deleteUserGroupUsers(long userGroupId, long[] userIds) 919 throws com.liferay.portal.kernel.exception.SystemException { 920 getService().deleteUserGroupUsers(userGroupId, userIds); 921 } 922 923 /** 924 * @throws SystemException if a system exception occurred 925 */ 926 public static void deleteUserGroupUsers(long userGroupId, 927 java.util.List<com.liferay.portal.model.User> Users) 928 throws com.liferay.portal.kernel.exception.SystemException { 929 getService().deleteUserGroupUsers(userGroupId, Users); 930 } 931 932 /** 933 * @throws SystemException if a system exception occurred 934 */ 935 public static java.util.List<com.liferay.portal.model.User> getUserGroupUsers( 936 long userGroupId) 937 throws com.liferay.portal.kernel.exception.SystemException { 938 return getService().getUserGroupUsers(userGroupId); 939 } 940 941 /** 942 * @throws SystemException if a system exception occurred 943 */ 944 public static java.util.List<com.liferay.portal.model.User> getUserGroupUsers( 945 long userGroupId, int start, int end) 946 throws com.liferay.portal.kernel.exception.SystemException { 947 return getService().getUserGroupUsers(userGroupId, start, end); 948 } 949 950 /** 951 * @throws SystemException if a system exception occurred 952 */ 953 public static java.util.List<com.liferay.portal.model.User> getUserGroupUsers( 954 long userGroupId, int start, int end, 955 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 956 throws com.liferay.portal.kernel.exception.SystemException { 957 return getService() 958 .getUserGroupUsers(userGroupId, start, end, orderByComparator); 959 } 960 961 /** 962 * @throws SystemException if a system exception occurred 963 */ 964 public static int getUserGroupUsersCount(long userGroupId) 965 throws com.liferay.portal.kernel.exception.SystemException { 966 return getService().getUserGroupUsersCount(userGroupId); 967 } 968 969 /** 970 * @throws SystemException if a system exception occurred 971 */ 972 public static boolean hasUserGroupUser(long userGroupId, long userId) 973 throws com.liferay.portal.kernel.exception.SystemException { 974 return getService().hasUserGroupUser(userGroupId, userId); 975 } 976 977 /** 978 * @throws SystemException if a system exception occurred 979 */ 980 public static boolean hasUserGroupUsers(long userGroupId) 981 throws com.liferay.portal.kernel.exception.SystemException { 982 return getService().hasUserGroupUsers(userGroupId); 983 } 984 985 /** 986 * @throws PortalException 987 * @throws SystemException if a system exception occurred 988 */ 989 public static void setUserGroupUsers(long userGroupId, long[] userIds) 990 throws com.liferay.portal.kernel.exception.PortalException, 991 com.liferay.portal.kernel.exception.SystemException { 992 getService().setUserGroupUsers(userGroupId, userIds); 993 } 994 995 /** 996 * Returns the Spring bean ID for this bean. 997 * 998 * @return the Spring bean ID for this bean 999 */ 1000 public static java.lang.String getBeanIdentifier() { 1001 return getService().getBeanIdentifier(); 1002 } 1003 1004 /** 1005 * Sets the Spring bean ID for this bean. 1006 * 1007 * @param beanIdentifier the Spring bean ID for this bean 1008 */ 1009 public static void setBeanIdentifier(java.lang.String beanIdentifier) { 1010 getService().setBeanIdentifier(beanIdentifier); 1011 } 1012 1013 /** 1014 * Adds a default admin user for the company. 1015 * 1016 * @param companyId the primary key of the user's company 1017 * @param screenName the user's screen name 1018 * @param emailAddress the user's email address 1019 * @param locale the user's locale 1020 * @param firstName the user's first name 1021 * @param middleName the user's middle name 1022 * @param lastName the user's last name 1023 * @return the new default admin user 1024 * @throws PortalException n if a portal exception occurred 1025 * @throws SystemException if a system exception occurred 1026 */ 1027 public static com.liferay.portal.model.User addDefaultAdminUser( 1028 long companyId, java.lang.String screenName, 1029 java.lang.String emailAddress, java.util.Locale locale, 1030 java.lang.String firstName, java.lang.String middleName, 1031 java.lang.String lastName) 1032 throws com.liferay.portal.kernel.exception.PortalException, 1033 com.liferay.portal.kernel.exception.SystemException { 1034 return getService() 1035 .addDefaultAdminUser(companyId, screenName, emailAddress, 1036 locale, firstName, middleName, lastName); 1037 } 1038 1039 /** 1040 * Adds the user to the default groups, unless the user is already in these 1041 * groups. The default groups can be specified in 1042 * <code>portal.properties</code> with the key 1043 * <code>admin.default.group.names</code>. 1044 * 1045 * @param userId the primary key of the user 1046 * @throws PortalException if a user with the primary key could not be found 1047 * @throws SystemException if a system exception occurred 1048 */ 1049 public static void addDefaultGroups(long userId) 1050 throws com.liferay.portal.kernel.exception.PortalException, 1051 com.liferay.portal.kernel.exception.SystemException { 1052 getService().addDefaultGroups(userId); 1053 } 1054 1055 /** 1056 * Adds the user to the default roles, unless the user already has these 1057 * roles. The default roles can be specified in 1058 * <code>portal.properties</code> with the key 1059 * <code>admin.default.role.names</code>. 1060 * 1061 * @param userId the primary key of the user 1062 * @throws PortalException if a user with the primary key could not be found 1063 * @throws SystemException if a system exception occurred 1064 */ 1065 public static void addDefaultRoles(long userId) 1066 throws com.liferay.portal.kernel.exception.PortalException, 1067 com.liferay.portal.kernel.exception.SystemException { 1068 getService().addDefaultRoles(userId); 1069 } 1070 1071 /** 1072 * Adds the user to the default user groups, unless the user is already in 1073 * these user groups. The default user groups can be specified in 1074 * <code>portal.properties</code> with the property 1075 * <code>admin.default.user.group.names</code>. 1076 * 1077 * @param userId the primary key of the user 1078 * @throws PortalException if a user with the primary key could not be found 1079 * @throws SystemException if a system exception occurred 1080 */ 1081 public static void addDefaultUserGroups(long userId) 1082 throws com.liferay.portal.kernel.exception.PortalException, 1083 com.liferay.portal.kernel.exception.SystemException { 1084 getService().addDefaultUserGroups(userId); 1085 } 1086 1087 /** 1088 * Assigns the password policy to the users, removing any other currently 1089 * assigned password policies. 1090 * 1091 * @param passwordPolicyId the primary key of the password policy 1092 * @param userIds the primary keys of the users 1093 * @throws SystemException if a system exception occurred 1094 */ 1095 public static void addPasswordPolicyUsers(long passwordPolicyId, 1096 long[] userIds) 1097 throws com.liferay.portal.kernel.exception.SystemException { 1098 getService().addPasswordPolicyUsers(passwordPolicyId, userIds); 1099 } 1100 1101 /** 1102 * Adds a user. 1103 * 1104 * <p> 1105 * This method handles the creation and bookkeeping of the user including 1106 * its resources, metadata, and internal data structures. It is not 1107 * necessary to make subsequent calls to any methods to setup default 1108 * groups, resources, etc. 1109 * </p> 1110 * 1111 * @param creatorUserId the primary key of the creator 1112 * @param companyId the primary key of the user's company 1113 * @param autoPassword whether a password should be automatically generated 1114 for the user 1115 * @param password1 the user's password 1116 * @param password2 the user's password confirmation 1117 * @param autoScreenName whether a screen name should be automatically 1118 generated for the user 1119 * @param screenName the user's screen name 1120 * @param emailAddress the user's email address 1121 * @param facebookId the user's facebook ID 1122 * @param openId the user's OpenID 1123 * @param locale the user's locale 1124 * @param firstName the user's first name 1125 * @param middleName the user's middle name 1126 * @param lastName the user's last name 1127 * @param prefixId the user's name prefix ID 1128 * @param suffixId the user's name suffix ID 1129 * @param male whether the user is male 1130 * @param birthdayMonth the user's birthday month (0-based, meaning 0 for 1131 January) 1132 * @param birthdayDay the user's birthday day 1133 * @param birthdayYear the user's birthday year 1134 * @param jobTitle the user's job title 1135 * @param groupIds the primary keys of the user's groups 1136 * @param organizationIds the primary keys of the user's organizations 1137 * @param roleIds the primary keys of the roles this user possesses 1138 * @param userGroupIds the primary keys of the user's user groups 1139 * @param sendEmail whether to send the user an email notification about 1140 their new account 1141 * @param serviceContext the service context to be applied (optionally 1142 <code>null</code>). Can set the UUID (with the <code>uuid</code> 1143 attribute), asset category IDs, asset tag names, and expando 1144 bridge attributes for the user. 1145 * @return the new user 1146 * @throws PortalException if the user's information was invalid 1147 * @throws SystemException if a system exception occurred 1148 */ 1149 public static com.liferay.portal.model.User addUser(long creatorUserId, 1150 long companyId, boolean autoPassword, java.lang.String password1, 1151 java.lang.String password2, boolean autoScreenName, 1152 java.lang.String screenName, java.lang.String emailAddress, 1153 long facebookId, java.lang.String openId, java.util.Locale locale, 1154 java.lang.String firstName, java.lang.String middleName, 1155 java.lang.String lastName, int prefixId, int suffixId, boolean male, 1156 int birthdayMonth, int birthdayDay, int birthdayYear, 1157 java.lang.String jobTitle, long[] groupIds, long[] organizationIds, 1158 long[] roleIds, long[] userGroupIds, boolean sendEmail, 1159 com.liferay.portal.service.ServiceContext serviceContext) 1160 throws com.liferay.portal.kernel.exception.PortalException, 1161 com.liferay.portal.kernel.exception.SystemException { 1162 return getService() 1163 .addUser(creatorUserId, companyId, autoPassword, password1, 1164 password2, autoScreenName, screenName, emailAddress, facebookId, 1165 openId, locale, firstName, middleName, lastName, prefixId, 1166 suffixId, male, birthdayMonth, birthdayDay, birthdayYear, jobTitle, 1167 groupIds, organizationIds, roleIds, userGroupIds, sendEmail, 1168 serviceContext); 1169 } 1170 1171 /** 1172 * Adds a user with workflow. 1173 * 1174 * <p> 1175 * This method handles the creation and bookkeeping of the user including 1176 * its resources, metadata, and internal data structures. It is not 1177 * necessary to make subsequent calls to any methods to setup default 1178 * groups, resources, etc. 1179 * </p> 1180 * 1181 * @param creatorUserId the primary key of the creator 1182 * @param companyId the primary key of the user's company 1183 * @param autoPassword whether a password should be automatically generated 1184 for the user 1185 * @param password1 the user's password 1186 * @param password2 the user's password confirmation 1187 * @param autoScreenName whether a screen name should be automatically 1188 generated for the user 1189 * @param screenName the user's screen name 1190 * @param emailAddress the user's email address 1191 * @param facebookId the user's facebook ID 1192 * @param openId the user's OpenID 1193 * @param locale the user's locale 1194 * @param firstName the user's first name 1195 * @param middleName the user's middle name 1196 * @param lastName the user's last name 1197 * @param prefixId the user's name prefix ID 1198 * @param suffixId the user's name suffix ID 1199 * @param male whether the user is male 1200 * @param birthdayMonth the user's birthday month (0-based, meaning 0 for 1201 January) 1202 * @param birthdayDay the user's birthday day 1203 * @param birthdayYear the user's birthday year 1204 * @param jobTitle the user's job title 1205 * @param groupIds the primary keys of the user's groups 1206 * @param organizationIds the primary keys of the user's organizations 1207 * @param roleIds the primary keys of the roles this user possesses 1208 * @param userGroupIds the primary keys of the user's user groups 1209 * @param sendEmail whether to send the user an email notification about 1210 their new account 1211 * @param serviceContext the service context to be applied (optionally 1212 <code>null</code>). Can set the UUID (with the <code>uuid</code> 1213 attribute), asset category IDs, asset tag names, and expando 1214 bridge attributes for the user. 1215 * @return the new user 1216 * @throws PortalException if the user's information was invalid 1217 * @throws SystemException if a system exception occurred 1218 */ 1219 public static com.liferay.portal.model.User addUserWithWorkflow( 1220 long creatorUserId, long companyId, boolean autoPassword, 1221 java.lang.String password1, java.lang.String password2, 1222 boolean autoScreenName, java.lang.String screenName, 1223 java.lang.String emailAddress, long facebookId, 1224 java.lang.String openId, java.util.Locale locale, 1225 java.lang.String firstName, java.lang.String middleName, 1226 java.lang.String lastName, int prefixId, int suffixId, boolean male, 1227 int birthdayMonth, int birthdayDay, int birthdayYear, 1228 java.lang.String jobTitle, long[] groupIds, long[] organizationIds, 1229 long[] roleIds, long[] userGroupIds, boolean sendEmail, 1230 com.liferay.portal.service.ServiceContext serviceContext) 1231 throws com.liferay.portal.kernel.exception.PortalException, 1232 com.liferay.portal.kernel.exception.SystemException { 1233 return getService() 1234 .addUserWithWorkflow(creatorUserId, companyId, autoPassword, 1235 password1, password2, autoScreenName, screenName, emailAddress, 1236 facebookId, openId, locale, firstName, middleName, lastName, 1237 prefixId, suffixId, male, birthdayMonth, birthdayDay, birthdayYear, 1238 jobTitle, groupIds, organizationIds, roleIds, userGroupIds, 1239 sendEmail, serviceContext); 1240 } 1241 1242 /** 1243 * Attempts to authenticate the user by their email address and password, 1244 * while using the AuthPipeline. 1245 * 1246 * @param companyId the primary key of the user's company 1247 * @param emailAddress the user's email address 1248 * @param password the user's password 1249 * @param headerMap the header map from the authentication request 1250 * @param parameterMap the parameter map from the authentication request 1251 * @param resultsMap the map of authentication results (may be nil). After 1252 a succesful authentication the user's primary key will be placed 1253 under the key <code>userId</code>. 1254 * @return the authentication status. This can be {@link 1255 com.liferay.portal.security.auth.Authenticator#FAILURE} 1256 indicating that the user's credentials are invalid, {@link 1257 com.liferay.portal.security.auth.Authenticator#SUCCESS} 1258 indicating a successful login, or {@link 1259 com.liferay.portal.security.auth.Authenticator#DNE} indicating 1260 that a user with that login does not exist. 1261 * @throws PortalException if <code>emailAddress</code> or 1262 <code>password</code> was <code>null</code> 1263 * @throws SystemException if a system exception occurred 1264 * @see com.liferay.portal.security.auth.AuthPipeline 1265 */ 1266 public static int authenticateByEmailAddress(long companyId, 1267 java.lang.String emailAddress, java.lang.String password, 1268 java.util.Map<java.lang.String, java.lang.String[]> headerMap, 1269 java.util.Map<java.lang.String, java.lang.String[]> parameterMap, 1270 java.util.Map<java.lang.String, java.lang.Object> resultsMap) 1271 throws com.liferay.portal.kernel.exception.PortalException, 1272 com.liferay.portal.kernel.exception.SystemException { 1273 return getService() 1274 .authenticateByEmailAddress(companyId, emailAddress, 1275 password, headerMap, parameterMap, resultsMap); 1276 } 1277 1278 /** 1279 * Attempts to authenticate the user by their screen name and password, 1280 * while using the AuthPipeline. 1281 * 1282 * @param companyId the primary key of the user's company 1283 * @param screenName the user's screen name 1284 * @param password the user's password 1285 * @param headerMap the header map from the authentication request 1286 * @param parameterMap the parameter map from the authentication request 1287 * @param resultsMap the map of authentication results (may be nil). After 1288 a succesful authentication the user's primary key will be placed 1289 under the key <code>userId</code>. 1290 * @return the authentication status. This can be {@link 1291 com.liferay.portal.security.auth.Authenticator#FAILURE} 1292 indicating that the user's credentials are invalid, {@link 1293 com.liferay.portal.security.auth.Authenticator#SUCCESS} 1294 indicating a successful login, or {@link 1295 com.liferay.portal.security.auth.Authenticator#DNE} indicating 1296 that a user with that login does not exist. 1297 * @throws PortalException if <code>screenName</code> or 1298 <code>password</code> was <code>null</code> 1299 * @throws SystemException if a system exception occurred 1300 * @see com.liferay.portal.security.auth.AuthPipeline 1301 */ 1302 public static int authenticateByScreenName(long companyId, 1303 java.lang.String screenName, java.lang.String password, 1304 java.util.Map<java.lang.String, java.lang.String[]> headerMap, 1305 java.util.Map<java.lang.String, java.lang.String[]> parameterMap, 1306 java.util.Map<java.lang.String, java.lang.Object> resultsMap) 1307 throws com.liferay.portal.kernel.exception.PortalException, 1308 com.liferay.portal.kernel.exception.SystemException { 1309 return getService() 1310 .authenticateByScreenName(companyId, screenName, password, 1311 headerMap, parameterMap, resultsMap); 1312 } 1313 1314 /** 1315 * Attempts to authenticate the user by their primary key and password, 1316 * while using the AuthPipeline. 1317 * 1318 * @param companyId the primary key of the user's company 1319 * @param userId the user's primary key 1320 * @param password the user's password 1321 * @param headerMap the header map from the authentication request 1322 * @param parameterMap the parameter map from the authentication request 1323 * @param resultsMap the map of authentication results (may be nil). After 1324 a succesful authentication the user's primary key will be placed 1325 under the key <code>userId</code>. 1326 * @return the authentication status. This can be {@link 1327 com.liferay.portal.security.auth.Authenticator#FAILURE} 1328 indicating that the user's credentials are invalid, {@link 1329 com.liferay.portal.security.auth.Authenticator#SUCCESS} 1330 indicating a successful login, or {@link 1331 com.liferay.portal.security.auth.Authenticator#DNE} indicating 1332 that a user with that login does not exist. 1333 * @throws PortalException if <code>userId</code> or <code>password</code> 1334 was <code>null</code> 1335 * @throws SystemException if a system exception occurred 1336 * @see com.liferay.portal.security.auth.AuthPipeline 1337 */ 1338 public static int authenticateByUserId(long companyId, long userId, 1339 java.lang.String password, 1340 java.util.Map<java.lang.String, java.lang.String[]> headerMap, 1341 java.util.Map<java.lang.String, java.lang.String[]> parameterMap, 1342 java.util.Map<java.lang.String, java.lang.Object> resultsMap) 1343 throws com.liferay.portal.kernel.exception.PortalException, 1344 com.liferay.portal.kernel.exception.SystemException { 1345 return getService() 1346 .authenticateByUserId(companyId, userId, password, 1347 headerMap, parameterMap, resultsMap); 1348 } 1349 1350 /** 1351 * Attempts to authenticate the user using HTTP basic access authentication, 1352 * without using the AuthPipeline. Primarily used for authenticating users 1353 * of <code>tunnel-web</code>. 1354 * 1355 * <p> 1356 * Authentication type specifies what <code>login</code> contains.The valid 1357 * values are: 1358 * </p> 1359 * 1360 * <ul> 1361 * <li> 1362 * <code>CompanyConstants.AUTH_TYPE_EA</code> - <code>login</code> is the 1363 * user's email address 1364 * </li> 1365 * <li> 1366 * <code>CompanyConstants.AUTH_TYPE_SN</code> - <code>login</code> is the 1367 * user's screen name 1368 * </li> 1369 * <li> 1370 * <code>CompanyConstants.AUTH_TYPE_ID</code> - <code>login</code> is the 1371 * user's primary key 1372 * </li> 1373 * </ul> 1374 * 1375 * @param companyId the primary key of the user's company 1376 * @param authType the type of authentication to perform 1377 * @param login either the user's email address, screen name, or primary 1378 key depending on the value of <code>authType</code> 1379 * @param password the user's password 1380 * @return the authentication status. This can be {@link 1381 com.liferay.portal.security.auth.Authenticator#FAILURE} 1382 indicating that the user's credentials are invalid, {@link 1383 com.liferay.portal.security.auth.Authenticator#SUCCESS} 1384 indicating a successful login, or {@link 1385 com.liferay.portal.security.auth.Authenticator#DNE} indicating 1386 that a user with that login does not exist. 1387 * @throws PortalException if a portal exception occurred 1388 * @throws SystemException if a system exception occurred 1389 */ 1390 public static long authenticateForBasic(long companyId, 1391 java.lang.String authType, java.lang.String login, 1392 java.lang.String password) 1393 throws com.liferay.portal.kernel.exception.PortalException, 1394 com.liferay.portal.kernel.exception.SystemException { 1395 return getService() 1396 .authenticateForBasic(companyId, authType, login, password); 1397 } 1398 1399 /** 1400 * Attempts to authenticate the user using HTTP digest access 1401 * authentication, without using the AuthPipeline. Primarily used for 1402 * authenticating users of <code>tunnel-web</code>. 1403 * 1404 * @param companyId the primary key of the user's company 1405 * @param username either the user's email address, screen name, or primary 1406 key 1407 * @param realm unused 1408 * @param nonce the number used once 1409 * @param method the request method 1410 * @param uri the request URI 1411 * @param response the authentication response hash 1412 * @return the user's primary key if authentication is succesful; 1413 <code>0</code> otherwise 1414 * @throws PortalException if a portal exception occurred 1415 * @throws SystemException if a system exception occurred 1416 */ 1417 public static long authenticateForDigest(long companyId, 1418 java.lang.String username, java.lang.String realm, 1419 java.lang.String nonce, java.lang.String method, java.lang.String uri, 1420 java.lang.String response) 1421 throws com.liferay.portal.kernel.exception.PortalException, 1422 com.liferay.portal.kernel.exception.SystemException { 1423 return getService() 1424 .authenticateForDigest(companyId, username, realm, nonce, 1425 method, uri, response); 1426 } 1427 1428 /** 1429 * Attempts to authenticate the user using JAAS credentials, without using 1430 * the AuthPipeline. 1431 * 1432 * @param userId the primary key of the user 1433 * @param encPassword the encrypted password 1434 * @return <code>true</code> if authentication is successful; 1435 <code>false</code> otherwise 1436 */ 1437 public static boolean authenticateForJAAS(long userId, 1438 java.lang.String encPassword) { 1439 return getService().authenticateForJAAS(userId, encPassword); 1440 } 1441 1442 /** 1443 * Checks if the user is currently locked out based on the password policy, 1444 * and performs maintenance on the user's lockout and failed login data. 1445 * 1446 * @param user the user 1447 * @throws PortalException if the user was determined to still be locked out 1448 * @throws SystemException if a system exception occurred 1449 */ 1450 public static void checkLockout(com.liferay.portal.model.User user) 1451 throws com.liferay.portal.kernel.exception.PortalException, 1452 com.liferay.portal.kernel.exception.SystemException { 1453 getService().checkLockout(user); 1454 } 1455 1456 /** 1457 * Adds a failed login attempt to the user and updates the user's last 1458 * failed login date. 1459 * 1460 * @param user the user 1461 * @throws SystemException if a system exception occurred 1462 */ 1463 public static void checkLoginFailure(com.liferay.portal.model.User user) 1464 throws com.liferay.portal.kernel.exception.SystemException { 1465 getService().checkLoginFailure(user); 1466 } 1467 1468 /** 1469 * Adds a failed login attempt to the user with the email address and 1470 * updates the user's last failed login date. 1471 * 1472 * @param companyId the primary key of the user's company 1473 * @param emailAddress the user's email address 1474 * @throws PortalException if a user with the email address could not be 1475 found 1476 * @throws SystemException if a system exception occurred 1477 */ 1478 public static void checkLoginFailureByEmailAddress(long companyId, 1479 java.lang.String emailAddress) 1480 throws com.liferay.portal.kernel.exception.PortalException, 1481 com.liferay.portal.kernel.exception.SystemException { 1482 getService().checkLoginFailureByEmailAddress(companyId, emailAddress); 1483 } 1484 1485 /** 1486 * Adds a failed login attempt to the user and updates the user's last 1487 * failed login date. 1488 * 1489 * @param userId the primary key of the user 1490 * @throws PortalException if a user with the primary key could not be found 1491 * @throws SystemException if a system exception occurred 1492 */ 1493 public static void checkLoginFailureById(long userId) 1494 throws com.liferay.portal.kernel.exception.PortalException, 1495 com.liferay.portal.kernel.exception.SystemException { 1496 getService().checkLoginFailureById(userId); 1497 } 1498 1499 /** 1500 * Adds a failed login attempt to the user with the screen name and updates 1501 * the user's last failed login date. 1502 * 1503 * @param companyId the primary key of the user's company 1504 * @param screenName the user's screen name 1505 * @throws PortalException if a user with the screen name could not be found 1506 * @throws SystemException if a system exception occurred 1507 */ 1508 public static void checkLoginFailureByScreenName(long companyId, 1509 java.lang.String screenName) 1510 throws com.liferay.portal.kernel.exception.PortalException, 1511 com.liferay.portal.kernel.exception.SystemException { 1512 getService().checkLoginFailureByScreenName(companyId, screenName); 1513 } 1514 1515 /** 1516 * Checks if the user's password is expired based on the password policy, 1517 * and performs maintenance on the user's grace login and password reset 1518 * data. 1519 * 1520 * @param user the user 1521 * @throws PortalException if the user's password has expired and the grace 1522 login limit has been exceeded 1523 * @throws SystemException if a system exception occurred 1524 */ 1525 public static void checkPasswordExpired(com.liferay.portal.model.User user) 1526 throws com.liferay.portal.kernel.exception.PortalException, 1527 com.liferay.portal.kernel.exception.SystemException { 1528 getService().checkPasswordExpired(user); 1529 } 1530 1531 /** 1532 * Completes the user's registration by generating a password and sending 1533 * the confirmation email. 1534 * 1535 * @param user the user 1536 * @param serviceContext the service context to be applied. Can set whether 1537 a password should be generated (with the 1538 <code>autoPassword</code> attribute) and whether the confirmation 1539 email should be sent (with the <code>sendEmail</code> attribute) 1540 for the user. 1541 * @throws PortalException if a portal exception occurred 1542 * @throws SystemException if a system exception occurred 1543 */ 1544 public static void completeUserRegistration( 1545 com.liferay.portal.model.User user, 1546 com.liferay.portal.service.ServiceContext serviceContext) 1547 throws com.liferay.portal.kernel.exception.PortalException, 1548 com.liferay.portal.kernel.exception.SystemException { 1549 getService().completeUserRegistration(user, serviceContext); 1550 } 1551 1552 /** 1553 * Decrypts the user's primary key and password from their encrypted forms. 1554 * Used for decrypting a user's credentials from the values stored in an 1555 * automatic login cookie. 1556 * 1557 * @param companyId the primary key of the user's company 1558 * @param name the encrypted primary key of the user 1559 * @param password the encrypted password of the user 1560 * @return the user's primary key and password 1561 * @throws PortalException if a user with the primary key could not be found 1562 or if the user's password was incorrect 1563 * @throws SystemException if a system exception occurred 1564 */ 1565 public static com.liferay.portal.kernel.util.KeyValuePair decryptUserId( 1566 long companyId, java.lang.String name, java.lang.String password) 1567 throws com.liferay.portal.kernel.exception.PortalException, 1568 com.liferay.portal.kernel.exception.SystemException { 1569 return getService().decryptUserId(companyId, name, password); 1570 } 1571 1572 /** 1573 * Deletes the user's portrait image. 1574 * 1575 * @param userId the primary key of the user 1576 * @throws PortalException if a user with the primary key could not be found 1577 or if the user's portrait could not be found 1578 * @throws SystemException if a system exception occurred 1579 */ 1580 public static void deletePortrait(long userId) 1581 throws com.liferay.portal.kernel.exception.PortalException, 1582 com.liferay.portal.kernel.exception.SystemException { 1583 getService().deletePortrait(userId); 1584 } 1585 1586 /** 1587 * Encrypts the primary key of the user. Used when encrypting the user's 1588 * credentials for storage in an automatic login cookie. 1589 * 1590 * @param name the primary key of the user 1591 * @return the user's encrypted primary key 1592 * @throws PortalException if a user with the primary key could not be found 1593 * @throws SystemException if a system exception occurred 1594 */ 1595 public static java.lang.String encryptUserId(java.lang.String name) 1596 throws com.liferay.portal.kernel.exception.PortalException, 1597 com.liferay.portal.kernel.exception.SystemException { 1598 return getService().encryptUserId(name); 1599 } 1600 1601 /** 1602 * Returns the user with the email address. 1603 * 1604 * @param companyId the primary key of the user's company 1605 * @param emailAddress the user's email address 1606 * @return the user with the email address, or <code>null</code> if a user 1607 with the email address could not be found 1608 * @throws SystemException if a system exception occurred 1609 */ 1610 public static com.liferay.portal.model.User fetchUserByEmailAddress( 1611 long companyId, java.lang.String emailAddress) 1612 throws com.liferay.portal.kernel.exception.SystemException { 1613 return getService().fetchUserByEmailAddress(companyId, emailAddress); 1614 } 1615 1616 /** 1617 * Returns the user with the Facebook ID. 1618 * 1619 * @param companyId the primary key of the user's company 1620 * @param facebookId the user's Facebook ID 1621 * @return the user with the Facebook ID, or <code>null</code> if a user 1622 with the Facebook ID could not be found 1623 * @throws SystemException if a system exception occurred 1624 */ 1625 public static com.liferay.portal.model.User fetchUserByFacebookId( 1626 long companyId, long facebookId) 1627 throws com.liferay.portal.kernel.exception.SystemException { 1628 return getService().fetchUserByFacebookId(companyId, facebookId); 1629 } 1630 1631 /** 1632 * Returns the user with the primary key. 1633 * 1634 * @param userId the primary key of the user 1635 * @return the user with the primary key, or <code>null</code> if a user 1636 with the primary key could not be found 1637 * @throws SystemException if a system exception occurred 1638 */ 1639 public static com.liferay.portal.model.User fetchUserById(long userId) 1640 throws com.liferay.portal.kernel.exception.SystemException { 1641 return getService().fetchUserById(userId); 1642 } 1643 1644 /** 1645 * Returns the user with the OpenID. 1646 * 1647 * @param companyId the primary key of the user's company 1648 * @param openId the user's OpenID 1649 * @return the user with the OpenID, or <code>null</code> if a user with the 1650 OpenID could not be found 1651 * @throws SystemException if a system exception occurred 1652 */ 1653 public static com.liferay.portal.model.User fetchUserByOpenId( 1654 long companyId, java.lang.String openId) 1655 throws com.liferay.portal.kernel.exception.SystemException { 1656 return getService().fetchUserByOpenId(companyId, openId); 1657 } 1658 1659 /** 1660 * Returns the user with the screen name. 1661 * 1662 * @param companyId the primary key of the user's company 1663 * @param screenName the user's screen name 1664 * @return the user with the screen name, or <code>null</code> if a user 1665 with the screen name could not be found 1666 * @throws SystemException if a system exception occurred 1667 */ 1668 public static com.liferay.portal.model.User fetchUserByScreenName( 1669 long companyId, java.lang.String screenName) 1670 throws com.liferay.portal.kernel.exception.SystemException { 1671 return getService().fetchUserByScreenName(companyId, screenName); 1672 } 1673 1674 /** 1675 * Returns a range of all the users belonging to the company. 1676 * 1677 * <p> 1678 * Useful when paginating results. Returns a maximum of <code>end - 1679 * start</code> instances. <code>start</code> and <code>end</code> are not 1680 * primary keys, they are indexes in the result set. Thus, <code>0</code> 1681 * refers to the first result in the set. Setting both <code>start</code> 1682 * and <code>end</code> to {@link 1683 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 1684 * result set. 1685 * </p> 1686 * 1687 * @param companyId the primary key of the company 1688 * @param start the lower bound of the range of users 1689 * @param end the upper bound of the range of users (not inclusive) 1690 * @return the range of users belonging to the company 1691 * @throws SystemException if a system exception occurred 1692 */ 1693 public static java.util.List<com.liferay.portal.model.User> getCompanyUsers( 1694 long companyId, int start, int end) 1695 throws com.liferay.portal.kernel.exception.SystemException { 1696 return getService().getCompanyUsers(companyId, start, end); 1697 } 1698 1699 /** 1700 * Returns the number of users belonging to the company. 1701 * 1702 * @param companyId the primary key of the company 1703 * @return the number of users belonging to the company 1704 * @throws SystemException if a system exception occurred 1705 */ 1706 public static int getCompanyUsersCount(long companyId) 1707 throws com.liferay.portal.kernel.exception.SystemException { 1708 return getService().getCompanyUsersCount(companyId); 1709 } 1710 1711 /** 1712 * Returns the default user for the company. 1713 * 1714 * @param companyId the primary key of the company 1715 * @return the default user for the company 1716 * @throws PortalException if a default user for the company could not be 1717 found 1718 * @throws SystemException if a system exception occurred 1719 */ 1720 public static com.liferay.portal.model.User getDefaultUser(long companyId) 1721 throws com.liferay.portal.kernel.exception.PortalException, 1722 com.liferay.portal.kernel.exception.SystemException { 1723 return getService().getDefaultUser(companyId); 1724 } 1725 1726 /** 1727 * Returns the primary key of the default user for the company. 1728 * 1729 * @param companyId the primary key of the company 1730 * @return the primary key of the default user for the company 1731 * @throws PortalException if a default user for the company could not be 1732 found 1733 * @throws SystemException if a system exception occurred 1734 */ 1735 public static long getDefaultUserId(long companyId) 1736 throws com.liferay.portal.kernel.exception.PortalException, 1737 com.liferay.portal.kernel.exception.SystemException { 1738 return getService().getDefaultUserId(companyId); 1739 } 1740 1741 /** 1742 * Returns the primary keys of all the users belonging to the group. 1743 * 1744 * @param groupId the primary key of the group 1745 * @return the primary keys of the users belonging to the group 1746 * @throws SystemException if a system exception occurred 1747 */ 1748 public static long[] getGroupUserIds(long groupId) 1749 throws com.liferay.portal.kernel.exception.SystemException { 1750 return getService().getGroupUserIds(groupId); 1751 } 1752 1753 /** 1754 * Returns the number of users with the status belonging to the group. 1755 * 1756 * @param groupId the primary key of the group 1757 * @param status the workflow status 1758 * @return the number of users with the status belonging to the group 1759 * @throws PortalException if a group with the primary key could not be 1760 found 1761 * @throws SystemException if a system exception occurred 1762 */ 1763 public static int getGroupUsersCount(long groupId, int status) 1764 throws com.liferay.portal.kernel.exception.PortalException, 1765 com.liferay.portal.kernel.exception.SystemException { 1766 return getService().getGroupUsersCount(groupId, status); 1767 } 1768 1769 /** 1770 * Returns all the users who have not had any announcements of the type 1771 * delivered, excluding the default user. 1772 * 1773 * @param type the type of announcement 1774 * @return the users who have not had any annoucements of the type delivered 1775 * @throws SystemException if a system exception occurred 1776 */ 1777 public static java.util.List<com.liferay.portal.model.User> getNoAnnouncementsDeliveries( 1778 java.lang.String type) 1779 throws com.liferay.portal.kernel.exception.SystemException { 1780 return getService().getNoAnnouncementsDeliveries(type); 1781 } 1782 1783 /** 1784 * Returns all the users who do not have any contacts. 1785 * 1786 * @return the users who do not have any contacts 1787 * @throws SystemException if a system exception occurred 1788 */ 1789 public static java.util.List<com.liferay.portal.model.User> getNoContacts() 1790 throws com.liferay.portal.kernel.exception.SystemException { 1791 return getService().getNoContacts(); 1792 } 1793 1794 /** 1795 * Returns all the users who do not belong to any groups, excluding the 1796 * default user. 1797 * 1798 * @return the users who do not belong to any groups 1799 * @throws SystemException if a system exception occurred 1800 */ 1801 public static java.util.List<com.liferay.portal.model.User> getNoGroups() 1802 throws com.liferay.portal.kernel.exception.SystemException { 1803 return getService().getNoGroups(); 1804 } 1805 1806 /** 1807 * Returns the primary keys of all the users belonging to the organization. 1808 * 1809 * @param organizationId the primary key of the organization 1810 * @return the primary keys of the users belonging to the organization 1811 * @throws SystemException if a system exception occurred 1812 */ 1813 public static long[] getOrganizationUserIds(long organizationId) 1814 throws com.liferay.portal.kernel.exception.SystemException { 1815 return getService().getOrganizationUserIds(organizationId); 1816 } 1817 1818 /** 1819 * Returns the number of users with the status belonging to the 1820 * organization. 1821 * 1822 * @param organizationId the primary key of the organization 1823 * @param status the workflow status 1824 * @return the number of users with the status belonging to the organization 1825 * @throws PortalException if an organization with the primary key could not 1826 be found 1827 * @throws SystemException if a system exception occurred 1828 */ 1829 public static int getOrganizationUsersCount(long organizationId, int status) 1830 throws com.liferay.portal.kernel.exception.PortalException, 1831 com.liferay.portal.kernel.exception.SystemException { 1832 return getService().getOrganizationUsersCount(organizationId, status); 1833 } 1834 1835 /** 1836 * Returns the primary keys of all the users belonging to the role. 1837 * 1838 * @param roleId the primary key of the role 1839 * @return the primary keys of the users belonging to the role 1840 * @throws SystemException if a system exception occurred 1841 */ 1842 public static long[] getRoleUserIds(long roleId) 1843 throws com.liferay.portal.kernel.exception.SystemException { 1844 return getService().getRoleUserIds(roleId); 1845 } 1846 1847 /** 1848 * Returns the number of users with the status belonging to the role. 1849 * 1850 * @param roleId the primary key of the role 1851 * @param status the workflow status 1852 * @return the number of users with the status belonging to the role 1853 * @throws PortalException if an role with the primary key could not be 1854 found 1855 * @throws SystemException if a system exception occurred 1856 */ 1857 public static int getRoleUsersCount(long roleId, int status) 1858 throws com.liferay.portal.kernel.exception.PortalException, 1859 com.liferay.portal.kernel.exception.SystemException { 1860 return getService().getRoleUsersCount(roleId, status); 1861 } 1862 1863 /** 1864 * Returns an ordered range of all the users with a social relation of the 1865 * type with the user. 1866 * 1867 * <p> 1868 * Useful when paginating results. Returns a maximum of <code>end - 1869 * start</code> instances. <code>start</code> and <code>end</code> are not 1870 * primary keys, they are indexes in the result set. Thus, <code>0</code> 1871 * refers to the first result in the set. Setting both <code>start</code> 1872 * and <code>end</code> to {@link 1873 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 1874 * result set. 1875 * </p> 1876 * 1877 * @param userId the primary key of the user 1878 * @param type the type of social relation. The possible types can be found 1879 in {@link 1880 com.liferay.portlet.social.model.SocialRelationConstants}. 1881 * @param start the lower bound of the range of users 1882 * @param end the upper bound of the range of users (not inclusive) 1883 * @param obc the comparator to order the users by (optionally 1884 <code>null</code>) 1885 * @return the ordered range of users with a social relation of the type 1886 with the user 1887 * @throws PortalException if a user with the primary key could not be found 1888 * @throws SystemException if a system exception occurred 1889 */ 1890 public static java.util.List<com.liferay.portal.model.User> getSocialUsers( 1891 long userId, int type, int start, int end, 1892 com.liferay.portal.kernel.util.OrderByComparator obc) 1893 throws com.liferay.portal.kernel.exception.PortalException, 1894 com.liferay.portal.kernel.exception.SystemException { 1895 return getService().getSocialUsers(userId, type, start, end, obc); 1896 } 1897 1898 /** 1899 * Returns an ordered range of all the users with a social relation with the 1900 * user. 1901 * 1902 * <p> 1903 * Useful when paginating results. Returns a maximum of <code>end - 1904 * start</code> instances. <code>start</code> and <code>end</code> are not 1905 * primary keys, they are indexes in the result set. Thus, <code>0</code> 1906 * refers to the first result in the set. Setting both <code>start</code> 1907 * and <code>end</code> to {@link 1908 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 1909 * result set. 1910 * </p> 1911 * 1912 * @param userId the primary key of the user 1913 * @param start the lower bound of the range of users 1914 * @param end the upper bound of the range of users (not inclusive) 1915 * @param obc the comparator to order the users by (optionally 1916 <code>null</code>) 1917 * @return the ordered range of users with a social relation with the user 1918 * @throws PortalException if a user with the primary key could not be found 1919 * @throws SystemException if a system exception occurred 1920 */ 1921 public static java.util.List<com.liferay.portal.model.User> getSocialUsers( 1922 long userId, int start, int end, 1923 com.liferay.portal.kernel.util.OrderByComparator obc) 1924 throws com.liferay.portal.kernel.exception.PortalException, 1925 com.liferay.portal.kernel.exception.SystemException { 1926 return getService().getSocialUsers(userId, start, end, obc); 1927 } 1928 1929 /** 1930 * Returns an ordered range of all the users with a mutual social relation 1931 * of the type with both of the given users. 1932 * 1933 * <p> 1934 * Useful when paginating results. Returns a maximum of <code>end - 1935 * start</code> instances. <code>start</code> and <code>end</code> are not 1936 * primary keys, they are indexes in the result set. Thus, <code>0</code> 1937 * refers to the first result in the set. Setting both <code>start</code> 1938 * and <code>end</code> to {@link 1939 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 1940 * result set. 1941 * </p> 1942 * 1943 * @param userId1 the primary key of the first user 1944 * @param userId2 the primary key of the second user 1945 * @param type the type of social relation. The possible types can be found 1946 in {@link 1947 com.liferay.portlet.social.model.SocialRelationConstants}. 1948 * @param start the lower bound of the range of users 1949 * @param end the upper bound of the range of users (not inclusive) 1950 * @param obc the comparator to order the users by (optionally 1951 <code>null</code>) 1952 * @return the ordered range of users with a mutual social relation of the 1953 type with the user 1954 * @throws PortalException if a user with the primary key could not be found 1955 * @throws SystemException if a system exception occurred 1956 */ 1957 public static java.util.List<com.liferay.portal.model.User> getSocialUsers( 1958 long userId1, long userId2, int type, int start, int end, 1959 com.liferay.portal.kernel.util.OrderByComparator obc) 1960 throws com.liferay.portal.kernel.exception.PortalException, 1961 com.liferay.portal.kernel.exception.SystemException { 1962 return getService() 1963 .getSocialUsers(userId1, userId2, type, start, end, obc); 1964 } 1965 1966 /** 1967 * Returns an ordered range of all the users with a mutual social relation 1968 * with both of the given users. 1969 * 1970 * <p> 1971 * Useful when paginating results. Returns a maximum of <code>end - 1972 * start</code> instances. <code>start</code> and <code>end</code> are not 1973 * primary keys, they are indexes in the result set. Thus, <code>0</code> 1974 * refers to the first result in the set. Setting both <code>start</code> 1975 * and <code>end</code> to {@link 1976 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 1977 * result set. 1978 * </p> 1979 * 1980 * @param userId1 the primary key of the first user 1981 * @param userId2 the primary key of the second user 1982 * @param start the lower bound of the range of users 1983 * @param end the upper bound of the range of users (not inclusive) 1984 * @param obc the comparator to order the users by (optionally 1985 <code>null</code>) 1986 * @return the ordered range of users with a mutual social relation with the 1987 user 1988 * @throws PortalException if a user with the primary key could not be found 1989 * @throws SystemException if a system exception occurred 1990 */ 1991 public static java.util.List<com.liferay.portal.model.User> getSocialUsers( 1992 long userId1, long userId2, int start, int end, 1993 com.liferay.portal.kernel.util.OrderByComparator obc) 1994 throws com.liferay.portal.kernel.exception.PortalException, 1995 com.liferay.portal.kernel.exception.SystemException { 1996 return getService().getSocialUsers(userId1, userId2, start, end, obc); 1997 } 1998 1999 /** 2000 * Returns the number of users with a social relation with the user. 2001 * 2002 * @param userId the primary key of the user 2003 * @return the number of users with a social relation with the user 2004 * @throws PortalException if a user with the primary key could not be found 2005 * @throws SystemException if a system exception occurred 2006 */ 2007 public static int getSocialUsersCount(long userId) 2008 throws com.liferay.portal.kernel.exception.PortalException, 2009 com.liferay.portal.kernel.exception.SystemException { 2010 return getService().getSocialUsersCount(userId); 2011 } 2012 2013 /** 2014 * Returns the number of users with a social relation of the type with the 2015 * user. 2016 * 2017 * @param userId the primary key of the user 2018 * @param type the type of social relation. The possible types can be found 2019 in {@link 2020 com.liferay.portlet.social.model.SocialRelationConstants}. 2021 * @return the number of users with a social relation of the type with the 2022 user 2023 * @throws PortalException if a user with the primary key could not be found 2024 * @throws SystemException if a system exception occurred 2025 */ 2026 public static int getSocialUsersCount(long userId, int type) 2027 throws com.liferay.portal.kernel.exception.PortalException, 2028 com.liferay.portal.kernel.exception.SystemException { 2029 return getService().getSocialUsersCount(userId, type); 2030 } 2031 2032 /** 2033 * Returns the number of users with a mutual social relation with both of 2034 * the given users. 2035 * 2036 * @param userId1 the primary key of the first user 2037 * @param userId2 the primary key of the second user 2038 * @return the number of users with a mutual social relation with the user 2039 * @throws PortalException if a user with the primary key could not be found 2040 * @throws SystemException if a system exception occurred 2041 */ 2042 public static int getSocialUsersCount(long userId1, long userId2) 2043 throws com.liferay.portal.kernel.exception.PortalException, 2044 com.liferay.portal.kernel.exception.SystemException { 2045 return getService().getSocialUsersCount(userId1, userId2); 2046 } 2047 2048 /** 2049 * Returns the number of users with a mutual social relation of the type 2050 * with both of the given users. 2051 * 2052 * @param userId1 the primary key of the first user 2053 * @param userId2 the primary key of the second user 2054 * @param type the type of social relation. The possible types can be found 2055 in {@link 2056 com.liferay.portlet.social.model.SocialRelationConstants}. 2057 * @return the number of users with a mutual social relation of the type 2058 with the user 2059 * @throws PortalException if a user with the primary key could not be found 2060 * @throws SystemException if a system exception occurred 2061 */ 2062 public static int getSocialUsersCount(long userId1, long userId2, int type) 2063 throws com.liferay.portal.kernel.exception.PortalException, 2064 com.liferay.portal.kernel.exception.SystemException { 2065 return getService().getSocialUsersCount(userId1, userId2, type); 2066 } 2067 2068 /** 2069 * Returns the user with the contact ID. 2070 * 2071 * @param contactId the user's contact ID 2072 * @return the user with the contact ID 2073 * @throws PortalException if a user with the contact ID could not be found 2074 * @throws SystemException if a system exception occurred 2075 */ 2076 public static com.liferay.portal.model.User getUserByContactId( 2077 long contactId) 2078 throws com.liferay.portal.kernel.exception.PortalException, 2079 com.liferay.portal.kernel.exception.SystemException { 2080 return getService().getUserByContactId(contactId); 2081 } 2082 2083 /** 2084 * Returns the user with the email address. 2085 * 2086 * @param companyId the primary key of the user's company 2087 * @param emailAddress the user's email address 2088 * @return the user with the email address 2089 * @throws PortalException if a user with the email address could not be 2090 found 2091 * @throws SystemException if a system exception occurred 2092 */ 2093 public static com.liferay.portal.model.User getUserByEmailAddress( 2094 long companyId, java.lang.String emailAddress) 2095 throws com.liferay.portal.kernel.exception.PortalException, 2096 com.liferay.portal.kernel.exception.SystemException { 2097 return getService().getUserByEmailAddress(companyId, emailAddress); 2098 } 2099 2100 /** 2101 * Returns the user with the Facebook ID. 2102 * 2103 * @param companyId the primary key of the user's company 2104 * @param facebookId the user's Facebook ID 2105 * @return the user with the Facebook ID 2106 * @throws PortalException if a user with the Facebook ID could not be found 2107 * @throws SystemException if a system exception occurred 2108 */ 2109 public static com.liferay.portal.model.User getUserByFacebookId( 2110 long companyId, long facebookId) 2111 throws com.liferay.portal.kernel.exception.PortalException, 2112 com.liferay.portal.kernel.exception.SystemException { 2113 return getService().getUserByFacebookId(companyId, facebookId); 2114 } 2115 2116 /** 2117 * Returns the user with the primary key. 2118 * 2119 * @param userId the primary key of the user 2120 * @return the user with the primary key 2121 * @throws PortalException if a user with the primary key could not be found 2122 * @throws SystemException if a system exception occurred 2123 */ 2124 public static com.liferay.portal.model.User getUserById(long userId) 2125 throws com.liferay.portal.kernel.exception.PortalException, 2126 com.liferay.portal.kernel.exception.SystemException { 2127 return getService().getUserById(userId); 2128 } 2129 2130 /** 2131 * Returns the user with the primary key from the company. 2132 * 2133 * @param companyId the primary key of the user's company 2134 * @param userId the primary key of the user 2135 * @return the user with the primary key 2136 * @throws PortalException if a user with the primary key from the company 2137 could not be found 2138 * @throws SystemException if a system exception occurred 2139 */ 2140 public static com.liferay.portal.model.User getUserById(long companyId, 2141 long userId) 2142 throws com.liferay.portal.kernel.exception.PortalException, 2143 com.liferay.portal.kernel.exception.SystemException { 2144 return getService().getUserById(companyId, userId); 2145 } 2146 2147 /** 2148 * Returns the user with the OpenID. 2149 * 2150 * @param companyId the primary key of the user's company 2151 * @param openId the user's OpenID 2152 * @return the user with the OpenID 2153 * @throws PortalException if a user with the OpenID could not be found 2154 * @throws SystemException if a system exception occurred 2155 */ 2156 public static com.liferay.portal.model.User getUserByOpenId( 2157 long companyId, java.lang.String openId) 2158 throws com.liferay.portal.kernel.exception.PortalException, 2159 com.liferay.portal.kernel.exception.SystemException { 2160 return getService().getUserByOpenId(companyId, openId); 2161 } 2162 2163 /** 2164 * Returns the user with the portrait ID. 2165 * 2166 * @param portraitId the user's portrait ID 2167 * @return the user with the portrait ID 2168 * @throws PortalException if a user with the portrait ID could not be found 2169 * @throws SystemException if a system exception occurred 2170 */ 2171 public static com.liferay.portal.model.User getUserByPortraitId( 2172 long portraitId) 2173 throws com.liferay.portal.kernel.exception.PortalException, 2174 com.liferay.portal.kernel.exception.SystemException { 2175 return getService().getUserByPortraitId(portraitId); 2176 } 2177 2178 /** 2179 * Returns the user with the screen name. 2180 * 2181 * @param companyId the primary key of the user's company 2182 * @param screenName the user's screen name 2183 * @return the user with the screen name 2184 * @throws PortalException if a user with the screen name could not be found 2185 * @throws SystemException if a system exception occurred 2186 */ 2187 public static com.liferay.portal.model.User getUserByScreenName( 2188 long companyId, java.lang.String screenName) 2189 throws com.liferay.portal.kernel.exception.PortalException, 2190 com.liferay.portal.kernel.exception.SystemException { 2191 return getService().getUserByScreenName(companyId, screenName); 2192 } 2193 2194 /** 2195 * Returns the user with the UUID. 2196 * 2197 * @param uuid the user's UUID 2198 * @return the user with the UUID 2199 * @throws PortalException if a user with the UUID could not be found 2200 * @throws SystemException if a system exception occurred 2201 * @deprecated As of 6.2.0, replaced by {@link 2202 #getUserByUuidAndCompanyId(String, long)} 2203 */ 2204 public static com.liferay.portal.model.User getUserByUuid( 2205 java.lang.String uuid) 2206 throws com.liferay.portal.kernel.exception.PortalException, 2207 com.liferay.portal.kernel.exception.SystemException { 2208 return getService().getUserByUuid(uuid); 2209 } 2210 2211 /** 2212 * Returns the number of users with the status belonging to the user group. 2213 * 2214 * @param userGroupId the primary key of the user group 2215 * @param status the workflow status 2216 * @return the number of users with the status belonging to the user group 2217 * @throws PortalException if a user group with the primary key could not be 2218 found 2219 * @throws SystemException if a system exception occurred 2220 */ 2221 public static int getUserGroupUsersCount(long userGroupId, int status) 2222 throws com.liferay.portal.kernel.exception.PortalException, 2223 com.liferay.portal.kernel.exception.SystemException { 2224 return getService().getUserGroupUsersCount(userGroupId, status); 2225 } 2226 2227 /** 2228 * Returns the primary key of the user with the email address. 2229 * 2230 * @param companyId the primary key of the user's company 2231 * @param emailAddress the user's email address 2232 * @return the primary key of the user with the email address 2233 * @throws PortalException if a user with the email address could not be 2234 found 2235 * @throws SystemException if a system exception occurred 2236 */ 2237 public static long getUserIdByEmailAddress(long companyId, 2238 java.lang.String emailAddress) 2239 throws com.liferay.portal.kernel.exception.PortalException, 2240 com.liferay.portal.kernel.exception.SystemException { 2241 return getService().getUserIdByEmailAddress(companyId, emailAddress); 2242 } 2243 2244 /** 2245 * Returns the primary key of the user with the screen name. 2246 * 2247 * @param companyId the primary key of the user's company 2248 * @param screenName the user's screen name 2249 * @return the primary key of the user with the screen name 2250 * @throws PortalException if a user with the screen name could not be found 2251 * @throws SystemException if a system exception occurred 2252 */ 2253 public static long getUserIdByScreenName(long companyId, 2254 java.lang.String screenName) 2255 throws com.liferay.portal.kernel.exception.PortalException, 2256 com.liferay.portal.kernel.exception.SystemException { 2257 return getService().getUserIdByScreenName(companyId, screenName); 2258 } 2259 2260 /** 2261 * Returns <code>true</code> if the password policy has been assigned to the 2262 * user. 2263 * 2264 * @param passwordPolicyId the primary key of the password policy 2265 * @param userId the primary key of the user 2266 * @return <code>true</code> if the password policy is assigned to the user; 2267 <code>false</code> otherwise 2268 * @throws SystemException if a system exception occurred 2269 */ 2270 public static boolean hasPasswordPolicyUser(long passwordPolicyId, 2271 long userId) throws com.liferay.portal.kernel.exception.SystemException { 2272 return getService().hasPasswordPolicyUser(passwordPolicyId, userId); 2273 } 2274 2275 /** 2276 * Returns <code>true</code> if the user has the role with the name, 2277 * optionally through inheritance. 2278 * 2279 * @param companyId the primary key of the role's company 2280 * @param name the name of the role (must be a regular role, not an 2281 organization, site or provider role) 2282 * @param userId the primary key of the user 2283 * @param inherited whether to include roles inherited from organizations, 2284 sites, etc. 2285 * @return <code>true</code> if the user has the role; <code>false</code> 2286 otherwise 2287 * @throws PortalException if a role with the name could not be found 2288 * @throws SystemException if a system exception occurred 2289 */ 2290 public static boolean hasRoleUser(long companyId, java.lang.String name, 2291 long userId, boolean inherited) 2292 throws com.liferay.portal.kernel.exception.PortalException, 2293 com.liferay.portal.kernel.exception.SystemException { 2294 return getService().hasRoleUser(companyId, name, userId, inherited); 2295 } 2296 2297 /** 2298 * Returns <code>true</code> if the user's password is expired. 2299 * 2300 * @param user the user 2301 * @return <code>true</code> if the user's password is expired; 2302 <code>false</code> otherwise 2303 * @throws PortalException if the password policy for the user could not be 2304 found 2305 * @throws SystemException if a system exception occurred 2306 */ 2307 public static boolean isPasswordExpired(com.liferay.portal.model.User user) 2308 throws com.liferay.portal.kernel.exception.PortalException, 2309 com.liferay.portal.kernel.exception.SystemException { 2310 return getService().isPasswordExpired(user); 2311 } 2312 2313 /** 2314 * Returns <code>true</code> if the password policy is configured to warn 2315 * the user that his password is expiring and the remaining time until 2316 * expiration is equal or less than the configured warning time. 2317 * 2318 * @param user the user 2319 * @return <code>true</code> if the user's password is expiring soon; 2320 <code>false</code> otherwise 2321 * @throws PortalException if the password policy for the user could not be 2322 found 2323 * @throws SystemException if a system exception occurred 2324 */ 2325 public static boolean isPasswordExpiringSoon( 2326 com.liferay.portal.model.User user) 2327 throws com.liferay.portal.kernel.exception.PortalException, 2328 com.liferay.portal.kernel.exception.SystemException { 2329 return getService().isPasswordExpiringSoon(user); 2330 } 2331 2332 /** 2333 * Returns the default user for the company. 2334 * 2335 * @param companyId the primary key of the company 2336 * @return the default user for the company 2337 * @throws PortalException if the user could not be found 2338 * @throws SystemException if a system exception occurred 2339 */ 2340 public static com.liferay.portal.model.User loadGetDefaultUser( 2341 long companyId) 2342 throws com.liferay.portal.kernel.exception.PortalException, 2343 com.liferay.portal.kernel.exception.SystemException { 2344 return getService().loadGetDefaultUser(companyId); 2345 } 2346 2347 /** 2348 * Returns an ordered range of all the users who match the keywords and 2349 * status, without using the indexer. It is preferable to use the indexed 2350 * version {@link #search(long, String, int, LinkedHashMap, int, int, Sort)} 2351 * instead of this method wherever possible for performance reasons. 2352 * 2353 * <p> 2354 * Useful when paginating results. Returns a maximum of <code>end - 2355 * start</code> instances. <code>start</code> and <code>end</code> are not 2356 * primary keys, they are indexes in the result set. Thus, <code>0</code> 2357 * refers to the first result in the set. Setting both <code>start</code> 2358 * and <code>end</code> to {@link 2359 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 2360 * result set. 2361 * </p> 2362 * 2363 * @param companyId the primary key of the user's company 2364 * @param keywords the keywords (space separated), which may occur in the 2365 user's first name, middle name, last name, screen name, or email 2366 address 2367 * @param status the workflow status 2368 * @param params the finder parameters (optionally <code>null</code>). For 2369 more information see {@link 2370 com.liferay.portal.service.persistence.UserFinder}. 2371 * @param start the lower bound of the range of users 2372 * @param end the upper bound of the range of users (not inclusive) 2373 * @param obc the comparator to order the users by (optionally 2374 <code>null</code>) 2375 * @return the matching users 2376 * @throws SystemException if a system exception occurred 2377 * @see com.liferay.portal.service.persistence.UserFinder 2378 */ 2379 public static java.util.List<com.liferay.portal.model.User> search( 2380 long companyId, java.lang.String keywords, int status, 2381 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params, 2382 int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc) 2383 throws com.liferay.portal.kernel.exception.SystemException { 2384 return getService() 2385 .search(companyId, keywords, status, params, start, end, obc); 2386 } 2387 2388 /** 2389 * Returns an ordered range of all the users who match the keywords and 2390 * status, using the indexer. It is preferable to use this method instead of 2391 * the non-indexed version whenever possible for performance reasons. 2392 * 2393 * <p> 2394 * Useful when paginating results. Returns a maximum of <code>end - 2395 * start</code> instances. <code>start</code> and <code>end</code> are not 2396 * primary keys, they are indexes in the result set. Thus, <code>0</code> 2397 * refers to the first result in the set. Setting both <code>start</code> 2398 * and <code>end</code> to {@link 2399 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 2400 * result set. 2401 * </p> 2402 * 2403 * @param companyId the primary key of the user's company 2404 * @param keywords the keywords (space separated), which may occur in the 2405 user's first name, middle name, last name, screen name, or email 2406 address 2407 * @param status the workflow status 2408 * @param params the indexer parameters (optionally <code>null</code>). For 2409 more information see {@link 2410 com.liferay.portlet.usersadmin.util.UserIndexer}. 2411 * @param start the lower bound of the range of users 2412 * @param end the upper bound of the range of users (not inclusive) 2413 * @param sort the field and direction to sort by (optionally 2414 <code>null</code>) 2415 * @return the matching users 2416 * @throws SystemException if a system exception occurred 2417 * @see com.liferay.portlet.usersadmin.util.UserIndexer 2418 */ 2419 public static com.liferay.portal.kernel.search.Hits search(long companyId, 2420 java.lang.String keywords, int status, 2421 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params, 2422 int start, int end, com.liferay.portal.kernel.search.Sort sort) 2423 throws com.liferay.portal.kernel.exception.SystemException { 2424 return getService() 2425 .search(companyId, keywords, status, params, start, end, sort); 2426 } 2427 2428 /** 2429 * Returns an ordered range of all the users with the status, and whose 2430 * first name, middle name, last name, screen name, and email address match 2431 * the keywords specified for them, without using the indexer. It is 2432 * preferable to use the indexed version {@link #search(long, String, 2433 * String, String, String, String, int, LinkedHashMap, boolean, int, int, 2434 * Sort)} instead of this method wherever possible for performance reasons. 2435 * 2436 * <p> 2437 * Useful when paginating results. Returns a maximum of <code>end - 2438 * start</code> instances. <code>start</code> and <code>end</code> are not 2439 * primary keys, they are indexes in the result set. Thus, <code>0</code> 2440 * refers to the first result in the set. Setting both <code>start</code> 2441 * and <code>end</code> to {@link 2442 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 2443 * result set. 2444 * </p> 2445 * 2446 * @param companyId the primary key of the user's company 2447 * @param firstName the first name keywords (space separated) 2448 * @param middleName the middle name keywords 2449 * @param lastName the last name keywords 2450 * @param screenName the screen name keywords 2451 * @param emailAddress the email address keywords 2452 * @param status the workflow status 2453 * @param params the finder parameters (optionally <code>null</code>). For 2454 more information see {@link 2455 com.liferay.portal.service.persistence.UserFinder}. 2456 * @param andSearch whether every field must match its keywords, or just 2457 one field. For example, "users with the first name 'bob' and 2458 last name 'smith'" vs "users with the first name 'bob' 2459 or the last name 'smith'". 2460 * @param start the lower bound of the range of users 2461 * @param end the upper bound of the range of users (not inclusive) 2462 * @param obc the comparator to order the users by (optionally 2463 <code>null</code>) 2464 * @return the matching users 2465 * @throws SystemException if a system exception occurred 2466 * @see com.liferay.portal.service.persistence.UserFinder 2467 */ 2468 public static java.util.List<com.liferay.portal.model.User> search( 2469 long companyId, java.lang.String firstName, 2470 java.lang.String middleName, java.lang.String lastName, 2471 java.lang.String screenName, java.lang.String emailAddress, int status, 2472 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params, 2473 boolean andSearch, int start, int end, 2474 com.liferay.portal.kernel.util.OrderByComparator obc) 2475 throws com.liferay.portal.kernel.exception.SystemException { 2476 return getService() 2477 .search(companyId, firstName, middleName, lastName, 2478 screenName, emailAddress, status, params, andSearch, start, end, obc); 2479 } 2480 2481 /** 2482 * Returns an ordered range of all the users with the status, and whose 2483 * first name, middle name, last name, screen name, and email address match 2484 * the keywords specified for them, using the indexer. It is preferable to 2485 * use this method instead of the non-indexed version whenever possible for 2486 * performance reasons. 2487 * 2488 * <p> 2489 * Useful when paginating results. Returns a maximum of <code>end - 2490 * start</code> instances. <code>start</code> and <code>end</code> are not 2491 * primary keys, they are indexes in the result set. Thus, <code>0</code> 2492 * refers to the first result in the set. Setting both <code>start</code> 2493 * and <code>end</code> to {@link 2494 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 2495 * result set. 2496 * </p> 2497 * 2498 * @param companyId the primary key of the user's company 2499 * @param firstName the first name keywords (space separated) 2500 * @param middleName the middle name keywords 2501 * @param lastName the last name keywords 2502 * @param screenName the screen name keywords 2503 * @param emailAddress the email address keywords 2504 * @param status the workflow status 2505 * @param params the indexer parameters (optionally <code>null</code>). For 2506 more information see {@link 2507 com.liferay.portlet.usersadmin.util.UserIndexer}. 2508 * @param andSearch whether every field must match its keywords, or just 2509 one field. For example, "users with the first name 'bob' and 2510 last name 'smith'" vs "users with the first name 'bob' 2511 or the last name 'smith'". 2512 * @param start the lower bound of the range of users 2513 * @param end the upper bound of the range of users (not inclusive) 2514 * @param sort the field and direction to sort by (optionally 2515 <code>null</code>) 2516 * @return the matching users 2517 * @throws SystemException if a system exception occurred 2518 * @see com.liferay.portlet.usersadmin.util.UserIndexer 2519 */ 2520 public static com.liferay.portal.kernel.search.Hits search(long companyId, 2521 java.lang.String firstName, java.lang.String middleName, 2522 java.lang.String lastName, java.lang.String screenName, 2523 java.lang.String emailAddress, int status, 2524 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params, 2525 boolean andSearch, int start, int end, 2526 com.liferay.portal.kernel.search.Sort sort) 2527 throws com.liferay.portal.kernel.exception.SystemException { 2528 return getService() 2529 .search(companyId, firstName, middleName, lastName, 2530 screenName, emailAddress, status, params, andSearch, start, end, 2531 sort); 2532 } 2533 2534 /** 2535 * Returns the number of users who match the keywords and status. 2536 * 2537 * @param companyId the primary key of the user's company 2538 * @param keywords the keywords (space separated), which may occur in the 2539 user's first name, middle name, last name, screen name, or email 2540 address 2541 * @param status the workflow status 2542 * @param params the finder parameters (optionally <code>null</code>). For 2543 more information see {@link 2544 com.liferay.portal.service.persistence.UserFinder}. 2545 * @return the number matching users 2546 * @throws SystemException if a system exception occurred 2547 */ 2548 public static int searchCount(long companyId, java.lang.String keywords, 2549 int status, 2550 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params) 2551 throws com.liferay.portal.kernel.exception.SystemException { 2552 return getService().searchCount(companyId, keywords, status, params); 2553 } 2554 2555 /** 2556 * Returns the number of users with the status, and whose first name, middle 2557 * name, last name, screen name, and email address match the keywords 2558 * specified for them. 2559 * 2560 * @param companyId the primary key of the user's company 2561 * @param firstName the first name keywords (space separated) 2562 * @param middleName the middle name keywords 2563 * @param lastName the last name keywords 2564 * @param screenName the screen name keywords 2565 * @param emailAddress the email address keywords 2566 * @param status the workflow status 2567 * @param params the finder parameters (optionally <code>null</code>). For 2568 more information see {@link 2569 com.liferay.portal.service.persistence.UserFinder}. 2570 * @param andSearch whether every field must match its keywords, or just 2571 one field. For example, "users with the first name 'bob' and 2572 last name 'smith'" vs "users with the first name 'bob' 2573 or the last name 'smith'". 2574 * @return the number of matching users 2575 * @throws SystemException if a system exception occurred 2576 */ 2577 public static int searchCount(long companyId, java.lang.String firstName, 2578 java.lang.String middleName, java.lang.String lastName, 2579 java.lang.String screenName, java.lang.String emailAddress, int status, 2580 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params, 2581 boolean andSearch) 2582 throws com.liferay.portal.kernel.exception.SystemException { 2583 return getService() 2584 .searchCount(companyId, firstName, middleName, lastName, 2585 screenName, emailAddress, status, params, andSearch); 2586 } 2587 2588 /** 2589 * Sends an email address verification to the user. 2590 * 2591 * @param user the verification email recipient 2592 * @param emailAddress the recipient's email address 2593 * @param serviceContext the service context to be applied. Must set the 2594 portal URL, main path, primary key of the layout, remote address, 2595 remote host, and agent for the user. 2596 * @throws PortalException if a portal exception occurred 2597 * @throws SystemException if a system exception occurred 2598 */ 2599 public static void sendEmailAddressVerification( 2600 com.liferay.portal.model.User user, java.lang.String emailAddress, 2601 com.liferay.portal.service.ServiceContext serviceContext) 2602 throws com.liferay.portal.kernel.exception.PortalException, 2603 com.liferay.portal.kernel.exception.SystemException { 2604 getService() 2605 .sendEmailAddressVerification(user, emailAddress, serviceContext); 2606 } 2607 2608 /** 2609 * Sends the password email to the user with the email address. The content 2610 * of this email can be specified in <code>portal.properties</code> with the 2611 * <code>admin.email.password</code> keys. 2612 * 2613 * @param companyId the primary key of the user's company 2614 * @param emailAddress the user's email address 2615 * @param fromName the name of the individual that the email should be from 2616 * @param fromAddress the address of the individual that the email should 2617 be from 2618 * @param subject the email subject. If <code>null</code>, the subject 2619 specified in <code>portal.properties</code> will be used. 2620 * @param body the email body. If <code>null</code>, the body specified in 2621 <code>portal.properties</code> will be used. 2622 * @param serviceContext the service context to be applied 2623 * @throws PortalException if a user with the email address could not be 2624 found 2625 * @throws SystemException if a system exception occurred 2626 */ 2627 public static void sendPassword(long companyId, 2628 java.lang.String emailAddress, java.lang.String fromName, 2629 java.lang.String fromAddress, java.lang.String subject, 2630 java.lang.String body, 2631 com.liferay.portal.service.ServiceContext serviceContext) 2632 throws com.liferay.portal.kernel.exception.PortalException, 2633 com.liferay.portal.kernel.exception.SystemException { 2634 getService() 2635 .sendPassword(companyId, emailAddress, fromName, fromAddress, 2636 subject, body, serviceContext); 2637 } 2638 2639 /** 2640 * Removes the users from the teams of a group. 2641 * 2642 * @param groupId the primary key of the group 2643 * @param userIds the primary keys of the users 2644 * @throws PortalException if a portal exception occurred 2645 * @throws SystemException if a system exception occurred 2646 */ 2647 public static void unsetGroupTeamsUsers(long groupId, long[] userIds) 2648 throws com.liferay.portal.kernel.exception.PortalException, 2649 com.liferay.portal.kernel.exception.SystemException { 2650 getService().unsetGroupTeamsUsers(groupId, userIds); 2651 } 2652 2653 /** 2654 * Removes the users from the group. 2655 * 2656 * @param groupId the primary key of the group 2657 * @param userIds the primary keys of the users 2658 * @param serviceContext the service context to be applied (optionally 2659 <code>null</code>) 2660 * @throws PortalException if a portal exception occurred 2661 * @throws SystemException if a system exception occurred 2662 */ 2663 public static void unsetGroupUsers(long groupId, long[] userIds, 2664 com.liferay.portal.service.ServiceContext serviceContext) 2665 throws com.liferay.portal.kernel.exception.PortalException, 2666 com.liferay.portal.kernel.exception.SystemException { 2667 getService().unsetGroupUsers(groupId, userIds, serviceContext); 2668 } 2669 2670 /** 2671 * Removes the users from the organization. 2672 * 2673 * @param organizationId the primary key of the organization 2674 * @param userIds the primary keys of the users 2675 * @throws PortalException if a portal exception occurred 2676 * @throws SystemException if a system exception occurred 2677 */ 2678 public static void unsetOrganizationUsers(long organizationId, 2679 long[] userIds) 2680 throws com.liferay.portal.kernel.exception.PortalException, 2681 com.liferay.portal.kernel.exception.SystemException { 2682 getService().unsetOrganizationUsers(organizationId, userIds); 2683 } 2684 2685 /** 2686 * Removes the users from the password policy. 2687 * 2688 * @param passwordPolicyId the primary key of the password policy 2689 * @param userIds the primary keys of the users 2690 * @throws SystemException if a system exception occurred 2691 */ 2692 public static void unsetPasswordPolicyUsers(long passwordPolicyId, 2693 long[] userIds) 2694 throws com.liferay.portal.kernel.exception.SystemException { 2695 getService().unsetPasswordPolicyUsers(passwordPolicyId, userIds); 2696 } 2697 2698 /** 2699 * Removes the users from the role. 2700 * 2701 * @param roleId the primary key of the role 2702 * @param users the users 2703 * @throws PortalException if a portal exception occurred 2704 * @throws SystemException if a system exception occurred 2705 */ 2706 public static void unsetRoleUsers(long roleId, 2707 java.util.List<com.liferay.portal.model.User> users) 2708 throws com.liferay.portal.kernel.exception.PortalException, 2709 com.liferay.portal.kernel.exception.SystemException { 2710 getService().unsetRoleUsers(roleId, users); 2711 } 2712 2713 /** 2714 * Removes the users from the role. 2715 * 2716 * @param roleId the primary key of the role 2717 * @param userIds the primary keys of the users 2718 * @throws PortalException if a portal exception occurred 2719 * @throws SystemException if a system exception occurred 2720 */ 2721 public static void unsetRoleUsers(long roleId, long[] userIds) 2722 throws com.liferay.portal.kernel.exception.PortalException, 2723 com.liferay.portal.kernel.exception.SystemException { 2724 getService().unsetRoleUsers(roleId, userIds); 2725 } 2726 2727 /** 2728 * Removes the users from the team. 2729 * 2730 * @param teamId the primary key of the team 2731 * @param userIds the primary keys of the users 2732 * @throws PortalException if a portal exception occurred 2733 * @throws SystemException if a system exception occurred 2734 */ 2735 public static void unsetTeamUsers(long teamId, long[] userIds) 2736 throws com.liferay.portal.kernel.exception.PortalException, 2737 com.liferay.portal.kernel.exception.SystemException { 2738 getService().unsetTeamUsers(teamId, userIds); 2739 } 2740 2741 /** 2742 * Removes the users from the user group. 2743 * 2744 * @param userGroupId the primary key of the user group 2745 * @param userIds the primary keys of the users 2746 * @throws PortalException if a portal exception occurred 2747 * @throws SystemException if a system exception occurred 2748 */ 2749 public static void unsetUserGroupUsers(long userGroupId, long[] userIds) 2750 throws com.liferay.portal.kernel.exception.PortalException, 2751 com.liferay.portal.kernel.exception.SystemException { 2752 getService().unsetUserGroupUsers(userGroupId, userIds); 2753 } 2754 2755 /** 2756 * Updates whether the user has agreed to the terms of use. 2757 * 2758 * @param userId the primary key of the user 2759 * @param agreedToTermsOfUse whether the user has agreet to the terms of 2760 use 2761 * @return the user 2762 * @throws PortalException if a user with the primary key could not be found 2763 * @throws SystemException if a system exception occurred 2764 */ 2765 public static com.liferay.portal.model.User updateAgreedToTermsOfUse( 2766 long userId, boolean agreedToTermsOfUse) 2767 throws com.liferay.portal.kernel.exception.PortalException, 2768 com.liferay.portal.kernel.exception.SystemException { 2769 return getService().updateAgreedToTermsOfUse(userId, agreedToTermsOfUse); 2770 } 2771 2772 /** 2773 * Updates the user's asset with the new asset categories and tag names, 2774 * removing and adding asset categories and tag names as necessary. 2775 * 2776 * @param userId the primary key of the user 2777 * @param user ID the primary key of the user 2778 * @param assetCategoryIds the primary key's of the new asset categories 2779 * @param assetTagNames the new asset tag names 2780 * @throws PortalException if a user with the primary key could not be found 2781 * @throws SystemException if a system exception occurred 2782 */ 2783 public static void updateAsset(long userId, 2784 com.liferay.portal.model.User user, long[] assetCategoryIds, 2785 java.lang.String[] assetTagNames) 2786 throws com.liferay.portal.kernel.exception.PortalException, 2787 com.liferay.portal.kernel.exception.SystemException { 2788 getService().updateAsset(userId, user, assetCategoryIds, assetTagNames); 2789 } 2790 2791 /** 2792 * Updates the user's creation date. 2793 * 2794 * @param userId the primary key of the user 2795 * @param createDate the new creation date 2796 * @return the user 2797 * @throws PortalException if a user with the primary key could not be found 2798 * @throws SystemException if a system exception occurred 2799 */ 2800 public static com.liferay.portal.model.User updateCreateDate(long userId, 2801 java.util.Date createDate) 2802 throws com.liferay.portal.kernel.exception.PortalException, 2803 com.liferay.portal.kernel.exception.SystemException { 2804 return getService().updateCreateDate(userId, createDate); 2805 } 2806 2807 /** 2808 * Updates the user's email address. 2809 * 2810 * @param userId the primary key of the user 2811 * @param password the user's password 2812 * @param emailAddress1 the user's new email address 2813 * @param emailAddress2 the user's new email address confirmation 2814 * @return the user 2815 * @throws PortalException if a user with the primary key could not be found 2816 * @throws SystemException if a system exception occurred 2817 */ 2818 public static com.liferay.portal.model.User updateEmailAddress( 2819 long userId, java.lang.String password, java.lang.String emailAddress1, 2820 java.lang.String emailAddress2) 2821 throws com.liferay.portal.kernel.exception.PortalException, 2822 com.liferay.portal.kernel.exception.SystemException { 2823 return getService() 2824 .updateEmailAddress(userId, password, emailAddress1, 2825 emailAddress2); 2826 } 2827 2828 /** 2829 * Updates the user's email address or sends verification email. 2830 * 2831 * @param userId the primary key of the user 2832 * @param password the user's password 2833 * @param emailAddress1 the user's new email address 2834 * @param emailAddress2 the user's new email address confirmation 2835 * @param serviceContext the service context to be applied. Must set the 2836 portal URL, main path, primary key of the layout, remote address, 2837 remote host, and agent for the user. 2838 * @return the user 2839 * @throws PortalException if a user with the primary key could not be found 2840 * @throws SystemException if a system exception occurred 2841 */ 2842 public static com.liferay.portal.model.User updateEmailAddress( 2843 long userId, java.lang.String password, java.lang.String emailAddress1, 2844 java.lang.String emailAddress2, 2845 com.liferay.portal.service.ServiceContext serviceContext) 2846 throws com.liferay.portal.kernel.exception.PortalException, 2847 com.liferay.portal.kernel.exception.SystemException { 2848 return getService() 2849 .updateEmailAddress(userId, password, emailAddress1, 2850 emailAddress2, serviceContext); 2851 } 2852 2853 /** 2854 * Updates whether the user has verified email address. 2855 * 2856 * @param userId the primary key of the user 2857 * @param emailAddressVerified whether the user has verified email address 2858 * @return the user 2859 * @throws PortalException if a user with the primary key could not be found 2860 * @throws SystemException if a system exception occurred 2861 */ 2862 public static com.liferay.portal.model.User updateEmailAddressVerified( 2863 long userId, boolean emailAddressVerified) 2864 throws com.liferay.portal.kernel.exception.PortalException, 2865 com.liferay.portal.kernel.exception.SystemException { 2866 return getService() 2867 .updateEmailAddressVerified(userId, emailAddressVerified); 2868 } 2869 2870 /** 2871 * Updates the user's Facebook ID. 2872 * 2873 * @param userId the primary key of the user 2874 * @param facebookId the user's new Facebook ID 2875 * @return the user 2876 * @throws PortalException if a user with the primary key could not be found 2877 * @throws SystemException if a system exception occurred 2878 */ 2879 public static com.liferay.portal.model.User updateFacebookId(long userId, 2880 long facebookId) 2881 throws com.liferay.portal.kernel.exception.PortalException, 2882 com.liferay.portal.kernel.exception.SystemException { 2883 return getService().updateFacebookId(userId, facebookId); 2884 } 2885 2886 /** 2887 * Sets the groups the user is in, removing and adding groups as necessary. 2888 * 2889 * @param userId the primary key of the user 2890 * @param newGroupIds the primary keys of the groups 2891 * @param serviceContext the service context to be applied (optionally 2892 <code>null</code>) 2893 * @throws PortalException if a portal exception occurred 2894 * @throws SystemException if a system exception occurred 2895 */ 2896 public static void updateGroups(long userId, long[] newGroupIds, 2897 com.liferay.portal.service.ServiceContext serviceContext) 2898 throws com.liferay.portal.kernel.exception.PortalException, 2899 com.liferay.portal.kernel.exception.SystemException { 2900 getService().updateGroups(userId, newGroupIds, serviceContext); 2901 } 2902 2903 /** 2904 * Updates a user account that was automatically created when a guest user 2905 * participated in an action (e.g. posting a comment) and only provided his 2906 * name and email address. 2907 * 2908 * @param creatorUserId the primary key of the creator 2909 * @param companyId the primary key of the user's company 2910 * @param autoPassword whether a password should be automatically generated 2911 for the user 2912 * @param password1 the user's password 2913 * @param password2 the user's password confirmation 2914 * @param autoScreenName whether a screen name should be automatically 2915 generated for the user 2916 * @param screenName the user's screen name 2917 * @param emailAddress the user's email address 2918 * @param facebookId the user's facebook ID 2919 * @param openId the user's OpenID 2920 * @param locale the user's locale 2921 * @param firstName the user's first name 2922 * @param middleName the user's middle name 2923 * @param lastName the user's last name 2924 * @param prefixId the user's name prefix ID 2925 * @param suffixId the user's name suffix ID 2926 * @param male whether the user is male 2927 * @param birthdayMonth the user's birthday month (0-based, meaning 0 for 2928 January) 2929 * @param birthdayDay the user's birthday day 2930 * @param birthdayYear the user's birthday year 2931 * @param jobTitle the user's job title 2932 * @param updateUserInformation whether to update the user's information 2933 * @param sendEmail whether to send the user an email notification about 2934 their new account 2935 * @param serviceContext the service context to be applied (optionally 2936 <code>null</code>). Can set expando bridge attributes for the 2937 user. 2938 * @return the user 2939 * @throws PortalException if the user's information was invalid 2940 * @throws SystemException if a system exception occurred 2941 */ 2942 public static com.liferay.portal.model.User updateIncompleteUser( 2943 long creatorUserId, long companyId, boolean autoPassword, 2944 java.lang.String password1, java.lang.String password2, 2945 boolean autoScreenName, java.lang.String screenName, 2946 java.lang.String emailAddress, long facebookId, 2947 java.lang.String openId, java.util.Locale locale, 2948 java.lang.String firstName, java.lang.String middleName, 2949 java.lang.String lastName, int prefixId, int suffixId, boolean male, 2950 int birthdayMonth, int birthdayDay, int birthdayYear, 2951 java.lang.String jobTitle, boolean updateUserInformation, 2952 boolean sendEmail, 2953 com.liferay.portal.service.ServiceContext serviceContext) 2954 throws com.liferay.portal.kernel.exception.PortalException, 2955 com.liferay.portal.kernel.exception.SystemException { 2956 return getService() 2957 .updateIncompleteUser(creatorUserId, companyId, 2958 autoPassword, password1, password2, autoScreenName, screenName, 2959 emailAddress, facebookId, openId, locale, firstName, middleName, 2960 lastName, prefixId, suffixId, male, birthdayMonth, birthdayDay, 2961 birthdayYear, jobTitle, updateUserInformation, sendEmail, 2962 serviceContext); 2963 } 2964 2965 /** 2966 * Updates the user's job title. 2967 * 2968 * @param userId the primary key of the user 2969 * @param jobTitle the user's job title 2970 * @return the user 2971 * @throws PortalException if a user with the primary key could not be found 2972 or if a contact could not be found matching the user's contact ID 2973 * @throws SystemException if a system exception occurred 2974 */ 2975 public static com.liferay.portal.model.User updateJobTitle(long userId, 2976 java.lang.String jobTitle) 2977 throws com.liferay.portal.kernel.exception.PortalException, 2978 com.liferay.portal.kernel.exception.SystemException { 2979 return getService().updateJobTitle(userId, jobTitle); 2980 } 2981 2982 /** 2983 * Updates the user's last login with the current time and the IP address. 2984 * 2985 * @param userId the primary key of the user 2986 * @param loginIP the IP address the user logged in from 2987 * @return the user 2988 * @throws PortalException if a user with the primary key could not be found 2989 * @throws SystemException if a system exception occurred 2990 */ 2991 public static com.liferay.portal.model.User updateLastLogin(long userId, 2992 java.lang.String loginIP) 2993 throws com.liferay.portal.kernel.exception.PortalException, 2994 com.liferay.portal.kernel.exception.SystemException { 2995 return getService().updateLastLogin(userId, loginIP); 2996 } 2997 2998 /** 2999 * Updates whether the user is locked out from logging in. 3000 * 3001 * @param user the user 3002 * @param lockout whether the user is locked out 3003 * @return the user 3004 * @throws PortalException if a portal exception occurred 3005 * @throws SystemException if a system exception occurred 3006 */ 3007 public static com.liferay.portal.model.User updateLockout( 3008 com.liferay.portal.model.User user, boolean lockout) 3009 throws com.liferay.portal.kernel.exception.PortalException, 3010 com.liferay.portal.kernel.exception.SystemException { 3011 return getService().updateLockout(user, lockout); 3012 } 3013 3014 /** 3015 * Updates whether the user is locked out from logging in. 3016 * 3017 * @param companyId the primary key of the user's company 3018 * @param emailAddress the user's email address 3019 * @param lockout whether the user is locked out 3020 * @return the user 3021 * @throws PortalException if a user with the email address could not be 3022 found 3023 * @throws SystemException if a system exception occurred 3024 */ 3025 public static com.liferay.portal.model.User updateLockoutByEmailAddress( 3026 long companyId, java.lang.String emailAddress, boolean lockout) 3027 throws com.liferay.portal.kernel.exception.PortalException, 3028 com.liferay.portal.kernel.exception.SystemException { 3029 return getService() 3030 .updateLockoutByEmailAddress(companyId, emailAddress, lockout); 3031 } 3032 3033 /** 3034 * Updates whether the user is locked out from logging in. 3035 * 3036 * @param userId the primary key of the user 3037 * @param lockout whether the user is locked out 3038 * @return the user 3039 * @throws PortalException if a user with the primary key could not be found 3040 * @throws SystemException if a system exception occurred 3041 */ 3042 public static com.liferay.portal.model.User updateLockoutById(long userId, 3043 boolean lockout) 3044 throws com.liferay.portal.kernel.exception.PortalException, 3045 com.liferay.portal.kernel.exception.SystemException { 3046 return getService().updateLockoutById(userId, lockout); 3047 } 3048 3049 /** 3050 * Updates whether the user is locked out from logging in. 3051 * 3052 * @param companyId the primary key of the user's company 3053 * @param screenName the user's screen name 3054 * @param lockout whether the user is locked out 3055 * @return the user 3056 * @throws PortalException if a user with the screen name could not be found 3057 * @throws SystemException if a system exception occurred 3058 */ 3059 public static com.liferay.portal.model.User updateLockoutByScreenName( 3060 long companyId, java.lang.String screenName, boolean lockout) 3061 throws com.liferay.portal.kernel.exception.PortalException, 3062 com.liferay.portal.kernel.exception.SystemException { 3063 return getService() 3064 .updateLockoutByScreenName(companyId, screenName, lockout); 3065 } 3066 3067 /** 3068 * Updates the user's modified date. 3069 * 3070 * @param userId the primary key of the user 3071 * @param modifiedDate the new modified date 3072 * @return the user 3073 * @throws PortalException if a user with the primary key could not be found 3074 * @throws SystemException if a system exception occurred 3075 */ 3076 public static com.liferay.portal.model.User updateModifiedDate( 3077 long userId, java.util.Date modifiedDate) 3078 throws com.liferay.portal.kernel.exception.PortalException, 3079 com.liferay.portal.kernel.exception.SystemException { 3080 return getService().updateModifiedDate(userId, modifiedDate); 3081 } 3082 3083 /** 3084 * Updates the user's OpenID. 3085 * 3086 * @param userId the primary key of the user 3087 * @param openId the new OpenID 3088 * @return the user 3089 * @throws PortalException if a user with the primary key could not be found 3090 * @throws SystemException if a system exception occurred 3091 */ 3092 public static com.liferay.portal.model.User updateOpenId(long userId, 3093 java.lang.String openId) 3094 throws com.liferay.portal.kernel.exception.PortalException, 3095 com.liferay.portal.kernel.exception.SystemException { 3096 return getService().updateOpenId(userId, openId); 3097 } 3098 3099 /** 3100 * Sets the organizations that the user is in, removing and adding 3101 * organizations as necessary. 3102 * 3103 * @param userId the primary key of the user 3104 * @param newOrganizationIds the primary keys of the organizations 3105 * @param serviceContext the service context to be applied. Must set 3106 whether user indexing is enabled. 3107 * @throws PortalException if a user with the primary key could not be found 3108 * @throws SystemException if a system exception occurred 3109 */ 3110 public static void updateOrganizations(long userId, 3111 long[] newOrganizationIds, 3112 com.liferay.portal.service.ServiceContext serviceContext) 3113 throws com.liferay.portal.kernel.exception.PortalException, 3114 com.liferay.portal.kernel.exception.SystemException { 3115 getService() 3116 .updateOrganizations(userId, newOrganizationIds, serviceContext); 3117 } 3118 3119 /** 3120 * Updates the user's password without tracking or validation of the change. 3121 * 3122 * @param userId the primary key of the user 3123 * @param password1 the user's new password 3124 * @param password2 the user's new password confirmation 3125 * @param passwordReset whether the user should be asked to reset their 3126 password the next time they log in 3127 * @return the user 3128 * @throws PortalException if a user with the primary key could not be found 3129 * @throws SystemException if a system exception occurred 3130 */ 3131 public static com.liferay.portal.model.User updatePassword(long userId, 3132 java.lang.String password1, java.lang.String password2, 3133 boolean passwordReset) 3134 throws com.liferay.portal.kernel.exception.PortalException, 3135 com.liferay.portal.kernel.exception.SystemException { 3136 return getService() 3137 .updatePassword(userId, password1, password2, passwordReset); 3138 } 3139 3140 /** 3141 * Updates the user's password, optionally with tracking and validation of 3142 * the change. 3143 * 3144 * @param userId the primary key of the user 3145 * @param password1 the user's new password 3146 * @param password2 the user's new password confirmation 3147 * @param passwordReset whether the user should be asked to reset their 3148 password the next time they login 3149 * @param silentUpdate whether the password should be updated without being 3150 tracked, or validated. Primarily used for password imports. 3151 * @return the user 3152 * @throws PortalException if a user with the primary key could not be found 3153 * @throws SystemException if a system exception occurred 3154 */ 3155 public static com.liferay.portal.model.User updatePassword(long userId, 3156 java.lang.String password1, java.lang.String password2, 3157 boolean passwordReset, boolean silentUpdate) 3158 throws com.liferay.portal.kernel.exception.PortalException, 3159 com.liferay.portal.kernel.exception.SystemException { 3160 return getService() 3161 .updatePassword(userId, password1, password2, passwordReset, 3162 silentUpdate); 3163 } 3164 3165 /** 3166 * Updates the user's password with manually input information. This method 3167 * should only be used when performing maintenance. 3168 * 3169 * @param userId the primary key of the user 3170 * @param password the user's new password 3171 * @param passwordEncrypted the user's new encrypted password 3172 * @param passwordReset whether the user should be asked to reset their 3173 password the next time they login 3174 * @param passwordModifiedDate the new password modified date 3175 * @return the user 3176 * @throws PortalException if a user with the primary key could not be found 3177 * @throws SystemException if a system exception occurred 3178 */ 3179 public static com.liferay.portal.model.User updatePasswordManually( 3180 long userId, java.lang.String password, boolean passwordEncrypted, 3181 boolean passwordReset, java.util.Date passwordModifiedDate) 3182 throws com.liferay.portal.kernel.exception.PortalException, 3183 com.liferay.portal.kernel.exception.SystemException { 3184 return getService() 3185 .updatePasswordManually(userId, password, passwordEncrypted, 3186 passwordReset, passwordModifiedDate); 3187 } 3188 3189 /** 3190 * Updates whether the user should be asked to reset their password the next 3191 * time they login. 3192 * 3193 * @param userId the primary key of the user 3194 * @param passwordReset whether the user should be asked to reset their 3195 password the next time they login 3196 * @return the user 3197 * @throws PortalException if a user with the primary key could not be found 3198 * @throws SystemException if a system exception occurred 3199 */ 3200 public static com.liferay.portal.model.User updatePasswordReset( 3201 long userId, boolean passwordReset) 3202 throws com.liferay.portal.kernel.exception.PortalException, 3203 com.liferay.portal.kernel.exception.SystemException { 3204 return getService().updatePasswordReset(userId, passwordReset); 3205 } 3206 3207 /** 3208 * Updates the user's portrait image. 3209 * 3210 * @param userId the primary key of the user 3211 * @param bytes the new portrait image data 3212 * @return the user 3213 * @throws PortalException if a user with the primary key could not be found 3214 or if the new portrait was invalid 3215 * @throws SystemException if a system exception occurred 3216 */ 3217 public static com.liferay.portal.model.User updatePortrait(long userId, 3218 byte[] bytes) 3219 throws com.liferay.portal.kernel.exception.PortalException, 3220 com.liferay.portal.kernel.exception.SystemException { 3221 return getService().updatePortrait(userId, bytes); 3222 } 3223 3224 /** 3225 * Updates the user's password reset question and answer. 3226 * 3227 * @param userId the primary key of the user 3228 * @param question the user's new password reset question 3229 * @param answer the user's new password reset answer 3230 * @return the user 3231 * @throws PortalException if a user with the primary key could not be found 3232 or if the new question or answer were invalid 3233 * @throws SystemException if a system exception occurred 3234 */ 3235 public static com.liferay.portal.model.User updateReminderQuery( 3236 long userId, java.lang.String question, java.lang.String answer) 3237 throws com.liferay.portal.kernel.exception.PortalException, 3238 com.liferay.portal.kernel.exception.SystemException { 3239 return getService().updateReminderQuery(userId, question, answer); 3240 } 3241 3242 /** 3243 * Updates the user's screen name. 3244 * 3245 * @param userId the primary key of the user 3246 * @param screenName the user's new screen name 3247 * @return the user 3248 * @throws PortalException if a user with the primary key could not be found 3249 or if the new screen name was invalid 3250 * @throws SystemException if a system exception occurred 3251 */ 3252 public static com.liferay.portal.model.User updateScreenName(long userId, 3253 java.lang.String screenName) 3254 throws com.liferay.portal.kernel.exception.PortalException, 3255 com.liferay.portal.kernel.exception.SystemException { 3256 return getService().updateScreenName(userId, screenName); 3257 } 3258 3259 /** 3260 * Updates the user's workflow status. 3261 * 3262 * @param userId the primary key of the user 3263 * @param status the user's new workflow status 3264 * @return the user 3265 * @throws PortalException if a user with the primary key could not be found 3266 * @throws SystemException if a system exception occurred 3267 */ 3268 public static com.liferay.portal.model.User updateStatus(long userId, 3269 int status) 3270 throws com.liferay.portal.kernel.exception.PortalException, 3271 com.liferay.portal.kernel.exception.SystemException { 3272 return getService().updateStatus(userId, status); 3273 } 3274 3275 /** 3276 * Updates the user. 3277 * 3278 * @param userId the primary key of the user 3279 * @param oldPassword the user's old password 3280 * @param newPassword1 the user's new password (optionally 3281 <code>null</code>) 3282 * @param newPassword2 the user's new password confirmation (optionally 3283 <code>null</code>) 3284 * @param passwordReset whether the user should be asked to reset their 3285 password the next time they login 3286 * @param reminderQueryQuestion the user's new password reset question 3287 * @param reminderQueryAnswer the user's new password reset answer 3288 * @param screenName the user's new screen name 3289 * @param emailAddress the user's new email address 3290 * @param facebookId the user's new Facebook ID 3291 * @param openId the user's new OpenID 3292 * @param languageId the user's new language ID 3293 * @param timeZoneId the user's new time zone ID 3294 * @param greeting the user's new greeting 3295 * @param comments the user's new comments 3296 * @param firstName the user's new first name 3297 * @param middleName the user's new middle name 3298 * @param lastName the user's new last name 3299 * @param prefixId the user's new name prefix ID 3300 * @param suffixId the user's new name suffix ID 3301 * @param male whether user is male 3302 * @param birthdayMonth the user's new birthday month (0-based, meaning 0 3303 for January) 3304 * @param birthdayDay the user's new birthday day 3305 * @param birthdayYear the user's birthday year 3306 * @param smsSn the user's new SMS screen name 3307 * @param aimSn the user's new AIM screen name 3308 * @param facebookSn the user's new Facebook screen name 3309 * @param icqSn the user's new ICQ screen name 3310 * @param jabberSn the user's new Jabber screen name 3311 * @param msnSn the user's new MSN screen name 3312 * @param mySpaceSn the user's new MySpace screen name 3313 * @param skypeSn the user's new Skype screen name 3314 * @param twitterSn the user's new Twitter screen name 3315 * @param ymSn the user's new Yahoo! Messenger screen name 3316 * @param jobTitle the user's new job title 3317 * @param groupIds the primary keys of the user's groups 3318 * @param organizationIds the primary keys of the user's organizations 3319 * @param roleIds the primary keys of the user's roles 3320 * @param userGroupRoles the user user's group roles 3321 * @param userGroupIds the primary keys of the user's user groups 3322 * @param serviceContext the service context to be applied (optionally 3323 <code>null</code>). Can set the UUID (with the <code>uuid</code> 3324 attribute), asset category IDs, asset tag names, and expando 3325 bridge attributes for the user. 3326 * @return the user 3327 * @throws PortalException if a user with the primary key could not be found 3328 or if the new information was invalid 3329 * @throws SystemException if a system exception occurred 3330 */ 3331 public static com.liferay.portal.model.User updateUser(long userId, 3332 java.lang.String oldPassword, java.lang.String newPassword1, 3333 java.lang.String newPassword2, boolean passwordReset, 3334 java.lang.String reminderQueryQuestion, 3335 java.lang.String reminderQueryAnswer, java.lang.String screenName, 3336 java.lang.String emailAddress, long facebookId, 3337 java.lang.String openId, java.lang.String languageId, 3338 java.lang.String timeZoneId, java.lang.String greeting, 3339 java.lang.String comments, java.lang.String firstName, 3340 java.lang.String middleName, java.lang.String lastName, int prefixId, 3341 int suffixId, boolean male, int birthdayMonth, int birthdayDay, 3342 int birthdayYear, java.lang.String smsSn, java.lang.String aimSn, 3343 java.lang.String facebookSn, java.lang.String icqSn, 3344 java.lang.String jabberSn, java.lang.String msnSn, 3345 java.lang.String mySpaceSn, java.lang.String skypeSn, 3346 java.lang.String twitterSn, java.lang.String ymSn, 3347 java.lang.String jobTitle, long[] groupIds, long[] organizationIds, 3348 long[] roleIds, 3349 java.util.List<com.liferay.portal.model.UserGroupRole> userGroupRoles, 3350 long[] userGroupIds, 3351 com.liferay.portal.service.ServiceContext serviceContext) 3352 throws com.liferay.portal.kernel.exception.PortalException, 3353 com.liferay.portal.kernel.exception.SystemException { 3354 return getService() 3355 .updateUser(userId, oldPassword, newPassword1, newPassword2, 3356 passwordReset, reminderQueryQuestion, reminderQueryAnswer, 3357 screenName, emailAddress, facebookId, openId, languageId, 3358 timeZoneId, greeting, comments, firstName, middleName, lastName, 3359 prefixId, suffixId, male, birthdayMonth, birthdayDay, birthdayYear, 3360 smsSn, aimSn, facebookSn, icqSn, jabberSn, msnSn, mySpaceSn, 3361 skypeSn, twitterSn, ymSn, jobTitle, groupIds, organizationIds, 3362 roleIds, userGroupRoles, userGroupIds, serviceContext); 3363 } 3364 3365 /** 3366 * Verifies the email address of the ticket. 3367 * 3368 * @param ticketKey the ticket key 3369 * @throws PortalException if a ticket matching the ticket key could not be 3370 found, if the ticket has expired, if the ticket is an email 3371 address ticket, or if the email address is invalid 3372 * @throws SystemException if a system exception occurred 3373 */ 3374 public static void verifyEmailAddress(java.lang.String ticketKey) 3375 throws com.liferay.portal.kernel.exception.PortalException, 3376 com.liferay.portal.kernel.exception.SystemException { 3377 getService().verifyEmailAddress(ticketKey); 3378 } 3379 3380 public static UserLocalService getService() { 3381 if (_service == null) { 3382 _service = (UserLocalService)PortalBeanLocatorUtil.locate(UserLocalService.class.getName()); 3383 3384 ReferenceRegistry.registerReference(UserLocalServiceUtil.class, 3385 "_service"); 3386 } 3387 3388 return _service; 3389 } 3390 3391 /** 3392 * @deprecated As of 6.2.0 3393 */ 3394 public void setService(UserLocalService service) { 3395 } 3396 3397 private static UserLocalService _service; 3398 }