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