Example usage for com.liferay.portal.kernel.service UserLocalServiceUtil updateUser

List of usage examples for com.liferay.portal.kernel.service UserLocalServiceUtil updateUser

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.service UserLocalServiceUtil updateUser.

Prototype

public static com.liferay.portal.kernel.model.User updateUser(long userId, String oldPassword,
        String newPassword1, String newPassword2, boolean passwordReset, String reminderQueryQuestion,
        String reminderQueryAnswer, String screenName, String emailAddress, long facebookId, String openId,
        boolean hasPortrait, byte[] portraitBytes, String languageId, String timeZoneId, String greeting,
        String comments, String firstName, String middleName, String lastName, long prefixId, long suffixId,
        boolean male, int birthdayMonth, int birthdayDay, int birthdayYear, String smsSn, String facebookSn,
        String jabberSn, String skypeSn, String twitterSn, String jobTitle, long[] groupIds,
        long[] organizationIds, long[] roleIds,
        java.util.List<com.liferay.portal.kernel.model.UserGroupRole> userGroupRoles, long[] userGroupIds,
        ServiceContext serviceContext) throws com.liferay.portal.kernel.exception.PortalException 

Source Link

Document

Updates the user.

Usage

From source file:it.sysdata.base.service.impl.UserHelperLocalServiceImpl.java

License:Open Source License

public User updateUserInfo(String emailAddress, String password, String firstName, String lastName,
        ServiceContext serviceContext) throws PortalException, SystemException {

    User user = UserLocalServiceUtil.getUserByEmailAddress(serviceContext.getCompanyId(), emailAddress);

    long userId = user.getUserId();
    String oldPassword = password;
    String newPassword1 = password;
    String newPassword2 = password;
    boolean passwordReset = false;

    String reminderQueryQuestion = null;
    String reminderQueryAnswer = null;
    String screenName = user.getScreenName();

    long facebookId = user.getFacebookId();
    String openId = user.getOpenId();
    String languageId = user.getLanguageId();
    String timeZoneId = user.getTimeZoneId();
    String greeting = user.getGreeting();
    String comments = null;//  www  .  j  a  va2s  . co  m
    String middleName = user.getMiddleName();

    int prefixId = 0;
    int suffixId = 0;
    boolean male = user.getMale();
    int birthdayMonth = 0;
    int birthdayDay = 0;
    int birthdayYear = 0;

    String smsSn = null;
    String aimSn = null;
    String facebookSn = null;
    String icqSn = null;
    String jabberSn = null;
    String msnSn = null;
    String mySpaceSn = null;
    String skypeSn = null;
    String twitterSn = null;
    String ymSn = null;
    String jobTitle = user.getJobTitle();

    long[] groupIds = user.getGroupIds();
    long[] organizationIds = user.getOrganizationIds();
    long[] roleIds = user.getRoleIds();
    List<UserGroupRole> userGroupRoles = null;
    long[] userGroupIds = user.getUserGroupIds();

    return UserLocalServiceUtil.updateUser(userId, oldPassword, newPassword1, newPassword2, passwordReset,
            reminderQueryQuestion, reminderQueryAnswer, screenName, emailAddress, facebookId, openId, true,
            null, languageId, timeZoneId, greeting, comments, firstName, middleName, lastName, prefixId,
            suffixId, male, birthdayMonth, birthdayDay, birthdayYear, smsSn, facebookSn, jabberSn, skypeSn,
            twitterSn, jobTitle, groupIds, organizationIds, roleIds, userGroupRoles, userGroupIds,
            serviceContext);
}