/portal-kernel/src/com/liferay/portal/kernel/service/UserServiceUtil.java

https://github.com/danielreuther/liferay-portal · Java · 1331 lines · 437 code · 122 blank · 772 comment · 0 complexity · 7100ed5e6a585a55e3578af2d0d7f45b MD5 · raw file

  1. /**
  2. * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
  3. *
  4. * This library is free software; you can redistribute it and/or modify it under
  5. * the terms of the GNU Lesser General Public License as published by the Free
  6. * Software Foundation; either version 2.1 of the License, or (at your option)
  7. * any later version.
  8. *
  9. * This library is distributed in the hope that it will be useful, but WITHOUT
  10. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  11. * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
  12. * details.
  13. */
  14. package com.liferay.portal.kernel.service;
  15. import com.liferay.portal.kernel.exception.PortalException;
  16. import com.liferay.portal.kernel.model.User;
  17. import com.liferay.portal.kernel.util.OrderByComparator;
  18. import java.util.List;
  19. /**
  20. * Provides the remote service utility for User. This utility wraps
  21. * <code>com.liferay.portal.service.impl.UserServiceImpl</code> and is an
  22. * access point for service operations in application layer code running on a
  23. * remote server. Methods of this service are expected to have security checks
  24. * based on the propagated JAAS credentials because this service can be
  25. * accessed remotely.
  26. *
  27. * @author Brian Wing Shun Chan
  28. * @see UserService
  29. * @generated
  30. */
  31. public class UserServiceUtil {
  32. /*
  33. * NOTE FOR DEVELOPERS:
  34. *
  35. * Never modify this class directly. Add custom service methods to <code>com.liferay.portal.service.impl.UserServiceImpl</code> and rerun ServiceBuilder to regenerate this class.
  36. */
  37. /**
  38. * Adds the users to the group.
  39. *
  40. * @param groupId the primary key of the group
  41. * @param userIds the primary keys of the users
  42. * @param serviceContext the service context to be applied (optionally
  43. <code>null</code>)
  44. */
  45. public static void addGroupUsers(
  46. long groupId, long[] userIds, ServiceContext serviceContext)
  47. throws PortalException {
  48. getService().addGroupUsers(groupId, userIds, serviceContext);
  49. }
  50. /**
  51. * Adds the users to the organization.
  52. *
  53. * @param organizationId the primary key of the organization
  54. * @param userIds the primary keys of the users
  55. */
  56. public static void addOrganizationUsers(long organizationId, long[] userIds)
  57. throws PortalException {
  58. getService().addOrganizationUsers(organizationId, userIds);
  59. }
  60. public static User addOrUpdateUser(
  61. String externalReferenceCode, long creatorUserId, long companyId,
  62. boolean autoPassword, String password1, String password2,
  63. boolean autoScreenName, String screenName, String emailAddress,
  64. java.util.Locale locale, String firstName, String middleName,
  65. String lastName, long prefixId, long suffixId, boolean male,
  66. int birthdayMonth, int birthdayDay, int birthdayYear,
  67. String jobTitle,
  68. List<com.liferay.portal.kernel.model.Address> addresses,
  69. List<com.liferay.portal.kernel.model.EmailAddress> emailAddresses,
  70. List<com.liferay.portal.kernel.model.Phone> phones,
  71. List<com.liferay.portal.kernel.model.Website> websites,
  72. boolean sendEmail, ServiceContext serviceContext)
  73. throws PortalException {
  74. return getService().addOrUpdateUser(
  75. externalReferenceCode, creatorUserId, companyId, autoPassword,
  76. password1, password2, autoScreenName, screenName, emailAddress,
  77. locale, firstName, middleName, lastName, prefixId, suffixId, male,
  78. birthdayMonth, birthdayDay, birthdayYear, jobTitle, addresses,
  79. emailAddresses, phones, websites, sendEmail, serviceContext);
  80. }
  81. /**
  82. * Assigns the password policy to the users, removing any other currently
  83. * assigned password policies.
  84. *
  85. * @param passwordPolicyId the primary key of the password policy
  86. * @param userIds the primary keys of the users
  87. */
  88. public static void addPasswordPolicyUsers(
  89. long passwordPolicyId, long[] userIds)
  90. throws PortalException {
  91. getService().addPasswordPolicyUsers(passwordPolicyId, userIds);
  92. }
  93. /**
  94. * Adds the users to the role.
  95. *
  96. * @param roleId the primary key of the role
  97. * @param userIds the primary keys of the users
  98. */
  99. public static void addRoleUsers(long roleId, long[] userIds)
  100. throws PortalException {
  101. getService().addRoleUsers(roleId, userIds);
  102. }
  103. /**
  104. * Adds the users to the team.
  105. *
  106. * @param teamId the primary key of the team
  107. * @param userIds the primary keys of the users
  108. */
  109. public static void addTeamUsers(long teamId, long[] userIds)
  110. throws PortalException {
  111. getService().addTeamUsers(teamId, userIds);
  112. }
  113. /**
  114. * Adds a user.
  115. *
  116. * <p>
  117. * This method handles the creation and bookkeeping of the user including
  118. * its resources, metadata, and internal data structures. It is not
  119. * necessary to make subsequent calls to any methods to setup default
  120. * groups, resources, etc.
  121. * </p>
  122. *
  123. * @param companyId the primary key of the user's company
  124. * @param autoPassword whether a password should be automatically generated
  125. for the user
  126. * @param password1 the user's password
  127. * @param password2 the user's password confirmation
  128. * @param autoScreenName whether a screen name should be automatically
  129. generated for the user
  130. * @param screenName the user's screen name
  131. * @param emailAddress the user's email address
  132. * @param locale the user's locale
  133. * @param firstName the user's first name
  134. * @param middleName the user's middle name
  135. * @param lastName the user's last name
  136. * @param prefixId the user's name prefix ID
  137. * @param suffixId the user's name suffix ID
  138. * @param male whether the user is male
  139. * @param birthdayMonth the user's birthday month (0-based, meaning 0 for
  140. January)
  141. * @param birthdayDay the user's birthday day
  142. * @param birthdayYear the user's birthday year
  143. * @param jobTitle the user's job title
  144. * @param groupIds the primary keys of the user's groups
  145. * @param organizationIds the primary keys of the user's organizations
  146. * @param roleIds the primary keys of the roles this user possesses
  147. * @param userGroupIds the primary keys of the user's user groups
  148. * @param sendEmail whether to send the user an email notification about
  149. their new account
  150. * @param serviceContext the service context to be applied (optionally
  151. <code>null</code>). Can set the UUID (with the <code>uuid</code>
  152. attribute), asset category IDs, asset tag names, and expando
  153. bridge attributes for the user.
  154. * @return the new user
  155. */
  156. public static User addUser(
  157. long companyId, boolean autoPassword, String password1,
  158. String password2, boolean autoScreenName, String screenName,
  159. String emailAddress, java.util.Locale locale, String firstName,
  160. String middleName, String lastName, long prefixId, long suffixId,
  161. boolean male, int birthdayMonth, int birthdayDay, int birthdayYear,
  162. String jobTitle, long[] groupIds, long[] organizationIds,
  163. long[] roleIds, long[] userGroupIds, boolean sendEmail,
  164. ServiceContext serviceContext)
  165. throws PortalException {
  166. return getService().addUser(
  167. companyId, autoPassword, password1, password2, autoScreenName,
  168. screenName, emailAddress, locale, firstName, middleName, lastName,
  169. prefixId, suffixId, male, birthdayMonth, birthdayDay, birthdayYear,
  170. jobTitle, groupIds, organizationIds, roleIds, userGroupIds,
  171. sendEmail, serviceContext);
  172. }
  173. /**
  174. * Adds a user with additional parameters.
  175. *
  176. * <p>
  177. * This method handles the creation and bookkeeping of the user including
  178. * its resources, metadata, and internal data structures. It is not
  179. * necessary to make subsequent calls to any methods to setup default
  180. * groups, resources, etc.
  181. * </p>
  182. *
  183. * @param companyId the primary key of the user's company
  184. * @param autoPassword whether a password should be automatically generated
  185. for the user
  186. * @param password1 the user's password
  187. * @param password2 the user's password confirmation
  188. * @param autoScreenName whether a screen name should be automatically
  189. generated for the user
  190. * @param screenName the user's screen name
  191. * @param emailAddress the user's email address
  192. * @param locale the user's locale
  193. * @param firstName the user's first name
  194. * @param middleName the user's middle name
  195. * @param lastName the user's last name
  196. * @param prefixId the user's name prefix ID
  197. * @param suffixId the user's name suffix ID
  198. * @param male whether the user is male
  199. * @param birthdayMonth the user's birthday month (0-based, meaning 0 for
  200. January)
  201. * @param birthdayDay the user's birthday day
  202. * @param birthdayYear the user's birthday year
  203. * @param jobTitle the user's job title
  204. * @param groupIds the primary keys of the user's groups
  205. * @param organizationIds the primary keys of the user's organizations
  206. * @param roleIds the primary keys of the roles this user possesses
  207. * @param userGroupIds the primary keys of the user's user groups
  208. * @param addresses the user's addresses
  209. * @param emailAddresses the user's email addresses
  210. * @param phones the user's phone numbers
  211. * @param websites the user's websites
  212. * @param announcementsDelivers the announcements deliveries
  213. * @param sendEmail whether to send the user an email notification about
  214. their new account
  215. * @param serviceContext the service context to be applied (optionally
  216. <code>null</code>). Can set the UUID (with the <code>uuid</code>
  217. attribute), asset category IDs, asset tag names, and expando
  218. bridge attributes for the user.
  219. * @return the new user
  220. */
  221. public static User addUser(
  222. long companyId, boolean autoPassword, String password1,
  223. String password2, boolean autoScreenName, String screenName,
  224. String emailAddress, java.util.Locale locale, String firstName,
  225. String middleName, String lastName, long prefixId, long suffixId,
  226. boolean male, int birthdayMonth, int birthdayDay, int birthdayYear,
  227. String jobTitle, long[] groupIds, long[] organizationIds,
  228. long[] roleIds, long[] userGroupIds,
  229. List<com.liferay.portal.kernel.model.Address> addresses,
  230. List<com.liferay.portal.kernel.model.EmailAddress> emailAddresses,
  231. List<com.liferay.portal.kernel.model.Phone> phones,
  232. List<com.liferay.portal.kernel.model.Website> websites,
  233. List<com.liferay.announcements.kernel.model.AnnouncementsDelivery>
  234. announcementsDelivers,
  235. boolean sendEmail, ServiceContext serviceContext)
  236. throws PortalException {
  237. return getService().addUser(
  238. companyId, autoPassword, password1, password2, autoScreenName,
  239. screenName, emailAddress, locale, firstName, middleName, lastName,
  240. prefixId, suffixId, male, birthdayMonth, birthdayDay, birthdayYear,
  241. jobTitle, groupIds, organizationIds, roleIds, userGroupIds,
  242. addresses, emailAddresses, phones, websites, announcementsDelivers,
  243. sendEmail, serviceContext);
  244. }
  245. /**
  246. * Adds a user.
  247. *
  248. * <p>
  249. * This method handles the creation and bookkeeping of the user including
  250. * its resources, metadata, and internal data structures. It is not
  251. * necessary to make subsequent calls to any methods to setup default
  252. * groups, resources, etc.
  253. * </p>
  254. *
  255. * @param companyId the primary key of the user's company
  256. * @param autoPassword whether a password should be automatically
  257. generated for the user
  258. * @param password1 the user's password
  259. * @param password2 the user's password confirmation
  260. * @param autoScreenName whether a screen name should be automatically
  261. generated for the user
  262. * @param screenName the user's screen name
  263. * @param emailAddress the user's email address
  264. * @param facebookId the user's facebook ID
  265. * @param openId the user's OpenID
  266. * @param locale the user's locale
  267. * @param firstName the user's first name
  268. * @param middleName the user's middle name
  269. * @param lastName the user's last name
  270. * @param prefixId the user's name prefix ID
  271. * @param suffixId the user's name suffix ID
  272. * @param male whether the user is male
  273. * @param birthdayMonth the user's birthday month (0-based, meaning 0
  274. for January)
  275. * @param birthdayDay the user's birthday day
  276. * @param birthdayYear the user's birthday year
  277. * @param jobTitle the user's job title
  278. * @param groupIds the primary keys of the user's groups
  279. * @param organizationIds the primary keys of the user's organizations
  280. * @param roleIds the primary keys of the roles this user possesses
  281. * @param userGroupIds the primary keys of the user's user groups
  282. * @param sendEmail whether to send the user an email notification
  283. about their new account
  284. * @param serviceContext the service context to be applied (optionally
  285. <code>null</code>). Can set the UUID (with the
  286. <code>uuid</code> attribute), asset category IDs, asset tag
  287. names, and expando bridge attributes for the user.
  288. * @return the new user
  289. * @deprecated As of Athanasius (7.3.x), replaced by {@link #addUser(long,
  290. boolean, String, String, boolean, String, String, Locale,
  291. String, String, String, long, long, boolean, int, int, int,
  292. String, long[], long[], long[], long[], boolean,
  293. ServiceContext)}
  294. */
  295. @Deprecated
  296. public static User addUser(
  297. long companyId, boolean autoPassword, String password1,
  298. String password2, boolean autoScreenName, String screenName,
  299. String emailAddress, long facebookId, String openId,
  300. java.util.Locale locale, String firstName, String middleName,
  301. String lastName, long prefixId, long suffixId, boolean male,
  302. int birthdayMonth, int birthdayDay, int birthdayYear,
  303. String jobTitle, long[] groupIds, long[] organizationIds,
  304. long[] roleIds, long[] userGroupIds, boolean sendEmail,
  305. ServiceContext serviceContext)
  306. throws PortalException {
  307. return getService().addUser(
  308. companyId, autoPassword, password1, password2, autoScreenName,
  309. screenName, emailAddress, facebookId, openId, locale, firstName,
  310. middleName, lastName, prefixId, suffixId, male, birthdayMonth,
  311. birthdayDay, birthdayYear, jobTitle, groupIds, organizationIds,
  312. roleIds, userGroupIds, sendEmail, serviceContext);
  313. }
  314. /**
  315. * Adds a user with additional parameters.
  316. *
  317. * <p>
  318. * This method handles the creation and bookkeeping of the user including
  319. * its resources, metadata, and internal data structures. It is not
  320. * necessary to make subsequent calls to any methods to setup default
  321. * groups, resources, etc.
  322. * </p>
  323. *
  324. * @param companyId the primary key of the user's company
  325. * @param autoPassword whether a password should be automatically
  326. generated for the user
  327. * @param password1 the user's password
  328. * @param password2 the user's password confirmation
  329. * @param autoScreenName whether a screen name should be automatically
  330. generated for the user
  331. * @param screenName the user's screen name
  332. * @param emailAddress the user's email address
  333. * @param facebookId the user's facebook ID
  334. * @param openId the user's OpenID
  335. * @param locale the user's locale
  336. * @param firstName the user's first name
  337. * @param middleName the user's middle name
  338. * @param lastName the user's last name
  339. * @param prefixId the user's name prefix ID
  340. * @param suffixId the user's name suffix ID
  341. * @param male whether the user is male
  342. * @param birthdayMonth the user's birthday month (0-based, meaning 0
  343. for January)
  344. * @param birthdayDay the user's birthday day
  345. * @param birthdayYear the user's birthday year
  346. * @param jobTitle the user's job title
  347. * @param groupIds the primary keys of the user's groups
  348. * @param organizationIds the primary keys of the user's organizations
  349. * @param roleIds the primary keys of the roles this user possesses
  350. * @param userGroupIds the primary keys of the user's user groups
  351. * @param addresses the user's addresses
  352. * @param emailAddresses the user's email addresses
  353. * @param phones the user's phone numbers
  354. * @param websites the user's websites
  355. * @param announcementsDelivers the announcements deliveries
  356. * @param sendEmail whether to send the user an email notification
  357. about their new account
  358. * @param serviceContext the service context to be applied (optionally
  359. <code>null</code>). Can set the UUID (with the
  360. <code>uuid</code> attribute), asset category IDs, asset tag
  361. names, and expando bridge attributes for the user.
  362. * @return the new user
  363. * @deprecated As of Athanasius (7.3.x), replaced by {@link #addUser(long,
  364. boolean, String, String, boolean, String, String, Locale,
  365. String, String, String, long, long, boolean, int, int, int,
  366. String, long[], long[], long[], long[], List, List, List,
  367. List, List, boolean, ServiceContext)}
  368. */
  369. @Deprecated
  370. public static User addUser(
  371. long companyId, boolean autoPassword, String password1,
  372. String password2, boolean autoScreenName, String screenName,
  373. String emailAddress, long facebookId, String openId,
  374. java.util.Locale locale, String firstName, String middleName,
  375. String lastName, long prefixId, long suffixId, boolean male,
  376. int birthdayMonth, int birthdayDay, int birthdayYear,
  377. String jobTitle, long[] groupIds, long[] organizationIds,
  378. long[] roleIds, long[] userGroupIds,
  379. List<com.liferay.portal.kernel.model.Address> addresses,
  380. List<com.liferay.portal.kernel.model.EmailAddress> emailAddresses,
  381. List<com.liferay.portal.kernel.model.Phone> phones,
  382. List<com.liferay.portal.kernel.model.Website> websites,
  383. List<com.liferay.announcements.kernel.model.AnnouncementsDelivery>
  384. announcementsDelivers,
  385. boolean sendEmail, ServiceContext serviceContext)
  386. throws PortalException {
  387. return getService().addUser(
  388. companyId, autoPassword, password1, password2, autoScreenName,
  389. screenName, emailAddress, facebookId, openId, locale, firstName,
  390. middleName, lastName, prefixId, suffixId, male, birthdayMonth,
  391. birthdayDay, birthdayYear, jobTitle, groupIds, organizationIds,
  392. roleIds, userGroupIds, addresses, emailAddresses, phones, websites,
  393. announcementsDelivers, sendEmail, serviceContext);
  394. }
  395. /**
  396. * Adds the users to the user group.
  397. *
  398. * @param userGroupId the primary key of the user group
  399. * @param userIds the primary keys of the users
  400. */
  401. public static void addUserGroupUsers(long userGroupId, long[] userIds)
  402. throws PortalException {
  403. getService().addUserGroupUsers(userGroupId, userIds);
  404. }
  405. /**
  406. * Adds a user with workflow.
  407. *
  408. * <p>
  409. * This method handles the creation and bookkeeping of the user including
  410. * its resources, metadata, and internal data structures. It is not
  411. * necessary to make subsequent calls to any methods to setup default
  412. * groups, resources, etc.
  413. * </p>
  414. *
  415. * @param companyId the primary key of the user's company
  416. * @param autoPassword whether a password should be automatically generated
  417. for the user
  418. * @param password1 the user's password
  419. * @param password2 the user's password confirmation
  420. * @param autoScreenName whether a screen name should be automatically
  421. generated for the user
  422. * @param screenName the user's screen name
  423. * @param emailAddress the user's email address
  424. * @param locale the user's locale
  425. * @param firstName the user's first name
  426. * @param middleName the user's middle name
  427. * @param lastName the user's last name
  428. * @param prefixId the user's name prefix ID
  429. * @param suffixId the user's name suffix ID
  430. * @param male whether the user is male
  431. * @param birthdayMonth the user's birthday month (0-based, meaning 0 for
  432. January)
  433. * @param birthdayDay the user's birthday day
  434. * @param birthdayYear the user's birthday year
  435. * @param jobTitle the user's job title
  436. * @param groupIds the primary keys of the user's groups
  437. * @param organizationIds the primary keys of the user's organizations
  438. * @param roleIds the primary keys of the roles this user possesses
  439. * @param userGroupIds the primary keys of the user's user groups
  440. * @param sendEmail whether to send the user an email notification about
  441. their new account
  442. * @param serviceContext the service context to be applied (optionally
  443. <code>null</code>). Can set the UUID (with the <code>uuid</code>
  444. attribute), asset category IDs, asset tag names, and expando
  445. bridge attributes for the user.
  446. * @return the new user
  447. */
  448. public static User addUserWithWorkflow(
  449. long companyId, boolean autoPassword, String password1,
  450. String password2, boolean autoScreenName, String screenName,
  451. String emailAddress, java.util.Locale locale, String firstName,
  452. String middleName, String lastName, long prefixId, long suffixId,
  453. boolean male, int birthdayMonth, int birthdayDay, int birthdayYear,
  454. String jobTitle, long[] groupIds, long[] organizationIds,
  455. long[] roleIds, long[] userGroupIds, boolean sendEmail,
  456. ServiceContext serviceContext)
  457. throws PortalException {
  458. return getService().addUserWithWorkflow(
  459. companyId, autoPassword, password1, password2, autoScreenName,
  460. screenName, emailAddress, locale, firstName, middleName, lastName,
  461. prefixId, suffixId, male, birthdayMonth, birthdayDay, birthdayYear,
  462. jobTitle, groupIds, organizationIds, roleIds, userGroupIds,
  463. sendEmail, serviceContext);
  464. }
  465. /**
  466. * Adds a user with workflow and additional parameters.
  467. *
  468. * <p>
  469. * This method handles the creation and bookkeeping of the user including
  470. * its resources, metadata, and internal data structures. It is not
  471. * necessary to make subsequent calls to any methods to setup default
  472. * groups, resources, etc.
  473. * </p>
  474. *
  475. * @param companyId the primary key of the user's company
  476. * @param autoPassword whether a password should be automatically generated
  477. for the user
  478. * @param password1 the user's password
  479. * @param password2 the user's password confirmation
  480. * @param autoScreenName whether a screen name should be automatically
  481. generated for the user
  482. * @param screenName the user's screen name
  483. * @param emailAddress the user's email address
  484. * @param locale the user's locale
  485. * @param firstName the user's first name
  486. * @param middleName the user's middle name
  487. * @param lastName the user's last name
  488. * @param prefixId the user's name prefix ID
  489. * @param suffixId the user's name suffix ID
  490. * @param male whether the user is male
  491. * @param birthdayMonth the user's birthday month (0-based, meaning 0 for
  492. January)
  493. * @param birthdayDay the user's birthday day
  494. * @param birthdayYear the user's birthday year
  495. * @param jobTitle the user's job title
  496. * @param groupIds the primary keys of the user's groups
  497. * @param organizationIds the primary keys of the user's organizations
  498. * @param roleIds the primary keys of the roles this user possesses
  499. * @param userGroupIds the primary keys of the user's user groups
  500. * @param addresses the user's addresses
  501. * @param emailAddresses the user's email addresses
  502. * @param phones the user's phone numbers
  503. * @param websites the user's websites
  504. * @param announcementsDelivers the announcements deliveries
  505. * @param sendEmail whether to send the user an email notification about
  506. their new account
  507. * @param serviceContext the service context to be applied (optionally
  508. <code>null</code>). Can set the UUID (with the <code>uuid</code>
  509. attribute), asset category IDs, asset tag names, and expando
  510. bridge attributes for the user.
  511. * @return the new user
  512. */
  513. public static User addUserWithWorkflow(
  514. long companyId, boolean autoPassword, String password1,
  515. String password2, boolean autoScreenName, String screenName,
  516. String emailAddress, java.util.Locale locale, String firstName,
  517. String middleName, String lastName, long prefixId, long suffixId,
  518. boolean male, int birthdayMonth, int birthdayDay, int birthdayYear,
  519. String jobTitle, long[] groupIds, long[] organizationIds,
  520. long[] roleIds, long[] userGroupIds,
  521. List<com.liferay.portal.kernel.model.Address> addresses,
  522. List<com.liferay.portal.kernel.model.EmailAddress> emailAddresses,
  523. List<com.liferay.portal.kernel.model.Phone> phones,
  524. List<com.liferay.portal.kernel.model.Website> websites,
  525. List<com.liferay.announcements.kernel.model.AnnouncementsDelivery>
  526. announcementsDelivers,
  527. boolean sendEmail, ServiceContext serviceContext)
  528. throws PortalException {
  529. return getService().addUserWithWorkflow(
  530. companyId, autoPassword, password1, password2, autoScreenName,
  531. screenName, emailAddress, locale, firstName, middleName, lastName,
  532. prefixId, suffixId, male, birthdayMonth, birthdayDay, birthdayYear,
  533. jobTitle, groupIds, organizationIds, roleIds, userGroupIds,
  534. addresses, emailAddresses, phones, websites, announcementsDelivers,
  535. sendEmail, serviceContext);
  536. }
  537. /**
  538. * Adds a user with workflow.
  539. *
  540. * <p>
  541. * This method handles the creation and bookkeeping of the user including
  542. * its resources, metadata, and internal data structures. It is not
  543. * necessary to make subsequent calls to any methods to setup default
  544. * groups, resources, etc.
  545. * </p>
  546. *
  547. * @param companyId the primary key of the user's company
  548. * @param autoPassword whether a password should be automatically
  549. generated for the user
  550. * @param password1 the user's password
  551. * @param password2 the user's password confirmation
  552. * @param autoScreenName whether a screen name should be automatically
  553. generated for the user
  554. * @param screenName the user's screen name
  555. * @param emailAddress the user's email address
  556. * @param facebookId the user's facebook ID
  557. * @param openId the user's OpenID
  558. * @param locale the user's locale
  559. * @param firstName the user's first name
  560. * @param middleName the user's middle name
  561. * @param lastName the user's last name
  562. * @param prefixId the user's name prefix ID
  563. * @param suffixId the user's name suffix ID
  564. * @param male whether the user is male
  565. * @param birthdayMonth the user's birthday month (0-based, meaning 0
  566. for January)
  567. * @param birthdayDay the user's birthday day
  568. * @param birthdayYear the user's birthday year
  569. * @param jobTitle the user's job title
  570. * @param groupIds the primary keys of the user's groups
  571. * @param organizationIds the primary keys of the user's organizations
  572. * @param roleIds the primary keys of the roles this user possesses
  573. * @param userGroupIds the primary keys of the user's user groups
  574. * @param sendEmail whether to send the user an email notification
  575. about their new account
  576. * @param serviceContext the service context to be applied (optionally
  577. <code>null</code>). Can set the UUID (with the
  578. <code>uuid</code> attribute), asset category IDs, asset tag
  579. names, and expando bridge attributes for the user.
  580. * @return the new user
  581. * @deprecated As of Athanasius (7.3.x), replaced by {@link
  582. #addUserWithWorkflow(long, boolean, String, String, boolean,
  583. String, String, Locale, String, String, String, long, long,
  584. boolean, int, int, int, String, long[], long[], long[],
  585. long[], boolean, ServiceContext)}
  586. */
  587. @Deprecated
  588. public static User addUserWithWorkflow(
  589. long companyId, boolean autoPassword, String password1,
  590. String password2, boolean autoScreenName, String screenName,
  591. String emailAddress, long facebookId, String openId,
  592. java.util.Locale locale, String firstName, String middleName,
  593. String lastName, long prefixId, long suffixId, boolean male,
  594. int birthdayMonth, int birthdayDay, int birthdayYear,
  595. String jobTitle, long[] groupIds, long[] organizationIds,
  596. long[] roleIds, long[] userGroupIds, boolean sendEmail,
  597. ServiceContext serviceContext)
  598. throws PortalException {
  599. return getService().addUserWithWorkflow(
  600. companyId, autoPassword, password1, password2, autoScreenName,
  601. screenName, emailAddress, facebookId, openId, locale, firstName,
  602. middleName, lastName, prefixId, suffixId, male, birthdayMonth,
  603. birthdayDay, birthdayYear, jobTitle, groupIds, organizationIds,
  604. roleIds, userGroupIds, sendEmail, serviceContext);
  605. }
  606. /**
  607. * Adds a user with workflow and additional parameters.
  608. *
  609. * <p>
  610. * This method handles the creation and bookkeeping of the user including
  611. * its resources, metadata, and internal data structures. It is not
  612. * necessary to make subsequent calls to any methods to setup default
  613. * groups, resources, etc.
  614. * </p>
  615. *
  616. * @param companyId the primary key of the user's company
  617. * @param autoPassword whether a password should be automatically
  618. generated for the user
  619. * @param password1 the user's password
  620. * @param password2 the user's password confirmation
  621. * @param autoScreenName whether a screen name should be automatically
  622. generated for the user
  623. * @param screenName the user's screen name
  624. * @param emailAddress the user's email address
  625. * @param facebookId the user's facebook ID
  626. * @param openId the user's OpenID
  627. * @param locale the user's locale
  628. * @param firstName the user's first name
  629. * @param middleName the user's middle name
  630. * @param lastName the user's last name
  631. * @param prefixId the user's name prefix ID
  632. * @param suffixId the user's name suffix ID
  633. * @param male whether the user is male
  634. * @param birthdayMonth the user's birthday month (0-based, meaning 0
  635. for January)
  636. * @param birthdayDay the user's birthday day
  637. * @param birthdayYear the user's birthday year
  638. * @param jobTitle the user's job title
  639. * @param groupIds the primary keys of the user's groups
  640. * @param organizationIds the primary keys of the user's organizations
  641. * @param roleIds the primary keys of the roles this user possesses
  642. * @param userGroupIds the primary keys of the user's user groups
  643. * @param addresses the user's addresses
  644. * @param emailAddresses the user's email addresses
  645. * @param phones the user's phone numbers
  646. * @param websites the user's websites
  647. * @param announcementsDelivers the announcements deliveries
  648. * @param sendEmail whether to send the user an email notification
  649. about their new account
  650. * @param serviceContext the service context to be applied (optionally
  651. <code>null</code>). Can set the UUID (with the
  652. <code>uuid</code> attribute), asset category IDs, asset tag
  653. names, and expando bridge attributes for the user.
  654. * @return the new user
  655. * @deprecated As of Athanasius (7.3.x), replaced by {@link
  656. #addUserWithWorkflow(long, boolean, String, String, boolean,
  657. String, String, Locale, String, String, String, long, long,
  658. boolean, int, int, int, String, long[], long[], long[],
  659. long[], List, List, List, List, List, boolean, ServiceContext
  660. )}
  661. */
  662. @Deprecated
  663. public static User addUserWithWorkflow(
  664. long companyId, boolean autoPassword, String password1,
  665. String password2, boolean autoScreenName, String screenName,
  666. String emailAddress, long facebookId, String openId,
  667. java.util.Locale locale, String firstName, String middleName,
  668. String lastName, long prefixId, long suffixId, boolean male,
  669. int birthdayMonth, int birthdayDay, int birthdayYear,
  670. String jobTitle, long[] groupIds, long[] organizationIds,
  671. long[] roleIds, long[] userGroupIds,
  672. List<com.liferay.portal.kernel.model.Address> addresses,
  673. List<com.liferay.portal.kernel.model.EmailAddress> emailAddresses,
  674. List<com.liferay.portal.kernel.model.Phone> phones,
  675. List<com.liferay.portal.kernel.model.Website> websites,
  676. List<com.liferay.announcements.kernel.model.AnnouncementsDelivery>
  677. announcementsDelivers,
  678. boolean sendEmail, ServiceContext serviceContext)
  679. throws PortalException {
  680. return getService().addUserWithWorkflow(
  681. companyId, autoPassword, password1, password2, autoScreenName,
  682. screenName, emailAddress, facebookId, openId, locale, firstName,
  683. middleName, lastName, prefixId, suffixId, male, birthdayMonth,
  684. birthdayDay, birthdayYear, jobTitle, groupIds, organizationIds,
  685. roleIds, userGroupIds, addresses, emailAddresses, phones, websites,
  686. announcementsDelivers, sendEmail, serviceContext);
  687. }
  688. /**
  689. * Deletes the user's portrait image.
  690. *
  691. * @param userId the primary key of the user
  692. */
  693. public static void deletePortrait(long userId) throws PortalException {
  694. getService().deletePortrait(userId);
  695. }
  696. /**
  697. * Removes the user from the role.
  698. *
  699. * @param roleId the primary key of the role
  700. * @param userId the primary key of the user
  701. */
  702. public static void deleteRoleUser(long roleId, long userId)
  703. throws PortalException {
  704. getService().deleteRoleUser(roleId, userId);
  705. }
  706. /**
  707. * Deletes the user.
  708. *
  709. * @param userId the primary key of the user
  710. */
  711. public static void deleteUser(long userId) throws PortalException {
  712. getService().deleteUser(userId);
  713. }
  714. public static List<User> getCompanyUsers(long companyId, int start, int end)
  715. throws PortalException {
  716. return getService().getCompanyUsers(companyId, start, end);
  717. }
  718. public static int getCompanyUsersCount(long companyId)
  719. throws PortalException {
  720. return getService().getCompanyUsersCount(companyId);
  721. }
  722. public static User getCurrentUser() throws PortalException {
  723. return getService().getCurrentUser();
  724. }
  725. /**
  726. * Returns the primary keys of all the users belonging to the group.
  727. *
  728. * @param groupId the primary key of the group
  729. * @return the primary keys of the users belonging to the group
  730. */
  731. public static long[] getGroupUserIds(long groupId) throws PortalException {
  732. return getService().getGroupUserIds(groupId);
  733. }
  734. /**
  735. * Returns all the users belonging to the group.
  736. *
  737. * @param groupId the primary key of the group
  738. * @return the users belonging to the group
  739. */
  740. public static List<User> getGroupUsers(long groupId)
  741. throws PortalException {
  742. return getService().getGroupUsers(groupId);
  743. }
  744. /**
  745. * Returns the users belonging to a group.
  746. *
  747. * @param groupId the primary key of the group
  748. * @param status the workflow status
  749. * @param start the lower bound of the range of users
  750. * @param end the upper bound of the range of users (not inclusive)
  751. * @param orderByComparator the comparator to order the users by
  752. (optionally <code>null</code>)
  753. * @return the matching users
  754. */
  755. public static List<User> getGroupUsers(
  756. long groupId, int status, int start, int end,
  757. OrderByComparator<User> orderByComparator)
  758. throws PortalException {
  759. return getService().getGroupUsers(
  760. groupId, status, start, end, orderByComparator);
  761. }
  762. /**
  763. * Returns the users belonging to a group.
  764. *
  765. * @param groupId the primary key of the group
  766. * @param status the workflow status
  767. * @param orderByComparator the comparator to order the users by
  768. (optionally <code>null</code>)
  769. * @return the matching users
  770. */
  771. public static List<User> getGroupUsers(
  772. long groupId, int status, OrderByComparator<User> orderByComparator)
  773. throws PortalException {
  774. return getService().getGroupUsers(groupId, status, orderByComparator);
  775. }
  776. /**
  777. * Returns the number of users with the status belonging to the group.
  778. *
  779. * @param groupId the primary key of the group
  780. * @param status the workflow status
  781. * @return the number of users with the status belonging to the group
  782. */
  783. public static int getGroupUsersCount(long groupId, int status)
  784. throws PortalException {
  785. return getService().getGroupUsersCount(groupId, status);
  786. }
  787. public static List<User> getGtCompanyUsers(
  788. long gtUserId, long companyId, int size)
  789. throws PortalException {
  790. return getService().getGtCompanyUsers(gtUserId, companyId, size);
  791. }
  792. public static List<User> getGtOrganizationUsers(
  793. long gtUserId, long organizationId, int size)
  794. throws PortalException {
  795. return getService().getGtOrganizationUsers(
  796. gtUserId, organizationId, size);
  797. }
  798. public static List<User> getGtUserGroupUsers(
  799. long gtUserId, long userGroupId, int size)
  800. throws PortalException {
  801. return getService().getGtUserGroupUsers(gtUserId, userGroupId, size);
  802. }
  803. public static int getOrganizationsAndUserGroupsUsersCount(
  804. long[] organizationIds, long[] userGroupIds)
  805. throws com.liferay.portal.kernel.security.auth.PrincipalException {
  806. return getService().getOrganizationsAndUserGroupsUsersCount(
  807. organizationIds, userGroupIds);
  808. }
  809. /**
  810. * Returns the primary keys of all the users belonging to the organization.
  811. *
  812. * @param organizationId the primary key of the organization
  813. * @return the primary keys of the users belonging to the organization
  814. */
  815. public static long[] getOrganizationUserIds(long organizationId)
  816. throws PortalException {
  817. return getService().getOrganizationUserIds(organizationId);
  818. }
  819. /**
  820. * Returns all the users belonging to the organization.
  821. *
  822. * @param organizationId the primary key of the organization
  823. * @return users belonging to the organization
  824. */
  825. public static List<User> getOrganizationUsers(long organizationId)
  826. throws PortalException {
  827. return getService().getOrganizationUsers(organizationId);
  828. }
  829. /**
  830. * Returns the users belonging to the organization with the status.
  831. *
  832. * @param organizationId the primary key of the organization
  833. * @param status the workflow status
  834. * @param start the lower bound of the range of users
  835. * @param end the upper bound of the range of users (not inclusive)
  836. * @param orderByComparator the comparator to order the users by
  837. (optionally <code>null</code>)
  838. * @return the matching users
  839. */
  840. public static List<User> getOrganizationUsers(
  841. long organizationId, int status, int start, int end,
  842. OrderByComparator<User> orderByComparator)
  843. throws PortalException {
  844. return getService().getOrganizationUsers(
  845. organizationId, status, start, end, orderByComparator);
  846. }
  847. /**
  848. * Returns the users belonging to the organization with the status.
  849. *
  850. * @param organizationId the primary key of the organization
  851. * @param status the workflow status
  852. * @param orderByComparator the comparator to order the users by
  853. (optionally <code>null</code>)
  854. * @return the matching users
  855. */
  856. public static List<User> getOrganizationUsers(
  857. long organizationId, int status,
  858. OrderByComparator<User> orderByComparator)
  859. throws PortalException {
  860. return getService().getOrganizationUsers(
  861. organizationId, status, orderByComparator);
  862. }
  863. /**
  864. * Returns the number of users with the status belonging to the
  865. * organization.
  866. *
  867. * @param organizationId the primary key of the organization
  868. * @param status the workflow status
  869. * @return the number of users with the status belonging to the organization
  870. */
  871. public static int getOrganizationUsersCount(long organizationId, int status)
  872. throws PortalException {
  873. return getService().getOrganizationUsersCount(organizationId, status);
  874. }
  875. /**
  876. * Returns the OSGi service identifier.
  877. *
  878. * @return the OSGi service identifier
  879. */
  880. public static String getOSGiServiceIdentifier() {
  881. return getService().getOSGiServiceIdentifier();
  882. }
  883. /**
  884. * Returns the primary keys of all the users belonging to the role.
  885. *
  886. * @param roleId the primary key of the role
  887. * @return the primary keys of the users belonging to the role
  888. */
  889. public static long[] getRoleUserIds(long roleId) throws PortalException {
  890. return getService().getRoleUserIds(roleId);
  891. }
  892. /**
  893. * Returns the user with the email address.
  894. *
  895. * @param companyId the primary key of the user's company
  896. * @param emailAddress the user's email address
  897. * @return the user with the email address
  898. */
  899. public static User getUserByEmailAddress(
  900. long companyId, String emailAddress)
  901. throws PortalException {
  902. return getService().getUserByEmailAddress(companyId, emailAddress);
  903. }
  904. /**
  905. * Returns the user with the external reference code.
  906. *
  907. * @param companyId the primary key of the user's company
  908. * @param externalReferenceCode the user's external reference code
  909. * @return the user with the external reference code
  910. */
  911. public static User getUserByExternalReferenceCode(
  912. long companyId, String externalReferenceCode)
  913. throws PortalException {
  914. return getService().getUserByExternalReferenceCode(
  915. companyId, externalReferenceCode);
  916. }
  917. /**
  918. * Returns the user with the primary key.
  919. *
  920. * @param userId the primary key of the user
  921. * @return the user with the primary key
  922. */
  923. public static User getUserById(long userId) throws PortalException {
  924. return getService().getUserById(userId);
  925. }
  926. /**
  927. * Returns the user with the screen name.
  928. *
  929. * @param companyId the primary key of the user's company
  930. * @param screenName the user's screen name
  931. * @return the user with the screen name
  932. */
  933. public static User getUserByScreenName(long companyId, String screenName)
  934. throws PortalException {
  935. return getService().getUserByScreenName(companyId, screenName);
  936. }
  937. public static List<User> getUserGroupUsers(long userGroupId)
  938. throws PortalException {
  939. return getService().getUserGroupUsers(userGroupId);
  940. }
  941. public static List<User> getUserGroupUsers(
  942. long userGroupId, int start, int end)
  943. throws PortalException {
  944. return getService().getUserGroupUsers(userGroupId, start, end);
  945. }
  946. /**
  947. * Returns the primary key of the user with the email address.
  948. *
  949. * @param companyId the primary key of the user's company
  950. * @param emailAddress the user's email address
  951. * @return the primary key of the user with the email address
  952. */
  953. public static long getUserIdByEmailAddress(
  954. long companyId, String emailAddress)
  955. throws PortalException {
  956. return getService().getUserIdByEmailAddress(companyId, emailAddress);
  957. }
  958. /**
  959. * Returns the primary key of the user with the screen name.
  960. *
  961. * @param companyId the primary key of the user's company
  962. * @param screenName the user's screen name
  963. * @return the primary key of the user with the screen name
  964. */
  965. public static long getUserIdByScreenName(long companyId, String screenName)
  966. throws PortalException {
  967. return getService().getUserIdByScreenName(companyId, screenName);
  968. }
  969. /**
  970. * Returns <code>true</code> if the user is a member of the group.
  971. *
  972. * @param groupId the primary key of the group
  973. * @param userId the primary key of the user
  974. * @return <code>true</code> if the user is a member of the group;
  975. <code>false</code> otherwise
  976. */
  977. public static boolean hasGroupUser(long groupId, long userId)
  978. throws PortalException {
  979. return getService().hasGroupUser(groupId, userId);
  980. }
  981. /**
  982. * Returns <code>true</code> if the user is a member of the role.
  983. *
  984. * @param roleId the primary key of the role
  985. * @param userId the primary key of the user
  986. * @return <code>true</code> if the user is a member of the role;
  987. <code>false</code> otherwise
  988. */
  989. public static boolean hasRoleUser(long roleId, long userId)
  990. throws PortalException {
  991. return getService().hasRoleUser(roleId, userId);
  992. }
  993. /**
  994. * Returns <code>true</code> if the user has the role with the name,
  995. * optionally through inheritance.
  996. *
  997. * @param companyId the primary key of the role's company
  998. * @param name the name of the role (must be a regular role, not an
  999. organization, site or provider role)
  1000. * @param userId the primary key of the user
  1001. * @param inherited whether to include roles inherited from organizations,
  1002. sites, etc.
  1003. * @return <code>true</code> if the user has the role; <code>false</code>
  1004. otherwise
  1005. */
  1006. public static boolean hasRoleUser(
  1007. long companyId, String name, long userId, boolean inherited)
  1008. throws PortalException {
  1009. return getService().hasRoleUser(companyId, name, userId, inherited);
  1010. }
  1011. /**
  1012. * Sends a password notification email to the user matching the email
  1013. * address. The portal's settings determine whether a password is sent
  1014. * explicitly or whether a link for resetting the user's password is sent.
  1015. * The method sends the email asynchronously and returns before the email is
  1016. * sent.
  1017. *
  1018. * <p>
  1019. * The content of the notification email is specified with the
  1020. * <code>admin.email.password</code> portal property keys. They can be
  1021. * overridden via a <code>portal-ext.properties</code> file or modified
  1022. * through the Portal Settings UI.
  1023. * </p>
  1024. *
  1025. * @param companyId the primary key of the user's company
  1026. * @param emailAddress the user's email address
  1027. * @return <code>true</code> if the notification email includes a new
  1028. password; <code>false</code> if the notification email only
  1029. contains a reset link
  1030. */
  1031. public static boolean sendPasswordByEmailAddress(
  1032. long companyId, String emailAddress)
  1033. throws PortalException {
  1034. return getService().sendPasswordByEmailAddress(companyId, emailAddress);
  1035. }
  1036. /**
  1037. * Sends a password notification email to the user matching the screen name.
  1038. * The portal's settings determine whether a password is sent explicitly or
  1039. * whether a link for resetting the user's password is sent. The method
  1040. * sends the email asynchronously and returns before the email is sent.
  1041. *
  1042. * <p>
  1043. * The content of the notification email is specified with the
  1044. * <code>admin.email.password</code> portal property keys. They can be
  1045. * overridden via a <code>portal-ext.properties</code> file or modified
  1046. * through the Portal Settings UI.
  1047. * </p>
  1048. *
  1049. * @param companyId the primary key of the user's company
  1050. * @param screenName the user's screen name
  1051. * @return <code>true</code> if the notification email includes a new
  1052. password; <code>false</code> if the notification email only
  1053. contains a reset link
  1054. */
  1055. public static boolean sendPasswordByScreenName(
  1056. long companyId, String screenName)
  1057. throws PortalException {
  1058. return getService().sendPasswordByScreenName(companyId, screenName);
  1059. }
  1060. /**
  1061. * Sends a password notification email to the user matching the ID. The
  1062. * portal's settings determine whether a password is sent explicitly or
  1063. * whether a link for resetting the user's password is sent. The method
  1064. * sends the email asynchronously and returns before the email is sent.
  1065. *
  1066. * <p>
  1067. * The content of the notification email is specified with the
  1068. * <code>admin.email.password</code> portal property keys. They can be
  1069. * overridden via a <code>portal-ext.properties</code> file or modified
  1070. * through the Portal Settings UI.
  1071. * </p>
  1072. *
  1073. * @param userId the user's primary key
  1074. * @return <code>true</code> if the notification email includes a new
  1075. password; <code>false</code> if the notification email only
  1076. contains a reset link
  1077. */
  1078. public static boolean sendPasswordByUserId(long userId)
  1079. throws PortalException {
  1080. return getService().sendPasswordByUserId(userId);
  1081. }
  1082. /**
  1083. * Sets the users in the role, removing and adding users to the role as
  1084. * necessary.
  1085. *
  1086. * @param roleId the primary key of the role
  1087. * @param userIds the primary keys of the users
  1088. */
  1089. public static void setRoleUsers(long roleId, long[] userIds)
  1090. throws PortalException {
  1091. getService().setRoleUsers(roleId, userIds);
  1092. }
  1093. /**
  1094. * Sets the users in the user group, removing and adding users to the user
  1095. * group as necessary.
  1096. *
  1097. * @param userGroupId the primary key of the user group
  1098. * @param userIds the primary keys of the users
  1099. */
  1100. public static void setUserGroupUsers(long userGroupId, long[] userIds)
  1101. throws PortalException {
  1102. getService().setUserGroupUsers(userGroupId, userIds);
  1103. }
  1104. /**
  1105. * Removes the users from the teams of a group.
  1106. *
  1107. * @param groupId the primary key of the group
  1108. * @param userIds the primary keys of the users
  1109. */
  1110. public static void unsetGroupTeamsUsers(long groupId, long[] userIds)
  1111. throws PortalException {
  1112. getService().unsetGroupTeamsUsers(groupId, userIds);
  1113. }
  1114. /**
  1115. * Removes the users from the group.
  1116. *
  1117. * @param groupId the primary key of the group
  1118. * @param userIds the primary keys of the users
  1119. * @param serviceContext the service context to be applied (optionally
  1120. <code>null</code>)
  1121. */
  1122. public static void unsetGroupUsers(
  1123. long groupId, long[] userIds, ServiceContext serviceContext)
  1124. throws PortalException {
  1125. getService().unsetGroupUsers(groupId, userIds, serviceContext);
  1126. }
  1127. /**
  1128. * Removes the users from the organization.
  1129. *
  1130. * @param organizationId the primary key of the organization
  1131. * @param userIds the primary keys of the users
  1132. */
  1133. public static void unsetOrganizationUsers(
  1134. long organizationId, long[] userIds)
  1135. throws PortalException {
  1136. getService().unsetOrganizationUsers(organizationId, userIds);
  1137. }
  1138. /**
  1139. * Removes the users from the password policy.
  1140. *
  1141. * @param passwordPolicyId the primary key of the password policy
  1142. * @param userIds the primary keys of the users
  1143. */
  1144. public static void unsetPasswordPolicyUsers(
  1145. long passwordPolicyId, long[] userIds)
  1146. throws PortalException {
  1147. getService().unsetPasswordPolicyUsers(passwordPolicyId, userIds);
  1148. }
  1149. /**
  1150. * Removes the users from the role.
  1151. *
  1152. * @param roleId the primary key of the role
  1153. * @param userIds the primary keys of the users
  1154. */
  1155. public static void unsetRoleUsers(long roleId, long[] userIds)
  1156. throws PortalException {
  1157. getService().unsetRoleUsers(roleId, userIds);
  1158. }
  1159. /**
  1160. * Removes the users from the team.
  1161. *
  1162. * @param teamId the primary key of the team
  1163. * @param userIds the primary keys of the users
  1164. */
  1165. public static void unsetTeamUsers(long teamId, long[] userIds)
  1166. throws PortalException {
  1167. getService().unsetTeamUsers(teamId, userIds);
  1168. }
  1169. /**
  1170. * Removes the users from the user group.
  1171. *
  1172. * @param userGroupId the primary key of the user group
  1173. * @param userIds the primary keys of the users
  1174. */
  1175. public static void unsetUserGroupUsers(long userGroupId, long[] userIds)
  1176. throws PortalException {
  1177. getService().unsetUserGroupUsers(userGroupId, userIds);
  1178. }
  1179. /**
  1180. * Updates the user's response to the terms of use agreement.
  1181. *
  1182. * @param userId the primary key of the user
  1183. * @param agreedToTermsOfUse whether the user has agree to the terms of use
  1184. * @return the user
  1185. */
  1186. public static User updateAgreedToTermsOfUse(
  1187. long userId, boolean agreedToTermsOfUse)
  1188. throws PortalException {
  1189. return getService().updateAgreedToTermsOfUse(
  1190. userId, agreedToTermsOfUse);
  1191. }
  1192. /**
  1193. * Updates the user's email address.
  1194. *
  1195. * @param userId the primary key of the user
  1196. * @param password the user's password
  1197. * @param emailAddress1 the user's new email address
  1198. * @param emailAddress2 the user's new email address confirmation
  1199. * @param serviceContext the service context to be applied. Must set the
  1200. portal URL, main path, primary key of the layout, remote address,
  1201. remote host, and agent for the user.
  1202. * @return the user
  1203. */
  1204. public static User updateEmailAddress(
  1205. long userId, String password, String emailAddress1,
  1206. String emailAddress2, ServiceContext serviceContext)
  1207. throws PortalException {
  1208. return getService().updateEmailAddress(
  1209. userId, password, emailAddre