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