001 /** 002 * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved. 003 * 004 * This library is free software; you can redistribute it and/or modify it under 005 * the terms of the GNU Lesser General Public License as published by the Free 006 * Software Foundation; either version 2.1 of the License, or (at your option) 007 * any later version. 008 * 009 * This library is distributed in the hope that it will be useful, but WITHOUT 010 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 011 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 012 * details. 013 */ 014 015 package com.liferay.portal.service.http; 016 017 import aQute.bnd.annotation.ProviderType; 018 019 import com.liferay.portal.kernel.log.Log; 020 import com.liferay.portal.kernel.log.LogFactoryUtil; 021 import com.liferay.portal.kernel.util.LocaleUtil; 022 import com.liferay.portal.service.UserServiceUtil; 023 024 import java.rmi.RemoteException; 025 026 /** 027 * Provides the SOAP utility for the 028 * {@link com.liferay.portal.service.UserServiceUtil} service utility. The 029 * static methods of this class calls the same methods of the service utility. 030 * However, the signatures are different because it is difficult for SOAP to 031 * support certain types. 032 * 033 * <p> 034 * ServiceBuilder follows certain rules in translating the methods. For example, 035 * if the method in the service utility returns a {@link java.util.List}, that 036 * is translated to an array of {@link com.liferay.portal.model.UserSoap}. 037 * If the method in the service utility returns a 038 * {@link com.liferay.portal.model.User}, that is translated to a 039 * {@link com.liferay.portal.model.UserSoap}. Methods that SOAP cannot 040 * safely wire are skipped. 041 * </p> 042 * 043 * <p> 044 * The benefits of using the SOAP utility is that it is cross platform 045 * compatible. SOAP allows different languages like Java, .NET, C++, PHP, and 046 * even Perl, to call the generated services. One drawback of SOAP is that it is 047 * slow because it needs to serialize all calls into a text format (XML). 048 * </p> 049 * 050 * <p> 051 * You can see a list of services at http://localhost:8080/api/axis. Set the 052 * property <b>axis.servlet.hosts.allowed</b> in portal.properties to configure 053 * security. 054 * </p> 055 * 056 * <p> 057 * The SOAP utility is only generated for remote services. 058 * </p> 059 * 060 * @author Brian Wing Shun Chan 061 * @see UserServiceHttp 062 * @see com.liferay.portal.model.UserSoap 063 * @see com.liferay.portal.service.UserServiceUtil 064 * @generated 065 */ 066 @ProviderType 067 public class UserServiceSoap { 068 /** 069 * Adds the users to the group. 070 * 071 * @param groupId the primary key of the group 072 * @param userIds the primary keys of the users 073 * @param serviceContext the service context to be applied (optionally 074 <code>null</code>) 075 * @throws PortalException if a group or user with the primary key could not 076 be found, if the user did not have permission to assign group 077 members, or if the operation was not allowed by the membership 078 policy 079 * @throws SystemException if a system exception occurred 080 */ 081 public static void addGroupUsers(long groupId, long[] userIds, 082 com.liferay.portal.service.ServiceContext serviceContext) 083 throws RemoteException { 084 try { 085 UserServiceUtil.addGroupUsers(groupId, userIds, serviceContext); 086 } 087 catch (Exception e) { 088 _log.error(e, e); 089 090 throw new RemoteException(e.getMessage()); 091 } 092 } 093 094 /** 095 * Adds the users to the organization. 096 * 097 * @param organizationId the primary key of the organization 098 * @param userIds the primary keys of the users 099 * @throws PortalException if an organization or user with the primary key 100 could not be found, if the user did not have permission to assign 101 organization members, if current user did not have an 102 organization in common with a given user, or if the operation was 103 not allowed by the membership policy 104 * @throws SystemException if a system exception occurred 105 */ 106 public static void addOrganizationUsers(long organizationId, long[] userIds) 107 throws RemoteException { 108 try { 109 UserServiceUtil.addOrganizationUsers(organizationId, userIds); 110 } 111 catch (Exception e) { 112 _log.error(e, e); 113 114 throw new RemoteException(e.getMessage()); 115 } 116 } 117 118 /** 119 * Assigns the password policy to the users, removing any other currently 120 * assigned password policies. 121 * 122 * @param passwordPolicyId the primary key of the password policy 123 * @param userIds the primary keys of the users 124 * @throws PortalException if the user did not have permission to assign 125 policy members 126 * @throws SystemException if a system exception occurred 127 */ 128 public static void addPasswordPolicyUsers(long passwordPolicyId, 129 long[] userIds) throws RemoteException { 130 try { 131 UserServiceUtil.addPasswordPolicyUsers(passwordPolicyId, userIds); 132 } 133 catch (Exception e) { 134 _log.error(e, e); 135 136 throw new RemoteException(e.getMessage()); 137 } 138 } 139 140 /** 141 * Adds the users to the role. 142 * 143 * @param roleId the primary key of the role 144 * @param userIds the primary keys of the users 145 * @throws PortalException if a role or user with the primary key could not 146 be found, if the user did not have permission to assign role 147 members, or if the operation was not allowed by the membership 148 policy 149 * @throws SystemException if a system exception occurred 150 */ 151 public static void addRoleUsers(long roleId, long[] userIds) 152 throws RemoteException { 153 try { 154 UserServiceUtil.addRoleUsers(roleId, userIds); 155 } 156 catch (Exception e) { 157 _log.error(e, e); 158 159 throw new RemoteException(e.getMessage()); 160 } 161 } 162 163 /** 164 * Adds the users to the team. 165 * 166 * @param teamId the primary key of the team 167 * @param userIds the primary keys of the users 168 * @throws PortalException if a team or user with the primary key could not 169 be found or if the user did not have permission to assign team 170 members 171 * @throws SystemException if a system exception occurred 172 */ 173 public static void addTeamUsers(long teamId, long[] userIds) 174 throws RemoteException { 175 try { 176 UserServiceUtil.addTeamUsers(teamId, userIds); 177 } 178 catch (Exception e) { 179 _log.error(e, e); 180 181 throw new RemoteException(e.getMessage()); 182 } 183 } 184 185 /** 186 * Adds a user. 187 * 188 * <p> 189 * This method handles the creation and bookkeeping of the user including 190 * its resources, metadata, and internal data structures. It is not 191 * necessary to make subsequent calls to any methods to setup default 192 * groups, resources, etc. 193 * </p> 194 * 195 * @param companyId the primary key of the user's company 196 * @param autoPassword whether a password should be automatically generated 197 for the user 198 * @param password1 the user's password 199 * @param password2 the user's password confirmation 200 * @param autoScreenName whether a screen name should be automatically 201 generated for the user 202 * @param screenName the user's screen name 203 * @param emailAddress the user's email address 204 * @param facebookId the user's facebook ID 205 * @param openId the user's OpenID 206 * @param locale the user's locale 207 * @param firstName the user's first name 208 * @param middleName the user's middle name 209 * @param lastName the user's last name 210 * @param prefixId the user's name prefix ID 211 * @param suffixId the user's name suffix ID 212 * @param male whether the user is male 213 * @param birthdayMonth the user's birthday month (0-based, meaning 0 for 214 January) 215 * @param birthdayDay the user's birthday day 216 * @param birthdayYear the user's birthday year 217 * @param jobTitle the user's job title 218 * @param groupIds the primary keys of the user's groups 219 * @param organizationIds the primary keys of the user's organizations 220 * @param roleIds the primary keys of the roles this user possesses 221 * @param userGroupIds the primary keys of the user's user groups 222 * @param sendEmail whether to send the user an email notification about 223 their new account 224 * @param serviceContext the service context to be applied (optionally 225 <code>null</code>). Can set the UUID (with the <code>uuid</code> 226 attribute), asset category IDs, asset tag names, and expando 227 bridge attributes for the user. 228 * @return the new user 229 * @throws PortalException if the user's information was invalid, if the 230 operation was not allowed by the membership policy, if the 231 creator did not have permission to add users, or if the email 232 address was reserved 233 * @throws SystemException if a system exception occurred 234 */ 235 public static com.liferay.portal.model.UserSoap addUser(long companyId, 236 boolean autoPassword, java.lang.String password1, 237 java.lang.String password2, boolean autoScreenName, 238 java.lang.String screenName, java.lang.String emailAddress, 239 long facebookId, java.lang.String openId, String locale, 240 java.lang.String firstName, java.lang.String middleName, 241 java.lang.String lastName, int prefixId, int suffixId, boolean male, 242 int birthdayMonth, int birthdayDay, int birthdayYear, 243 java.lang.String jobTitle, long[] groupIds, long[] organizationIds, 244 long[] roleIds, long[] userGroupIds, boolean sendEmail, 245 com.liferay.portal.service.ServiceContext serviceContext) 246 throws RemoteException { 247 try { 248 com.liferay.portal.model.User returnValue = UserServiceUtil.addUser(companyId, 249 autoPassword, password1, password2, autoScreenName, 250 screenName, emailAddress, facebookId, openId, 251 LocaleUtil.fromLanguageId(locale), firstName, middleName, 252 lastName, prefixId, suffixId, male, birthdayMonth, 253 birthdayDay, birthdayYear, jobTitle, groupIds, 254 organizationIds, roleIds, userGroupIds, sendEmail, 255 serviceContext); 256 257 return com.liferay.portal.model.UserSoap.toSoapModel(returnValue); 258 } 259 catch (Exception e) { 260 _log.error(e, e); 261 262 throw new RemoteException(e.getMessage()); 263 } 264 } 265 266 /** 267 * Adds a user with additional parameters. 268 * 269 * <p> 270 * This method handles the creation and bookkeeping of the user including 271 * its resources, metadata, and internal data structures. It is not 272 * necessary to make subsequent calls to any methods to setup default 273 * groups, resources, etc. 274 * </p> 275 * 276 * @param companyId the primary key of the user's company 277 * @param autoPassword whether a password should be automatically generated 278 for the user 279 * @param password1 the user's password 280 * @param password2 the user's password confirmation 281 * @param autoScreenName whether a screen name should be automatically 282 generated for the user 283 * @param screenName the user's screen name 284 * @param emailAddress the user's email address 285 * @param facebookId the user's facebook ID 286 * @param openId the user's OpenID 287 * @param locale the user's locale 288 * @param firstName the user's first name 289 * @param middleName the user's middle name 290 * @param lastName the user's last name 291 * @param prefixId the user's name prefix ID 292 * @param suffixId the user's name suffix ID 293 * @param male whether the user is male 294 * @param birthdayMonth the user's birthday month (0-based, meaning 0 for 295 January) 296 * @param birthdayDay the user's birthday day 297 * @param birthdayYear the user's birthday year 298 * @param jobTitle the user's job title 299 * @param groupIds the primary keys of the user's groups 300 * @param organizationIds the primary keys of the user's organizations 301 * @param roleIds the primary keys of the roles this user possesses 302 * @param userGroupIds the primary keys of the user's user groups 303 * @param addresses the user's addresses 304 * @param emailAddresses the user's email addresses 305 * @param phones the user's phone numbers 306 * @param websites the user's websites 307 * @param announcementsDelivers the announcements deliveries 308 * @param sendEmail whether to send the user an email notification about 309 their new account 310 * @param serviceContext the service context to be applied (optionally 311 <code>null</code>). Can set the UUID (with the <code>uuid</code> 312 attribute), asset category IDs, asset tag names, and expando 313 bridge attributes for the user. 314 * @return the new user 315 * @throws PortalException if the user's information was invalid, if the 316 creator did not have permission to add users, if the email 317 address was reserved, if the operation was not allowed by the 318 membership policy, or if some other portal exception occurred 319 * @throws SystemException if a system exception occurred 320 */ 321 public static com.liferay.portal.model.UserSoap addUser(long companyId, 322 boolean autoPassword, java.lang.String password1, 323 java.lang.String password2, boolean autoScreenName, 324 java.lang.String screenName, java.lang.String emailAddress, 325 long facebookId, java.lang.String openId, String locale, 326 java.lang.String firstName, java.lang.String middleName, 327 java.lang.String lastName, int prefixId, int suffixId, boolean male, 328 int birthdayMonth, int birthdayDay, int birthdayYear, 329 java.lang.String jobTitle, long[] groupIds, long[] organizationIds, 330 long[] roleIds, long[] userGroupIds, 331 com.liferay.portal.model.AddressSoap[] addresses, 332 com.liferay.portal.model.EmailAddressSoap[] emailAddresses, 333 com.liferay.portal.model.PhoneSoap[] phones, 334 com.liferay.portal.model.WebsiteSoap[] websites, 335 com.liferay.portlet.announcements.model.AnnouncementsDeliverySoap[] announcementsDelivers, 336 boolean sendEmail, 337 com.liferay.portal.service.ServiceContext serviceContext) 338 throws RemoteException { 339 try { 340 com.liferay.portal.model.User returnValue = UserServiceUtil.addUser(companyId, 341 autoPassword, password1, password2, autoScreenName, 342 screenName, emailAddress, facebookId, openId, 343 LocaleUtil.fromLanguageId(locale), firstName, middleName, 344 lastName, prefixId, suffixId, male, birthdayMonth, 345 birthdayDay, birthdayYear, jobTitle, groupIds, 346 organizationIds, roleIds, userGroupIds, 347 com.liferay.portal.model.impl.AddressModelImpl.toModels( 348 addresses), 349 com.liferay.portal.model.impl.EmailAddressModelImpl.toModels( 350 emailAddresses), 351 com.liferay.portal.model.impl.PhoneModelImpl.toModels( 352 phones), 353 com.liferay.portal.model.impl.WebsiteModelImpl.toModels( 354 websites), 355 com.liferay.portlet.announcements.model.impl.AnnouncementsDeliveryModelImpl.toModels( 356 announcementsDelivers), sendEmail, serviceContext); 357 358 return com.liferay.portal.model.UserSoap.toSoapModel(returnValue); 359 } 360 catch (Exception e) { 361 _log.error(e, e); 362 363 throw new RemoteException(e.getMessage()); 364 } 365 } 366 367 /** 368 * Adds the users to the user group. 369 * 370 * @param userGroupId the primary key of the user group 371 * @param userIds the primary keys of the users 372 * @throws PortalException if a user group or user with the primary could 373 could not be found, if the current user did not have permission 374 to assign group members, or if the operation was not allowed by 375 the membership policy 376 * @throws SystemException if a system exception occurred 377 */ 378 public static void addUserGroupUsers(long userGroupId, long[] userIds) 379 throws RemoteException { 380 try { 381 UserServiceUtil.addUserGroupUsers(userGroupId, userIds); 382 } 383 catch (Exception e) { 384 _log.error(e, e); 385 386 throw new RemoteException(e.getMessage()); 387 } 388 } 389 390 /** 391 * Adds a user with workflow. 392 * 393 * <p> 394 * This method handles the creation and bookkeeping of the user including 395 * its resources, metadata, and internal data structures. It is not 396 * necessary to make subsequent calls to any methods to setup default 397 * groups, resources, etc. 398 * </p> 399 * 400 * @param companyId the primary key of the user's company 401 * @param autoPassword whether a password should be automatically generated 402 for the user 403 * @param password1 the user's password 404 * @param password2 the user's password confirmation 405 * @param autoScreenName whether a screen name should be automatically 406 generated for the user 407 * @param screenName the user's screen name 408 * @param emailAddress the user's email address 409 * @param facebookId the user's facebook ID 410 * @param openId the user's OpenID 411 * @param locale the user's locale 412 * @param firstName the user's first name 413 * @param middleName the user's middle name 414 * @param lastName the user's last name 415 * @param prefixId the user's name prefix ID 416 * @param suffixId the user's name suffix ID 417 * @param male whether the user is male 418 * @param birthdayMonth the user's birthday month (0-based, meaning 0 for 419 January) 420 * @param birthdayDay the user's birthday day 421 * @param birthdayYear the user's birthday year 422 * @param jobTitle the user's job title 423 * @param groupIds the primary keys of the user's groups 424 * @param organizationIds the primary keys of the user's organizations 425 * @param roleIds the primary keys of the roles this user possesses 426 * @param userGroupIds the primary keys of the user's user groups 427 * @param sendEmail whether to send the user an email notification about 428 their new account 429 * @param serviceContext the service context to be applied (optionally 430 <code>null</code>). Can set the UUID (with the <code>uuid</code> 431 attribute), asset category IDs, asset tag names, and expando 432 bridge attributes for the user. 433 * @return the new user 434 * @throws PortalException if the user's information was invalid, if the 435 operation was not allowed by the membership policy, if the 436 creator did not have permission to add users, or if the email 437 address was reserved 438 * @throws SystemException if a system exception occurred 439 */ 440 public static com.liferay.portal.model.UserSoap addUserWithWorkflow( 441 long companyId, boolean autoPassword, java.lang.String password1, 442 java.lang.String password2, boolean autoScreenName, 443 java.lang.String screenName, java.lang.String emailAddress, 444 long facebookId, java.lang.String openId, String locale, 445 java.lang.String firstName, java.lang.String middleName, 446 java.lang.String lastName, int prefixId, int suffixId, boolean male, 447 int birthdayMonth, int birthdayDay, int birthdayYear, 448 java.lang.String jobTitle, long[] groupIds, long[] organizationIds, 449 long[] roleIds, long[] userGroupIds, boolean sendEmail, 450 com.liferay.portal.service.ServiceContext serviceContext) 451 throws RemoteException { 452 try { 453 com.liferay.portal.model.User returnValue = UserServiceUtil.addUserWithWorkflow(companyId, 454 autoPassword, password1, password2, autoScreenName, 455 screenName, emailAddress, facebookId, openId, 456 LocaleUtil.fromLanguageId(locale), firstName, middleName, 457 lastName, prefixId, suffixId, male, birthdayMonth, 458 birthdayDay, birthdayYear, jobTitle, groupIds, 459 organizationIds, roleIds, userGroupIds, sendEmail, 460 serviceContext); 461 462 return com.liferay.portal.model.UserSoap.toSoapModel(returnValue); 463 } 464 catch (Exception e) { 465 _log.error(e, e); 466 467 throw new RemoteException(e.getMessage()); 468 } 469 } 470 471 /** 472 * Adds a user with workflow and additional parameters. 473 * 474 * <p> 475 * This method handles the creation and bookkeeping of the user including 476 * its resources, metadata, and internal data structures. It is not 477 * necessary to make subsequent calls to any methods to setup default 478 * groups, resources, etc. 479 * </p> 480 * 481 * @param companyId the primary key of the user's company 482 * @param autoPassword whether a password should be automatically generated 483 for the user 484 * @param password1 the user's password 485 * @param password2 the user's password confirmation 486 * @param autoScreenName whether a screen name should be automatically 487 generated for the user 488 * @param screenName the user's screen name 489 * @param emailAddress the user's email address 490 * @param facebookId the user's facebook ID 491 * @param openId the user's OpenID 492 * @param locale the user's locale 493 * @param firstName the user's first name 494 * @param middleName the user's middle name 495 * @param lastName the user's last name 496 * @param prefixId the user's name prefix ID 497 * @param suffixId the user's name suffix ID 498 * @param male whether the user is male 499 * @param birthdayMonth the user's birthday month (0-based, meaning 0 for 500 January) 501 * @param birthdayDay the user's birthday day 502 * @param birthdayYear the user's birthday year 503 * @param jobTitle the user's job title 504 * @param groupIds the primary keys of the user's groups 505 * @param organizationIds the primary keys of the user's organizations 506 * @param roleIds the primary keys of the roles this user possesses 507 * @param userGroupIds the primary keys of the user's user groups 508 * @param addresses the user's addresses 509 * @param emailAddresses the user's email addresses 510 * @param phones the user's phone numbers 511 * @param websites the user's websites 512 * @param announcementsDelivers the announcements deliveries 513 * @param sendEmail whether to send the user an email notification about 514 their new account 515 * @param serviceContext the service context to be applied (optionally 516 <code>null</code>). Can set the UUID (with the <code>uuid</code> 517 attribute), asset category IDs, asset tag names, and expando 518 bridge attributes for the user. 519 * @return the new user 520 * @throws PortalException if the user's information was invalid, if the 521 operation was not allowed by the membership policy, if the 522 creator did not have permission to add users, if the email 523 address was reserved, or if some other portal exception occurred 524 * @throws SystemException if a system exception occurred 525 */ 526 public static com.liferay.portal.model.UserSoap addUserWithWorkflow( 527 long companyId, boolean autoPassword, java.lang.String password1, 528 java.lang.String password2, boolean autoScreenName, 529 java.lang.String screenName, java.lang.String emailAddress, 530 long facebookId, java.lang.String openId, String locale, 531 java.lang.String firstName, java.lang.String middleName, 532 java.lang.String lastName, int prefixId, int suffixId, boolean male, 533 int birthdayMonth, int birthdayDay, int birthdayYear, 534 java.lang.String jobTitle, long[] groupIds, long[] organizationIds, 535 long[] roleIds, long[] userGroupIds, 536 com.liferay.portal.model.AddressSoap[] addresses, 537 com.liferay.portal.model.EmailAddressSoap[] emailAddresses, 538 com.liferay.portal.model.PhoneSoap[] phones, 539 com.liferay.portal.model.WebsiteSoap[] websites, 540 com.liferay.portlet.announcements.model.AnnouncementsDeliverySoap[] announcementsDelivers, 541 boolean sendEmail, 542 com.liferay.portal.service.ServiceContext serviceContext) 543 throws RemoteException { 544 try { 545 com.liferay.portal.model.User returnValue = UserServiceUtil.addUserWithWorkflow(companyId, 546 autoPassword, password1, password2, autoScreenName, 547 screenName, emailAddress, facebookId, openId, 548 LocaleUtil.fromLanguageId(locale), firstName, middleName, 549 lastName, prefixId, suffixId, male, birthdayMonth, 550 birthdayDay, birthdayYear, jobTitle, groupIds, 551 organizationIds, roleIds, userGroupIds, 552 com.liferay.portal.model.impl.AddressModelImpl.toModels( 553 addresses), 554 com.liferay.portal.model.impl.EmailAddressModelImpl.toModels( 555 emailAddresses), 556 com.liferay.portal.model.impl.PhoneModelImpl.toModels( 557 phones), 558 com.liferay.portal.model.impl.WebsiteModelImpl.toModels( 559 websites), 560 com.liferay.portlet.announcements.model.impl.AnnouncementsDeliveryModelImpl.toModels( 561 announcementsDelivers), sendEmail, serviceContext); 562 563 return com.liferay.portal.model.UserSoap.toSoapModel(returnValue); 564 } 565 catch (Exception e) { 566 _log.error(e, e); 567 568 throw new RemoteException(e.getMessage()); 569 } 570 } 571 572 /** 573 * Deletes the user's portrait image. 574 * 575 * @param userId the primary key of the user 576 * @throws PortalException if a user with the primary key could not be 577 found, if the user's portrait could not be found, or if the 578 current user did not have permission to update the user 579 * @throws SystemException if a system exception occurred 580 */ 581 public static void deletePortrait(long userId) throws RemoteException { 582 try { 583 UserServiceUtil.deletePortrait(userId); 584 } 585 catch (Exception e) { 586 _log.error(e, e); 587 588 throw new RemoteException(e.getMessage()); 589 } 590 } 591 592 /** 593 * Removes the user from the role. 594 * 595 * @param roleId the primary key of the role 596 * @param userId the primary key of the user 597 * @throws PortalException if a role or user with the primary key could not 598 be found, or if the current user did not have permission to 599 assign role members 600 * @throws SystemException if a system exception occurred 601 */ 602 public static void deleteRoleUser(long roleId, long userId) 603 throws RemoteException { 604 try { 605 UserServiceUtil.deleteRoleUser(roleId, userId); 606 } 607 catch (Exception e) { 608 _log.error(e, e); 609 610 throw new RemoteException(e.getMessage()); 611 } 612 } 613 614 /** 615 * Deletes the user. 616 * 617 * @param userId the primary key of the user 618 * @throws PortalException if a user with the primary key could not be found 619 or if the current user did not have permission to delete the user 620 * @throws SystemException if a system exception occurred 621 */ 622 public static void deleteUser(long userId) throws RemoteException { 623 try { 624 UserServiceUtil.deleteUser(userId); 625 } 626 catch (Exception e) { 627 _log.error(e, e); 628 629 throw new RemoteException(e.getMessage()); 630 } 631 } 632 633 public static com.liferay.portal.model.UserSoap[] getCompanyUsers( 634 long companyId, int start, int end) throws RemoteException { 635 try { 636 java.util.List<com.liferay.portal.model.User> returnValue = UserServiceUtil.getCompanyUsers(companyId, 637 start, end); 638 639 return com.liferay.portal.model.UserSoap.toSoapModels(returnValue); 640 } 641 catch (Exception e) { 642 _log.error(e, e); 643 644 throw new RemoteException(e.getMessage()); 645 } 646 } 647 648 public static int getCompanyUsersCount(long companyId) 649 throws RemoteException { 650 try { 651 int returnValue = UserServiceUtil.getCompanyUsersCount(companyId); 652 653 return returnValue; 654 } 655 catch (Exception e) { 656 _log.error(e, e); 657 658 throw new RemoteException(e.getMessage()); 659 } 660 } 661 662 /** 663 * Returns the primary keys of all the users belonging to the group. 664 * 665 * @param groupId the primary key of the group 666 * @return the primary keys of the users belonging to the group 667 * @throws PortalException if the current user did not have permission to 668 view group assignments 669 * @throws SystemException if a system exception occurred 670 */ 671 public static long[] getGroupUserIds(long groupId) 672 throws RemoteException { 673 try { 674 long[] returnValue = UserServiceUtil.getGroupUserIds(groupId); 675 676 return returnValue; 677 } 678 catch (Exception e) { 679 _log.error(e, e); 680 681 throw new RemoteException(e.getMessage()); 682 } 683 } 684 685 /** 686 * Returns all the users belonging to the group. 687 * 688 * @param groupId the primary key of the group 689 * @return the users belonging to the group 690 * @throws PortalException if the current user did not have permission to 691 view group assignments 692 * @throws SystemException if a system exception occurred 693 */ 694 public static com.liferay.portal.model.UserSoap[] getGroupUsers( 695 long groupId) throws RemoteException { 696 try { 697 java.util.List<com.liferay.portal.model.User> returnValue = UserServiceUtil.getGroupUsers(groupId); 698 699 return com.liferay.portal.model.UserSoap.toSoapModels(returnValue); 700 } 701 catch (Exception e) { 702 _log.error(e, e); 703 704 throw new RemoteException(e.getMessage()); 705 } 706 } 707 708 /** 709 * Returns the primary keys of all the users belonging to the organization. 710 * 711 * @param organizationId the primary key of the organization 712 * @return the primary keys of the users belonging to the organization 713 * @throws PortalException if the current user did not have permission to 714 view organization assignments 715 * @throws SystemException if a system exception occurred 716 */ 717 public static long[] getOrganizationUserIds(long organizationId) 718 throws RemoteException { 719 try { 720 long[] returnValue = UserServiceUtil.getOrganizationUserIds(organizationId); 721 722 return returnValue; 723 } 724 catch (Exception e) { 725 _log.error(e, e); 726 727 throw new RemoteException(e.getMessage()); 728 } 729 } 730 731 /** 732 * Returns all the users belonging to the organization. 733 * 734 * @param organizationId the primary key of the organization 735 * @return users belonging to the organization 736 * @throws PortalException if the current user did not have permission to 737 view organization assignments 738 * @throws SystemException if a system exception occurred 739 */ 740 public static com.liferay.portal.model.UserSoap[] getOrganizationUsers( 741 long organizationId) throws RemoteException { 742 try { 743 java.util.List<com.liferay.portal.model.User> returnValue = UserServiceUtil.getOrganizationUsers(organizationId); 744 745 return com.liferay.portal.model.UserSoap.toSoapModels(returnValue); 746 } 747 catch (Exception e) { 748 _log.error(e, e); 749 750 throw new RemoteException(e.getMessage()); 751 } 752 } 753 754 /** 755 * Returns the primary keys of all the users belonging to the role. 756 * 757 * @param roleId the primary key of the role 758 * @return the primary keys of the users belonging to the role 759 * @throws PortalException if the current user did not have permission to 760 view role members 761 * @throws SystemException if a system exception occurred 762 */ 763 public static long[] getRoleUserIds(long roleId) throws RemoteException { 764 try { 765 long[] returnValue = UserServiceUtil.getRoleUserIds(roleId); 766 767 return returnValue; 768 } 769 catch (Exception e) { 770 _log.error(e, e); 771 772 throw new RemoteException(e.getMessage()); 773 } 774 } 775 776 /** 777 * Returns the user with the email address. 778 * 779 * @param companyId the primary key of the user's company 780 * @param emailAddress the user's email address 781 * @return the user with the email address 782 * @throws PortalException if a user with the email address could not be 783 found or if the current user did not have permission to view the 784 user 785 * @throws SystemException if a system exception occurred 786 */ 787 public static com.liferay.portal.model.UserSoap getUserByEmailAddress( 788 long companyId, java.lang.String emailAddress) 789 throws RemoteException { 790 try { 791 com.liferay.portal.model.User returnValue = UserServiceUtil.getUserByEmailAddress(companyId, 792 emailAddress); 793 794 return com.liferay.portal.model.UserSoap.toSoapModel(returnValue); 795 } 796 catch (Exception e) { 797 _log.error(e, e); 798 799 throw new RemoteException(e.getMessage()); 800 } 801 } 802 803 /** 804 * Returns the user with the primary key. 805 * 806 * @param userId the primary key of the user 807 * @return the user with the primary key 808 * @throws PortalException if a user with the primary key could not be found 809 or if the current user did not have permission to view the user 810 * @throws SystemException if a system exception occurred 811 */ 812 public static com.liferay.portal.model.UserSoap getUserById(long userId) 813 throws RemoteException { 814 try { 815 com.liferay.portal.model.User returnValue = UserServiceUtil.getUserById(userId); 816 817 return com.liferay.portal.model.UserSoap.toSoapModel(returnValue); 818 } 819 catch (Exception e) { 820 _log.error(e, e); 821 822 throw new RemoteException(e.getMessage()); 823 } 824 } 825 826 /** 827 * Returns the user with the screen name. 828 * 829 * @param companyId the primary key of the user's company 830 * @param screenName the user's screen name 831 * @return the user with the screen name 832 * @throws PortalException if a user with the screen name could not be found 833 or if the current user did not have permission to view the user 834 * @throws SystemException if a system exception occurred 835 */ 836 public static com.liferay.portal.model.UserSoap getUserByScreenName( 837 long companyId, java.lang.String screenName) throws RemoteException { 838 try { 839 com.liferay.portal.model.User returnValue = UserServiceUtil.getUserByScreenName(companyId, 840 screenName); 841 842 return com.liferay.portal.model.UserSoap.toSoapModel(returnValue); 843 } 844 catch (Exception e) { 845 _log.error(e, e); 846 847 throw new RemoteException(e.getMessage()); 848 } 849 } 850 851 public static com.liferay.portal.model.UserSoap[] getUserGroupUsers( 852 long userGroupId) throws RemoteException { 853 try { 854 java.util.List<com.liferay.portal.model.User> returnValue = UserServiceUtil.getUserGroupUsers(userGroupId); 855 856 return com.liferay.portal.model.UserSoap.toSoapModels(returnValue); 857 } 858 catch (Exception e) { 859 _log.error(e, e); 860 861 throw new RemoteException(e.getMessage()); 862 } 863 } 864 865 /** 866 * Returns the primary key of the user with the email address. 867 * 868 * @param companyId the primary key of the user's company 869 * @param emailAddress the user's email address 870 * @return the primary key of the user with the email address 871 * @throws PortalException if a user with the email address could not be 872 found 873 * @throws SystemException if a system exception occurred 874 */ 875 public static long getUserIdByEmailAddress(long companyId, 876 java.lang.String emailAddress) throws RemoteException { 877 try { 878 long returnValue = UserServiceUtil.getUserIdByEmailAddress(companyId, 879 emailAddress); 880 881 return returnValue; 882 } 883 catch (Exception e) { 884 _log.error(e, e); 885 886 throw new RemoteException(e.getMessage()); 887 } 888 } 889 890 /** 891 * Returns the primary key of the user with the screen name. 892 * 893 * @param companyId the primary key of the user's company 894 * @param screenName the user's screen name 895 * @return the primary key of the user with the screen name 896 * @throws PortalException if a user with the screen name could not be found 897 * @throws SystemException if a system exception occurred 898 */ 899 public static long getUserIdByScreenName(long companyId, 900 java.lang.String screenName) throws RemoteException { 901 try { 902 long returnValue = UserServiceUtil.getUserIdByScreenName(companyId, 903 screenName); 904 905 return returnValue; 906 } 907 catch (Exception e) { 908 _log.error(e, e); 909 910 throw new RemoteException(e.getMessage()); 911 } 912 } 913 914 /** 915 * Returns <code>true</code> if the user is a member of the group. 916 * 917 * @param groupId the primary key of the group 918 * @param userId the primary key of the user 919 * @return <code>true</code> if the user is a member of the group; 920 <code>false</code> otherwise 921 * @throws PortalException if the current user did not have permission to 922 view the user or group members 923 * @throws SystemException if a system exception occurred 924 */ 925 public static boolean hasGroupUser(long groupId, long userId) 926 throws RemoteException { 927 try { 928 boolean returnValue = UserServiceUtil.hasGroupUser(groupId, userId); 929 930 return returnValue; 931 } 932 catch (Exception e) { 933 _log.error(e, e); 934 935 throw new RemoteException(e.getMessage()); 936 } 937 } 938 939 /** 940 * Returns <code>true</code> if the user is a member of the role. 941 * 942 * @param roleId the primary key of the role 943 * @param userId the primary key of the user 944 * @return <code>true</code> if the user is a member of the role; 945 <code>false</code> otherwise 946 * @throws PortalException if the current user did not have permission to 947 view the user or role members 948 * @throws SystemException if a system exception occurred 949 */ 950 public static boolean hasRoleUser(long roleId, long userId) 951 throws RemoteException { 952 try { 953 boolean returnValue = UserServiceUtil.hasRoleUser(roleId, userId); 954 955 return returnValue; 956 } 957 catch (Exception e) { 958 _log.error(e, e); 959 960 throw new RemoteException(e.getMessage()); 961 } 962 } 963 964 /** 965 * Returns <code>true</code> if the user has the role with the name, 966 * optionally through inheritance. 967 * 968 * @param companyId the primary key of the role's company 969 * @param name the name of the role (must be a regular role, not an 970 organization, site or provider role) 971 * @param userId the primary key of the user 972 * @param inherited whether to include roles inherited from organizations, 973 sites, etc. 974 * @return <code>true</code> if the user has the role; <code>false</code> 975 otherwise 976 * @throws PortalException if a role with the name could not be found 977 * @throws SystemException if a system exception occurred 978 */ 979 public static boolean hasRoleUser(long companyId, java.lang.String name, 980 long userId, boolean inherited) throws RemoteException { 981 try { 982 boolean returnValue = UserServiceUtil.hasRoleUser(companyId, name, 983 userId, inherited); 984 985 return returnValue; 986 } 987 catch (Exception e) { 988 _log.error(e, e); 989 990 throw new RemoteException(e.getMessage()); 991 } 992 } 993 994 /** 995 * Sets the users in the role, removing and adding users to the role as 996 * necessary. 997 * 998 * @param roleId the primary key of the role 999 * @param userIds the primary keys of the users 1000 * @throws PortalException if the current user did not have permission to 1001 assign role members or if the operation was not allowed by the 1002 membership policy 1003 * @throws SystemException if a system exception occurred 1004 */ 1005 public static void setRoleUsers(long roleId, long[] userIds) 1006 throws RemoteException { 1007 try { 1008 UserServiceUtil.setRoleUsers(roleId, userIds); 1009 } 1010 catch (Exception e) { 1011 _log.error(e, e); 1012 1013 throw new RemoteException(e.getMessage()); 1014 } 1015 } 1016 1017 /** 1018 * Sets the users in the user group, removing and adding users to the user 1019 * group as necessary. 1020 * 1021 * @param userGroupId the primary key of the user group 1022 * @param userIds the primary keys of the users 1023 * @throws PortalException if the current user did not have permission to 1024 assign group members 1025 * @throws SystemException if a system exception occurred 1026 */ 1027 public static void setUserGroupUsers(long userGroupId, long[] userIds) 1028 throws RemoteException { 1029 try { 1030 UserServiceUtil.setUserGroupUsers(userGroupId, userIds); 1031 } 1032 catch (Exception e) { 1033 _log.error(e, e); 1034 1035 throw new RemoteException(e.getMessage()); 1036 } 1037 } 1038 1039 /** 1040 * Removes the users from the teams of a group. 1041 * 1042 * @param groupId the primary key of the group 1043 * @param userIds the primary keys of the users 1044 * @throws PortalException if the current user did not have permission to 1045 modify user group assignments 1046 * @throws SystemException if a system exception occurred 1047 */ 1048 public static void unsetGroupTeamsUsers(long groupId, long[] userIds) 1049 throws RemoteException { 1050 try { 1051 UserServiceUtil.unsetGroupTeamsUsers(groupId, userIds); 1052 } 1053 catch (Exception e) { 1054 _log.error(e, e); 1055 1056 throw new RemoteException(e.getMessage()); 1057 } 1058 } 1059 1060 /** 1061 * Removes the users from the group. 1062 * 1063 * @param groupId the primary key of the group 1064 * @param userIds the primary keys of the users 1065 * @param serviceContext the service context to be applied (optionally 1066 <code>null</code>) 1067 * @throws PortalException if the current user did not have permission to 1068 modify group assignments or if the operation was not allowed by 1069 the membership policy 1070 * @throws SystemException if a system exception occurred 1071 */ 1072 public static void unsetGroupUsers(long groupId, long[] userIds, 1073 com.liferay.portal.service.ServiceContext serviceContext) 1074 throws RemoteException { 1075 try { 1076 UserServiceUtil.unsetGroupUsers(groupId, userIds, serviceContext); 1077 } 1078 catch (Exception e) { 1079 _log.error(e, e); 1080 1081 throw new RemoteException(e.getMessage()); 1082 } 1083 } 1084 1085 /** 1086 * Removes the users from the organization. 1087 * 1088 * @param organizationId the primary key of the organization 1089 * @param userIds the primary keys of the users 1090 * @throws PortalException if the current user did not have permission to 1091 modify organization assignments or if the operation was not 1092 allowed by the membership policy 1093 * @throws SystemException if a system exception occurred 1094 */ 1095 public static void unsetOrganizationUsers(long organizationId, 1096 long[] userIds) throws RemoteException { 1097 try { 1098 UserServiceUtil.unsetOrganizationUsers(organizationId, userIds); 1099 } 1100 catch (Exception e) { 1101 _log.error(e, e); 1102 1103 throw new RemoteException(e.getMessage()); 1104 } 1105 } 1106 1107 /** 1108 * Removes the users from the password policy. 1109 * 1110 * @param passwordPolicyId the primary key of the password policy 1111 * @param userIds the primary keys of the users 1112 * @throws PortalException if the current user did not have permission to 1113 modify policy assignments 1114 * @throws SystemException if a system exception occurred 1115 */ 1116 public static void unsetPasswordPolicyUsers(long passwordPolicyId, 1117 long[] userIds) throws RemoteException { 1118 try { 1119 UserServiceUtil.unsetPasswordPolicyUsers(passwordPolicyId, userIds); 1120 } 1121 catch (Exception e) { 1122 _log.error(e, e); 1123 1124 throw new RemoteException(e.getMessage()); 1125 } 1126 } 1127 1128 /** 1129 * Removes the users from the role. 1130 * 1131 * @param roleId the primary key of the role 1132 * @param userIds the primary keys of the users 1133 * @throws PortalException if the current user did not have permission to 1134 modify role assignments or if the operation was not allowed by 1135 the membership policy 1136 * @throws SystemException if a system exception occurred 1137 */ 1138 public static void unsetRoleUsers(long roleId, long[] userIds) 1139 throws RemoteException { 1140 try { 1141 UserServiceUtil.unsetRoleUsers(roleId, userIds); 1142 } 1143 catch (Exception e) { 1144 _log.error(e, e); 1145 1146 throw new RemoteException(e.getMessage()); 1147 } 1148 } 1149 1150 /** 1151 * Removes the users from the team. 1152 * 1153 * @param teamId the primary key of the team 1154 * @param userIds the primary keys of the users 1155 * @throws PortalException if the current user did not have permission to 1156 modify team assignments 1157 * @throws SystemException if a system exception occurred 1158 */ 1159 public static void unsetTeamUsers(long teamId, long[] userIds) 1160 throws RemoteException { 1161 try { 1162 UserServiceUtil.unsetTeamUsers(teamId, userIds); 1163 } 1164 catch (Exception e) { 1165 _log.error(e, e); 1166 1167 throw new RemoteException(e.getMessage()); 1168 } 1169 } 1170 1171 /** 1172 * Removes the users from the user group. 1173 * 1174 * @param userGroupId the primary key of the user group 1175 * @param userIds the primary keys of the users 1176 * @throws PortalException if the current user did not have permission to 1177 modify user group assignments or if the operation was not allowed 1178 by the membership policy 1179 * @throws SystemException if a system exception occurred 1180 */ 1181 public static void unsetUserGroupUsers(long userGroupId, long[] userIds) 1182 throws RemoteException { 1183 try { 1184 UserServiceUtil.unsetUserGroupUsers(userGroupId, userIds); 1185 } 1186 catch (Exception e) { 1187 _log.error(e, e); 1188 1189 throw new RemoteException(e.getMessage()); 1190 } 1191 } 1192 1193 /** 1194 * Updates the user's response to the terms of use agreement. 1195 * 1196 * @param userId the primary key of the user 1197 * @param agreedToTermsOfUse whether the user has agree to the terms of use 1198 * @return the user 1199 * @throws PortalException if the current user did not have permission to 1200 update the user's agreement to terms-of-use 1201 * @throws SystemException if a system exception occurred 1202 */ 1203 public static com.liferay.portal.model.UserSoap updateAgreedToTermsOfUse( 1204 long userId, boolean agreedToTermsOfUse) throws RemoteException { 1205 try { 1206 com.liferay.portal.model.User returnValue = UserServiceUtil.updateAgreedToTermsOfUse(userId, 1207 agreedToTermsOfUse); 1208 1209 return com.liferay.portal.model.UserSoap.toSoapModel(returnValue); 1210 } 1211 catch (Exception e) { 1212 _log.error(e, e); 1213 1214 throw new RemoteException(e.getMessage()); 1215 } 1216 } 1217 1218 /** 1219 * Updates the user's email address. 1220 * 1221 * @param userId the primary key of the user 1222 * @param password the user's password 1223 * @param emailAddress1 the user's new email address 1224 * @param emailAddress2 the user's new email address confirmation 1225 * @param serviceContext the service context to be applied. Must set the 1226 portal URL, main path, primary key of the layout, remote address, 1227 remote host, and agent for the user. 1228 * @return the user 1229 * @throws PortalException if a user with the primary key could not be found 1230 or if the current user did not have permission to update the user 1231 * @throws SystemException if a system exception occurred 1232 */ 1233 public static com.liferay.portal.model.UserSoap updateEmailAddress( 1234 long userId, java.lang.String password, java.lang.String emailAddress1, 1235 java.lang.String emailAddress2, 1236 com.liferay.portal.service.ServiceContext serviceContext) 1237 throws RemoteException { 1238 try { 1239 com.liferay.portal.model.User returnValue = UserServiceUtil.updateEmailAddress(userId, 1240 password, emailAddress1, emailAddress2, serviceContext); 1241 1242 return com.liferay.portal.model.UserSoap.toSoapModel(returnValue); 1243 } 1244 catch (Exception e) { 1245 _log.error(e, e); 1246 1247 throw new RemoteException(e.getMessage()); 1248 } 1249 } 1250 1251 /** 1252 * Updates a user account that was automatically created when a guest user 1253 * participated in an action (e.g. posting a comment) and only provided his 1254 * name and email address. 1255 * 1256 * @param companyId the primary key of the user's company 1257 * @param autoPassword whether a password should be automatically generated 1258 for the user 1259 * @param password1 the user's password 1260 * @param password2 the user's password confirmation 1261 * @param autoScreenName whether a screen name should be automatically 1262 generated for the user 1263 * @param screenName the user's screen name 1264 * @param emailAddress the user's email address 1265 * @param facebookId the user's facebook ID 1266 * @param openId the user's OpenID 1267 * @param locale the user's locale 1268 * @param firstName the user's first name 1269 * @param middleName the user's middle name 1270 * @param lastName the user's last name 1271 * @param prefixId the user's name prefix ID 1272 * @param suffixId the user's name suffix ID 1273 * @param male whether the user is male 1274 * @param birthdayMonth the user's birthday month (0-based, meaning 0 for 1275 January) 1276 * @param birthdayDay the user's birthday day 1277 * @param birthdayYear the user's birthday year 1278 * @param jobTitle the user's job title 1279 * @param updateUserInformation whether to update the user's information 1280 * @param sendEmail whether to send the user an email notification about 1281 their new account 1282 * @param serviceContext the service context to be applied (optionally 1283 <code>null</code>). Can set the expando bridge attributes for the 1284 user. 1285 * @return the user 1286 * @throws PortalException if the user's information was invalid or if the 1287 email address was reserved 1288 * @throws SystemException if a system exception occurred 1289 */ 1290 public static com.liferay.portal.model.UserSoap updateIncompleteUser( 1291 long companyId, boolean autoPassword, java.lang.String password1, 1292 java.lang.String password2, boolean autoScreenName, 1293 java.lang.String screenName, java.lang.String emailAddress, 1294 long facebookId, java.lang.String openId, String locale, 1295 java.lang.String firstName, java.lang.String middleName, 1296 java.lang.String lastName, int prefixId, int suffixId, boolean male, 1297 int birthdayMonth, int birthdayDay, int birthdayYear, 1298 java.lang.String jobTitle, boolean updateUserInformation, 1299 boolean sendEmail, 1300 com.liferay.portal.service.ServiceContext serviceContext) 1301 throws RemoteException { 1302 try { 1303 com.liferay.portal.model.User returnValue = UserServiceUtil.updateIncompleteUser(companyId, 1304 autoPassword, password1, password2, autoScreenName, 1305 screenName, emailAddress, facebookId, openId, 1306 LocaleUtil.fromLanguageId(locale), firstName, middleName, 1307 lastName, prefixId, suffixId, male, birthdayMonth, 1308 birthdayDay, birthdayYear, jobTitle, updateUserInformation, 1309 sendEmail, serviceContext); 1310 1311 return com.liferay.portal.model.UserSoap.toSoapModel(returnValue); 1312 } 1313 catch (Exception e) { 1314 _log.error(e, e); 1315 1316 throw new RemoteException(e.getMessage()); 1317 } 1318 } 1319 1320 /** 1321 * Updates whether the user is locked out from logging in. 1322 * 1323 * @param userId the primary key of the user 1324 * @param lockout whether the user is locked out 1325 * @return the user 1326 * @throws PortalException if the user did not have permission to lock out 1327 the user 1328 * @throws SystemException if a system exception occurred 1329 */ 1330 public static com.liferay.portal.model.UserSoap updateLockoutById( 1331 long userId, boolean lockout) throws RemoteException { 1332 try { 1333 com.liferay.portal.model.User returnValue = UserServiceUtil.updateLockoutById(userId, 1334 lockout); 1335 1336 return com.liferay.portal.model.UserSoap.toSoapModel(returnValue); 1337 } 1338 catch (Exception e) { 1339 _log.error(e, e); 1340 1341 throw new RemoteException(e.getMessage()); 1342 } 1343 } 1344 1345 /** 1346 * Updates the user's OpenID. 1347 * 1348 * @param userId the primary key of the user 1349 * @param openId the new OpenID 1350 * @return the user 1351 * @throws PortalException if a user with the primary key could not be found 1352 or if the current user did not have permission to update the user 1353 * @throws SystemException if a system exception occurred 1354 */ 1355 public static com.liferay.portal.model.UserSoap updateOpenId(long userId, 1356 java.lang.String openId) throws RemoteException { 1357 try { 1358 com.liferay.portal.model.User returnValue = UserServiceUtil.updateOpenId(userId, 1359 openId); 1360 1361 return com.liferay.portal.model.UserSoap.toSoapModel(returnValue); 1362 } 1363 catch (Exception e) { 1364 _log.error(e, e); 1365 1366 throw new RemoteException(e.getMessage()); 1367 } 1368 } 1369 1370 /** 1371 * Sets the organizations that the user is in, removing and adding 1372 * organizations as necessary. 1373 * 1374 * @param userId the primary key of the user 1375 * @param organizationIds the primary keys of the organizations 1376 * @param serviceContext the service context to be applied. Must set 1377 whether user indexing is enabled. 1378 * @throws PortalException if a user with the primary key could not be found 1379 or if the current user did not have permission to update the user 1380 * @throws SystemException if a system exception occurred 1381 */ 1382 public static void updateOrganizations(long userId, long[] organizationIds, 1383 com.liferay.portal.service.ServiceContext serviceContext) 1384 throws RemoteException { 1385 try { 1386 UserServiceUtil.updateOrganizations(userId, organizationIds, 1387 serviceContext); 1388 } 1389 catch (Exception e) { 1390 _log.error(e, e); 1391 1392 throw new RemoteException(e.getMessage()); 1393 } 1394 } 1395 1396 /** 1397 * Updates the user's password without tracking or validation of the change. 1398 * 1399 * @param userId the primary key of the user 1400 * @param password1 the user's new password 1401 * @param password2 the user's new password confirmation 1402 * @param passwordReset whether the user should be asked to reset their 1403 password the next time they log in 1404 * @return the user 1405 * @throws PortalException if a user with the primary key could not be found 1406 or if the current user did not have permission to update the user 1407 * @throws SystemException if a system exception occurred 1408 */ 1409 public static com.liferay.portal.model.UserSoap updatePassword( 1410 long userId, java.lang.String password1, java.lang.String password2, 1411 boolean passwordReset) throws RemoteException { 1412 try { 1413 com.liferay.portal.model.User returnValue = UserServiceUtil.updatePassword(userId, 1414 password1, password2, passwordReset); 1415 1416 return com.liferay.portal.model.UserSoap.toSoapModel(returnValue); 1417 } 1418 catch (Exception e) { 1419 _log.error(e, e); 1420 1421 throw new RemoteException(e.getMessage()); 1422 } 1423 } 1424 1425 /** 1426 * Updates the user's portrait image. 1427 * 1428 * @param userId the primary key of the user 1429 * @param bytes the new portrait image data 1430 * @return the user 1431 * @throws PortalException if a user with the primary key could not be 1432 found, if the new portrait was invalid, or if the current user 1433 did not have permission to update the user 1434 * @throws SystemException if a system exception occurred 1435 */ 1436 public static com.liferay.portal.model.UserSoap updatePortrait( 1437 long userId, byte[] bytes) throws RemoteException { 1438 try { 1439 com.liferay.portal.model.User returnValue = UserServiceUtil.updatePortrait(userId, 1440 bytes); 1441 1442 return com.liferay.portal.model.UserSoap.toSoapModel(returnValue); 1443 } 1444 catch (Exception e) { 1445 _log.error(e, e); 1446 1447 throw new RemoteException(e.getMessage()); 1448 } 1449 } 1450 1451 /** 1452 * Updates the user's password reset question and answer. 1453 * 1454 * @param userId the primary key of the user 1455 * @param question the user's new password reset question 1456 * @param answer the user's new password reset answer 1457 * @return the user 1458 * @throws PortalException if a user with the primary key could not be 1459 found, if the new question or answer were invalid, or if the 1460 current user did not have permission to update the user 1461 * @throws SystemException if a system exception occurred 1462 */ 1463 public static com.liferay.portal.model.UserSoap updateReminderQuery( 1464 long userId, java.lang.String question, java.lang.String answer) 1465 throws RemoteException { 1466 try { 1467 com.liferay.portal.model.User returnValue = UserServiceUtil.updateReminderQuery(userId, 1468 question, answer); 1469 1470 return com.liferay.portal.model.UserSoap.toSoapModel(returnValue); 1471 } 1472 catch (Exception e) { 1473 _log.error(e, e); 1474 1475 throw new RemoteException(e.getMessage()); 1476 } 1477 } 1478 1479 /** 1480 * Updates the user's screen name. 1481 * 1482 * @param userId the primary key of the user 1483 * @param screenName the user's new screen name 1484 * @return the user 1485 * @throws PortalException if a user with the primary key could not be 1486 found, if the new screen name was invalid, or if the current user 1487 did not have permission to update the user 1488 * @throws SystemException if a system exception occurred 1489 */ 1490 public static com.liferay.portal.model.UserSoap updateScreenName( 1491 long userId, java.lang.String screenName) throws RemoteException { 1492 try { 1493 com.liferay.portal.model.User returnValue = UserServiceUtil.updateScreenName(userId, 1494 screenName); 1495 1496 return com.liferay.portal.model.UserSoap.toSoapModel(returnValue); 1497 } 1498 catch (Exception e) { 1499 _log.error(e, e); 1500 1501 throw new RemoteException(e.getMessage()); 1502 } 1503 } 1504 1505 /** 1506 * Updates the user's workflow status. 1507 * 1508 * @param userId the primary key of the user 1509 * @param status the user's new workflow status 1510 * @return the user 1511 * @throws PortalException if a user with the primary key could not be 1512 found, if the current user was updating her own status to 1513 anything but {@link 1514 com.liferay.portal.kernel.workflow.WorkflowConstants#STATUS_APPROVED}, 1515 or if the current user did not have permission to update the 1516 user's workflow status. 1517 * @throws SystemException if a system exception occurred 1518 * @deprecated As of 7.0.0, replaced by {@link #updateStatus(long, int, 1519 ServiceContext)} 1520 */ 1521 public static com.liferay.portal.model.UserSoap updateStatus(long userId, 1522 int status) throws RemoteException { 1523 try { 1524 com.liferay.portal.model.User returnValue = UserServiceUtil.updateStatus(userId, 1525 status); 1526 1527 return com.liferay.portal.model.UserSoap.toSoapModel(returnValue); 1528 } 1529 catch (Exception e) { 1530 _log.error(e, e); 1531 1532 throw new RemoteException(e.getMessage()); 1533 } 1534 } 1535 1536 /** 1537 * Updates the user's workflow status. 1538 * 1539 * @param userId the primary key of the user 1540 * @param status the user's new workflow status 1541 * @param serviceContext the service context to be applied. You can specify 1542 an unencrypted custom password (used by an LDAP listener) for the 1543 user via attribute <code>passwordUnencrypted</code>. 1544 * @return the user 1545 * @throws PortalException if a user with the primary key could not be 1546 found, if the current user was updating her own status to 1547 anything but {@link 1548 com.liferay.portal.kernel.workflow.WorkflowConstants#STATUS_APPROVED}, 1549 or if the current user did not have permission to update the 1550 user's workflow status. 1551 * @throws SystemException if a system exception occurred 1552 */ 1553 public static com.liferay.portal.model.UserSoap updateStatus(long userId, 1554 int status, com.liferay.portal.service.ServiceContext serviceContext) 1555 throws RemoteException { 1556 try { 1557 com.liferay.portal.model.User returnValue = UserServiceUtil.updateStatus(userId, 1558 status, serviceContext); 1559 1560 return com.liferay.portal.model.UserSoap.toSoapModel(returnValue); 1561 } 1562 catch (Exception e) { 1563 _log.error(e, e); 1564 1565 throw new RemoteException(e.getMessage()); 1566 } 1567 } 1568 1569 /** 1570 * Updates the user with additional parameters. 1571 * 1572 * @param userId the primary key of the user 1573 * @param oldPassword the user's old password 1574 * @param newPassword1 the user's new password (optionally 1575 <code>null</code>) 1576 * @param newPassword2 the user's new password confirmation (optionally 1577 <code>null</code>) 1578 * @param passwordReset whether the user should be asked to reset their 1579 password the next time they login 1580 * @param reminderQueryQuestion the user's new password reset question 1581 * @param reminderQueryAnswer the user's new password reset answer 1582 * @param screenName the user's new screen name 1583 * @param emailAddress the user's new email address 1584 * @param facebookId the user's new Facebook ID 1585 * @param openId the user's new OpenID 1586 * @param languageId the user's new language ID 1587 * @param timeZoneId the user's new time zone ID 1588 * @param greeting the user's new greeting 1589 * @param comments the user's new comments 1590 * @param firstName the user's new first name 1591 * @param middleName the user's new middle name 1592 * @param lastName the user's new last name 1593 * @param prefixId the user's new name prefix ID 1594 * @param suffixId the user's new name suffix ID 1595 * @param male whether user is male 1596 * @param birthdayMonth the user's new birthday month (0-based, meaning 0 1597 for January) 1598 * @param birthdayDay the user's new birthday day 1599 * @param birthdayYear the user's birthday year 1600 * @param smsSn the user's new SMS screen name 1601 * @param aimSn the user's new AIM screen name 1602 * @param facebookSn the user's new Facebook screen name 1603 * @param icqSn the user's new ICQ screen name 1604 * @param jabberSn the user's new Jabber screen name 1605 * @param msnSn the user's new MSN screen name 1606 * @param mySpaceSn the user's new MySpace screen name 1607 * @param skypeSn the user's new Skype screen name 1608 * @param twitterSn the user's new Twitter screen name 1609 * @param ymSn the user's new Yahoo! Messenger screen name 1610 * @param jobTitle the user's new job title 1611 * @param groupIds the primary keys of the user's groups 1612 * @param organizationIds the primary keys of the user's organizations 1613 * @param roleIds the primary keys of the user's roles 1614 * @param userGroupRoles the user user's group roles 1615 * @param userGroupIds the primary keys of the user's user groups 1616 * @param addresses the user's addresses 1617 * @param emailAddresses the user's email addresses 1618 * @param phones the user's phone numbers 1619 * @param websites the user's websites 1620 * @param announcementsDelivers the announcements deliveries 1621 * @param serviceContext the service context to be applied (optionally 1622 <code>null</code>). Can set the UUID (with the <code>uuid</code> 1623 attribute), asset category IDs, asset tag names, and expando 1624 bridge attributes for the user. 1625 * @return the user 1626 * @throws PortalException if a user with the primary key could not be 1627 found, if the new information was invalid, if the current user 1628 did not have permission to update the user, or if the operation 1629 was not allowed by the membership policy 1630 * @throws SystemException if a system exception occurred 1631 */ 1632 public static com.liferay.portal.model.UserSoap updateUser(long userId, 1633 java.lang.String oldPassword, java.lang.String newPassword1, 1634 java.lang.String newPassword2, boolean passwordReset, 1635 java.lang.String reminderQueryQuestion, 1636 java.lang.String reminderQueryAnswer, java.lang.String screenName, 1637 java.lang.String emailAddress, long facebookId, 1638 java.lang.String openId, java.lang.String languageId, 1639 java.lang.String timeZoneId, java.lang.String greeting, 1640 java.lang.String comments, java.lang.String firstName, 1641 java.lang.String middleName, java.lang.String lastName, int prefixId, 1642 int suffixId, boolean male, int birthdayMonth, int birthdayDay, 1643 int birthdayYear, java.lang.String smsSn, java.lang.String aimSn, 1644 java.lang.String facebookSn, java.lang.String icqSn, 1645 java.lang.String jabberSn, java.lang.String msnSn, 1646 java.lang.String mySpaceSn, java.lang.String skypeSn, 1647 java.lang.String twitterSn, java.lang.String ymSn, 1648 java.lang.String jobTitle, long[] groupIds, long[] organizationIds, 1649 long[] roleIds, 1650 com.liferay.portal.model.UserGroupRoleSoap[] userGroupRoles, 1651 long[] userGroupIds, com.liferay.portal.model.AddressSoap[] addresses, 1652 com.liferay.portal.model.EmailAddressSoap[] emailAddresses, 1653 com.liferay.portal.model.PhoneSoap[] phones, 1654 com.liferay.portal.model.WebsiteSoap[] websites, 1655 com.liferay.portlet.announcements.model.AnnouncementsDeliverySoap[] announcementsDelivers, 1656 com.liferay.portal.service.ServiceContext serviceContext) 1657 throws RemoteException { 1658 try { 1659 com.liferay.portal.model.User returnValue = UserServiceUtil.updateUser(userId, 1660 oldPassword, newPassword1, newPassword2, passwordReset, 1661 reminderQueryQuestion, reminderQueryAnswer, screenName, 1662 emailAddress, facebookId, openId, languageId, timeZoneId, 1663 greeting, comments, firstName, middleName, lastName, 1664 prefixId, suffixId, male, birthdayMonth, birthdayDay, 1665 birthdayYear, smsSn, aimSn, facebookSn, icqSn, jabberSn, 1666 msnSn, mySpaceSn, skypeSn, twitterSn, ymSn, jobTitle, 1667 groupIds, organizationIds, roleIds, 1668 com.liferay.portal.model.impl.UserGroupRoleModelImpl.toModels( 1669 userGroupRoles), userGroupIds, 1670 com.liferay.portal.model.impl.AddressModelImpl.toModels( 1671 addresses), 1672 com.liferay.portal.model.impl.EmailAddressModelImpl.toModels( 1673 emailAddresses), 1674 com.liferay.portal.model.impl.PhoneModelImpl.toModels( 1675 phones), 1676 com.liferay.portal.model.impl.WebsiteModelImpl.toModels( 1677 websites), 1678 com.liferay.portlet.announcements.model.impl.AnnouncementsDeliveryModelImpl.toModels( 1679 announcementsDelivers), serviceContext); 1680 1681 return com.liferay.portal.model.UserSoap.toSoapModel(returnValue); 1682 } 1683 catch (Exception e) { 1684 _log.error(e, e); 1685 1686 throw new RemoteException(e.getMessage()); 1687 } 1688 } 1689 1690 /** 1691 * Updates the user. 1692 * 1693 * @param userId the primary key of the user 1694 * @param oldPassword the user's old password 1695 * @param newPassword1 the user's new password (optionally 1696 <code>null</code>) 1697 * @param newPassword2 the user's new password confirmation (optionally 1698 <code>null</code>) 1699 * @param passwordReset whether the user should be asked to reset their 1700 password the next time they login 1701 * @param reminderQueryQuestion the user's new password reset question 1702 * @param reminderQueryAnswer the user's new password reset answer 1703 * @param screenName the user's new screen name 1704 * @param emailAddress the user's new email address 1705 * @param facebookId the user's new Facebook ID 1706 * @param openId the user's new OpenID 1707 * @param languageId the user's new language ID 1708 * @param timeZoneId the user's new time zone ID 1709 * @param greeting the user's new greeting 1710 * @param comments the user's new comments 1711 * @param firstName the user's new first name 1712 * @param middleName the user's new middle name 1713 * @param lastName the user's new last name 1714 * @param prefixId the user's new name prefix ID 1715 * @param suffixId the user's new name suffix ID 1716 * @param male whether user is male 1717 * @param birthdayMonth the user's new birthday month (0-based, meaning 0 1718 for January) 1719 * @param birthdayDay the user's new birthday day 1720 * @param birthdayYear the user's birthday year 1721 * @param smsSn the user's new SMS screen name 1722 * @param aimSn the user's new AIM screen name 1723 * @param facebookSn the user's new Facebook screen name 1724 * @param icqSn the user's new ICQ screen name 1725 * @param jabberSn the user's new Jabber screen name 1726 * @param msnSn the user's new MSN screen name 1727 * @param mySpaceSn the user's new MySpace screen name 1728 * @param skypeSn the user's new Skype screen name 1729 * @param twitterSn the user's new Twitter screen name 1730 * @param ymSn the user's new Yahoo! Messenger screen name 1731 * @param jobTitle the user's new job title 1732 * @param groupIds the primary keys of the user's groups 1733 * @param organizationIds the primary keys of the user's organizations 1734 * @param roleIds the primary keys of the user's roles 1735 * @param userGroupRoles the user user's group roles 1736 * @param userGroupIds the primary keys of the user's user groups 1737 * @param serviceContext the service context to be applied (optionally 1738 <code>null</code>). Can set the UUID (with the <code>uuid</code> 1739 attribute), asset category IDs, asset tag names, and expando 1740 bridge attributes for the user. 1741 * @return the user 1742 * @throws PortalException if a user with the primary key could not be 1743 found, if the new information was invalid, if the current user 1744 did not have permission to update the user, or if the operation 1745 was not allowed by the membership policy 1746 * @throws SystemException if a system exception occurred 1747 */ 1748 public static com.liferay.portal.model.UserSoap updateUser(long userId, 1749 java.lang.String oldPassword, java.lang.String newPassword1, 1750 java.lang.String newPassword2, boolean passwordReset, 1751 java.lang.String reminderQueryQuestion, 1752 java.lang.String reminderQueryAnswer, java.lang.String screenName, 1753 java.lang.String emailAddress, long facebookId, 1754 java.lang.String openId, java.lang.String languageId, 1755 java.lang.String timeZoneId, java.lang.String greeting, 1756 java.lang.String comments, java.lang.String firstName, 1757 java.lang.String middleName, java.lang.String lastName, int prefixId, 1758 int suffixId, boolean male, int birthdayMonth, int birthdayDay, 1759 int birthdayYear, java.lang.String smsSn, java.lang.String aimSn, 1760 java.lang.String facebookSn, java.lang.String icqSn, 1761 java.lang.String jabberSn, java.lang.String msnSn, 1762 java.lang.String mySpaceSn, java.lang.String skypeSn, 1763 java.lang.String twitterSn, java.lang.String ymSn, 1764 java.lang.String jobTitle, long[] groupIds, long[] organizationIds, 1765 long[] roleIds, 1766 com.liferay.portal.model.UserGroupRoleSoap[] userGroupRoles, 1767 long[] userGroupIds, 1768 com.liferay.portal.service.ServiceContext serviceContext) 1769 throws RemoteException { 1770 try { 1771 com.liferay.portal.model.User returnValue = UserServiceUtil.updateUser(userId, 1772 oldPassword, newPassword1, newPassword2, passwordReset, 1773 reminderQueryQuestion, reminderQueryAnswer, screenName, 1774 emailAddress, facebookId, openId, languageId, timeZoneId, 1775 greeting, comments, firstName, middleName, lastName, 1776 prefixId, suffixId, male, birthdayMonth, birthdayDay, 1777 birthdayYear, smsSn, aimSn, facebookSn, icqSn, jabberSn, 1778 msnSn, mySpaceSn, skypeSn, twitterSn, ymSn, jobTitle, 1779 groupIds, organizationIds, roleIds, 1780 com.liferay.portal.model.impl.UserGroupRoleModelImpl.toModels( 1781 userGroupRoles), userGroupIds, serviceContext); 1782 1783 return com.liferay.portal.model.UserSoap.toSoapModel(returnValue); 1784 } 1785 catch (Exception e) { 1786 _log.error(e, e); 1787 1788 throw new RemoteException(e.getMessage()); 1789 } 1790 } 1791 1792 private static Log _log = LogFactoryUtil.getLog(UserServiceSoap.class); 1793 }