Search in sources :

Example 1 with NoSuchGroupException

use of com.liferay.portal.NoSuchGroupException in project liferay-ide by liferay.

the class WebServerServlet method _getGroupId.

private static long _getGroupId(long companyId, String name) throws Exception {
    try {
        Group group = GroupLocalServiceUtil.getFriendlyURLGroup(companyId, StringPool.SLASH + name);
        return group.getGroupId();
    } catch (NoSuchGroupException nsge) {
    }
    User user = UserLocalServiceUtil.getUserByScreenName(companyId, name);
    Group group = user.getGroup();
    return group.getGroupId();
}
Also used : Group(com.liferay.portal.model.Group) User(com.liferay.portal.model.User) NoSuchGroupException(com.liferay.portal.NoSuchGroupException)

Aggregations

NoSuchGroupException (com.liferay.portal.NoSuchGroupException)1 Group (com.liferay.portal.model.Group)1 User (com.liferay.portal.model.User)1