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 n 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 */ 1613 public static com.liferay.portal.model.User fetchUserByContactId( 1614 long contactId) 1615 throws com.liferay.portal.kernel.exception.SystemException { 1616 return getService().fetchUserByContactId(contactId); 1617 } 1618 1619 /** 1620 * Returns the user with the email address. 1621 * 1622 * @param companyId the primary key of the user's company 1623 * @param emailAddress the user's email address 1624 * @return the user with the email address, or <code>null</code> if a user 1625 with the email address could not be found 1626 * @throws SystemException if a system exception occurred 1627 */ 1628 public static com.liferay.portal.model.User fetchUserByEmailAddress( 1629 long companyId, java.lang.String emailAddress) 1630 throws com.liferay.portal.kernel.exception.SystemException { 1631 return getService().fetchUserByEmailAddress(companyId, emailAddress); 1632 } 1633 1634 /** 1635 * Returns the user with the Facebook ID. 1636 * 1637 * @param companyId the primary key of the user's company 1638 * @param facebookId the user's Facebook ID 1639 * @return the user with the Facebook ID, or <code>null</code> if a user 1640 with the Facebook ID could not be found 1641 * @throws SystemException if a system exception occurred 1642 */ 1643 public static com.liferay.portal.model.User fetchUserByFacebookId( 1644 long companyId, long facebookId) 1645 throws com.liferay.portal.kernel.exception.SystemException { 1646 return getService().fetchUserByFacebookId(companyId, facebookId); 1647 } 1648 1649 /** 1650 * Returns the user with the primary key. 1651 * 1652 * @param userId the primary key of the user 1653 * @return the user with the primary key, or <code>null</code> if a user 1654 with the primary key could not be found 1655 * @throws SystemException if a system exception occurred 1656 */ 1657 public static com.liferay.portal.model.User fetchUserById(long userId) 1658 throws com.liferay.portal.kernel.exception.SystemException { 1659 return getService().fetchUserById(userId); 1660 } 1661 1662 /** 1663 * Returns the user with the OpenID. 1664 * 1665 * @param companyId the primary key of the user's company 1666 * @param openId the user's OpenID 1667 * @return the user with the OpenID, or <code>null</code> if a user with the 1668 OpenID could not be found 1669 * @throws SystemException if a system exception occurred 1670 */ 1671 public static com.liferay.portal.model.User fetchUserByOpenId( 1672 long companyId, java.lang.String openId) 1673 throws com.liferay.portal.kernel.exception.SystemException { 1674 return getService().fetchUserByOpenId(companyId, openId); 1675 } 1676 1677 /** 1678 * Returns the user with the screen name. 1679 * 1680 * @param companyId the primary key of the user's company 1681 * @param screenName the user's screen name 1682 * @return the user with the screen name, or <code>null</code> if a user 1683 with the screen name could not be found 1684 * @throws SystemException if a system exception occurred 1685 */ 1686 public static com.liferay.portal.model.User fetchUserByScreenName( 1687 long companyId, java.lang.String screenName) 1688 throws com.liferay.portal.kernel.exception.SystemException { 1689 return getService().fetchUserByScreenName(companyId, screenName); 1690 } 1691 1692 /** 1693 * Returns a range of all the users belonging to the company. 1694 * 1695 * <p> 1696 * Useful when paginating results. Returns a maximum of <code>end - 1697 * start</code> instances. <code>start</code> and <code>end</code> are not 1698 * primary keys, they are indexes in the result set. Thus, <code>0</code> 1699 * refers to the first result in the set. Setting both <code>start</code> 1700 * and <code>end</code> to {@link 1701 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 1702 * result set. 1703 * </p> 1704 * 1705 * @param companyId the primary key of the company 1706 * @param start the lower bound of the range of users 1707 * @param end the upper bound of the range of users (not inclusive) 1708 * @return the range of users belonging to the company 1709 * @throws SystemException if a system exception occurred 1710 */ 1711 public static java.util.List<com.liferay.portal.model.User> getCompanyUsers( 1712 long companyId, int start, int end) 1713 throws com.liferay.portal.kernel.exception.SystemException { 1714 return getService().getCompanyUsers(companyId, start, end); 1715 } 1716 1717 /** 1718 * Returns the number of users belonging to the company. 1719 * 1720 * @param companyId the primary key of the company 1721 * @return the number of users belonging to the company 1722 * @throws SystemException if a system exception occurred 1723 */ 1724 public static int getCompanyUsersCount(long companyId) 1725 throws com.liferay.portal.kernel.exception.SystemException { 1726 return getService().getCompanyUsersCount(companyId); 1727 } 1728 1729 /** 1730 * Returns the default user for the company. 1731 * 1732 * @param companyId the primary key of the company 1733 * @return the default user for the company 1734 * @throws PortalException if a default user for the company could not be 1735 found 1736 * @throws SystemException if a system exception occurred 1737 */ 1738 public static com.liferay.portal.model.User getDefaultUser(long companyId) 1739 throws com.liferay.portal.kernel.exception.PortalException, 1740 com.liferay.portal.kernel.exception.SystemException { 1741 return getService().getDefaultUser(companyId); 1742 } 1743 1744 /** 1745 * Returns the primary key of the default user for the company. 1746 * 1747 * @param companyId the primary key of the company 1748 * @return the primary key of the default user for the company 1749 * @throws PortalException if a default user for the company could not be 1750 found 1751 * @throws SystemException if a system exception occurred 1752 */ 1753 public static long getDefaultUserId(long companyId) 1754 throws com.liferay.portal.kernel.exception.PortalException, 1755 com.liferay.portal.kernel.exception.SystemException { 1756 return getService().getDefaultUserId(companyId); 1757 } 1758 1759 /** 1760 * Returns the primary keys of all the users belonging to the group. 1761 * 1762 * @param groupId the primary key of the group 1763 * @return the primary keys of the users belonging to the group 1764 * @throws SystemException if a system exception occurred 1765 */ 1766 public static long[] getGroupUserIds(long groupId) 1767 throws com.liferay.portal.kernel.exception.SystemException { 1768 return getService().getGroupUserIds(groupId); 1769 } 1770 1771 /** 1772 * Returns the number of users with the status belonging to the group. 1773 * 1774 * @param groupId the primary key of the group 1775 * @param status the workflow status 1776 * @return the number of users with the status belonging to the group 1777 * @throws PortalException if a group with the primary key could not be 1778 found 1779 * @throws SystemException if a system exception occurred 1780 */ 1781 public static int getGroupUsersCount(long groupId, int status) 1782 throws com.liferay.portal.kernel.exception.PortalException, 1783 com.liferay.portal.kernel.exception.SystemException { 1784 return getService().getGroupUsersCount(groupId, status); 1785 } 1786 1787 public static java.util.List<com.liferay.portal.model.User> getInheritedRoleUsers( 1788 long roleId, int start, int end, 1789 com.liferay.portal.kernel.util.OrderByComparator obc) 1790 throws com.liferay.portal.kernel.exception.PortalException, 1791 com.liferay.portal.kernel.exception.SystemException { 1792 return getService().getInheritedRoleUsers(roleId, start, end, obc); 1793 } 1794 1795 /** 1796 * Returns all the users who have not had any announcements of the type 1797 * delivered, excluding the default user. 1798 * 1799 * @param type the type of announcement 1800 * @return the users who have not had any annoucements of the type delivered 1801 * @throws SystemException if a system exception occurred 1802 */ 1803 public static java.util.List<com.liferay.portal.model.User> getNoAnnouncementsDeliveries( 1804 java.lang.String type) 1805 throws com.liferay.portal.kernel.exception.SystemException { 1806 return getService().getNoAnnouncementsDeliveries(type); 1807 } 1808 1809 /** 1810 * Returns all the users who do not have any contacts. 1811 * 1812 * @return the users who do not have any contacts 1813 * @throws SystemException if a system exception occurred 1814 */ 1815 public static java.util.List<com.liferay.portal.model.User> getNoContacts() 1816 throws com.liferay.portal.kernel.exception.SystemException { 1817 return getService().getNoContacts(); 1818 } 1819 1820 /** 1821 * Returns all the users who do not belong to any groups, excluding the 1822 * default user. 1823 * 1824 * @return the users who do not belong to any groups 1825 * @throws SystemException if a system exception occurred 1826 */ 1827 public static java.util.List<com.liferay.portal.model.User> getNoGroups() 1828 throws com.liferay.portal.kernel.exception.SystemException { 1829 return getService().getNoGroups(); 1830 } 1831 1832 /** 1833 * Returns the primary keys of all the users belonging to the organization. 1834 * 1835 * @param organizationId the primary key of the organization 1836 * @return the primary keys of the users belonging to the organization 1837 * @throws SystemException if a system exception occurred 1838 */ 1839 public static long[] getOrganizationUserIds(long organizationId) 1840 throws com.liferay.portal.kernel.exception.SystemException { 1841 return getService().getOrganizationUserIds(organizationId); 1842 } 1843 1844 /** 1845 * Returns the number of users with the status belonging to the 1846 * organization. 1847 * 1848 * @param organizationId the primary key of the organization 1849 * @param status the workflow status 1850 * @return the number of users with the status belonging to the organization 1851 * @throws PortalException if an organization with the primary key could not 1852 be found 1853 * @throws SystemException if a system exception occurred 1854 */ 1855 public static int getOrganizationUsersCount(long organizationId, int status) 1856 throws com.liferay.portal.kernel.exception.PortalException, 1857 com.liferay.portal.kernel.exception.SystemException { 1858 return getService().getOrganizationUsersCount(organizationId, status); 1859 } 1860 1861 /** 1862 * Returns the primary keys of all the users belonging to the role. 1863 * 1864 * @param roleId the primary key of the role 1865 * @return the primary keys of the users belonging to the role 1866 * @throws SystemException if a system exception occurred 1867 */ 1868 public static long[] getRoleUserIds(long roleId) 1869 throws com.liferay.portal.kernel.exception.SystemException { 1870 return getService().getRoleUserIds(roleId); 1871 } 1872 1873 /** 1874 * Returns the number of users with the status belonging to the role. 1875 * 1876 * @param roleId the primary key of the role 1877 * @param status the workflow status 1878 * @return the number of users with the status belonging to the role 1879 * @throws PortalException if an role with the primary key could not be 1880 found 1881 * @throws SystemException if a system exception occurred 1882 */ 1883 public static int getRoleUsersCount(long roleId, int status) 1884 throws com.liferay.portal.kernel.exception.PortalException, 1885 com.liferay.portal.kernel.exception.SystemException { 1886 return getService().getRoleUsersCount(roleId, status); 1887 } 1888 1889 /** 1890 * Returns an ordered range of all the users with a social relation of the 1891 * type with the user. 1892 * 1893 * <p> 1894 * Useful when paginating results. Returns a maximum of <code>end - 1895 * start</code> instances. <code>start</code> and <code>end</code> are not 1896 * primary keys, they are indexes in the result set. Thus, <code>0</code> 1897 * refers to the first result in the set. Setting both <code>start</code> 1898 * and <code>end</code> to {@link 1899 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 1900 * result set. 1901 * </p> 1902 * 1903 * @param userId the primary key of the user 1904 * @param socialRelationType the type of social relation. The possible 1905 types can be found in {@link 1906 com.liferay.portlet.social.model.SocialRelationConstants}. 1907 * @param start the lower bound of the range of users 1908 * @param end the upper bound of the range of users (not inclusive) 1909 * @param obc the comparator to order the users by (optionally 1910 <code>null</code>) 1911 * @return the ordered range of users with a social relation of the type 1912 with the user 1913 * @throws PortalException if a user with the primary key could not be 1914 found 1915 * @throws SystemException if a system exception occurred 1916 * @deprecated As of 7.0.0, replaced by {@link #getSocialUsers(long, int, 1917 String, int, int, OrderByComparator)} 1918 */ 1919 public static java.util.List<com.liferay.portal.model.User> getSocialUsers( 1920 long userId, int socialRelationType, int start, int end, 1921 com.liferay.portal.kernel.util.OrderByComparator obc) 1922 throws com.liferay.portal.kernel.exception.PortalException, 1923 com.liferay.portal.kernel.exception.SystemException { 1924 return getService() 1925 .getSocialUsers(userId, socialRelationType, start, end, obc); 1926 } 1927 1928 /** 1929 * Returns an ordered range of all the users with a social relation with the 1930 * user. 1931 * 1932 * <p> 1933 * Useful when paginating results. Returns a maximum of <code>end - 1934 * start</code> instances. <code>start</code> and <code>end</code> are not 1935 * primary keys, they are indexes in the result set. Thus, <code>0</code> 1936 * refers to the first result in the set. Setting both <code>start</code> 1937 * and <code>end</code> to {@link 1938 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 1939 * result set. 1940 * </p> 1941 * 1942 * @param userId the primary key of the user 1943 * @param start the lower bound of the range of users 1944 * @param end the upper bound of the range of users (not inclusive) 1945 * @param obc the comparator to order the users by (optionally 1946 <code>null</code>) 1947 * @return the ordered range of users with a social relation with the 1948 user 1949 * @throws PortalException if a user with the primary key could not be 1950 found 1951 * @throws SystemException if a system exception occurred 1952 * @deprecated As of 7.0.0, replaced by {@link #getSocialUsers(long, int, 1953 boolean, int, int, OrderByComparator)} 1954 */ 1955 public static java.util.List<com.liferay.portal.model.User> getSocialUsers( 1956 long userId, int start, int end, 1957 com.liferay.portal.kernel.util.OrderByComparator obc) 1958 throws com.liferay.portal.kernel.exception.PortalException, 1959 com.liferay.portal.kernel.exception.SystemException { 1960 return getService().getSocialUsers(userId, start, end, obc); 1961 } 1962 1963 public static java.util.List<com.liferay.portal.model.User> getSocialUsers( 1964 long userId, int socialRelationType, 1965 java.lang.String socialRelationTypeComparator, int start, int end, 1966 com.liferay.portal.kernel.util.OrderByComparator obc) 1967 throws com.liferay.portal.kernel.exception.PortalException, 1968 com.liferay.portal.kernel.exception.SystemException { 1969 return getService() 1970 .getSocialUsers(userId, socialRelationType, 1971 socialRelationTypeComparator, start, end, obc); 1972 } 1973 1974 /** 1975 * Returns an ordered range of all the users with a mutual social relation 1976 * of the type with both of the given users. 1977 * 1978 * <p> 1979 * Useful when paginating results. Returns a maximum of <code>end - 1980 * start</code> instances. <code>start</code> and <code>end</code> are not 1981 * primary keys, they are indexes in the result set. Thus, <code>0</code> 1982 * refers to the first result in the set. Setting both <code>start</code> 1983 * and <code>end</code> to {@link 1984 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 1985 * result set. 1986 * </p> 1987 * 1988 * @param userId1 the primary key of the first user 1989 * @param userId2 the primary key of the second user 1990 * @param socialRelationType the type of social relation. The possible 1991 types can be found in {@link 1992 com.liferay.portlet.social.model.SocialRelationConstants}. 1993 * @param start the lower bound of the range of users 1994 * @param end the upper bound of the range of users (not inclusive) 1995 * @param obc the comparator to order the users by (optionally 1996 <code>null</code>) 1997 * @return the ordered range of users with a mutual social relation of the 1998 type with the user 1999 * @throws PortalException if a user with the primary key could not be found 2000 * @throws SystemException if a system exception occurred 2001 */ 2002 public static java.util.List<com.liferay.portal.model.User> getSocialUsers( 2003 long userId1, long userId2, int socialRelationType, int start, int end, 2004 com.liferay.portal.kernel.util.OrderByComparator obc) 2005 throws com.liferay.portal.kernel.exception.PortalException, 2006 com.liferay.portal.kernel.exception.SystemException { 2007 return getService() 2008 .getSocialUsers(userId1, userId2, socialRelationType, start, 2009 end, obc); 2010 } 2011 2012 /** 2013 * Returns an ordered range of all the users with a mutual social relation 2014 * with both of the given users. 2015 * 2016 * <p> 2017 * Useful when paginating results. Returns a maximum of <code>end - 2018 * start</code> instances. <code>start</code> and <code>end</code> are not 2019 * primary keys, they are indexes in the result set. Thus, <code>0</code> 2020 * refers to the first result in the set. Setting both <code>start</code> 2021 * and <code>end</code> to {@link 2022 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 2023 * result set. 2024 * </p> 2025 * 2026 * @param userId1 the primary key of the first user 2027 * @param userId2 the primary key of the second user 2028 * @param start the lower bound of the range of users 2029 * @param end the upper bound of the range of users (not inclusive) 2030 * @param obc the comparator to order the users by (optionally 2031 <code>null</code>) 2032 * @return the ordered range of users with a mutual social relation with the 2033 user 2034 * @throws PortalException if a user with the primary key could not be found 2035 * @throws SystemException if a system exception occurred 2036 */ 2037 public static java.util.List<com.liferay.portal.model.User> getSocialUsers( 2038 long userId1, long userId2, int start, int end, 2039 com.liferay.portal.kernel.util.OrderByComparator obc) 2040 throws com.liferay.portal.kernel.exception.PortalException, 2041 com.liferay.portal.kernel.exception.SystemException { 2042 return getService().getSocialUsers(userId1, userId2, start, end, obc); 2043 } 2044 2045 /** 2046 * Returns the number of users with a social relation with the user. 2047 * 2048 * @param userId the primary key of the user 2049 * @return the number of users with a social relation with the user 2050 * @throws PortalException if a user with the primary key could not be 2051 found 2052 * @throws SystemException if a system exception occurred 2053 * @deprecated As of 7.0.0, replaced by {@link #getSocialUsersCount(long, 2054 int, String)} 2055 */ 2056 public static int getSocialUsersCount(long userId) 2057 throws com.liferay.portal.kernel.exception.PortalException, 2058 com.liferay.portal.kernel.exception.SystemException { 2059 return getService().getSocialUsersCount(userId); 2060 } 2061 2062 /** 2063 * Returns the number of users with a social relation of the type with the 2064 * user. 2065 * 2066 * @param userId the primary key of the user 2067 * @param socialRelationType the type of social relation. The possible 2068 types can be found in {@link 2069 com.liferay.portlet.social.model.SocialRelationConstants}. 2070 * @return the number of users with a social relation of the type with 2071 the user 2072 * @throws PortalException if a user with the primary key could not be 2073 found 2074 * @throws SystemException if a system exception occurred 2075 * @deprecated As of 7.0.0, replaced by {@link #getSocialUsersCount(long, 2076 int, String)} 2077 */ 2078 public static int getSocialUsersCount(long userId, int socialRelationType) 2079 throws com.liferay.portal.kernel.exception.PortalException, 2080 com.liferay.portal.kernel.exception.SystemException { 2081 return getService().getSocialUsersCount(userId, socialRelationType); 2082 } 2083 2084 /** 2085 * Returns the number of users with a social relation with the user. 2086 * 2087 * @param userId the primary key of the user 2088 * @param socialRelationType the type of social relation. The possible 2089 types can be found in {@link 2090 com.liferay.portlet.social.model.SocialRelationConstants}. 2091 * @return the number of users with a social relation with the user 2092 * @throws PortalException if a user with the primary key could not be found 2093 * @throws SystemException if a system exception occurred 2094 */ 2095 public static int getSocialUsersCount(long userId, int socialRelationType, 2096 java.lang.String socialRelationTypeComparator) 2097 throws com.liferay.portal.kernel.exception.PortalException, 2098 com.liferay.portal.kernel.exception.SystemException { 2099 return getService() 2100 .getSocialUsersCount(userId, socialRelationType, 2101 socialRelationTypeComparator); 2102 } 2103 2104 /** 2105 * Returns the number of users with a mutual social relation with both of 2106 * the given users. 2107 * 2108 * @param userId1 the primary key of the first user 2109 * @param userId2 the primary key of the second user 2110 * @return the number of users with a mutual social relation with the user 2111 * @throws PortalException if a user with the primary key could not be found 2112 * @throws SystemException if a system exception occurred 2113 */ 2114 public static int getSocialUsersCount(long userId1, long userId2) 2115 throws com.liferay.portal.kernel.exception.PortalException, 2116 com.liferay.portal.kernel.exception.SystemException { 2117 return getService().getSocialUsersCount(userId1, userId2); 2118 } 2119 2120 /** 2121 * Returns the number of users with a mutual social relation of the type 2122 * with both of the given users. 2123 * 2124 * @param userId1 the primary key of the first user 2125 * @param userId2 the primary key of the second user 2126 * @param socialRelationType the type of social relation. The possible 2127 types can be found in {@link 2128 com.liferay.portlet.social.model.SocialRelationConstants}. 2129 * @return the number of users with a mutual social relation of the type 2130 with the user 2131 * @throws PortalException if a user with the primary key could not be found 2132 * @throws SystemException if a system exception occurred 2133 */ 2134 public static int getSocialUsersCount(long userId1, long userId2, 2135 int socialRelationType) 2136 throws com.liferay.portal.kernel.exception.PortalException, 2137 com.liferay.portal.kernel.exception.SystemException { 2138 return getService() 2139 .getSocialUsersCount(userId1, userId2, socialRelationType); 2140 } 2141 2142 /** 2143 * Returns the user with the contact ID. 2144 * 2145 * @param contactId the user's contact ID 2146 * @return the user with the contact ID 2147 * @throws PortalException if a user with the contact ID could not be found 2148 * @throws SystemException if a system exception occurred 2149 */ 2150 public static com.liferay.portal.model.User getUserByContactId( 2151 long contactId) 2152 throws com.liferay.portal.kernel.exception.PortalException, 2153 com.liferay.portal.kernel.exception.SystemException { 2154 return getService().getUserByContactId(contactId); 2155 } 2156 2157 /** 2158 * Returns the user with the email address. 2159 * 2160 * @param companyId the primary key of the user's company 2161 * @param emailAddress the user's email address 2162 * @return the user with the email address 2163 * @throws PortalException if a user with the email address could not be 2164 found 2165 * @throws SystemException if a system exception occurred 2166 */ 2167 public static com.liferay.portal.model.User getUserByEmailAddress( 2168 long companyId, java.lang.String emailAddress) 2169 throws com.liferay.portal.kernel.exception.PortalException, 2170 com.liferay.portal.kernel.exception.SystemException { 2171 return getService().getUserByEmailAddress(companyId, emailAddress); 2172 } 2173 2174 /** 2175 * Returns the user with the Facebook ID. 2176 * 2177 * @param companyId the primary key of the user's company 2178 * @param facebookId the user's Facebook ID 2179 * @return the user with the Facebook ID 2180 * @throws PortalException if a user with the Facebook ID could not be found 2181 * @throws SystemException if a system exception occurred 2182 */ 2183 public static com.liferay.portal.model.User getUserByFacebookId( 2184 long companyId, long facebookId) 2185 throws com.liferay.portal.kernel.exception.PortalException, 2186 com.liferay.portal.kernel.exception.SystemException { 2187 return getService().getUserByFacebookId(companyId, facebookId); 2188 } 2189 2190 /** 2191 * Returns the user with the primary key. 2192 * 2193 * @param userId the primary key of the user 2194 * @return the user with the primary key 2195 * @throws PortalException if a user with the primary key could not be found 2196 * @throws SystemException if a system exception occurred 2197 */ 2198 public static com.liferay.portal.model.User getUserById(long userId) 2199 throws com.liferay.portal.kernel.exception.PortalException, 2200 com.liferay.portal.kernel.exception.SystemException { 2201 return getService().getUserById(userId); 2202 } 2203 2204 /** 2205 * Returns the user with the primary key from the company. 2206 * 2207 * @param companyId the primary key of the user's company 2208 * @param userId the primary key of the user 2209 * @return the user with the primary key 2210 * @throws PortalException if a user with the primary key from the company 2211 could not be found 2212 * @throws SystemException if a system exception occurred 2213 */ 2214 public static com.liferay.portal.model.User getUserById(long companyId, 2215 long userId) 2216 throws com.liferay.portal.kernel.exception.PortalException, 2217 com.liferay.portal.kernel.exception.SystemException { 2218 return getService().getUserById(companyId, userId); 2219 } 2220 2221 /** 2222 * Returns the user with the OpenID. 2223 * 2224 * @param companyId the primary key of the user's company 2225 * @param openId the user's OpenID 2226 * @return the user with the OpenID 2227 * @throws PortalException if a user with the OpenID could not be found 2228 * @throws SystemException if a system exception occurred 2229 */ 2230 public static com.liferay.portal.model.User getUserByOpenId( 2231 long companyId, java.lang.String openId) 2232 throws com.liferay.portal.kernel.exception.PortalException, 2233 com.liferay.portal.kernel.exception.SystemException { 2234 return getService().getUserByOpenId(companyId, openId); 2235 } 2236 2237 /** 2238 * Returns the user with the portrait ID. 2239 * 2240 * @param portraitId the user's portrait ID 2241 * @return the user with the portrait ID 2242 * @throws PortalException if a user with the portrait ID could not be found 2243 * @throws SystemException if a system exception occurred 2244 */ 2245 public static com.liferay.portal.model.User getUserByPortraitId( 2246 long portraitId) 2247 throws com.liferay.portal.kernel.exception.PortalException, 2248 com.liferay.portal.kernel.exception.SystemException { 2249 return getService().getUserByPortraitId(portraitId); 2250 } 2251 2252 /** 2253 * Returns the user with the screen name. 2254 * 2255 * @param companyId the primary key of the user's company 2256 * @param screenName the user's screen name 2257 * @return the user with the screen name 2258 * @throws PortalException if a user with the screen name could not be found 2259 * @throws SystemException if a system exception occurred 2260 */ 2261 public static com.liferay.portal.model.User getUserByScreenName( 2262 long companyId, java.lang.String screenName) 2263 throws com.liferay.portal.kernel.exception.PortalException, 2264 com.liferay.portal.kernel.exception.SystemException { 2265 return getService().getUserByScreenName(companyId, screenName); 2266 } 2267 2268 /** 2269 * Returns the user with the UUID. 2270 * 2271 * @param uuid the user's UUID 2272 * @return the user with the UUID 2273 * @throws PortalException if a user with the UUID could not be found 2274 * @throws SystemException if a system exception occurred 2275 * @deprecated As of 6.2.0, replaced by {@link 2276 #getUserByUuidAndCompanyId(String, long)} 2277 */ 2278 public static com.liferay.portal.model.User getUserByUuid( 2279 java.lang.String uuid) 2280 throws com.liferay.portal.kernel.exception.PortalException, 2281 com.liferay.portal.kernel.exception.SystemException { 2282 return getService().getUserByUuid(uuid); 2283 } 2284 2285 /** 2286 * Returns the number of users with the status belonging to the user group. 2287 * 2288 * @param userGroupId the primary key of the user group 2289 * @param status the workflow status 2290 * @return the number of users with the status belonging to the user group 2291 * @throws PortalException if a user group with the primary key could not be 2292 found 2293 * @throws SystemException if a system exception occurred 2294 */ 2295 public static int getUserGroupUsersCount(long userGroupId, int status) 2296 throws com.liferay.portal.kernel.exception.PortalException, 2297 com.liferay.portal.kernel.exception.SystemException { 2298 return getService().getUserGroupUsersCount(userGroupId, status); 2299 } 2300 2301 /** 2302 * Returns the primary key of the user with the email address. 2303 * 2304 * @param companyId the primary key of the user's company 2305 * @param emailAddress the user's email address 2306 * @return the primary key of the user with the email address 2307 * @throws PortalException if a user with the email address could not be 2308 found 2309 * @throws SystemException if a system exception occurred 2310 */ 2311 public static long getUserIdByEmailAddress(long companyId, 2312 java.lang.String emailAddress) 2313 throws com.liferay.portal.kernel.exception.PortalException, 2314 com.liferay.portal.kernel.exception.SystemException { 2315 return getService().getUserIdByEmailAddress(companyId, emailAddress); 2316 } 2317 2318 /** 2319 * Returns the primary key of the user with the screen name. 2320 * 2321 * @param companyId the primary key of the user's company 2322 * @param screenName the user's screen name 2323 * @return the primary key of the user with the screen name 2324 * @throws PortalException if a user with the screen name could not be found 2325 * @throws SystemException if a system exception occurred 2326 */ 2327 public static long getUserIdByScreenName(long companyId, 2328 java.lang.String screenName) 2329 throws com.liferay.portal.kernel.exception.PortalException, 2330 com.liferay.portal.kernel.exception.SystemException { 2331 return getService().getUserIdByScreenName(companyId, screenName); 2332 } 2333 2334 /** 2335 * Returns <code>true</code> if the password policy has been assigned to the 2336 * user. 2337 * 2338 * @param passwordPolicyId the primary key of the password policy 2339 * @param userId the primary key of the user 2340 * @return <code>true</code> if the password policy is assigned to the user; 2341 <code>false</code> otherwise 2342 * @throws SystemException if a system exception occurred 2343 */ 2344 public static boolean hasPasswordPolicyUser(long passwordPolicyId, 2345 long userId) throws com.liferay.portal.kernel.exception.SystemException { 2346 return getService().hasPasswordPolicyUser(passwordPolicyId, userId); 2347 } 2348 2349 /** 2350 * Returns <code>true</code> if the user has the role with the name, 2351 * optionally through inheritance. 2352 * 2353 * @param companyId the primary key of the role's company 2354 * @param name the name of the role (must be a regular role, not an 2355 organization, site or provider role) 2356 * @param userId the primary key of the user 2357 * @param inherited whether to include roles inherited from organizations, 2358 sites, etc. 2359 * @return <code>true</code> if the user has the role; <code>false</code> 2360 otherwise 2361 * @throws PortalException if a role with the name could not be found 2362 * @throws SystemException if a system exception occurred 2363 */ 2364 public static boolean hasRoleUser(long companyId, java.lang.String name, 2365 long userId, boolean inherited) 2366 throws com.liferay.portal.kernel.exception.PortalException, 2367 com.liferay.portal.kernel.exception.SystemException { 2368 return getService().hasRoleUser(companyId, name, userId, inherited); 2369 } 2370 2371 /** 2372 * Returns <code>true</code> if the user's password is expired. 2373 * 2374 * @param user the user 2375 * @return <code>true</code> if the user's password is expired; 2376 <code>false</code> otherwise 2377 * @throws PortalException if the password policy for the user could not be 2378 found 2379 * @throws SystemException if a system exception occurred 2380 */ 2381 public static boolean isPasswordExpired(com.liferay.portal.model.User user) 2382 throws com.liferay.portal.kernel.exception.PortalException, 2383 com.liferay.portal.kernel.exception.SystemException { 2384 return getService().isPasswordExpired(user); 2385 } 2386 2387 /** 2388 * Returns <code>true</code> if the password policy is configured to warn 2389 * the user that his password is expiring and the remaining time until 2390 * expiration is equal or less than the configured warning time. 2391 * 2392 * @param user the user 2393 * @return <code>true</code> if the user's password is expiring soon; 2394 <code>false</code> otherwise 2395 * @throws PortalException if the password policy for the user could not be 2396 found 2397 * @throws SystemException if a system exception occurred 2398 */ 2399 public static boolean isPasswordExpiringSoon( 2400 com.liferay.portal.model.User user) 2401 throws com.liferay.portal.kernel.exception.PortalException, 2402 com.liferay.portal.kernel.exception.SystemException { 2403 return getService().isPasswordExpiringSoon(user); 2404 } 2405 2406 /** 2407 * Returns the default user for the company. 2408 * 2409 * @param companyId the primary key of the company 2410 * @return the default user for the company 2411 * @throws PortalException if the user could not be found 2412 * @throws SystemException if a system exception occurred 2413 */ 2414 public static com.liferay.portal.model.User loadGetDefaultUser( 2415 long companyId) 2416 throws com.liferay.portal.kernel.exception.PortalException, 2417 com.liferay.portal.kernel.exception.SystemException { 2418 return getService().loadGetDefaultUser(companyId); 2419 } 2420 2421 /** 2422 * Returns an ordered range of all the users who match the keywords and 2423 * status, without using the indexer. It is preferable to use the indexed 2424 * version {@link #search(long, String, int, LinkedHashMap, int, int, Sort)} 2425 * instead of this method wherever possible for performance reasons. 2426 * 2427 * <p> 2428 * Useful when paginating results. Returns a maximum of <code>end - 2429 * start</code> instances. <code>start</code> and <code>end</code> are not 2430 * primary keys, they are indexes in the result set. Thus, <code>0</code> 2431 * refers to the first result in the set. Setting both <code>start</code> 2432 * and <code>end</code> to {@link 2433 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 2434 * result set. 2435 * </p> 2436 * 2437 * @param companyId the primary key of the user's company 2438 * @param keywords the keywords (space separated), which may occur in the 2439 user's first name, middle name, last name, screen name, or email 2440 address 2441 * @param status the workflow status 2442 * @param params the finder parameters (optionally <code>null</code>). For 2443 more information see {@link 2444 com.liferay.portal.service.persistence.UserFinder}. 2445 * @param start the lower bound of the range of users 2446 * @param end the upper bound of the range of users (not inclusive) 2447 * @param obc the comparator to order the users by (optionally 2448 <code>null</code>) 2449 * @return the matching users 2450 * @throws SystemException if a system exception occurred 2451 * @see com.liferay.portal.service.persistence.UserFinder 2452 */ 2453 public static java.util.List<com.liferay.portal.model.User> search( 2454 long companyId, java.lang.String keywords, int status, 2455 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params, 2456 int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc) 2457 throws com.liferay.portal.kernel.exception.SystemException { 2458 return getService() 2459 .search(companyId, keywords, status, params, start, end, obc); 2460 } 2461 2462 /** 2463 * Returns an ordered range of all the users who match the keywords and 2464 * status, using the indexer. It is preferable to use this method instead of 2465 * the non-indexed version whenever possible for performance reasons. 2466 * 2467 * <p> 2468 * Useful when paginating results. Returns a maximum of <code>end - 2469 * start</code> instances. <code>start</code> and <code>end</code> are not 2470 * primary keys, they are indexes in the result set. Thus, <code>0</code> 2471 * refers to the first result in the set. Setting both <code>start</code> 2472 * and <code>end</code> to {@link 2473 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 2474 * result set. 2475 * </p> 2476 * 2477 * @param companyId the primary key of the user's company 2478 * @param keywords the keywords (space separated), which may occur in the 2479 user's first name, middle name, last name, screen name, or email 2480 address 2481 * @param status the workflow status 2482 * @param params the indexer parameters (optionally <code>null</code>). For 2483 more information see {@link 2484 com.liferay.portlet.usersadmin.util.UserIndexer}. 2485 * @param start the lower bound of the range of users 2486 * @param end the upper bound of the range of users (not inclusive) 2487 * @param sort the field and direction to sort by (optionally 2488 <code>null</code>) 2489 * @return the matching users 2490 * @throws SystemException if a system exception occurred 2491 * @see com.liferay.portlet.usersadmin.util.UserIndexer 2492 */ 2493 public static com.liferay.portal.kernel.search.Hits search(long companyId, 2494 java.lang.String keywords, int status, 2495 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params, 2496 int start, int end, com.liferay.portal.kernel.search.Sort sort) 2497 throws com.liferay.portal.kernel.exception.SystemException { 2498 return getService() 2499 .search(companyId, keywords, status, params, start, end, sort); 2500 } 2501 2502 /** 2503 * Returns an ordered range of all the users with the status, and whose 2504 * first name, middle name, last name, screen name, and email address match 2505 * the keywords specified for them, without using the indexer. It is 2506 * preferable to use the indexed version {@link #search(long, String, 2507 * String, String, String, String, int, LinkedHashMap, boolean, int, int, 2508 * Sort)} instead of this method wherever possible for performance reasons. 2509 * 2510 * <p> 2511 * Useful when paginating results. Returns a maximum of <code>end - 2512 * start</code> instances. <code>start</code> and <code>end</code> are not 2513 * primary keys, they are indexes in the result set. Thus, <code>0</code> 2514 * refers to the first result in the set. Setting both <code>start</code> 2515 * and <code>end</code> to {@link 2516 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 2517 * result set. 2518 * </p> 2519 * 2520 * @param companyId the primary key of the user's company 2521 * @param firstName the first name keywords (space separated) 2522 * @param middleName the middle name keywords 2523 * @param lastName the last name keywords 2524 * @param screenName the screen name keywords 2525 * @param emailAddress the email address keywords 2526 * @param status the workflow status 2527 * @param params the finder parameters (optionally <code>null</code>). For 2528 more information see {@link 2529 com.liferay.portal.service.persistence.UserFinder}. 2530 * @param andSearch whether every field must match its keywords, or just 2531 one field. For example, "users with the first name 'bob' and 2532 last name 'smith'" vs "users with the first name 'bob' 2533 or the last name 'smith'". 2534 * @param start the lower bound of the range of users 2535 * @param end the upper bound of the range of users (not inclusive) 2536 * @param obc the comparator to order the users by (optionally 2537 <code>null</code>) 2538 * @return the matching users 2539 * @throws SystemException if a system exception occurred 2540 * @see com.liferay.portal.service.persistence.UserFinder 2541 */ 2542 public static java.util.List<com.liferay.portal.model.User> search( 2543 long companyId, java.lang.String firstName, 2544 java.lang.String middleName, java.lang.String lastName, 2545 java.lang.String screenName, java.lang.String emailAddress, int status, 2546 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params, 2547 boolean andSearch, int start, int end, 2548 com.liferay.portal.kernel.util.OrderByComparator obc) 2549 throws com.liferay.portal.kernel.exception.SystemException { 2550 return getService() 2551 .search(companyId, firstName, middleName, lastName, 2552 screenName, emailAddress, status, params, andSearch, start, end, obc); 2553 } 2554 2555 /** 2556 * Returns an ordered range of all the users with the status, and whose 2557 * first name, middle name, last name, screen name, and email address match 2558 * the keywords specified for them, using the indexer. It is preferable to 2559 * use this method instead of the non-indexed version whenever possible for 2560 * performance reasons. 2561 * 2562 * <p> 2563 * Useful when paginating results. Returns a maximum of <code>end - 2564 * start</code> instances. <code>start</code> and <code>end</code> are not 2565 * primary keys, they are indexes in the result set. Thus, <code>0</code> 2566 * refers to the first result in the set. Setting both <code>start</code> 2567 * and <code>end</code> to {@link 2568 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 2569 * result set. 2570 * </p> 2571 * 2572 * @param companyId the primary key of the user's company 2573 * @param firstName the first name keywords (space separated) 2574 * @param middleName the middle name keywords 2575 * @param lastName the last name keywords 2576 * @param screenName the screen name keywords 2577 * @param emailAddress the email address keywords 2578 * @param status the workflow status 2579 * @param params the indexer parameters (optionally <code>null</code>). For 2580 more information see {@link 2581 com.liferay.portlet.usersadmin.util.UserIndexer}. 2582 * @param andSearch whether every field must match its keywords, or just 2583 one field. For example, "users with the first name 'bob' and 2584 last name 'smith'" vs "users with the first name 'bob' 2585 or the last name 'smith'". 2586 * @param start the lower bound of the range of users 2587 * @param end the upper bound of the range of users (not inclusive) 2588 * @param sort the field and direction to sort by (optionally 2589 <code>null</code>) 2590 * @return the matching users 2591 * @throws SystemException if a system exception occurred 2592 * @see com.liferay.portlet.usersadmin.util.UserIndexer 2593 */ 2594 public static com.liferay.portal.kernel.search.Hits search(long companyId, 2595 java.lang.String firstName, java.lang.String middleName, 2596 java.lang.String lastName, java.lang.String screenName, 2597 java.lang.String emailAddress, int status, 2598 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params, 2599 boolean andSearch, int start, int end, 2600 com.liferay.portal.kernel.search.Sort sort) 2601 throws com.liferay.portal.kernel.exception.SystemException { 2602 return getService() 2603 .search(companyId, firstName, middleName, lastName, 2604 screenName, emailAddress, status, params, andSearch, start, end, 2605 sort); 2606 } 2607 2608 /** 2609 * Returns the number of users who match the keywords and status. 2610 * 2611 * @param companyId the primary key of the user's company 2612 * @param keywords the keywords (space separated), which may occur in the 2613 user's first name, middle name, last name, screen name, or email 2614 address 2615 * @param status the workflow status 2616 * @param params the finder parameters (optionally <code>null</code>). For 2617 more information see {@link 2618 com.liferay.portal.service.persistence.UserFinder}. 2619 * @return the number matching users 2620 * @throws SystemException if a system exception occurred 2621 */ 2622 public static int searchCount(long companyId, java.lang.String keywords, 2623 int status, 2624 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params) 2625 throws com.liferay.portal.kernel.exception.SystemException { 2626 return getService().searchCount(companyId, keywords, status, params); 2627 } 2628 2629 /** 2630 * Returns the number of users with the status, and whose first name, middle 2631 * name, last name, screen name, and email address match the keywords 2632 * specified for them. 2633 * 2634 * @param companyId the primary key of the user's company 2635 * @param firstName the first name keywords (space separated) 2636 * @param middleName the middle name keywords 2637 * @param lastName the last name keywords 2638 * @param screenName the screen name keywords 2639 * @param emailAddress the email address keywords 2640 * @param status the workflow status 2641 * @param params the finder parameters (optionally <code>null</code>). For 2642 more information see {@link 2643 com.liferay.portal.service.persistence.UserFinder}. 2644 * @param andSearch whether every field must match its keywords, or just 2645 one field. For example, "users with the first name 'bob' and 2646 last name 'smith'" vs "users with the first name 'bob' 2647 or the last name 'smith'". 2648 * @return the number of matching users 2649 * @throws SystemException if a system exception occurred 2650 */ 2651 public static int searchCount(long companyId, java.lang.String firstName, 2652 java.lang.String middleName, java.lang.String lastName, 2653 java.lang.String screenName, java.lang.String emailAddress, int status, 2654 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params, 2655 boolean andSearch) 2656 throws com.liferay.portal.kernel.exception.SystemException { 2657 return getService() 2658 .searchCount(companyId, firstName, middleName, lastName, 2659 screenName, emailAddress, status, params, andSearch); 2660 } 2661 2662 /** 2663 * Sends an email address verification to the user. 2664 * 2665 * @param user the verification email recipient 2666 * @param emailAddress the recipient's email address 2667 * @param serviceContext the service context to be applied. Must set the 2668 portal URL, main path, primary key of the layout, remote address, 2669 remote host, and agent for the user. 2670 * @throws PortalException if a portal exception occurred 2671 * @throws SystemException if a system exception occurred 2672 */ 2673 public static void sendEmailAddressVerification( 2674 com.liferay.portal.model.User user, java.lang.String emailAddress, 2675 com.liferay.portal.service.ServiceContext serviceContext) 2676 throws com.liferay.portal.kernel.exception.PortalException, 2677 com.liferay.portal.kernel.exception.SystemException { 2678 getService() 2679 .sendEmailAddressVerification(user, emailAddress, serviceContext); 2680 } 2681 2682 /** 2683 * Sends the password email to the user with the email address. The content 2684 * of this email can be specified in <code>portal.properties</code> with the 2685 * <code>admin.email.password</code> keys. 2686 * 2687 * @param companyId the primary key of the user's company 2688 * @param emailAddress the user's email address 2689 * @param fromName the name of the individual that the email should be from 2690 * @param fromAddress the address of the individual that the email should 2691 be from 2692 * @param subject the email subject. If <code>null</code>, the subject 2693 specified in <code>portal.properties</code> will be used. 2694 * @param body the email body. If <code>null</code>, the body specified in 2695 <code>portal.properties</code> will be used. 2696 * @param serviceContext the service context to be applied 2697 * @throws PortalException if a user with the email address could not be 2698 found 2699 * @throws SystemException if a system exception occurred 2700 */ 2701 public static void sendPassword(long companyId, 2702 java.lang.String emailAddress, java.lang.String fromName, 2703 java.lang.String fromAddress, java.lang.String subject, 2704 java.lang.String body, 2705 com.liferay.portal.service.ServiceContext serviceContext) 2706 throws com.liferay.portal.kernel.exception.PortalException, 2707 com.liferay.portal.kernel.exception.SystemException { 2708 getService() 2709 .sendPassword(companyId, emailAddress, fromName, fromAddress, 2710 subject, body, serviceContext); 2711 } 2712 2713 /** 2714 * Removes the users from the teams of a group. 2715 * 2716 * @param groupId the primary key of the group 2717 * @param userIds the primary keys of the users 2718 * @throws PortalException if a portal exception occurred 2719 * @throws SystemException if a system exception occurred 2720 */ 2721 public static void unsetGroupTeamsUsers(long groupId, long[] userIds) 2722 throws com.liferay.portal.kernel.exception.PortalException, 2723 com.liferay.portal.kernel.exception.SystemException { 2724 getService().unsetGroupTeamsUsers(groupId, userIds); 2725 } 2726 2727 /** 2728 * Removes the users from the group. 2729 * 2730 * @param groupId the primary key of the group 2731 * @param userIds the primary keys of the users 2732 * @param serviceContext the service context to be applied (optionally 2733 <code>null</code>) 2734 * @throws PortalException if a portal exception occurred 2735 * @throws SystemException if a system exception occurred 2736 */ 2737 public static void unsetGroupUsers(long groupId, long[] userIds, 2738 com.liferay.portal.service.ServiceContext serviceContext) 2739 throws com.liferay.portal.kernel.exception.PortalException, 2740 com.liferay.portal.kernel.exception.SystemException { 2741 getService().unsetGroupUsers(groupId, userIds, serviceContext); 2742 } 2743 2744 /** 2745 * Removes the users from the organization. 2746 * 2747 * @param organizationId the primary key of the organization 2748 * @param userIds the primary keys of the users 2749 * @throws PortalException if a portal exception occurred 2750 * @throws SystemException if a system exception occurred 2751 */ 2752 public static void unsetOrganizationUsers(long organizationId, 2753 long[] userIds) 2754 throws com.liferay.portal.kernel.exception.PortalException, 2755 com.liferay.portal.kernel.exception.SystemException { 2756 getService().unsetOrganizationUsers(organizationId, userIds); 2757 } 2758 2759 /** 2760 * Removes the users from the password policy. 2761 * 2762 * @param passwordPolicyId the primary key of the password policy 2763 * @param userIds the primary keys of the users 2764 * @throws SystemException if a system exception occurred 2765 */ 2766 public static void unsetPasswordPolicyUsers(long passwordPolicyId, 2767 long[] userIds) 2768 throws com.liferay.portal.kernel.exception.SystemException { 2769 getService().unsetPasswordPolicyUsers(passwordPolicyId, userIds); 2770 } 2771 2772 /** 2773 * Removes the users from the role. 2774 * 2775 * @param roleId the primary key of the role 2776 * @param users the users 2777 * @throws PortalException if a portal exception occurred 2778 * @throws SystemException if a system exception occurred 2779 */ 2780 public static void unsetRoleUsers(long roleId, 2781 java.util.List<com.liferay.portal.model.User> users) 2782 throws com.liferay.portal.kernel.exception.PortalException, 2783 com.liferay.portal.kernel.exception.SystemException { 2784 getService().unsetRoleUsers(roleId, users); 2785 } 2786 2787 /** 2788 * Removes the users from the role. 2789 * 2790 * @param roleId the primary key of the role 2791 * @param userIds the primary keys of the users 2792 * @throws PortalException if a portal exception occurred 2793 * @throws SystemException if a system exception occurred 2794 */ 2795 public static void unsetRoleUsers(long roleId, long[] userIds) 2796 throws com.liferay.portal.kernel.exception.PortalException, 2797 com.liferay.portal.kernel.exception.SystemException { 2798 getService().unsetRoleUsers(roleId, userIds); 2799 } 2800 2801 /** 2802 * Removes the users from the team. 2803 * 2804 * @param teamId the primary key of the team 2805 * @param userIds the primary keys of the users 2806 * @throws PortalException if a portal exception occurred 2807 * @throws SystemException if a system exception occurred 2808 */ 2809 public static void unsetTeamUsers(long teamId, long[] userIds) 2810 throws com.liferay.portal.kernel.exception.PortalException, 2811 com.liferay.portal.kernel.exception.SystemException { 2812 getService().unsetTeamUsers(teamId, userIds); 2813 } 2814 2815 /** 2816 * Removes the users from the user group. 2817 * 2818 * @param userGroupId the primary key of the user group 2819 * @param userIds the primary keys of the users 2820 * @throws PortalException if a portal exception occurred 2821 * @throws SystemException if a system exception occurred 2822 */ 2823 public static void unsetUserGroupUsers(long userGroupId, long[] userIds) 2824 throws com.liferay.portal.kernel.exception.PortalException, 2825 com.liferay.portal.kernel.exception.SystemException { 2826 getService().unsetUserGroupUsers(userGroupId, userIds); 2827 } 2828 2829 /** 2830 * Updates whether the user has agreed to the terms of use. 2831 * 2832 * @param userId the primary key of the user 2833 * @param agreedToTermsOfUse whether the user has agreet to the terms of 2834 use 2835 * @return the user 2836 * @throws PortalException if a user with the primary key could not be found 2837 * @throws SystemException if a system exception occurred 2838 */ 2839 public static com.liferay.portal.model.User updateAgreedToTermsOfUse( 2840 long userId, boolean agreedToTermsOfUse) 2841 throws com.liferay.portal.kernel.exception.PortalException, 2842 com.liferay.portal.kernel.exception.SystemException { 2843 return getService().updateAgreedToTermsOfUse(userId, agreedToTermsOfUse); 2844 } 2845 2846 /** 2847 * Updates the user's asset with the new asset categories and tag names, 2848 * removing and adding asset categories and tag names as necessary. 2849 * 2850 * @param userId the primary key of the user 2851 * @param user ID the primary key of the user 2852 * @param assetCategoryIds the primary key's of the new asset categories 2853 * @param assetTagNames the new asset tag names 2854 * @throws PortalException if a user with the primary key could not be found 2855 * @throws SystemException if a system exception occurred 2856 */ 2857 public static void updateAsset(long userId, 2858 com.liferay.portal.model.User user, long[] assetCategoryIds, 2859 java.lang.String[] assetTagNames) 2860 throws com.liferay.portal.kernel.exception.PortalException, 2861 com.liferay.portal.kernel.exception.SystemException { 2862 getService().updateAsset(userId, user, assetCategoryIds, assetTagNames); 2863 } 2864 2865 /** 2866 * Updates the user's creation date. 2867 * 2868 * @param userId the primary key of the user 2869 * @param createDate the new creation date 2870 * @return the user 2871 * @throws PortalException if a user with the primary key could not be found 2872 * @throws SystemException if a system exception occurred 2873 */ 2874 public static com.liferay.portal.model.User updateCreateDate(long userId, 2875 java.util.Date createDate) 2876 throws com.liferay.portal.kernel.exception.PortalException, 2877 com.liferay.portal.kernel.exception.SystemException { 2878 return getService().updateCreateDate(userId, createDate); 2879 } 2880 2881 /** 2882 * Updates the user's email address. 2883 * 2884 * @param userId the primary key of the user 2885 * @param password the user's password 2886 * @param emailAddress1 the user's new email address 2887 * @param emailAddress2 the user's new email address confirmation 2888 * @return the user 2889 * @throws PortalException if a user with the primary key could not be found 2890 * @throws SystemException if a system exception occurred 2891 */ 2892 public static com.liferay.portal.model.User updateEmailAddress( 2893 long userId, java.lang.String password, java.lang.String emailAddress1, 2894 java.lang.String emailAddress2) 2895 throws com.liferay.portal.kernel.exception.PortalException, 2896 com.liferay.portal.kernel.exception.SystemException { 2897 return getService() 2898 .updateEmailAddress(userId, password, emailAddress1, 2899 emailAddress2); 2900 } 2901 2902 /** 2903 * Updates the user's email address or sends verification email. 2904 * 2905 * @param userId the primary key of the user 2906 * @param password the user's password 2907 * @param emailAddress1 the user's new email address 2908 * @param emailAddress2 the user's new email address confirmation 2909 * @param serviceContext the service context to be applied. Must set the 2910 portal URL, main path, primary key of the layout, remote address, 2911 remote host, and agent for the user. 2912 * @return the user 2913 * @throws PortalException if a user with the primary key could not be found 2914 * @throws SystemException if a system exception occurred 2915 */ 2916 public static com.liferay.portal.model.User updateEmailAddress( 2917 long userId, java.lang.String password, java.lang.String emailAddress1, 2918 java.lang.String emailAddress2, 2919 com.liferay.portal.service.ServiceContext serviceContext) 2920 throws com.liferay.portal.kernel.exception.PortalException, 2921 com.liferay.portal.kernel.exception.SystemException { 2922 return getService() 2923 .updateEmailAddress(userId, password, emailAddress1, 2924 emailAddress2, serviceContext); 2925 } 2926 2927 /** 2928 * Updates whether the user has verified email address. 2929 * 2930 * @param userId the primary key of the user 2931 * @param emailAddressVerified whether the user has verified email address 2932 * @return the user 2933 * @throws PortalException if a user with the primary key could not be found 2934 * @throws SystemException if a system exception occurred 2935 */ 2936 public static com.liferay.portal.model.User updateEmailAddressVerified( 2937 long userId, boolean emailAddressVerified) 2938 throws com.liferay.portal.kernel.exception.PortalException, 2939 com.liferay.portal.kernel.exception.SystemException { 2940 return getService() 2941 .updateEmailAddressVerified(userId, emailAddressVerified); 2942 } 2943 2944 /** 2945 * Updates the user's Facebook ID. 2946 * 2947 * @param userId the primary key of the user 2948 * @param facebookId the user's new Facebook ID 2949 * @return the user 2950 * @throws PortalException if a user with the primary key could not be found 2951 * @throws SystemException if a system exception occurred 2952 */ 2953 public static com.liferay.portal.model.User updateFacebookId(long userId, 2954 long facebookId) 2955 throws com.liferay.portal.kernel.exception.PortalException, 2956 com.liferay.portal.kernel.exception.SystemException { 2957 return getService().updateFacebookId(userId, facebookId); 2958 } 2959 2960 /** 2961 * Sets the groups the user is in, removing and adding groups as necessary. 2962 * 2963 * @param userId the primary key of the user 2964 * @param newGroupIds the primary keys of the groups 2965 * @param serviceContext the service context to be applied (optionally 2966 <code>null</code>) 2967 * @throws PortalException if a portal exception occurred 2968 * @throws SystemException if a system exception occurred 2969 */ 2970 public static void updateGroups(long userId, long[] newGroupIds, 2971 com.liferay.portal.service.ServiceContext serviceContext) 2972 throws com.liferay.portal.kernel.exception.PortalException, 2973 com.liferay.portal.kernel.exception.SystemException { 2974 getService().updateGroups(userId, newGroupIds, serviceContext); 2975 } 2976 2977 /** 2978 * Updates a user account that was automatically created when a guest user 2979 * participated in an action (e.g. posting a comment) and only provided his 2980 * name and email address. 2981 * 2982 * @param creatorUserId the primary key of the creator 2983 * @param companyId the primary key of the user's company 2984 * @param autoPassword whether a password should be automatically generated 2985 for the user 2986 * @param password1 the user's password 2987 * @param password2 the user's password confirmation 2988 * @param autoScreenName whether a screen name should be automatically 2989 generated for the user 2990 * @param screenName the user's screen name 2991 * @param emailAddress the user's email address 2992 * @param facebookId the user's facebook ID 2993 * @param openId the user's OpenID 2994 * @param locale the user's locale 2995 * @param firstName the user's first name 2996 * @param middleName the user's middle name 2997 * @param lastName the user's last name 2998 * @param prefixId the user's name prefix ID 2999 * @param suffixId the user's name suffix ID 3000 * @param male whether the user is male 3001 * @param birthdayMonth the user's birthday month (0-based, meaning 0 for 3002 January) 3003 * @param birthdayDay the user's birthday day 3004 * @param birthdayYear the user's birthday year 3005 * @param jobTitle the user's job title 3006 * @param updateUserInformation whether to update the user's information 3007 * @param sendEmail whether to send the user an email notification about 3008 their new account 3009 * @param serviceContext the service context to be applied (optionally 3010 <code>null</code>). Can set expando bridge attributes for the 3011 user. 3012 * @return the user 3013 * @throws PortalException if the user's information was invalid 3014 * @throws SystemException if a system exception occurred 3015 */ 3016 public static com.liferay.portal.model.User updateIncompleteUser( 3017 long creatorUserId, long companyId, boolean autoPassword, 3018 java.lang.String password1, java.lang.String password2, 3019 boolean autoScreenName, java.lang.String screenName, 3020 java.lang.String emailAddress, long facebookId, 3021 java.lang.String openId, java.util.Locale locale, 3022 java.lang.String firstName, java.lang.String middleName, 3023 java.lang.String lastName, int prefixId, int suffixId, boolean male, 3024 int birthdayMonth, int birthdayDay, int birthdayYear, 3025 java.lang.String jobTitle, boolean updateUserInformation, 3026 boolean sendEmail, 3027 com.liferay.portal.service.ServiceContext serviceContext) 3028 throws com.liferay.portal.kernel.exception.PortalException, 3029 com.liferay.portal.kernel.exception.SystemException { 3030 return getService() 3031 .updateIncompleteUser(creatorUserId, companyId, 3032 autoPassword, password1, password2, autoScreenName, screenName, 3033 emailAddress, facebookId, openId, locale, firstName, middleName, 3034 lastName, prefixId, suffixId, male, birthdayMonth, birthdayDay, 3035 birthdayYear, jobTitle, updateUserInformation, sendEmail, 3036 serviceContext); 3037 } 3038 3039 /** 3040 * Updates the user's job title. 3041 * 3042 * @param userId the primary key of the user 3043 * @param jobTitle the user's job title 3044 * @return the user 3045 * @throws PortalException if a user with the primary key could not be found 3046 or if a contact could not be found matching the user's contact ID 3047 * @throws SystemException if a system exception occurred 3048 */ 3049 public static com.liferay.portal.model.User updateJobTitle(long userId, 3050 java.lang.String jobTitle) 3051 throws com.liferay.portal.kernel.exception.PortalException, 3052 com.liferay.portal.kernel.exception.SystemException { 3053 return getService().updateJobTitle(userId, jobTitle); 3054 } 3055 3056 /** 3057 * Updates the user's last login with the current time and the IP address. 3058 * 3059 * @param userId the primary key of the user 3060 * @param loginIP the IP address the user logged in from 3061 * @return the user 3062 * @throws PortalException if a user with the primary key could not be found 3063 * @throws SystemException if a system exception occurred 3064 */ 3065 public static com.liferay.portal.model.User updateLastLogin(long userId, 3066 java.lang.String loginIP) 3067 throws com.liferay.portal.kernel.exception.PortalException, 3068 com.liferay.portal.kernel.exception.SystemException { 3069 return getService().updateLastLogin(userId, loginIP); 3070 } 3071 3072 /** 3073 * Updates whether the user is locked out from logging in. 3074 * 3075 * @param user the user 3076 * @param lockout whether the user is locked out 3077 * @return the user 3078 * @throws PortalException if a portal exception occurred 3079 * @throws SystemException if a system exception occurred 3080 */ 3081 public static com.liferay.portal.model.User updateLockout( 3082 com.liferay.portal.model.User user, boolean lockout) 3083 throws com.liferay.portal.kernel.exception.PortalException, 3084 com.liferay.portal.kernel.exception.SystemException { 3085 return getService().updateLockout(user, lockout); 3086 } 3087 3088 /** 3089 * Updates whether the user is locked out from logging in. 3090 * 3091 * @param companyId the primary key of the user's company 3092 * @param emailAddress the user's email address 3093 * @param lockout whether the user is locked out 3094 * @return the user 3095 * @throws PortalException if a user with the email address could not be 3096 found 3097 * @throws SystemException if a system exception occurred 3098 */ 3099 public static com.liferay.portal.model.User updateLockoutByEmailAddress( 3100 long companyId, java.lang.String emailAddress, boolean lockout) 3101 throws com.liferay.portal.kernel.exception.PortalException, 3102 com.liferay.portal.kernel.exception.SystemException { 3103 return getService() 3104 .updateLockoutByEmailAddress(companyId, emailAddress, lockout); 3105 } 3106 3107 /** 3108 * Updates whether the user is locked out from logging in. 3109 * 3110 * @param userId the primary key of the user 3111 * @param lockout whether the user is locked out 3112 * @return the user 3113 * @throws PortalException if a user with the primary key could not be found 3114 * @throws SystemException if a system exception occurred 3115 */ 3116 public static com.liferay.portal.model.User updateLockoutById(long userId, 3117 boolean lockout) 3118 throws com.liferay.portal.kernel.exception.PortalException, 3119 com.liferay.portal.kernel.exception.SystemException { 3120 return getService().updateLockoutById(userId, lockout); 3121 } 3122 3123 /** 3124 * Updates whether the user is locked out from logging in. 3125 * 3126 * @param companyId the primary key of the user's company 3127 * @param screenName the user's screen name 3128 * @param lockout whether the user is locked out 3129 * @return the user 3130 * @throws PortalException if a user with the screen name could not be found 3131 * @throws SystemException if a system exception occurred 3132 */ 3133 public static com.liferay.portal.model.User updateLockoutByScreenName( 3134 long companyId, java.lang.String screenName, boolean lockout) 3135 throws com.liferay.portal.kernel.exception.PortalException, 3136 com.liferay.portal.kernel.exception.SystemException { 3137 return getService() 3138 .updateLockoutByScreenName(companyId, screenName, lockout); 3139 } 3140 3141 /** 3142 * Updates the user's modified date. 3143 * 3144 * @param userId the primary key of the user 3145 * @param modifiedDate the new modified date 3146 * @return the user 3147 * @throws PortalException if a user with the primary key could not be found 3148 * @throws SystemException if a system exception occurred 3149 */ 3150 public static com.liferay.portal.model.User updateModifiedDate( 3151 long userId, java.util.Date modifiedDate) 3152 throws com.liferay.portal.kernel.exception.PortalException, 3153 com.liferay.portal.kernel.exception.SystemException { 3154 return getService().updateModifiedDate(userId, modifiedDate); 3155 } 3156 3157 /** 3158 * Updates the user's OpenID. 3159 * 3160 * @param userId the primary key of the user 3161 * @param openId the new OpenID 3162 * @return the user 3163 * @throws PortalException if a user with the primary key could not be found 3164 * @throws SystemException if a system exception occurred 3165 */ 3166 public static com.liferay.portal.model.User updateOpenId(long userId, 3167 java.lang.String openId) 3168 throws com.liferay.portal.kernel.exception.PortalException, 3169 com.liferay.portal.kernel.exception.SystemException { 3170 return getService().updateOpenId(userId, openId); 3171 } 3172 3173 /** 3174 * Sets the organizations that the user is in, removing and adding 3175 * organizations as necessary. 3176 * 3177 * @param userId the primary key of the user 3178 * @param newOrganizationIds the primary keys of the organizations 3179 * @param serviceContext the service context to be applied. Must set 3180 whether user indexing is enabled. 3181 * @throws PortalException if a user with the primary key could not be found 3182 * @throws SystemException if a system exception occurred 3183 */ 3184 public static void updateOrganizations(long userId, 3185 long[] newOrganizationIds, 3186 com.liferay.portal.service.ServiceContext serviceContext) 3187 throws com.liferay.portal.kernel.exception.PortalException, 3188 com.liferay.portal.kernel.exception.SystemException { 3189 getService() 3190 .updateOrganizations(userId, newOrganizationIds, serviceContext); 3191 } 3192 3193 /** 3194 * Updates the user's password without tracking or validation of the change. 3195 * 3196 * @param userId the primary key of the user 3197 * @param password1 the user's new password 3198 * @param password2 the user's new password confirmation 3199 * @param passwordReset whether the user should be asked to reset their 3200 password the next time they log in 3201 * @return the user 3202 * @throws PortalException if a user with the primary key could not be found 3203 * @throws SystemException if a system exception occurred 3204 */ 3205 public static com.liferay.portal.model.User updatePassword(long userId, 3206 java.lang.String password1, java.lang.String password2, 3207 boolean passwordReset) 3208 throws com.liferay.portal.kernel.exception.PortalException, 3209 com.liferay.portal.kernel.exception.SystemException { 3210 return getService() 3211 .updatePassword(userId, password1, password2, passwordReset); 3212 } 3213 3214 /** 3215 * Updates the user's password, optionally with tracking and validation of 3216 * the change. 3217 * 3218 * @param userId the primary key of the user 3219 * @param password1 the user's new password 3220 * @param password2 the user's new password confirmation 3221 * @param passwordReset whether the user should be asked to reset their 3222 password the next time they login 3223 * @param silentUpdate whether the password should be updated without being 3224 tracked, or validated. Primarily used for password imports. 3225 * @return the user 3226 * @throws PortalException if a user with the primary key could not be found 3227 * @throws SystemException if a system exception occurred 3228 */ 3229 public static com.liferay.portal.model.User updatePassword(long userId, 3230 java.lang.String password1, java.lang.String password2, 3231 boolean passwordReset, boolean silentUpdate) 3232 throws com.liferay.portal.kernel.exception.PortalException, 3233 com.liferay.portal.kernel.exception.SystemException { 3234 return getService() 3235 .updatePassword(userId, password1, password2, passwordReset, 3236 silentUpdate); 3237 } 3238 3239 /** 3240 * Updates the user's password with manually input information. This method 3241 * should only be used when performing maintenance. 3242 * 3243 * @param userId the primary key of the user 3244 * @param password the user's new password 3245 * @param passwordEncrypted the user's new encrypted password 3246 * @param passwordReset whether the user should be asked to reset their 3247 password the next time they login 3248 * @param passwordModifiedDate the new password modified date 3249 * @return the user 3250 * @throws PortalException if a user with the primary key could not be found 3251 * @throws SystemException if a system exception occurred 3252 */ 3253 public static com.liferay.portal.model.User updatePasswordManually( 3254 long userId, java.lang.String password, boolean passwordEncrypted, 3255 boolean passwordReset, java.util.Date passwordModifiedDate) 3256 throws com.liferay.portal.kernel.exception.PortalException, 3257 com.liferay.portal.kernel.exception.SystemException { 3258 return getService() 3259 .updatePasswordManually(userId, password, passwordEncrypted, 3260 passwordReset, passwordModifiedDate); 3261 } 3262 3263 /** 3264 * Updates whether the user should be asked to reset their password the next 3265 * time they login. 3266 * 3267 * @param userId the primary key of the user 3268 * @param passwordReset whether the user should be asked to reset their 3269 password the next time they login 3270 * @return the user 3271 * @throws PortalException if a user with the primary key could not be found 3272 * @throws SystemException if a system exception occurred 3273 */ 3274 public static com.liferay.portal.model.User updatePasswordReset( 3275 long userId, boolean passwordReset) 3276 throws com.liferay.portal.kernel.exception.PortalException, 3277 com.liferay.portal.kernel.exception.SystemException { 3278 return getService().updatePasswordReset(userId, passwordReset); 3279 } 3280 3281 /** 3282 * Updates the user's portrait image. 3283 * 3284 * @param userId the primary key of the user 3285 * @param bytes the new portrait image data 3286 * @return the user 3287 * @throws PortalException if a user with the primary key could not be found 3288 or if the new portrait was invalid 3289 * @throws SystemException if a system exception occurred 3290 */ 3291 public static com.liferay.portal.model.User updatePortrait(long userId, 3292 byte[] bytes) 3293 throws com.liferay.portal.kernel.exception.PortalException, 3294 com.liferay.portal.kernel.exception.SystemException { 3295 return getService().updatePortrait(userId, bytes); 3296 } 3297 3298 /** 3299 * Updates the user's password reset question and answer. 3300 * 3301 * @param userId the primary key of the user 3302 * @param question the user's new password reset question 3303 * @param answer the user's new password reset answer 3304 * @return the user 3305 * @throws PortalException if a user with the primary key could not be found 3306 or if the new question or answer were invalid 3307 * @throws SystemException if a system exception occurred 3308 */ 3309 public static com.liferay.portal.model.User updateReminderQuery( 3310 long userId, java.lang.String question, java.lang.String answer) 3311 throws com.liferay.portal.kernel.exception.PortalException, 3312 com.liferay.portal.kernel.exception.SystemException { 3313 return getService().updateReminderQuery(userId, question, answer); 3314 } 3315 3316 /** 3317 * Updates the user's screen name. 3318 * 3319 * @param userId the primary key of the user 3320 * @param screenName the user's new screen name 3321 * @return the user 3322 * @throws PortalException if a user with the primary key could not be found 3323 or if the new screen name was invalid 3324 * @throws SystemException if a system exception occurred 3325 */ 3326 public static com.liferay.portal.model.User updateScreenName(long userId, 3327 java.lang.String screenName) 3328 throws com.liferay.portal.kernel.exception.PortalException, 3329 com.liferay.portal.kernel.exception.SystemException { 3330 return getService().updateScreenName(userId, screenName); 3331 } 3332 3333 /** 3334 * Updates the user's workflow status. 3335 * 3336 * @param userId the primary key of the user 3337 * @param status the user's new workflow status 3338 * @return the user 3339 * @throws PortalException if a user with the primary key could not be 3340 found 3341 * @throws SystemException if a system exception occurred 3342 * @deprecated As of 7.0.0, replaced by {@link #updateStatus(long, int, 3343 ServiceContext)} 3344 */ 3345 public static com.liferay.portal.model.User updateStatus(long userId, 3346 int status) 3347 throws com.liferay.portal.kernel.exception.PortalException, 3348 com.liferay.portal.kernel.exception.SystemException { 3349 return getService().updateStatus(userId, status); 3350 } 3351 3352 /** 3353 * Updates the user's workflow status. 3354 * 3355 * @param userId the primary key of the user 3356 * @param status the user's new workflow status 3357 * @param serviceContext the service context to be applied. You can specify 3358 an unencrypted custom password (used by an LDAP listener) for the 3359 user via attribute <code>passwordUnencrypted</code>. 3360 * @return the user 3361 * @throws PortalException if a user with the primary key could not be found 3362 * @throws SystemException if a system exception occurred 3363 */ 3364 public static com.liferay.portal.model.User updateStatus(long userId, 3365 int status, com.liferay.portal.service.ServiceContext serviceContext) 3366 throws com.liferay.portal.kernel.exception.PortalException, 3367 com.liferay.portal.kernel.exception.SystemException { 3368 return getService().updateStatus(userId, status, serviceContext); 3369 } 3370 3371 /** 3372 * Updates the user. 3373 * 3374 * @param userId the primary key of the user 3375 * @param oldPassword the user's old password 3376 * @param newPassword1 the user's new password (optionally 3377 <code>null</code>) 3378 * @param newPassword2 the user's new password confirmation (optionally 3379 <code>null</code>) 3380 * @param passwordReset whether the user should be asked to reset their 3381 password the next time they login 3382 * @param reminderQueryQuestion the user's new password reset question 3383 * @param reminderQueryAnswer the user's new password reset answer 3384 * @param screenName the user's new screen name 3385 * @param emailAddress the user's new email address 3386 * @param facebookId the user's new Facebook ID 3387 * @param openId the user's new OpenID 3388 * @param languageId the user's new language ID 3389 * @param timeZoneId the user's new time zone ID 3390 * @param greeting the user's new greeting 3391 * @param comments the user's new comments 3392 * @param firstName the user's new first name 3393 * @param middleName the user's new middle name 3394 * @param lastName the user's new last name 3395 * @param prefixId the user's new name prefix ID 3396 * @param suffixId the user's new name suffix ID 3397 * @param male whether user is male 3398 * @param birthdayMonth the user's new birthday month (0-based, meaning 0 3399 for January) 3400 * @param birthdayDay the user's new birthday day 3401 * @param birthdayYear the user's birthday year 3402 * @param smsSn the user's new SMS screen name 3403 * @param aimSn the user's new AIM screen name 3404 * @param facebookSn the user's new Facebook screen name 3405 * @param icqSn the user's new ICQ screen name 3406 * @param jabberSn the user's new Jabber screen name 3407 * @param msnSn the user's new MSN screen name 3408 * @param mySpaceSn the user's new MySpace screen name 3409 * @param skypeSn the user's new Skype screen name 3410 * @param twitterSn the user's new Twitter screen name 3411 * @param ymSn the user's new Yahoo! Messenger screen name 3412 * @param jobTitle the user's new job title 3413 * @param groupIds the primary keys of the user's groups 3414 * @param organizationIds the primary keys of the user's organizations 3415 * @param roleIds the primary keys of the user's roles 3416 * @param userGroupRoles the user user's group roles 3417 * @param userGroupIds the primary keys of the user's user groups 3418 * @param serviceContext the service context to be applied (optionally 3419 <code>null</code>). Can set the UUID (with the <code>uuid</code> 3420 attribute), asset category IDs, asset tag names, and expando 3421 bridge attributes for the user. 3422 * @return the user 3423 * @throws PortalException if a user with the primary key could not be found 3424 or if the new information was invalid 3425 * @throws SystemException if a system exception occurred 3426 */ 3427 public static com.liferay.portal.model.User updateUser(long userId, 3428 java.lang.String oldPassword, java.lang.String newPassword1, 3429 java.lang.String newPassword2, boolean passwordReset, 3430 java.lang.String reminderQueryQuestion, 3431 java.lang.String reminderQueryAnswer, java.lang.String screenName, 3432 java.lang.String emailAddress, long facebookId, 3433 java.lang.String openId, java.lang.String languageId, 3434 java.lang.String timeZoneId, java.lang.String greeting, 3435 java.lang.String comments, java.lang.String firstName, 3436 java.lang.String middleName, java.lang.String lastName, int prefixId, 3437 int suffixId, boolean male, int birthdayMonth, int birthdayDay, 3438 int birthdayYear, java.lang.String smsSn, java.lang.String aimSn, 3439 java.lang.String facebookSn, java.lang.String icqSn, 3440 java.lang.String jabberSn, java.lang.String msnSn, 3441 java.lang.String mySpaceSn, java.lang.String skypeSn, 3442 java.lang.String twitterSn, java.lang.String ymSn, 3443 java.lang.String jobTitle, long[] groupIds, long[] organizationIds, 3444 long[] roleIds, 3445 java.util.List<com.liferay.portal.model.UserGroupRole> userGroupRoles, 3446 long[] userGroupIds, 3447 com.liferay.portal.service.ServiceContext serviceContext) 3448 throws com.liferay.portal.kernel.exception.PortalException, 3449 com.liferay.portal.kernel.exception.SystemException { 3450 return getService() 3451 .updateUser(userId, oldPassword, newPassword1, newPassword2, 3452 passwordReset, reminderQueryQuestion, reminderQueryAnswer, 3453 screenName, emailAddress, facebookId, openId, languageId, 3454 timeZoneId, greeting, comments, firstName, middleName, lastName, 3455 prefixId, suffixId, male, birthdayMonth, birthdayDay, birthdayYear, 3456 smsSn, aimSn, facebookSn, icqSn, jabberSn, msnSn, mySpaceSn, 3457 skypeSn, twitterSn, ymSn, jobTitle, groupIds, organizationIds, 3458 roleIds, userGroupRoles, userGroupIds, serviceContext); 3459 } 3460 3461 /** 3462 * Verifies the email address of the ticket. 3463 * 3464 * @param ticketKey the ticket key 3465 * @throws PortalException if a ticket matching the ticket key could not be 3466 found, if the ticket has expired, if the ticket is an email 3467 address ticket, or if the email address is invalid 3468 * @throws SystemException if a system exception occurred 3469 */ 3470 public static void verifyEmailAddress(java.lang.String ticketKey) 3471 throws com.liferay.portal.kernel.exception.PortalException, 3472 com.liferay.portal.kernel.exception.SystemException { 3473 getService().verifyEmailAddress(ticketKey); 3474 } 3475 3476 public static UserLocalService getService() { 3477 if (_service == null) { 3478 _service = (UserLocalService)PortalBeanLocatorUtil.locate(UserLocalService.class.getName()); 3479 3480 ReferenceRegistry.registerReference(UserLocalServiceUtil.class, 3481 "_service"); 3482 } 3483 3484 return _service; 3485 } 3486 3487 /** 3488 * @deprecated As of 6.2.0 3489 */ 3490 public void setService(UserLocalService service) { 3491 } 3492 3493 private static UserLocalService _service; 3494 }