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