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