Example usage for com.liferay.portal.kernel.util PropsKeys USERS_UPDATE_USER_NAME

List of usage examples for com.liferay.portal.kernel.util PropsKeys USERS_UPDATE_USER_NAME

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.util PropsKeys USERS_UPDATE_USER_NAME.

Prototype

String USERS_UPDATE_USER_NAME

To view the source code for com.liferay.portal.kernel.util PropsKeys USERS_UPDATE_USER_NAME.

Click Source Link

Usage

From source file:com.liferay.message.boards.internal.service.MBMessageUserLocalServiceWrapper.java

License:Open Source License

@Override
public 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 portrait, 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,
        List<UserGroupRole> userGroupRoles, long[] userGroupIds, ServiceContext serviceContext)
        throws PortalException {

    User user = getUser(userId);//from   w  ww .  j  av  a 2s  . c  om

    String oldFullName = user.getFullName();

    User curUser = super.updateUser(userId, oldPassword, newPassword1, newPassword2, passwordReset,
            reminderQueryQuestion, reminderQueryAnswer, screenName, emailAddress, facebookId, openId, portrait,
            portraitBytes, 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);

    if (GetterUtil.getBoolean(PropsKeys.USERS_UPDATE_USER_NAME + MBMessage.class.getName())
            && !oldFullName.equals(user.getFullName())) {

        _mbMessageLocalService.updateUserName(userId, user.getFullName());
    }

    return curUser;
}