2 * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
4 * This library is free software; you can redistribute it and/or modify it under
5 * the terms of the GNU Lesser General Public License as published by the Free
6 * Software Foundation; either version 2.1 of the License, or (at your option)
9 * This library is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
15 package com.liferay.portal.service.impl;
17 import java.util.List;
19 import com.liferay.portal.kernel.exception.PortalException;
20 import com.liferay.portal.kernel.exception.SystemException;
21 import com.liferay.portal.model.MembershipRequest;
22 import com.liferay.portal.security.permission.ActionKeys;
23 import com.liferay.portal.service.ServiceContext;
24 import com.liferay.portal.service.base.MembershipRequestServiceBaseImpl;
25 import com.liferay.portal.service.permission.GroupPermissionUtil;
28 * @author Jorge Ferrer
30 public class MembershipRequestServiceImpl
31 extends MembershipRequestServiceBaseImpl {
33 public MembershipRequest addMembershipRequest(
34 long groupId, String comments, ServiceContext serviceContext)
35 throws PortalException, SystemException {
37 return membershipRequestLocalService.addMembershipRequest(
38 getUserId(), groupId, comments, serviceContext);
41 public void deleteMembershipRequests(long groupId, int statusId)
42 throws PortalException, SystemException {
44 GroupPermissionUtil.check(
45 getPermissionChecker(), groupId, ActionKeys.ASSIGN_MEMBERS);
47 membershipRequestLocalService.deleteMembershipRequests(
51 public MembershipRequest getMembershipRequest(long membershipRequestId)
52 throws PortalException, SystemException {
54 return membershipRequestLocalService.getMembershipRequest(
58 public List<MembershipRequest> getMembershipRequestByUserId(long userId)
59 throws PortalException, SystemException {
60 return membershipRequestLocalService.getMembershipRequestByUserId(userId);
63 public void updateStatus(
64 long membershipRequestId, String reviewComments, int statusId,
65 ServiceContext serviceContext)
66 throws PortalException, SystemException {
68 MembershipRequest membershipRequest =
69 membershipRequestPersistence.findByPrimaryKey(membershipRequestId);
71 GroupPermissionUtil.check(
72 getPermissionChecker(), membershipRequest.getGroupId(),
73 ActionKeys.ASSIGN_MEMBERS);
75 membershipRequestLocalService.updateStatus(
76 getUserId(), membershipRequestId, reviewComments, statusId, true,