001
014
015 package com.liferay.portal.service.http;
016
017 import com.liferay.portal.kernel.log.Log;
018 import com.liferay.portal.kernel.log.LogFactoryUtil;
019 import com.liferay.portal.kernel.util.IntegerWrapper;
020 import com.liferay.portal.kernel.util.LongWrapper;
021 import com.liferay.portal.kernel.util.MethodWrapper;
022 import com.liferay.portal.kernel.util.NullWrapper;
023 import com.liferay.portal.security.auth.HttpPrincipal;
024 import com.liferay.portal.service.MembershipRequestServiceUtil;
025
026
056 public class MembershipRequestServiceHttp {
057 public static com.liferay.portal.model.MembershipRequest addMembershipRequest(
058 HttpPrincipal httpPrincipal, long groupId, java.lang.String comments)
059 throws com.liferay.portal.kernel.exception.PortalException,
060 com.liferay.portal.kernel.exception.SystemException {
061 try {
062 Object paramObj0 = new LongWrapper(groupId);
063
064 Object paramObj1 = comments;
065
066 if (comments == null) {
067 paramObj1 = new NullWrapper("java.lang.String");
068 }
069
070 MethodWrapper methodWrapper = new MethodWrapper(MembershipRequestServiceUtil.class.getName(),
071 "addMembershipRequest",
072 new Object[] { paramObj0, paramObj1 });
073
074 Object returnObj = null;
075
076 try {
077 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
078 }
079 catch (Exception e) {
080 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
081 throw (com.liferay.portal.kernel.exception.PortalException)e;
082 }
083
084 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
085 throw (com.liferay.portal.kernel.exception.SystemException)e;
086 }
087
088 throw new com.liferay.portal.kernel.exception.SystemException(e);
089 }
090
091 return (com.liferay.portal.model.MembershipRequest)returnObj;
092 }
093 catch (com.liferay.portal.kernel.exception.SystemException se) {
094 _log.error(se, se);
095
096 throw se;
097 }
098 }
099
100 public static void deleteMembershipRequests(HttpPrincipal httpPrincipal,
101 long groupId, int statusId)
102 throws com.liferay.portal.kernel.exception.PortalException,
103 com.liferay.portal.kernel.exception.SystemException {
104 try {
105 Object paramObj0 = new LongWrapper(groupId);
106
107 Object paramObj1 = new IntegerWrapper(statusId);
108
109 MethodWrapper methodWrapper = new MethodWrapper(MembershipRequestServiceUtil.class.getName(),
110 "deleteMembershipRequests",
111 new Object[] { paramObj0, paramObj1 });
112
113 try {
114 TunnelUtil.invoke(httpPrincipal, methodWrapper);
115 }
116 catch (Exception e) {
117 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
118 throw (com.liferay.portal.kernel.exception.PortalException)e;
119 }
120
121 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
122 throw (com.liferay.portal.kernel.exception.SystemException)e;
123 }
124
125 throw new com.liferay.portal.kernel.exception.SystemException(e);
126 }
127 }
128 catch (com.liferay.portal.kernel.exception.SystemException se) {
129 _log.error(se, se);
130
131 throw se;
132 }
133 }
134
135 public static com.liferay.portal.model.MembershipRequest getMembershipRequest(
136 HttpPrincipal httpPrincipal, long membershipRequestId)
137 throws com.liferay.portal.kernel.exception.PortalException,
138 com.liferay.portal.kernel.exception.SystemException {
139 try {
140 Object paramObj0 = new LongWrapper(membershipRequestId);
141
142 MethodWrapper methodWrapper = new MethodWrapper(MembershipRequestServiceUtil.class.getName(),
143 "getMembershipRequest", new Object[] { paramObj0 });
144
145 Object returnObj = null;
146
147 try {
148 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
149 }
150 catch (Exception e) {
151 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
152 throw (com.liferay.portal.kernel.exception.PortalException)e;
153 }
154
155 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
156 throw (com.liferay.portal.kernel.exception.SystemException)e;
157 }
158
159 throw new com.liferay.portal.kernel.exception.SystemException(e);
160 }
161
162 return (com.liferay.portal.model.MembershipRequest)returnObj;
163 }
164 catch (com.liferay.portal.kernel.exception.SystemException se) {
165 _log.error(se, se);
166
167 throw se;
168 }
169 }
170
171 public static void updateStatus(HttpPrincipal httpPrincipal,
172 long membershipRequestId, java.lang.String reviewComments, int statusId)
173 throws com.liferay.portal.kernel.exception.PortalException,
174 com.liferay.portal.kernel.exception.SystemException {
175 try {
176 Object paramObj0 = new LongWrapper(membershipRequestId);
177
178 Object paramObj1 = reviewComments;
179
180 if (reviewComments == null) {
181 paramObj1 = new NullWrapper("java.lang.String");
182 }
183
184 Object paramObj2 = new IntegerWrapper(statusId);
185
186 MethodWrapper methodWrapper = new MethodWrapper(MembershipRequestServiceUtil.class.getName(),
187 "updateStatus",
188 new Object[] { paramObj0, paramObj1, paramObj2 });
189
190 try {
191 TunnelUtil.invoke(httpPrincipal, methodWrapper);
192 }
193 catch (Exception e) {
194 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
195 throw (com.liferay.portal.kernel.exception.PortalException)e;
196 }
197
198 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
199 throw (com.liferay.portal.kernel.exception.SystemException)e;
200 }
201
202 throw new com.liferay.portal.kernel.exception.SystemException(e);
203 }
204 }
205 catch (com.liferay.portal.kernel.exception.SystemException se) {
206 _log.error(se, se);
207
208 throw se;
209 }
210 }
211
212 private static Log _log = LogFactoryUtil.getLog(MembershipRequestServiceHttp.class);
213 }