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;
17 import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
18 import com.liferay.portal.kernel.util.ReferenceRegistry;
21 * The utility for the membership request local service. This utility wraps {@link com.liferay.portal.service.impl.MembershipRequestLocalServiceImpl} and is the primary access point for service operations in application layer code running on the local server.
24 * This is a local service. Methods of this service will not have security checks based on the propagated JAAS credentials because this service can only be accessed from within the same VM.
27 * @author Brian Wing Shun Chan
28 * @see MembershipRequestLocalService
29 * @see com.liferay.portal.service.base.MembershipRequestLocalServiceBaseImpl
30 * @see com.liferay.portal.service.impl.MembershipRequestLocalServiceImpl
33 public class MembershipRequestLocalServiceUtil {
35 * NOTE FOR DEVELOPERS:
37 * Never modify this class directly. Add custom service methods to {@link com.liferay.portal.service.impl.MembershipRequestLocalServiceImpl} and rerun ServiceBuilder to regenerate this class.
41 * Adds the membership request to the database. Also notifies the appropriate model listeners.
43 * @param membershipRequest the membership request
44 * @return the membership request that was added
45 * @throws SystemException if a system exception occurred
47 public static com.liferay.portal.model.MembershipRequest addMembershipRequest(
48 com.liferay.portal.model.MembershipRequest membershipRequest)
49 throws com.liferay.portal.kernel.exception.SystemException {
50 return getService().addMembershipRequest(membershipRequest);
54 * Creates a new membership request with the primary key. Does not add the membership request to the database.
56 * @param membershipRequestId the primary key for the new membership request
57 * @return the new membership request
59 public static com.liferay.portal.model.MembershipRequest createMembershipRequest(
60 long membershipRequestId) {
61 return getService().createMembershipRequest(membershipRequestId);
65 * Deletes the membership request with the primary key from the database. Also notifies the appropriate model listeners.
67 * @param membershipRequestId the primary key of the membership request
68 * @return the membership request that was removed
69 * @throws PortalException if a membership request with the primary key could not be found
70 * @throws SystemException if a system exception occurred
72 public static com.liferay.portal.model.MembershipRequest deleteMembershipRequest(
73 long membershipRequestId)
74 throws com.liferay.portal.kernel.exception.PortalException,
75 com.liferay.portal.kernel.exception.SystemException {
76 return getService().deleteMembershipRequest(membershipRequestId);
80 * Deletes the membership request from the database. Also notifies the appropriate model listeners.
82 * @param membershipRequest the membership request
83 * @return the membership request that was removed
84 * @throws SystemException if a system exception occurred
86 public static com.liferay.portal.model.MembershipRequest deleteMembershipRequest(
87 com.liferay.portal.model.MembershipRequest membershipRequest)
88 throws com.liferay.portal.kernel.exception.SystemException {
89 return getService().deleteMembershipRequest(membershipRequest);
92 public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() {
93 return getService().dynamicQuery();
97 * Performs a dynamic query on the database and returns the matching rows.
99 * @param dynamicQuery the dynamic query
100 * @return the matching rows
101 * @throws SystemException if a system exception occurred
103 @SuppressWarnings("rawtypes")
104 public static java.util.List dynamicQuery(
105 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
106 throws com.liferay.portal.kernel.exception.SystemException {
107 return getService().dynamicQuery(dynamicQuery);
111 * Performs a dynamic query on the database and returns a range of the matching rows.
114 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
117 * @param dynamicQuery the dynamic query
118 * @param start the lower bound of the range of model instances
119 * @param end the upper bound of the range of model instances (not inclusive)
120 * @return the range of matching rows
121 * @throws SystemException if a system exception occurred
123 @SuppressWarnings("rawtypes")
124 public static java.util.List dynamicQuery(
125 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
126 int end) throws com.liferay.portal.kernel.exception.SystemException {
127 return getService().dynamicQuery(dynamicQuery, start, end);
131 * Performs a dynamic query on the database and returns an ordered range of the matching rows.
134 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
137 * @param dynamicQuery the dynamic query
138 * @param start the lower bound of the range of model instances
139 * @param end the upper bound of the range of model instances (not inclusive)
140 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
141 * @return the ordered range of matching rows
142 * @throws SystemException if a system exception occurred
144 @SuppressWarnings("rawtypes")
145 public static java.util.List dynamicQuery(
146 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
148 com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
149 throws com.liferay.portal.kernel.exception.SystemException {
151 .dynamicQuery(dynamicQuery, start, end, orderByComparator);
155 * Returns the number of rows that match the dynamic query.
157 * @param dynamicQuery the dynamic query
158 * @return the number of rows that match the dynamic query
159 * @throws SystemException if a system exception occurred
161 public static long dynamicQueryCount(
162 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
163 throws com.liferay.portal.kernel.exception.SystemException {
164 return getService().dynamicQueryCount(dynamicQuery);
167 public static com.liferay.portal.model.MembershipRequest fetchMembershipRequest(
168 long membershipRequestId)
169 throws com.liferay.portal.kernel.exception.SystemException {
170 return getService().fetchMembershipRequest(membershipRequestId);
174 * Returns the membership request with the primary key.
176 * @param membershipRequestId the primary key of the membership request
177 * @return the membership request
178 * @throws PortalException if a membership request with the primary key could not be found
179 * @throws SystemException if a system exception occurred
181 public static com.liferay.portal.model.MembershipRequest getMembershipRequest(
182 long membershipRequestId)
183 throws com.liferay.portal.kernel.exception.PortalException,
184 com.liferay.portal.kernel.exception.SystemException {
185 return getService().getMembershipRequest(membershipRequestId);
188 public static java.util.List<com.liferay.portal.model.MembershipRequest> getMembershipRequestByUserId(
190 throws com.liferay.portal.kernel.exception.PortalException,
191 com.liferay.portal.kernel.exception.SystemException {
192 return getService().getMembershipRequestByUserId(userId);
195 public static com.liferay.portal.model.PersistedModel getPersistedModel(
196 java.io.Serializable primaryKeyObj)
197 throws com.liferay.portal.kernel.exception.PortalException,
198 com.liferay.portal.kernel.exception.SystemException {
199 return getService().getPersistedModel(primaryKeyObj);
203 * Returns a range of all the membership requests.
206 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
209 * @param start the lower bound of the range of membership requests
210 * @param end the upper bound of the range of membership requests (not inclusive)
211 * @return the range of membership requests
212 * @throws SystemException if a system exception occurred
214 public static java.util.List<com.liferay.portal.model.MembershipRequest> getMembershipRequests(
216 throws com.liferay.portal.kernel.exception.SystemException {
217 return getService().getMembershipRequests(start, end);
221 * Returns the number of membership requests.
223 * @return the number of membership requests
224 * @throws SystemException if a system exception occurred
226 public static int getMembershipRequestsCount()
227 throws com.liferay.portal.kernel.exception.SystemException {
228 return getService().getMembershipRequestsCount();
232 * Updates the membership request in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
234 * @param membershipRequest the membership request
235 * @return the membership request that was updated
236 * @throws SystemException if a system exception occurred
238 public static com.liferay.portal.model.MembershipRequest updateMembershipRequest(
239 com.liferay.portal.model.MembershipRequest membershipRequest)
240 throws com.liferay.portal.kernel.exception.SystemException {
241 return getService().updateMembershipRequest(membershipRequest);
245 * Updates the membership request in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
247 * @param membershipRequest the membership request
248 * @param merge whether to merge the membership request with the current session. See {@link com.liferay.portal.service.persistence.BatchSession#update(com.liferay.portal.kernel.dao.orm.Session, com.liferay.portal.model.BaseModel, boolean)} for an explanation.
249 * @return the membership request that was updated
250 * @throws SystemException if a system exception occurred
252 public static com.liferay.portal.model.MembershipRequest updateMembershipRequest(
253 com.liferay.portal.model.MembershipRequest membershipRequest,
255 throws com.liferay.portal.kernel.exception.SystemException {
256 return getService().updateMembershipRequest(membershipRequest, merge);
260 * Returns the Spring bean ID for this bean.
262 * @return the Spring bean ID for this bean
264 public static java.lang.String getBeanIdentifier() {
265 return getService().getBeanIdentifier();
269 * Sets the Spring bean ID for this bean.
271 * @param beanIdentifier the Spring bean ID for this bean
273 public static void setBeanIdentifier(java.lang.String beanIdentifier) {
274 getService().setBeanIdentifier(beanIdentifier);
277 public static com.liferay.portal.model.MembershipRequest addMembershipRequest(
278 long userId, long groupId, java.lang.String comments,
279 com.liferay.portal.service.ServiceContext serviceContext)
280 throws com.liferay.portal.kernel.exception.PortalException,
281 com.liferay.portal.kernel.exception.SystemException {
283 .addMembershipRequest(userId, groupId, comments,
287 public static void deleteMembershipRequests(long groupId)
288 throws com.liferay.portal.kernel.exception.SystemException {
289 getService().deleteMembershipRequests(groupId);
292 public static void deleteMembershipRequests(long groupId, int statusId)
293 throws com.liferay.portal.kernel.exception.SystemException {
294 getService().deleteMembershipRequests(groupId, statusId);
297 public static void deleteMembershipRequestsByUserId(long userId)
298 throws com.liferay.portal.kernel.exception.SystemException {
299 getService().deleteMembershipRequestsByUserId(userId);
302 public static java.util.List<com.liferay.portal.model.MembershipRequest> getMembershipRequests(
303 long userId, long groupId, int statusId)
304 throws com.liferay.portal.kernel.exception.SystemException {
305 return getService().getMembershipRequests(userId, groupId, statusId);
308 public static boolean hasMembershipRequest(long userId, long groupId,
310 throws com.liferay.portal.kernel.exception.SystemException {
311 return getService().hasMembershipRequest(userId, groupId, statusId);
314 public static java.util.List<com.liferay.portal.model.MembershipRequest> search(
315 long groupId, int status, int start, int end)
316 throws com.liferay.portal.kernel.exception.SystemException {
317 return getService().search(groupId, status, start, end);
320 public static int searchCount(long groupId, int status)
321 throws com.liferay.portal.kernel.exception.SystemException {
322 return getService().searchCount(groupId, status);
325 public static void updateStatus(long replierUserId,
326 long membershipRequestId, java.lang.String replyComments, int statusId,
327 boolean addUserToGroup,
328 com.liferay.portal.service.ServiceContext serviceContext)
329 throws com.liferay.portal.kernel.exception.PortalException,
330 com.liferay.portal.kernel.exception.SystemException {
332 .updateStatus(replierUserId, membershipRequestId, replyComments,
333 statusId, addUserToGroup, serviceContext);
336 public static MembershipRequestLocalService getService() {
337 if (_service == null) {
338 _service = (MembershipRequestLocalService)PortalBeanLocatorUtil.locate(MembershipRequestLocalService.class.getName());
340 ReferenceRegistry.registerReference(MembershipRequestLocalServiceUtil.class,
350 public void setService(MembershipRequestLocalService service) {
353 private static MembershipRequestLocalService _service;