1
22
23 package com.liferay.portal.service.http;
24
25 import com.liferay.portal.kernel.log.Log;
26 import com.liferay.portal.kernel.log.LogFactoryUtil;
27 import com.liferay.portal.kernel.util.IntegerWrapper;
28 import com.liferay.portal.kernel.util.LongWrapper;
29 import com.liferay.portal.kernel.util.MethodWrapper;
30 import com.liferay.portal.kernel.util.NullWrapper;
31 import com.liferay.portal.security.auth.HttpPrincipal;
32 import com.liferay.portal.service.MembershipRequestServiceUtil;
33
34
71 public class MembershipRequestServiceHttp {
72 public static com.liferay.portal.model.MembershipRequest addMembershipRequest(
73 HttpPrincipal httpPrincipal, long groupId, java.lang.String comments)
74 throws com.liferay.portal.PortalException,
75 com.liferay.portal.SystemException {
76 try {
77 Object paramObj0 = new LongWrapper(groupId);
78
79 Object paramObj1 = comments;
80
81 if (comments == null) {
82 paramObj1 = new NullWrapper("java.lang.String");
83 }
84
85 MethodWrapper methodWrapper = new MethodWrapper(MembershipRequestServiceUtil.class.getName(),
86 "addMembershipRequest",
87 new Object[] { paramObj0, paramObj1 });
88
89 Object returnObj = null;
90
91 try {
92 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
93 }
94 catch (Exception e) {
95 if (e instanceof com.liferay.portal.PortalException) {
96 throw (com.liferay.portal.PortalException)e;
97 }
98
99 if (e instanceof com.liferay.portal.SystemException) {
100 throw (com.liferay.portal.SystemException)e;
101 }
102
103 throw new com.liferay.portal.SystemException(e);
104 }
105
106 return (com.liferay.portal.model.MembershipRequest)returnObj;
107 }
108 catch (com.liferay.portal.SystemException se) {
109 _log.error(se, se);
110
111 throw se;
112 }
113 }
114
115 public static void deleteMembershipRequests(HttpPrincipal httpPrincipal,
116 long groupId, int statusId)
117 throws com.liferay.portal.PortalException,
118 com.liferay.portal.SystemException {
119 try {
120 Object paramObj0 = new LongWrapper(groupId);
121
122 Object paramObj1 = new IntegerWrapper(statusId);
123
124 MethodWrapper methodWrapper = new MethodWrapper(MembershipRequestServiceUtil.class.getName(),
125 "deleteMembershipRequests",
126 new Object[] { paramObj0, paramObj1 });
127
128 try {
129 TunnelUtil.invoke(httpPrincipal, methodWrapper);
130 }
131 catch (Exception e) {
132 if (e instanceof com.liferay.portal.PortalException) {
133 throw (com.liferay.portal.PortalException)e;
134 }
135
136 if (e instanceof com.liferay.portal.SystemException) {
137 throw (com.liferay.portal.SystemException)e;
138 }
139
140 throw new com.liferay.portal.SystemException(e);
141 }
142 }
143 catch (com.liferay.portal.SystemException se) {
144 _log.error(se, se);
145
146 throw se;
147 }
148 }
149
150 public static com.liferay.portal.model.MembershipRequest getMembershipRequest(
151 HttpPrincipal httpPrincipal, long membershipRequestId)
152 throws com.liferay.portal.PortalException,
153 com.liferay.portal.SystemException {
154 try {
155 Object paramObj0 = new LongWrapper(membershipRequestId);
156
157 MethodWrapper methodWrapper = new MethodWrapper(MembershipRequestServiceUtil.class.getName(),
158 "getMembershipRequest", new Object[] { paramObj0 });
159
160 Object returnObj = null;
161
162 try {
163 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
164 }
165 catch (Exception e) {
166 if (e instanceof com.liferay.portal.PortalException) {
167 throw (com.liferay.portal.PortalException)e;
168 }
169
170 if (e instanceof com.liferay.portal.SystemException) {
171 throw (com.liferay.portal.SystemException)e;
172 }
173
174 throw new com.liferay.portal.SystemException(e);
175 }
176
177 return (com.liferay.portal.model.MembershipRequest)returnObj;
178 }
179 catch (com.liferay.portal.SystemException se) {
180 _log.error(se, se);
181
182 throw se;
183 }
184 }
185
186 public static void updateStatus(HttpPrincipal httpPrincipal,
187 long membershipRequestId, java.lang.String reviewComments, int statusId)
188 throws com.liferay.portal.PortalException,
189 com.liferay.portal.SystemException {
190 try {
191 Object paramObj0 = new LongWrapper(membershipRequestId);
192
193 Object paramObj1 = reviewComments;
194
195 if (reviewComments == null) {
196 paramObj1 = new NullWrapper("java.lang.String");
197 }
198
199 Object paramObj2 = new IntegerWrapper(statusId);
200
201 MethodWrapper methodWrapper = new MethodWrapper(MembershipRequestServiceUtil.class.getName(),
202 "updateStatus",
203 new Object[] { paramObj0, paramObj1, paramObj2 });
204
205 try {
206 TunnelUtil.invoke(httpPrincipal, methodWrapper);
207 }
208 catch (Exception e) {
209 if (e instanceof com.liferay.portal.PortalException) {
210 throw (com.liferay.portal.PortalException)e;
211 }
212
213 if (e instanceof com.liferay.portal.SystemException) {
214 throw (com.liferay.portal.SystemException)e;
215 }
216
217 throw new com.liferay.portal.SystemException(e);
218 }
219 }
220 catch (com.liferay.portal.SystemException se) {
221 _log.error(se, se);
222
223 throw se;
224 }
225 }
226
227 private static Log _log = LogFactoryUtil.getLog(MembershipRequestServiceHttp.class);
228 }