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