Example usage for com.liferay.portal.kernel.service OrganizationLocalServiceUtil addUserOrganization

List of usage examples for com.liferay.portal.kernel.service OrganizationLocalServiceUtil addUserOrganization

Introduction

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

Prototype

public static void addUserOrganization(long userId, com.liferay.portal.kernel.model.Organization organization) 

Source Link

Usage

From source file:eu.gerhards.liferay.services.angular.service.impl.AngularUserServiceImpl.java

License:Open Source License

/**
 * Adds the user to the organization.//from  w w  w.  j a v a 2 s.  co  m
 *
 * @param organizationId the primary key of the organization
 * @param user the user
 */
protected void addOrganizationUser(long organizationId, User user) {

    OrganizationLocalServiceUtil.addUserOrganization(user.getUserId(), organizationId);

    try {
        reindex(user);
    } catch (SearchException se) {
        throw new SystemException(se);
    }
}

From source file:eu.gerhards.liferay.services.angular.service.impl.AngularUserServiceImpl.java

License:Open Source License

/**
 * Adds the users to the organization./* w  w w.  ja va  2 s.c o  m*/
 *
 * @param organizationId the primary key of the organization
 * @param users the users
 */
protected void addOrganizationUsers(long organizationId, List<User> users) throws PortalException {

    for (User user : users) {
        OrganizationLocalServiceUtil.addUserOrganization(user.getUserId(), organizationId);
    }

    reindex(users);
}