001 /** 002 * Copyright (c) 2000-2011 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 with additional parameters. 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 addresses the user's addresses 157 * @param emailAddresses the user's email addresses 158 * @param phones the user's phone numbers 159 * @param websites the user's websites 160 * @param announcementsDelivers the announcements deliveries 161 * @param sendEmail whether to send the user an email notification about 162 their new account 163 * @param serviceContext the user's service context (optionally 164 <code>null</code>). Can set the universally unique identifier 165 (with the <code>uuid</code> attribute), asset category IDs, asset 166 tag names, and expando bridge attributes for the user. 167 * @return the new user 168 * @throws PortalException if the user's information was invalid, if the 169 creator did not have permission to add users, if the email 170 address was reserved, or some other portal exception occurred 171 * @throws SystemException if a system exception occurred 172 */ 173 public com.liferay.portal.model.User addUser(long companyId, 174 boolean autoPassword, java.lang.String password1, 175 java.lang.String password2, boolean autoScreenName, 176 java.lang.String screenName, java.lang.String emailAddress, 177 long facebookId, java.lang.String openId, java.util.Locale locale, 178 java.lang.String firstName, java.lang.String middleName, 179 java.lang.String lastName, int prefixId, int suffixId, boolean male, 180 int birthdayMonth, int birthdayDay, int birthdayYear, 181 java.lang.String jobTitle, long[] groupIds, long[] organizationIds, 182 long[] roleIds, long[] userGroupIds, 183 java.util.List<com.liferay.portal.model.Address> addresses, 184 java.util.List<com.liferay.portal.model.EmailAddress> emailAddresses, 185 java.util.List<com.liferay.portal.model.Phone> phones, 186 java.util.List<com.liferay.portal.model.Website> websites, 187 java.util.List<com.liferay.portlet.announcements.model.AnnouncementsDelivery> announcementsDelivers, 188 boolean sendEmail, 189 com.liferay.portal.service.ServiceContext serviceContext) 190 throws com.liferay.portal.kernel.exception.PortalException, 191 com.liferay.portal.kernel.exception.SystemException; 192 193 /** 194 * Adds a user. 195 * 196 * <p> 197 * This method handles the creation and bookkeeping of the user including 198 * its resources, metadata, and internal data structures. It is not 199 * necessary to make subsequent calls to any methods to setup default 200 * groups, resources, etc. 201 * </p> 202 * 203 * @param companyId the primary key of the user's company 204 * @param autoPassword whether a password should be automatically generated 205 for the user 206 * @param password1 the user's password 207 * @param password2 the user's password confirmation 208 * @param autoScreenName whether a screen name should be automatically 209 generated for the user 210 * @param screenName the user's screen name 211 * @param emailAddress the user's email address 212 * @param facebookId the user's facebook ID 213 * @param openId the user's OpenID 214 * @param locale the user's locale 215 * @param firstName the user's first name 216 * @param middleName the user's middle name 217 * @param lastName the user's last name 218 * @param prefixId the user's name prefix ID 219 * @param suffixId the user's name suffix ID 220 * @param male whether the user is male 221 * @param birthdayMonth the user's birthday month (0-based, meaning 0 for 222 January) 223 * @param birthdayDay the user's birthday day 224 * @param birthdayYear the user's birthday year 225 * @param jobTitle the user's job title 226 * @param groupIds the primary keys of the user's groups 227 * @param organizationIds the primary keys of the user's organizations 228 * @param roleIds the primary keys of the roles this user possesses 229 * @param userGroupIds the primary keys of the user's user groups 230 * @param sendEmail whether to send the user an email notification about 231 their new account 232 * @param serviceContext the user's service context (optionally 233 <code>null</code>). Can set the universally unique identifier 234 (with the <code>uuid</code> attribute), asset category IDs, asset 235 tag names, and expando bridge attributes for the user. 236 * @return the new user 237 * @throws PortalException if the user's information was invalid, if the 238 creator did not have permission to add users, or if the email 239 address was reserved 240 * @throws SystemException if a system exception occurred 241 */ 242 public com.liferay.portal.model.User addUser(long companyId, 243 boolean autoPassword, java.lang.String password1, 244 java.lang.String password2, boolean autoScreenName, 245 java.lang.String screenName, java.lang.String emailAddress, 246 long facebookId, java.lang.String openId, java.util.Locale locale, 247 java.lang.String firstName, java.lang.String middleName, 248 java.lang.String lastName, int prefixId, int suffixId, boolean male, 249 int birthdayMonth, int birthdayDay, int birthdayYear, 250 java.lang.String jobTitle, long[] groupIds, long[] organizationIds, 251 long[] roleIds, long[] userGroupIds, 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 a user with workflow and additional parameters. 258 * 259 * <p> 260 * This method handles the creation and bookkeeping of the user including 261 * its resources, metadata, and internal data structures. It is not 262 * necessary to make subsequent calls to any methods to setup default 263 * groups, resources, etc. 264 * </p> 265 * 266 * @param companyId the primary key of the user's company 267 * @param autoPassword whether a password should be automatically generated 268 for the user 269 * @param password1 the user's password 270 * @param password2 the user's password confirmation 271 * @param autoScreenName whether a screen name should be automatically 272 generated for the user 273 * @param screenName the user's screen name 274 * @param emailAddress the user's email address 275 * @param facebookId the user's facebook ID 276 * @param openId the user's OpenID 277 * @param locale the user's locale 278 * @param firstName the user's first name 279 * @param middleName the user's middle name 280 * @param lastName the user's last name 281 * @param prefixId the user's name prefix ID 282 * @param suffixId the user's name suffix ID 283 * @param male whether the user is male 284 * @param birthdayMonth the user's birthday month (0-based, meaning 0 for 285 January) 286 * @param birthdayDay the user's birthday day 287 * @param birthdayYear the user's birthday year 288 * @param jobTitle the user's job title 289 * @param groupIds the primary keys of the user's groups 290 * @param organizationIds the primary keys of the user's organizations 291 * @param roleIds the primary keys of the roles this user possesses 292 * @param userGroupIds the primary keys of the user's user groups 293 * @param addresses the user's addresses 294 * @param emailAddresses the user's email addresses 295 * @param phones the user's phone numbers 296 * @param websites the user's websites 297 * @param announcementsDelivers the announcements deliveries 298 * @param sendEmail whether to send the user an email notification about 299 their new account 300 * @param serviceContext the user's service context (optionally 301 <code>null</code>). Can set the universally unique identifier 302 (with the <code>uuid</code> attribute), asset category IDs, asset 303 tag names, and expando bridge attributes for the user. 304 * @return the new user 305 * @throws PortalException if the user's information was invalid, if the 306 creator did not have permission to add users, if the email 307 address was reserved, or some other portal exception occurred 308 * @throws SystemException if a system exception occurred 309 */ 310 public com.liferay.portal.model.User addUserWithWorkflow(long companyId, 311 boolean autoPassword, java.lang.String password1, 312 java.lang.String password2, boolean autoScreenName, 313 java.lang.String screenName, java.lang.String emailAddress, 314 long facebookId, java.lang.String openId, java.util.Locale locale, 315 java.lang.String firstName, java.lang.String middleName, 316 java.lang.String lastName, int prefixId, int suffixId, boolean male, 317 int birthdayMonth, int birthdayDay, int birthdayYear, 318 java.lang.String jobTitle, long[] groupIds, long[] organizationIds, 319 long[] roleIds, long[] userGroupIds, 320 java.util.List<com.liferay.portal.model.Address> addresses, 321 java.util.List<com.liferay.portal.model.EmailAddress> emailAddresses, 322 java.util.List<com.liferay.portal.model.Phone> phones, 323 java.util.List<com.liferay.portal.model.Website> websites, 324 java.util.List<com.liferay.portlet.announcements.model.AnnouncementsDelivery> announcementsDelivers, 325 boolean sendEmail, 326 com.liferay.portal.service.ServiceContext serviceContext) 327 throws com.liferay.portal.kernel.exception.PortalException, 328 com.liferay.portal.kernel.exception.SystemException; 329 330 /** 331 * Adds a user with workflow. 332 * 333 * <p> 334 * This method handles the creation and bookkeeping of the user including 335 * its resources, metadata, and internal data structures. It is not 336 * necessary to make subsequent calls to any methods to setup default 337 * groups, resources, etc. 338 * </p> 339 * 340 * @param companyId the primary key of the user's company 341 * @param autoPassword whether a password should be automatically generated 342 for the user 343 * @param password1 the user's password 344 * @param password2 the user's password confirmation 345 * @param autoScreenName whether a screen name should be automatically 346 generated for the user 347 * @param screenName the user's screen name 348 * @param emailAddress the user's email address 349 * @param facebookId the user's facebook ID 350 * @param openId the user's OpenID 351 * @param locale the user's locale 352 * @param firstName the user's first name 353 * @param middleName the user's middle name 354 * @param lastName the user's last name 355 * @param prefixId the user's name prefix ID 356 * @param suffixId the user's name suffix ID 357 * @param male whether the user is male 358 * @param birthdayMonth the user's birthday month (0-based, meaning 0 for 359 January) 360 * @param birthdayDay the user's birthday day 361 * @param birthdayYear the user's birthday year 362 * @param jobTitle the user's job title 363 * @param groupIds the primary keys of the user's groups 364 * @param organizationIds the primary keys of the user's organizations 365 * @param roleIds the primary keys of the roles this user possesses 366 * @param userGroupIds the primary keys of the user's user groups 367 * @param sendEmail whether to send the user an email notification about 368 their new account 369 * @param serviceContext the user's service context (optionally 370 <code>null</code>). Can set the universally unique identifier 371 (with the <code>uuid</code> attribute), asset category IDs, asset 372 tag names, and expando bridge attributes for the user. 373 * @return the new user 374 * @throws PortalException if the user's information was invalid, if the 375 creator did not have permission to add users, or if the email 376 address was reserved 377 * @throws SystemException if a system exception occurred 378 */ 379 public com.liferay.portal.model.User addUserWithWorkflow(long companyId, 380 boolean autoPassword, java.lang.String password1, 381 java.lang.String password2, boolean autoScreenName, 382 java.lang.String screenName, java.lang.String emailAddress, 383 long facebookId, java.lang.String openId, java.util.Locale locale, 384 java.lang.String firstName, java.lang.String middleName, 385 java.lang.String lastName, int prefixId, int suffixId, boolean male, 386 int birthdayMonth, int birthdayDay, int birthdayYear, 387 java.lang.String jobTitle, long[] groupIds, long[] organizationIds, 388 long[] roleIds, long[] userGroupIds, boolean sendEmail, 389 com.liferay.portal.service.ServiceContext serviceContext) 390 throws com.liferay.portal.kernel.exception.PortalException, 391 com.liferay.portal.kernel.exception.SystemException; 392 393 /** 394 * Adds the users to the user group. 395 * 396 * @param userGroupId the primary key of the user group 397 * @param userIds the primary keys of the users 398 * @throws PortalException if a user group or user with the primary could 399 could not be found, or if the current user did not have 400 permission to assign group members 401 * @throws SystemException if a system exception occurred 402 */ 403 public void addUserGroupUsers(long userGroupId, long[] userIds) 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 * Updates a user account that was automatically created when a guest user 629 * participated in an action (e.g. posting a comment) and only provided his 630 * name and email address. 631 * 632 * @param companyId the primary key of the user's company 633 * @param autoPassword whether a password should be automatically generated 634 for the user 635 * @param password1 the user's password 636 * @param password2 the user's password confirmation 637 * @param autoScreenName whether a screen name should be automatically 638 generated for the user 639 * @param screenName the user's screen name 640 * @param emailAddress the user's email address 641 * @param facebookId the user's facebook ID 642 * @param openId the user's OpenID 643 * @param locale the user's locale 644 * @param firstName the user's first name 645 * @param middleName the user's middle name 646 * @param lastName the user's last name 647 * @param prefixId the user's name prefix ID 648 * @param suffixId the user's name suffix ID 649 * @param male whether the user is male 650 * @param birthdayMonth the user's birthday month (0-based, meaning 0 for 651 January) 652 * @param birthdayDay the user's birthday day 653 * @param birthdayYear the user's birthday year 654 * @param jobTitle the user's job title 655 * @param updateUserInformation whether to update the user's information 656 * @param sendEmail whether to send the user an email notification about 657 their new account 658 * @param serviceContext the user's service context (optionally 659 <code>null</code>). Can set the expando bridge attributes for the 660 user. 661 * @return the user 662 * @throws PortalException if the user's information was invalid or if the 663 email address was reserved 664 * @throws SystemException if a system exception occurred 665 */ 666 public com.liferay.portal.model.User updateIncompleteUser(long companyId, 667 boolean autoPassword, java.lang.String password1, 668 java.lang.String password2, boolean autoScreenName, 669 java.lang.String screenName, java.lang.String emailAddress, 670 long facebookId, java.lang.String openId, java.util.Locale locale, 671 java.lang.String firstName, java.lang.String middleName, 672 java.lang.String lastName, int prefixId, int suffixId, boolean male, 673 int birthdayMonth, int birthdayDay, int birthdayYear, 674 java.lang.String jobTitle, boolean updateUserInformation, 675 boolean sendEmail, 676 com.liferay.portal.service.ServiceContext serviceContext) 677 throws com.liferay.portal.kernel.exception.PortalException, 678 com.liferay.portal.kernel.exception.SystemException; 679 680 /** 681 * Sets the users in the role, removing and adding users to the role as 682 * necessary. 683 * 684 * @param roleId the primary key of the role 685 * @param userIds the primary keys of the users 686 * @throws PortalException if the current user did not have permission to 687 assign role members 688 * @throws SystemException if a system exception occurred 689 */ 690 public void setRoleUsers(long roleId, long[] userIds) 691 throws com.liferay.portal.kernel.exception.PortalException, 692 com.liferay.portal.kernel.exception.SystemException; 693 694 /** 695 * Sets the users in the user group, removing and adding users to the user 696 * group as necessary. 697 * 698 * @param userGroupId the primary key of the user group 699 * @param userIds the primary keys of the users 700 * @throws PortalException if the current user did not have permission to 701 assign group members 702 * @throws SystemException if a system exception occurred 703 */ 704 public void setUserGroupUsers(long userGroupId, 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 group. 710 * 711 * @param groupId the primary key of the group 712 * @param userIds the primary keys of the users 713 * @throws PortalException if the current user did not have permission to 714 modify group assignments 715 * @throws SystemException if a system exception occurred 716 */ 717 public void unsetGroupUsers(long groupId, long[] userIds, 718 com.liferay.portal.service.ServiceContext serviceContext) 719 throws com.liferay.portal.kernel.exception.PortalException, 720 com.liferay.portal.kernel.exception.SystemException; 721 722 /** 723 * Removes the users from the organization. 724 * 725 * @param organizationId the primary key of the organization 726 * @param userIds the primary keys of the users 727 * @throws PortalException if the current user did not have permission to 728 modify organization assignments 729 * @throws SystemException if a system exception occurred 730 */ 731 public void unsetOrganizationUsers(long organizationId, long[] userIds) 732 throws com.liferay.portal.kernel.exception.PortalException, 733 com.liferay.portal.kernel.exception.SystemException; 734 735 /** 736 * Removes the users from the password policy. 737 * 738 * @param passwordPolicyId the primary key of the password policy 739 * @param userIds the primary keys of the users 740 * @throws PortalException if the current user did not have permission to 741 modify policy assignments 742 * @throws SystemException if a system exception occurred 743 */ 744 public void unsetPasswordPolicyUsers(long passwordPolicyId, long[] userIds) 745 throws com.liferay.portal.kernel.exception.PortalException, 746 com.liferay.portal.kernel.exception.SystemException; 747 748 /** 749 * Removes the users from the role. 750 * 751 * @param roleId the primary key of the role 752 * @param userIds the primary keys of the users 753 * @throws PortalException if the current user did not have permission to 754 modify role assignments 755 * @throws SystemException if a system exception occurred 756 */ 757 public void unsetRoleUsers(long roleId, long[] userIds) 758 throws com.liferay.portal.kernel.exception.PortalException, 759 com.liferay.portal.kernel.exception.SystemException; 760 761 /** 762 * Removes the users from the team. 763 * 764 * @param teamId the primary key of the team 765 * @param userIds the primary keys of the users 766 * @throws PortalException if the current user did not have permission to 767 modify team assignments 768 * @throws SystemException if a system exception occurred 769 */ 770 public void unsetTeamUsers(long teamId, long[] userIds) 771 throws com.liferay.portal.kernel.exception.PortalException, 772 com.liferay.portal.kernel.exception.SystemException; 773 774 /** 775 * Removes the users from the user group. 776 * 777 * @param userGroupId the primary key of the user group 778 * @param userIds the primary keys of the users 779 * @throws PortalException if the current user did not have permission to 780 modify user group assignments 781 * @throws SystemException if a system exception occurred 782 */ 783 public void unsetUserGroupUsers(long userGroupId, long[] userIds) 784 throws com.liferay.portal.kernel.exception.PortalException, 785 com.liferay.portal.kernel.exception.SystemException; 786 787 /** 788 * Updates the user's response to the terms of use agreement. 789 * 790 * @param userId the primary key of the user 791 * @param agreedToTermsOfUse whether the user has agree to the terms of use 792 * @return the user 793 * @throws PortalException if the current user did not have permission to 794 update the user's agreement to terms-of-use 795 * @throws SystemException if a system exception occurred 796 */ 797 public com.liferay.portal.model.User updateAgreedToTermsOfUse(long userId, 798 boolean agreedToTermsOfUse) 799 throws com.liferay.portal.kernel.exception.PortalException, 800 com.liferay.portal.kernel.exception.SystemException; 801 802 /** 803 * Updates the user's email address. 804 * 805 * @param userId the primary key of the user 806 * @param password the user's password 807 * @param emailAddress1 the user's new email address 808 * @param emailAddress2 the user's new email address confirmation 809 * @return the user 810 * @throws PortalException if a user with the primary key could not be found 811 or if the current user did not have permission to update the user 812 * @throws SystemException if a system exception occurred 813 */ 814 public com.liferay.portal.model.User updateEmailAddress(long userId, 815 java.lang.String password, java.lang.String emailAddress1, 816 java.lang.String emailAddress2, 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 }