001 /** 002 * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved. 003 * 004 * This library is free software; you can redistribute it and/or modify it under 005 * the terms of the GNU Lesser General Public License as published by the Free 006 * Software Foundation; either version 2.1 of the License, or (at your option) 007 * any later version. 008 * 009 * This library is distributed in the hope that it will be useful, but WITHOUT 010 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 011 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 012 * details. 013 */ 014 015 package com.liferay.portal.service; 016 017 import com.liferay.portal.kernel.exception.PortalException; 018 import com.liferay.portal.kernel.exception.SystemException; 019 import com.liferay.portal.kernel.jsonwebservice.JSONWebService; 020 import com.liferay.portal.kernel.transaction.Isolation; 021 import com.liferay.portal.kernel.transaction.Propagation; 022 import com.liferay.portal.kernel.transaction.Transactional; 023 024 /** 025 * The interface for the user remote service. 026 * 027 * <p> 028 * This is a remote service. Methods of this service are expected to have security checks based on the propagated JAAS credentials because this service can be accessed remotely. 029 * </p> 030 * 031 * @author Brian Wing Shun Chan 032 * @see UserServiceUtil 033 * @see com.liferay.portal.service.base.UserServiceBaseImpl 034 * @see com.liferay.portal.service.impl.UserServiceImpl 035 * @generated 036 */ 037 @JSONWebService 038 @Transactional(isolation = Isolation.PORTAL, rollbackFor = { 039 PortalException.class, SystemException.class}) 040 public interface UserService { 041 /* 042 * NOTE FOR DEVELOPERS: 043 * 044 * Never modify or reference this interface directly. Always use {@link UserServiceUtil} to access the user remote service. Add custom service methods to {@link com.liferay.portal.service.impl.UserServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface. 045 */ 046 047 /** 048 * Adds the users to the group. 049 * 050 * @param groupId the primary key of the group 051 * @param userIds the primary keys of the users 052 * @throws PortalException if a group or user with the primary key could not 053 be found, or if the user did not have permission to assign group 054 members 055 * @throws SystemException if a system exception occurred 056 */ 057 public void addGroupUsers(long groupId, long[] userIds, 058 com.liferay.portal.service.ServiceContext serviceContext) 059 throws com.liferay.portal.kernel.exception.PortalException, 060 com.liferay.portal.kernel.exception.SystemException; 061 062 /** 063 * Adds the users to the organization. 064 * 065 * @param organizationId the primary key of the organization 066 * @param userIds the primary keys of the users 067 * @throws PortalException if an organization or user with the primary key 068 could not be found, if the user did not have permission to assign 069 organization members, or if current user did not have an 070 organization in common with a given user 071 * @throws SystemException if a system exception occurred 072 */ 073 public void addOrganizationUsers(long organizationId, long[] userIds) 074 throws com.liferay.portal.kernel.exception.PortalException, 075 com.liferay.portal.kernel.exception.SystemException; 076 077 /** 078 * Assigns the password policy to the users, removing any other currently 079 * assigned password policies. 080 * 081 * @param passwordPolicyId the primary key of the password policy 082 * @param userIds the primary keys of the users 083 * @throws PortalException if the user did not have permission to assign 084 policy members 085 * @throws SystemException if a system exception occurred 086 */ 087 public void addPasswordPolicyUsers(long passwordPolicyId, long[] userIds) 088 throws com.liferay.portal.kernel.exception.PortalException, 089 com.liferay.portal.kernel.exception.SystemException; 090 091 /** 092 * Adds the users to the role. 093 * 094 * @param roleId the primary key of the role 095 * @param userIds the primary keys of the users 096 * @throws PortalException if a role or user with the primary key could not 097 be found or if the user did not have permission to assign role 098 members 099 * @throws SystemException if a system exception occurred 100 */ 101 public void addRoleUsers(long roleId, long[] userIds) 102 throws com.liferay.portal.kernel.exception.PortalException, 103 com.liferay.portal.kernel.exception.SystemException; 104 105 /** 106 * Adds the users to the team. 107 * 108 * @param teamId the primary key of the team 109 * @param userIds the primary keys of the users 110 * @throws PortalException if a team or user with the primary key could not 111 be found or if the user did not have permission to assign team 112 members 113 * @throws SystemException if a system exception occurred 114 */ 115 public void addTeamUsers(long teamId, long[] userIds) 116 throws com.liferay.portal.kernel.exception.PortalException, 117 com.liferay.portal.kernel.exception.SystemException; 118 119 /** 120 * Adds a user. 121 * 122 * <p> 123 * This method handles the creation and bookkeeping of the user including 124 * its resources, metadata, and internal data structures. It is not 125 * necessary to make subsequent calls to any methods to setup default 126 * groups, resources, etc. 127 * </p> 128 * 129 * @param companyId the primary key of the user's company 130 * @param autoPassword whether a password should be automatically generated 131 for the user 132 * @param password1 the user's password 133 * @param password2 the user's password confirmation 134 * @param autoScreenName whether a screen name should be automatically 135 generated for the user 136 * @param screenName the user's screen name 137 * @param emailAddress the user's email address 138 * @param facebookId the user's facebook ID 139 * @param openId the user's OpenID 140 * @param locale the user's locale 141 * @param firstName the user's first name 142 * @param middleName the user's middle name 143 * @param lastName the user's last name 144 * @param prefixId the user's name prefix ID 145 * @param suffixId the user's name suffix ID 146 * @param male whether the user is male 147 * @param birthdayMonth the user's birthday month (0-based, meaning 0 for 148 January) 149 * @param birthdayDay the user's birthday day 150 * @param birthdayYear the user's birthday year 151 * @param jobTitle the user's job title 152 * @param groupIds the primary keys of the user's groups 153 * @param organizationIds the primary keys of the user's organizations 154 * @param roleIds the primary keys of the roles this user possesses 155 * @param userGroupIds the primary keys of the user's user groups 156 * @param sendEmail whether to send the user an email notification about 157 their new account 158 * @param serviceContext the user's service context (optionally 159 <code>null</code>). Can set the universally unique identifier 160 (with the <code>uuid</code> attribute), asset category IDs, asset 161 tag names, and expando bridge attributes for the user. 162 * @return the new user 163 * @throws PortalException if the user's information was invalid, if the 164 creator did not have permission to add users, or if the email 165 address was reserved 166 * @throws SystemException if a system exception occurred 167 */ 168 public com.liferay.portal.model.User addUser(long companyId, 169 boolean autoPassword, java.lang.String password1, 170 java.lang.String password2, boolean autoScreenName, 171 java.lang.String screenName, java.lang.String emailAddress, 172 long facebookId, java.lang.String openId, java.util.Locale locale, 173 java.lang.String firstName, java.lang.String middleName, 174 java.lang.String lastName, int prefixId, int suffixId, boolean male, 175 int birthdayMonth, int birthdayDay, int birthdayYear, 176 java.lang.String jobTitle, long[] groupIds, long[] organizationIds, 177 long[] roleIds, long[] userGroupIds, boolean sendEmail, 178 com.liferay.portal.service.ServiceContext serviceContext) 179 throws com.liferay.portal.kernel.exception.PortalException, 180 com.liferay.portal.kernel.exception.SystemException; 181 182 /** 183 * Adds a user with additional parameters. 184 * 185 * <p> 186 * This method handles the creation and bookkeeping of the user including 187 * its resources, metadata, and internal data structures. It is not 188 * necessary to make subsequent calls to any methods to setup default 189 * groups, resources, etc. 190 * </p> 191 * 192 * @param companyId the primary key of the user's company 193 * @param autoPassword whether a password should be automatically generated 194 for the user 195 * @param password1 the user's password 196 * @param password2 the user's password confirmation 197 * @param autoScreenName whether a screen name should be automatically 198 generated for the user 199 * @param screenName the user's screen name 200 * @param emailAddress the user's email address 201 * @param facebookId the user's facebook ID 202 * @param openId the user's OpenID 203 * @param locale the user's locale 204 * @param firstName the user's first name 205 * @param middleName the user's middle name 206 * @param lastName the user's last name 207 * @param prefixId the user's name prefix ID 208 * @param suffixId the user's name suffix ID 209 * @param male whether the user is male 210 * @param birthdayMonth the user's birthday month (0-based, meaning 0 for 211 January) 212 * @param birthdayDay the user's birthday day 213 * @param birthdayYear the user's birthday year 214 * @param jobTitle the user's job title 215 * @param groupIds the primary keys of the user's groups 216 * @param organizationIds the primary keys of the user's organizations 217 * @param roleIds the primary keys of the roles this user possesses 218 * @param userGroupIds the primary keys of the user's user groups 219 * @param addresses the user's addresses 220 * @param emailAddresses the user's email addresses 221 * @param phones the user's phone numbers 222 * @param websites the user's websites 223 * @param announcementsDelivers the announcements deliveries 224 * @param sendEmail whether to send the user an email notification about 225 their new account 226 * @param serviceContext the user's service context (optionally 227 <code>null</code>). Can set the universally unique identifier 228 (with the <code>uuid</code> attribute), asset category IDs, asset 229 tag names, and expando bridge attributes for the user. 230 * @return the new user 231 * @throws PortalException if the user's information was invalid, if the 232 creator did not have permission to add users, if the email 233 address was reserved, or some other portal exception occurred 234 * @throws SystemException if a system exception occurred 235 */ 236 public com.liferay.portal.model.User addUser(long companyId, 237 boolean autoPassword, java.lang.String password1, 238 java.lang.String password2, boolean autoScreenName, 239 java.lang.String screenName, java.lang.String emailAddress, 240 long facebookId, java.lang.String openId, java.util.Locale locale, 241 java.lang.String firstName, java.lang.String middleName, 242 java.lang.String lastName, int prefixId, int suffixId, boolean male, 243 int birthdayMonth, int birthdayDay, int birthdayYear, 244 java.lang.String jobTitle, long[] groupIds, long[] organizationIds, 245 long[] roleIds, long[] userGroupIds, 246 java.util.List<com.liferay.portal.model.Address> addresses, 247 java.util.List<com.liferay.portal.model.EmailAddress> emailAddresses, 248 java.util.List<com.liferay.portal.model.Phone> phones, 249 java.util.List<com.liferay.portal.model.Website> websites, 250 java.util.List<com.liferay.portlet.announcements.model.AnnouncementsDelivery> announcementsDelivers, 251 boolean sendEmail, 252 com.liferay.portal.service.ServiceContext serviceContext) 253 throws com.liferay.portal.kernel.exception.PortalException, 254 com.liferay.portal.kernel.exception.SystemException; 255 256 /** 257 * Adds the users to the user group. 258 * 259 * @param userGroupId the primary key of the user group 260 * @param userIds the primary keys of the users 261 * @throws PortalException if a user group or user with the primary could 262 could not be found, or if the current user did not have 263 permission to assign group members 264 * @throws SystemException if a system exception occurred 265 */ 266 public void addUserGroupUsers(long userGroupId, long[] userIds) 267 throws com.liferay.portal.kernel.exception.PortalException, 268 com.liferay.portal.kernel.exception.SystemException; 269 270 /** 271 * Adds a user with workflow. 272 * 273 * <p> 274 * This method handles the creation and bookkeeping of the user including 275 * its resources, metadata, and internal data structures. It is not 276 * necessary to make subsequent calls to any methods to setup default 277 * groups, resources, etc. 278 * </p> 279 * 280 * @param companyId the primary key of the user's company 281 * @param autoPassword whether a password should be automatically generated 282 for the user 283 * @param password1 the user's password 284 * @param password2 the user's password confirmation 285 * @param autoScreenName whether a screen name should be automatically 286 generated for the user 287 * @param screenName the user's screen name 288 * @param emailAddress the user's email address 289 * @param facebookId the user's facebook ID 290 * @param openId the user's OpenID 291 * @param locale the user's locale 292 * @param firstName the user's first name 293 * @param middleName the user's middle name 294 * @param lastName the user's last name 295 * @param prefixId the user's name prefix ID 296 * @param suffixId the user's name suffix ID 297 * @param male whether the user is male 298 * @param birthdayMonth the user's birthday month (0-based, meaning 0 for 299 January) 300 * @param birthdayDay the user's birthday day 301 * @param birthdayYear the user's birthday year 302 * @param jobTitle the user's job title 303 * @param groupIds the primary keys of the user's groups 304 * @param organizationIds the primary keys of the user's organizations 305 * @param roleIds the primary keys of the roles this user possesses 306 * @param userGroupIds the primary keys of the user's user groups 307 * @param sendEmail whether to send the user an email notification about 308 their new account 309 * @param serviceContext the user's service context (optionally 310 <code>null</code>). Can set the universally unique identifier 311 (with the <code>uuid</code> attribute), asset category IDs, asset 312 tag names, and expando bridge attributes for the user. 313 * @return the new user 314 * @throws PortalException if the user's information was invalid, if the 315 creator did not have permission to add users, or if the email 316 address was reserved 317 * @throws SystemException if a system exception occurred 318 */ 319 public com.liferay.portal.model.User addUserWithWorkflow(long companyId, 320 boolean autoPassword, java.lang.String password1, 321 java.lang.String password2, boolean autoScreenName, 322 java.lang.String screenName, java.lang.String emailAddress, 323 long facebookId, java.lang.String openId, java.util.Locale locale, 324 java.lang.String firstName, java.lang.String middleName, 325 java.lang.String lastName, int prefixId, int suffixId, boolean male, 326 int birthdayMonth, int birthdayDay, int birthdayYear, 327 java.lang.String jobTitle, long[] groupIds, long[] organizationIds, 328 long[] roleIds, long[] userGroupIds, boolean sendEmail, 329 com.liferay.portal.service.ServiceContext serviceContext) 330 throws com.liferay.portal.kernel.exception.PortalException, 331 com.liferay.portal.kernel.exception.SystemException; 332 333 /** 334 * Adds a user with workflow and additional parameters. 335 * 336 * <p> 337 * This method handles the creation and bookkeeping of the user including 338 * its resources, metadata, and internal data structures. It is not 339 * necessary to make subsequent calls to any methods to setup default 340 * groups, resources, etc. 341 * </p> 342 * 343 * @param companyId the primary key of the user's company 344 * @param autoPassword whether a password should be automatically generated 345 for the user 346 * @param password1 the user's password 347 * @param password2 the user's password confirmation 348 * @param autoScreenName whether a screen name should be automatically 349 generated for the user 350 * @param screenName the user's screen name 351 * @param emailAddress the user's email address 352 * @param facebookId the user's facebook ID 353 * @param openId the user's OpenID 354 * @param locale the user's locale 355 * @param firstName the user's first name 356 * @param middleName the user's middle name 357 * @param lastName the user's last name 358 * @param prefixId the user's name prefix ID 359 * @param suffixId the user's name suffix ID 360 * @param male whether the user is male 361 * @param birthdayMonth the user's birthday month (0-based, meaning 0 for 362 January) 363 * @param birthdayDay the user's birthday day 364 * @param birthdayYear the user's birthday year 365 * @param jobTitle the user's job title 366 * @param groupIds the primary keys of the user's groups 367 * @param organizationIds the primary keys of the user's organizations 368 * @param roleIds the primary keys of the roles this user possesses 369 * @param userGroupIds the primary keys of the user's user groups 370 * @param addresses the user's addresses 371 * @param emailAddresses the user's email addresses 372 * @param phones the user's phone numbers 373 * @param websites the user's websites 374 * @param announcementsDelivers the announcements deliveries 375 * @param sendEmail whether to send the user an email notification about 376 their new account 377 * @param serviceContext the user's service context (optionally 378 <code>null</code>). Can set the universally unique identifier 379 (with the <code>uuid</code> attribute), asset category IDs, asset 380 tag names, and expando bridge attributes for the user. 381 * @return the new user 382 * @throws PortalException if the user's information was invalid, if the 383 creator did not have permission to add users, if the email 384 address was reserved, or some other portal exception occurred 385 * @throws SystemException if a system exception occurred 386 */ 387 public com.liferay.portal.model.User addUserWithWorkflow(long companyId, 388 boolean autoPassword, java.lang.String password1, 389 java.lang.String password2, boolean autoScreenName, 390 java.lang.String screenName, java.lang.String emailAddress, 391 long facebookId, java.lang.String openId, java.util.Locale locale, 392 java.lang.String firstName, java.lang.String middleName, 393 java.lang.String lastName, int prefixId, int suffixId, boolean male, 394 int birthdayMonth, int birthdayDay, int birthdayYear, 395 java.lang.String jobTitle, long[] groupIds, long[] organizationIds, 396 long[] roleIds, long[] userGroupIds, 397 java.util.List<com.liferay.portal.model.Address> addresses, 398 java.util.List<com.liferay.portal.model.EmailAddress> emailAddresses, 399 java.util.List<com.liferay.portal.model.Phone> phones, 400 java.util.List<com.liferay.portal.model.Website> websites, 401 java.util.List<com.liferay.portlet.announcements.model.AnnouncementsDelivery> announcementsDelivers, 402 boolean sendEmail, 403 com.liferay.portal.service.ServiceContext serviceContext) 404 throws com.liferay.portal.kernel.exception.PortalException, 405 com.liferay.portal.kernel.exception.SystemException; 406 407 /** 408 * Deletes the user's portrait image. 409 * 410 * @param userId the primary key of the user 411 * @throws PortalException if a user with the primary key could not be 412 found, if the user's portrait could not be found, or if the 413 current user did not have permission to update the user 414 * @throws SystemException if a system exception occurred 415 */ 416 public void deletePortrait(long userId) 417 throws com.liferay.portal.kernel.exception.PortalException, 418 com.liferay.portal.kernel.exception.SystemException; 419 420 /** 421 * Removes the user from the role. 422 * 423 * @param roleId the primary key of the role 424 * @param userId the primary key of the user 425 * @throws PortalException if a role or user with the primary key could not 426 be found, or if the current user did not have permission to 427 assign role members 428 * @throws SystemException if a system exception occurred 429 */ 430 public void deleteRoleUser(long roleId, long userId) 431 throws com.liferay.portal.kernel.exception.PortalException, 432 com.liferay.portal.kernel.exception.SystemException; 433 434 /** 435 * Deletes the user. 436 * 437 * @param userId the primary key of the user 438 * @throws PortalException if a user with the primary key could not be found 439 or if the current user did not have permission to delete the user 440 * @throws SystemException if a system exception occurred 441 */ 442 public void deleteUser(long userId) 443 throws com.liferay.portal.kernel.exception.PortalException, 444 com.liferay.portal.kernel.exception.SystemException; 445 446 /** 447 * Returns the primary key of the default user for the company. 448 * 449 * @param companyId the primary key of the company 450 * @return the primary key of the default user for the company 451 * @throws PortalException if a default user for the company could not be 452 found 453 * @throws SystemException if a system exception occurred 454 */ 455 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 456 public long getDefaultUserId(long companyId) 457 throws com.liferay.portal.kernel.exception.PortalException, 458 com.liferay.portal.kernel.exception.SystemException; 459 460 /** 461 * Returns the primary keys of all the users belonging to the group. 462 * 463 * @param groupId the primary key of the group 464 * @return the primary keys of the users belonging to the group 465 * @throws PortalException if the current user did not have permission to 466 view group assignments 467 * @throws SystemException if a system exception occurred 468 */ 469 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 470 public long[] getGroupUserIds(long groupId) 471 throws com.liferay.portal.kernel.exception.PortalException, 472 com.liferay.portal.kernel.exception.SystemException; 473 474 /** 475 * Returns the primary keys of all the users belonging to the organization. 476 * 477 * @param organizationId the primary key of the organization 478 * @return the primary keys of the users belonging to the organization 479 * @throws PortalException if the current user did not have permission to 480 view organization assignments 481 * @throws SystemException if a system exception occurred 482 */ 483 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 484 public long[] getOrganizationUserIds(long organizationId) 485 throws com.liferay.portal.kernel.exception.PortalException, 486 com.liferay.portal.kernel.exception.SystemException; 487 488 /** 489 * Returns the primary keys of all the users belonging to the role. 490 * 491 * @param roleId the primary key of the role 492 * @return the primary keys of the users belonging to the role 493 * @throws PortalException if the current user did not have permission to 494 view role members 495 * @throws SystemException if a system exception occurred 496 */ 497 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 498 public long[] getRoleUserIds(long roleId) 499 throws com.liferay.portal.kernel.exception.PortalException, 500 com.liferay.portal.kernel.exception.SystemException; 501 502 /** 503 * Returns the user with the email address. 504 * 505 * @param companyId the primary key of the user's company 506 * @param emailAddress the user's email address 507 * @return the user with the email address 508 * @throws PortalException if a user with the email address could not be 509 found or if the current user did not have permission to view the 510 user 511 * @throws SystemException if a system exception occurred 512 */ 513 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 514 public com.liferay.portal.model.User getUserByEmailAddress(long companyId, 515 java.lang.String emailAddress) 516 throws com.liferay.portal.kernel.exception.PortalException, 517 com.liferay.portal.kernel.exception.SystemException; 518 519 /** 520 * Returns the user with the primary key. 521 * 522 * @param userId the primary key of the user 523 * @return the user with the primary key 524 * @throws PortalException if a user with the primary key could not be found 525 or if the current user did not have permission to view the user 526 * @throws SystemException if a system exception occurred 527 */ 528 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 529 public com.liferay.portal.model.User getUserById(long userId) 530 throws com.liferay.portal.kernel.exception.PortalException, 531 com.liferay.portal.kernel.exception.SystemException; 532 533 /** 534 * Returns the user with the screen name. 535 * 536 * @param companyId the primary key of the user's company 537 * @param screenName the user's screen name 538 * @return the user with the screen name 539 * @throws PortalException if a user with the screen name could not be found 540 or if the current user did not have permission to veiw the user 541 * @throws SystemException if a system exception occurred 542 */ 543 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 544 public com.liferay.portal.model.User getUserByScreenName(long companyId, 545 java.lang.String screenName) 546 throws com.liferay.portal.kernel.exception.PortalException, 547 com.liferay.portal.kernel.exception.SystemException; 548 549 /** 550 * Returns the primary key of the user with the email address. 551 * 552 * @param companyId the primary key of the user's company 553 * @param emailAddress the user's email address 554 * @return the primary key of the user with the email address 555 * @throws PortalException if a user with the email address could not be 556 found 557 * @throws SystemException if a system exception occurred 558 */ 559 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 560 public long getUserIdByEmailAddress(long companyId, 561 java.lang.String emailAddress) 562 throws com.liferay.portal.kernel.exception.PortalException, 563 com.liferay.portal.kernel.exception.SystemException; 564 565 /** 566 * Returns the primary key of the user with the screen name. 567 * 568 * @param companyId the primary key of the user's company 569 * @param screenName the user's screen name 570 * @return the primary key of the user with the screen name 571 * @throws PortalException if a user with the screen name could not be found 572 * @throws SystemException if a system exception occurred 573 */ 574 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 575 public long getUserIdByScreenName(long companyId, 576 java.lang.String screenName) 577 throws com.liferay.portal.kernel.exception.PortalException, 578 com.liferay.portal.kernel.exception.SystemException; 579 580 /** 581 * Returns <code>true</code> if the user is a member of the group. 582 * 583 * @param groupId the primary key of the group 584 * @param userId the primary key of the user 585 * @return <code>true</code> if the user is a member of the group; 586 <code>false</code> otherwise 587 * @throws SystemException if a system exception occurred 588 */ 589 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 590 public boolean hasGroupUser(long groupId, long userId) 591 throws com.liferay.portal.kernel.exception.SystemException; 592 593 /** 594 * Returns <code>true</code> if the user is a member of the role. 595 * 596 * @param roleId the primary key of the role 597 * @param userId the primary key of the user 598 * @return <code>true</code> if the user is a member of the role; 599 <code>false</code> otherwise 600 * @throws SystemException if a system exception occurred 601 */ 602 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 603 public boolean hasRoleUser(long roleId, long userId) 604 throws com.liferay.portal.kernel.exception.SystemException; 605 606 /** 607 * Returns <code>true</code> if the user has the role with the name, 608 * optionally through inheritance. 609 * 610 * @param companyId the primary key of the role's company 611 * @param name the name of the role (must be a regular role, not an 612 organization, site or provider role) 613 * @param userId the primary key of the user 614 * @param inherited whether to include roles inherited from organizations, 615 sites, etc. 616 * @return <code>true</code> if the user has the role; <code>false</code> 617 otherwise 618 * @throws PortalException if a role with the name could not be found 619 * @throws SystemException if a system exception occurred 620 */ 621 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 622 public boolean hasRoleUser(long companyId, java.lang.String name, 623 long userId, boolean inherited) 624 throws com.liferay.portal.kernel.exception.PortalException, 625 com.liferay.portal.kernel.exception.SystemException; 626 627 /** 628 * Sets the users in the role, removing and adding users to the role as 629 * necessary. 630 * 631 * @param roleId the primary key of the role 632 * @param userIds the primary keys of the users 633 * @throws PortalException if the current user did not have permission to 634 assign role members 635 * @throws SystemException if a system exception occurred 636 */ 637 public void setRoleUsers(long roleId, long[] userIds) 638 throws com.liferay.portal.kernel.exception.PortalException, 639 com.liferay.portal.kernel.exception.SystemException; 640 641 /** 642 * Sets the users in the user group, removing and adding users to the user 643 * group as necessary. 644 * 645 * @param userGroupId the primary key of the user group 646 * @param userIds the primary keys of the users 647 * @throws PortalException if the current user did not have permission to 648 assign group members 649 * @throws SystemException if a system exception occurred 650 */ 651 public void setUserGroupUsers(long userGroupId, long[] userIds) 652 throws com.liferay.portal.kernel.exception.PortalException, 653 com.liferay.portal.kernel.exception.SystemException; 654 655 /** 656 * Removes the users from the group. 657 * 658 * @param groupId the primary key of the group 659 * @param userIds the primary keys of the users 660 * @throws PortalException if the current user did not have permission to 661 modify group assignments 662 * @throws SystemException if a system exception occurred 663 */ 664 public void unsetGroupUsers(long groupId, long[] userIds, 665 com.liferay.portal.service.ServiceContext serviceContext) 666 throws com.liferay.portal.kernel.exception.PortalException, 667 com.liferay.portal.kernel.exception.SystemException; 668 669 /** 670 * Removes the users from the organization. 671 * 672 * @param organizationId the primary key of the organization 673 * @param userIds the primary keys of the users 674 * @throws PortalException if the current user did not have permission to 675 modify organization assignments 676 * @throws SystemException if a system exception occurred 677 */ 678 public void unsetOrganizationUsers(long organizationId, long[] userIds) 679 throws com.liferay.portal.kernel.exception.PortalException, 680 com.liferay.portal.kernel.exception.SystemException; 681 682 /** 683 * Removes the users from the password policy. 684 * 685 * @param passwordPolicyId the primary key of the password policy 686 * @param userIds the primary keys of the users 687 * @throws PortalException if the current user did not have permission to 688 modify policy assignments 689 * @throws SystemException if a system exception occurred 690 */ 691 public void unsetPasswordPolicyUsers(long passwordPolicyId, long[] userIds) 692 throws com.liferay.portal.kernel.exception.PortalException, 693 com.liferay.portal.kernel.exception.SystemException; 694 695 /** 696 * Removes the users from the role. 697 * 698 * @param roleId the primary key of the role 699 * @param userIds the primary keys of the users 700 * @throws PortalException if the current user did not have permission to 701 modify role assignments 702 * @throws SystemException if a system exception occurred 703 */ 704 public void unsetRoleUsers(long roleId, long[] userIds) 705 throws com.liferay.portal.kernel.exception.PortalException, 706 com.liferay.portal.kernel.exception.SystemException; 707 708 /** 709 * Removes the users from the team. 710 * 711 * @param teamId the primary key of the team 712 * @param userIds the primary keys of the users 713 * @throws PortalException if the current user did not have permission to 714 modify team assignments 715 * @throws SystemException if a system exception occurred 716 */ 717 public void unsetTeamUsers(long teamId, long[] userIds) 718 throws com.liferay.portal.kernel.exception.PortalException, 719 com.liferay.portal.kernel.exception.SystemException; 720 721 /** 722 * Removes the users from the user group. 723 * 724 * @param userGroupId the primary key of the user group 725 * @param userIds the primary keys of the users 726 * @throws PortalException if the current user did not have permission to 727 modify user group assignments 728 * @throws SystemException if a system exception occurred 729 */ 730 public void unsetUserGroupUsers(long userGroupId, long[] userIds) 731 throws com.liferay.portal.kernel.exception.PortalException, 732 com.liferay.portal.kernel.exception.SystemException; 733 734 /** 735 * Updates the user's response to the terms of use agreement. 736 * 737 * @param userId the primary key of the user 738 * @param agreedToTermsOfUse whether the user has agree to the terms of use 739 * @return the user 740 * @throws PortalException if the current user did not have permission to 741 update the user's agreement to terms-of-use 742 * @throws SystemException if a system exception occurred 743 */ 744 public com.liferay.portal.model.User updateAgreedToTermsOfUse(long userId, 745 boolean agreedToTermsOfUse) 746 throws com.liferay.portal.kernel.exception.PortalException, 747 com.liferay.portal.kernel.exception.SystemException; 748 749 /** 750 * Updates the user's email address. 751 * 752 * @param userId the primary key of the user 753 * @param password the user's password 754 * @param emailAddress1 the user's new email address 755 * @param emailAddress2 the user's new email address confirmation 756 * @return the user 757 * @throws PortalException if a user with the primary key could not be found 758 or if the current user did not have permission to update the user 759 * @throws SystemException if a system exception occurred 760 */ 761 public com.liferay.portal.model.User updateEmailAddress(long userId, 762 java.lang.String password, java.lang.String emailAddress1, 763 java.lang.String emailAddress2, 764 com.liferay.portal.service.ServiceContext serviceContext) 765 throws com.liferay.portal.kernel.exception.PortalException, 766 com.liferay.portal.kernel.exception.SystemException; 767 768 /** 769 * Updates a user account that was automatically created when a guest user 770 * participated in an action (e.g. posting a comment) and only provided his 771 * name and email address. 772 * 773 * @param companyId the primary key of the user's company 774 * @param autoPassword whether a password should be automatically generated 775 for the user 776 * @param password1 the user's password 777 * @param password2 the user's password confirmation 778 * @param autoScreenName whether a screen name should be automatically 779 generated for the user 780 * @param screenName the user's screen name 781 * @param emailAddress the user's email address 782 * @param facebookId the user's facebook ID 783 * @param openId the user's OpenID 784 * @param locale the user's locale 785 * @param firstName the user's first name 786 * @param middleName the user's middle name 787 * @param lastName the user's last name 788 * @param prefixId the user's name prefix ID 789 * @param suffixId the user's name suffix ID 790 * @param male whether the user is male 791 * @param birthdayMonth the user's birthday month (0-based, meaning 0 for 792 January) 793 * @param birthdayDay the user's birthday day 794 * @param birthdayYear the user's birthday year 795 * @param jobTitle the user's job title 796 * @param updateUserInformation whether to update the user's information 797 * @param sendEmail whether to send the user an email notification about 798 their new account 799 * @param serviceContext the user's service context (optionally 800 <code>null</code>). Can set the expando bridge attributes for the 801 user. 802 * @return the user 803 * @throws PortalException if the user's information was invalid or if the 804 email address was reserved 805 * @throws SystemException if a system exception occurred 806 */ 807 public com.liferay.portal.model.User updateIncompleteUser(long companyId, 808 boolean autoPassword, java.lang.String password1, 809 java.lang.String password2, boolean autoScreenName, 810 java.lang.String screenName, java.lang.String emailAddress, 811 long facebookId, java.lang.String openId, java.util.Locale locale, 812 java.lang.String firstName, java.lang.String middleName, 813 java.lang.String lastName, int prefixId, int suffixId, boolean male, 814 int birthdayMonth, int birthdayDay, int birthdayYear, 815 java.lang.String jobTitle, boolean updateUserInformation, 816 boolean sendEmail, 817 com.liferay.portal.service.ServiceContext serviceContext) 818 throws com.liferay.portal.kernel.exception.PortalException, 819 com.liferay.portal.kernel.exception.SystemException; 820 821 /** 822 * Updates whether the user is locked out from logging in. 823 * 824 * @param userId the primary key of the user 825 * @param lockout whether the user is locked out 826 * @return the user 827 * @throws PortalException if the user did not have permission to lock out 828 the user 829 * @throws SystemException if a system exception occurred 830 */ 831 public com.liferay.portal.model.User updateLockoutById(long userId, 832 boolean lockout) 833 throws com.liferay.portal.kernel.exception.PortalException, 834 com.liferay.portal.kernel.exception.SystemException; 835 836 /** 837 * Updates the user's OpenID. 838 * 839 * @param userId the primary key of the user 840 * @param openId the new OpenID 841 * @return the user 842 * @throws PortalException if a user with the primary key could not be found 843 or if the current user did not have permission to update the user 844 * @throws SystemException if a system exception occurred 845 */ 846 public com.liferay.portal.model.User updateOpenId(long userId, 847 java.lang.String openId) 848 throws com.liferay.portal.kernel.exception.PortalException, 849 com.liferay.portal.kernel.exception.SystemException; 850 851 /** 852 * Sets the organizations that the user is in, removing and adding 853 * organizations as necessary. 854 * 855 * @param userId the primary key of the user 856 * @param organizationIds the primary keys of the organizations 857 * @throws PortalException if a user with the primary key could not be found 858 or if the current user did not have permission to update the user 859 * @throws SystemException if a system exception occurred 860 */ 861 public void updateOrganizations(long userId, long[] organizationIds, 862 com.liferay.portal.service.ServiceContext serviceContext) 863 throws com.liferay.portal.kernel.exception.PortalException, 864 com.liferay.portal.kernel.exception.SystemException; 865 866 /** 867 * Updates the user's password without tracking or validation of the change. 868 * 869 * @param userId the primary key of the user 870 * @param password1 the user's new password 871 * @param password2 the user's new password confirmation 872 * @param passwordReset whether the user should be asked to reset their 873 password the next time they log in 874 * @return the user 875 * @throws PortalException if a user with the primary key could not be found 876 or if the current user did not have permission to update the user 877 * @throws SystemException if a system exception occurred 878 */ 879 public com.liferay.portal.model.User updatePassword(long userId, 880 java.lang.String password1, java.lang.String password2, 881 boolean passwordReset) 882 throws com.liferay.portal.kernel.exception.PortalException, 883 com.liferay.portal.kernel.exception.SystemException; 884 885 /** 886 * Updates the user's portrait image. 887 * 888 * @param userId the primary key of the user 889 * @param bytes the new portrait image data 890 * @return the user 891 * @throws PortalException if a user with the primary key could not be 892 found, if the new portrait was invalid, or if the current user 893 did not have permission to update the user 894 * @throws SystemException if a system exception occurred 895 */ 896 public com.liferay.portal.model.User updatePortrait(long userId, 897 byte[] bytes) 898 throws com.liferay.portal.kernel.exception.PortalException, 899 com.liferay.portal.kernel.exception.SystemException; 900 901 /** 902 * Updates the user's password reset question and answer. 903 * 904 * @param userId the primary key of the user 905 * @param question the user's new password reset question 906 * @param answer the user's new password reset answer 907 * @return the user 908 * @throws PortalException if a user with the primary key could not be 909 found, if the new question or answer were invalid, or if the 910 current user did not have permission to update the user 911 * @throws SystemException if a system exception occurred 912 */ 913 public com.liferay.portal.model.User updateReminderQuery(long userId, 914 java.lang.String question, java.lang.String answer) 915 throws com.liferay.portal.kernel.exception.PortalException, 916 com.liferay.portal.kernel.exception.SystemException; 917 918 /** 919 * Updates the user's screen name. 920 * 921 * @param userId the primary key of the user 922 * @param screenName the user's new screen name 923 * @return the user 924 * @throws PortalException if a user with the primary key could not be 925 found, if the new screen name was invalid, or if the current user 926 did not have permission to update the user 927 * @throws SystemException if a system exception occurred 928 */ 929 public com.liferay.portal.model.User updateScreenName(long userId, 930 java.lang.String screenName) 931 throws com.liferay.portal.kernel.exception.PortalException, 932 com.liferay.portal.kernel.exception.SystemException; 933 934 /** 935 * Updates the user's workflow status. 936 * 937 * @param userId the primary key of the user 938 * @param status the user's new workflow status 939 * @return the user 940 * @throws PortalException if a user with the primary key could not be 941 found, if the current user was updating her own status to 942 anything but {@link WorkflowConstants.STATUS_APPROVED}, or if the 943 current user did not have permission to update the user's 944 workflow status. 945 * @throws SystemException if a system exception occurred 946 */ 947 public com.liferay.portal.model.User updateStatus(long userId, int status) 948 throws com.liferay.portal.kernel.exception.PortalException, 949 com.liferay.portal.kernel.exception.SystemException; 950 951 /** 952 * Updates the user with additional parameters. 953 * 954 * @param userId the primary key of the user 955 * @param oldPassword the user's old password 956 * @param newPassword1 the user's new password (optionally 957 <code>null</code>) 958 * @param newPassword2 the user's new password confirmation (optionally 959 <code>null</code>) 960 * @param passwordReset whether the user should be asked to reset their 961 password the next time they login 962 * @param reminderQueryQuestion the user's new password reset question 963 * @param reminderQueryAnswer the user's new password reset answer 964 * @param screenName the user's new screen name 965 * @param emailAddress the user's new email address 966 * @param facebookId the user's new Facebook ID 967 * @param openId the user's new OpenID 968 * @param languageId the user's new language ID 969 * @param timeZoneId the user's new time zone ID 970 * @param greeting the user's new greeting 971 * @param comments the user's new comments 972 * @param firstName the user's new first name 973 * @param middleName the user's new middle name 974 * @param lastName the user's new last name 975 * @param prefixId the user's new name prefix ID 976 * @param suffixId the user's new name suffix ID 977 * @param male whether user is male 978 * @param birthdayMonth the user's new birthday month (0-based, meaning 0 979 for January) 980 * @param birthdayDay the user's new birthday day 981 * @param birthdayYear the user's birthday year 982 * @param smsSn the user's new SMS screen name 983 * @param aimSn the user's new AIM screen name 984 * @param facebookSn the user's new Facebook screen name 985 * @param icqSn the user's new ICQ screen name 986 * @param jabberSn the user's new Jabber screen name 987 * @param msnSn the user's new MSN screen name 988 * @param mySpaceSn the user's new MySpace screen name 989 * @param skypeSn the user's new Skype screen name 990 * @param twitterSn the user's new Twitter screen name 991 * @param ymSn the user's new Yahoo! Messenger screen name 992 * @param jobTitle the user's new job title 993 * @param groupIds the primary keys of the user's groups 994 * @param organizationIds the primary keys of the user's organizations 995 * @param roleIds the primary keys of the user's roles 996 * @param userGroupRoles the user user's group roles 997 * @param userGroupIds the primary keys of the user's user groups 998 * @param addresses the user's addresses 999 * @param emailAddresses the user's email addresses 1000 * @param phones the user's phone numbers 1001 * @param websites the user's websites 1002 * @param announcementsDelivers the announcements deliveries 1003 * @param serviceContext the user's service context (optionally 1004 <code>null</code>). Can set the universally unique identifier 1005 (with the <code>uuid</code> attribute), asset category IDs, asset 1006 tag names, and expando bridge attributes for the user. 1007 * @return the user 1008 * @throws PortalException if a user with the primary key could not be 1009 found, if the new information was invalid, or if the current user 1010 did not have permission to update the user 1011 * @throws SystemException if a system exception occurred 1012 */ 1013 public com.liferay.portal.model.User updateUser(long userId, 1014 java.lang.String oldPassword, java.lang.String newPassword1, 1015 java.lang.String newPassword2, boolean passwordReset, 1016 java.lang.String reminderQueryQuestion, 1017 java.lang.String reminderQueryAnswer, java.lang.String screenName, 1018 java.lang.String emailAddress, long facebookId, 1019 java.lang.String openId, java.lang.String languageId, 1020 java.lang.String timeZoneId, java.lang.String greeting, 1021 java.lang.String comments, java.lang.String firstName, 1022 java.lang.String middleName, java.lang.String lastName, int prefixId, 1023 int suffixId, boolean male, int birthdayMonth, int birthdayDay, 1024 int birthdayYear, java.lang.String smsSn, java.lang.String aimSn, 1025 java.lang.String facebookSn, java.lang.String icqSn, 1026 java.lang.String jabberSn, java.lang.String msnSn, 1027 java.lang.String mySpaceSn, java.lang.String skypeSn, 1028 java.lang.String twitterSn, java.lang.String ymSn, 1029 java.lang.String jobTitle, long[] groupIds, long[] organizationIds, 1030 long[] roleIds, 1031 java.util.List<com.liferay.portal.model.UserGroupRole> userGroupRoles, 1032 long[] userGroupIds, 1033 java.util.List<com.liferay.portal.model.Address> addresses, 1034 java.util.List<com.liferay.portal.model.EmailAddress> emailAddresses, 1035 java.util.List<com.liferay.portal.model.Phone> phones, 1036 java.util.List<com.liferay.portal.model.Website> websites, 1037 java.util.List<com.liferay.portlet.announcements.model.AnnouncementsDelivery> announcementsDelivers, 1038 com.liferay.portal.service.ServiceContext serviceContext) 1039 throws com.liferay.portal.kernel.exception.PortalException, 1040 com.liferay.portal.kernel.exception.SystemException; 1041 1042 /** 1043 * Updates the user. 1044 * 1045 * @param userId the primary key of the user 1046 * @param oldPassword the user's old password 1047 * @param newPassword1 the user's new password (optionally 1048 <code>null</code>) 1049 * @param newPassword2 the user's new password confirmation (optionally 1050 <code>null</code>) 1051 * @param passwordReset whether the user should be asked to reset their 1052 password the next time they login 1053 * @param reminderQueryQuestion the user's new password reset question 1054 * @param reminderQueryAnswer the user's new password reset answer 1055 * @param screenName the user's new screen name 1056 * @param emailAddress the user's new email address 1057 * @param facebookId the user's new Facebook ID 1058 * @param openId the user's new OpenID 1059 * @param languageId the user's new language ID 1060 * @param timeZoneId the user's new time zone ID 1061 * @param greeting the user's new greeting 1062 * @param comments the user's new comments 1063 * @param firstName the user's new first name 1064 * @param middleName the user's new middle name 1065 * @param lastName the user's new last name 1066 * @param prefixId the user's new name prefix ID 1067 * @param suffixId the user's new name suffix ID 1068 * @param male whether user is male 1069 * @param birthdayMonth the user's new birthday month (0-based, meaning 0 1070 for January) 1071 * @param birthdayDay the user's new birthday day 1072 * @param birthdayYear the user's birthday year 1073 * @param smsSn the user's new SMS screen name 1074 * @param aimSn the user's new AIM screen name 1075 * @param facebookSn the user's new Facebook screen name 1076 * @param icqSn the user's new ICQ screen name 1077 * @param jabberSn the user's new Jabber screen name 1078 * @param msnSn the user's new MSN screen name 1079 * @param mySpaceSn the user's new MySpace screen name 1080 * @param skypeSn the user's new Skype screen name 1081 * @param twitterSn the user's new Twitter screen name 1082 * @param ymSn the user's new Yahoo! Messenger screen name 1083 * @param jobTitle the user's new job title 1084 * @param groupIds the primary keys of the user's groups 1085 * @param organizationIds the primary keys of the user's organizations 1086 * @param roleIds the primary keys of the user's roles 1087 * @param userGroupRoles the user user's group roles 1088 * @param userGroupIds the primary keys of the user's user groups 1089 * @param serviceContext the user's service context (optionally 1090 <code>null</code>). Can set the universally unique identifier 1091 (with the <code>uuid</code> attribute), asset category IDs, asset 1092 tag names, and expando bridge attributes for the user. 1093 * @return the user 1094 * @throws PortalException if a user with the primary key could not be 1095 found, if the new information was invalid, or if the current user 1096 did not have permission to update the user 1097 * @throws SystemException if a system exception occurred 1098 */ 1099 public com.liferay.portal.model.User updateUser(long userId, 1100 java.lang.String oldPassword, java.lang.String newPassword1, 1101 java.lang.String newPassword2, boolean passwordReset, 1102 java.lang.String reminderQueryQuestion, 1103 java.lang.String reminderQueryAnswer, java.lang.String screenName, 1104 java.lang.String emailAddress, long facebookId, 1105 java.lang.String openId, java.lang.String languageId, 1106 java.lang.String timeZoneId, java.lang.String greeting, 1107 java.lang.String comments, java.lang.String firstName, 1108 java.lang.String middleName, java.lang.String lastName, int prefixId, 1109 int suffixId, boolean male, int birthdayMonth, int birthdayDay, 1110 int birthdayYear, java.lang.String smsSn, java.lang.String aimSn, 1111 java.lang.String facebookSn, java.lang.String icqSn, 1112 java.lang.String jabberSn, java.lang.String msnSn, 1113 java.lang.String mySpaceSn, java.lang.String skypeSn, 1114 java.lang.String twitterSn, java.lang.String ymSn, 1115 java.lang.String jobTitle, long[] groupIds, long[] organizationIds, 1116 long[] roleIds, 1117 java.util.List<com.liferay.portal.model.UserGroupRole> userGroupRoles, 1118 long[] userGroupIds, 1119 com.liferay.portal.service.ServiceContext serviceContext) 1120 throws com.liferay.portal.kernel.exception.PortalException, 1121 com.liferay.portal.kernel.exception.SystemException; 1122 }