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

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

Introduction

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

Prototype

public static com.liferay.portal.kernel.model.User getUserByUuidAndCompanyId(String uuid, long companyId)
        throws com.liferay.portal.kernel.exception.PortalException 

Source Link

Document

Returns the user with the matching UUID and company.

Usage

From source file:com.liferay.exportimport.lar.CurrentUserIdStrategy.java

License:Open Source License

@Override
public long getUserId(String userUuid) {
    if (Validator.isNull(userUuid)) {
        return _user.getUserId();
    }/*from  w w w .j a  v  a2 s  .  c  o  m*/

    try {
        User user = UserLocalServiceUtil.getUserByUuidAndCompanyId(userUuid, _user.getCompanyId());

        return user.getUserId();
    } catch (Exception e) {
        return _user.getUserId();
    }
}