1
22
23 package com.liferay.portlet.imagegallery.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.BooleanWrapper;
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.http.TunnelUtil;
33
34 import com.liferay.portlet.imagegallery.service.IGImageServiceUtil;
35
36
73 public class IGImageServiceHttp {
74 public static com.liferay.portlet.imagegallery.model.IGImage addImage(
75 HttpPrincipal httpPrincipal, long folderId,
76 java.lang.String description, java.io.File file,
77 java.lang.String contentType, java.lang.String[] tagsEntries,
78 boolean addCommunityPermissions, boolean addGuestPermissions)
79 throws com.liferay.portal.SystemException,
80 com.liferay.portal.PortalException {
81 try {
82 Object paramObj0 = new LongWrapper(folderId);
83 Object paramObj1 = description;
84
85 if (description == null) {
86 paramObj1 = new NullWrapper("java.lang.String");
87 }
88
89 Object paramObj2 = file;
90
91 if (file == null) {
92 paramObj2 = new NullWrapper("java.io.File");
93 }
94
95 Object paramObj3 = contentType;
96
97 if (contentType == null) {
98 paramObj3 = new NullWrapper("java.lang.String");
99 }
100
101 Object paramObj4 = tagsEntries;
102
103 if (tagsEntries == null) {
104 paramObj4 = new NullWrapper("[Ljava.lang.String;");
105 }
106
107 Object paramObj5 = new BooleanWrapper(addCommunityPermissions);
108 Object paramObj6 = new BooleanWrapper(addGuestPermissions);
109 MethodWrapper methodWrapper = new MethodWrapper(IGImageServiceUtil.class.getName(),
110 "addImage",
111 new Object[] {
112 paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
113 paramObj5, paramObj6
114 });
115 Object returnObj = null;
116
117 try {
118 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
119 }
120 catch (Exception e) {
121 if (e instanceof com.liferay.portal.SystemException) {
122 throw (com.liferay.portal.SystemException)e;
123 }
124
125 if (e instanceof com.liferay.portal.PortalException) {
126 throw (com.liferay.portal.PortalException)e;
127 }
128
129 throw new com.liferay.portal.SystemException(e);
130 }
131
132 return (com.liferay.portlet.imagegallery.model.IGImage)returnObj;
133 }
134 catch (com.liferay.portal.SystemException se) {
135 _log.error(se, se);
136 throw se;
137 }
138 }
139
140 public static com.liferay.portlet.imagegallery.model.IGImage addImage(
141 HttpPrincipal httpPrincipal, long folderId,
142 java.lang.String description, java.io.File file,
143 java.lang.String contentType, java.lang.String[] tagsEntries,
144 java.lang.String[] communityPermissions,
145 java.lang.String[] guestPermissions)
146 throws com.liferay.portal.SystemException,
147 com.liferay.portal.PortalException {
148 try {
149 Object paramObj0 = new LongWrapper(folderId);
150 Object paramObj1 = description;
151
152 if (description == null) {
153 paramObj1 = new NullWrapper("java.lang.String");
154 }
155
156 Object paramObj2 = file;
157
158 if (file == null) {
159 paramObj2 = new NullWrapper("java.io.File");
160 }
161
162 Object paramObj3 = contentType;
163
164 if (contentType == null) {
165 paramObj3 = new NullWrapper("java.lang.String");
166 }
167
168 Object paramObj4 = tagsEntries;
169
170 if (tagsEntries == null) {
171 paramObj4 = new NullWrapper("[Ljava.lang.String;");
172 }
173
174 Object paramObj5 = communityPermissions;
175
176 if (communityPermissions == null) {
177 paramObj5 = new NullWrapper("[Ljava.lang.String;");
178 }
179
180 Object paramObj6 = guestPermissions;
181
182 if (guestPermissions == null) {
183 paramObj6 = new NullWrapper("[Ljava.lang.String;");
184 }
185
186 MethodWrapper methodWrapper = new MethodWrapper(IGImageServiceUtil.class.getName(),
187 "addImage",
188 new Object[] {
189 paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
190 paramObj5, paramObj6
191 });
192 Object returnObj = null;
193
194 try {
195 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
196 }
197 catch (Exception e) {
198 if (e instanceof com.liferay.portal.SystemException) {
199 throw (com.liferay.portal.SystemException)e;
200 }
201
202 if (e instanceof com.liferay.portal.PortalException) {
203 throw (com.liferay.portal.PortalException)e;
204 }
205
206 throw new com.liferay.portal.SystemException(e);
207 }
208
209 return (com.liferay.portlet.imagegallery.model.IGImage)returnObj;
210 }
211 catch (com.liferay.portal.SystemException se) {
212 _log.error(se, se);
213 throw se;
214 }
215 }
216
217 public static void deleteImage(HttpPrincipal httpPrincipal, long imageId)
218 throws com.liferay.portal.SystemException,
219 com.liferay.portal.PortalException {
220 try {
221 Object paramObj0 = new LongWrapper(imageId);
222 MethodWrapper methodWrapper = new MethodWrapper(IGImageServiceUtil.class.getName(),
223 "deleteImage", new Object[] { paramObj0 });
224
225 try {
226 TunnelUtil.invoke(httpPrincipal, methodWrapper);
227 }
228 catch (Exception e) {
229 if (e instanceof com.liferay.portal.SystemException) {
230 throw (com.liferay.portal.SystemException)e;
231 }
232
233 if (e instanceof com.liferay.portal.PortalException) {
234 throw (com.liferay.portal.PortalException)e;
235 }
236
237 throw new com.liferay.portal.SystemException(e);
238 }
239 }
240 catch (com.liferay.portal.SystemException se) {
241 _log.error(se, se);
242 throw se;
243 }
244 }
245
246 public static com.liferay.portlet.imagegallery.model.IGImage getImage(
247 HttpPrincipal httpPrincipal, long imageId)
248 throws com.liferay.portal.SystemException,
249 com.liferay.portal.PortalException {
250 try {
251 Object paramObj0 = new LongWrapper(imageId);
252 MethodWrapper methodWrapper = new MethodWrapper(IGImageServiceUtil.class.getName(),
253 "getImage", new Object[] { paramObj0 });
254 Object returnObj = null;
255
256 try {
257 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
258 }
259 catch (Exception e) {
260 if (e instanceof com.liferay.portal.SystemException) {
261 throw (com.liferay.portal.SystemException)e;
262 }
263
264 if (e instanceof com.liferay.portal.PortalException) {
265 throw (com.liferay.portal.PortalException)e;
266 }
267
268 throw new com.liferay.portal.SystemException(e);
269 }
270
271 return (com.liferay.portlet.imagegallery.model.IGImage)returnObj;
272 }
273 catch (com.liferay.portal.SystemException se) {
274 _log.error(se, se);
275 throw se;
276 }
277 }
278
279 public static com.liferay.portlet.imagegallery.model.IGImage updateImage(
280 HttpPrincipal httpPrincipal, long imageId, long folderId,
281 java.lang.String description, java.io.File file,
282 java.lang.String contentType, java.lang.String[] tagsEntries)
283 throws com.liferay.portal.SystemException,
284 com.liferay.portal.PortalException {
285 try {
286 Object paramObj0 = new LongWrapper(imageId);
287 Object paramObj1 = new LongWrapper(folderId);
288 Object paramObj2 = description;
289
290 if (description == null) {
291 paramObj2 = new NullWrapper("java.lang.String");
292 }
293
294 Object paramObj3 = file;
295
296 if (file == null) {
297 paramObj3 = new NullWrapper("java.io.File");
298 }
299
300 Object paramObj4 = contentType;
301
302 if (contentType == null) {
303 paramObj4 = new NullWrapper("java.lang.String");
304 }
305
306 Object paramObj5 = tagsEntries;
307
308 if (tagsEntries == null) {
309 paramObj5 = new NullWrapper("[Ljava.lang.String;");
310 }
311
312 MethodWrapper methodWrapper = new MethodWrapper(IGImageServiceUtil.class.getName(),
313 "updateImage",
314 new Object[] {
315 paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
316 paramObj5
317 });
318 Object returnObj = null;
319
320 try {
321 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
322 }
323 catch (Exception e) {
324 if (e instanceof com.liferay.portal.SystemException) {
325 throw (com.liferay.portal.SystemException)e;
326 }
327
328 if (e instanceof com.liferay.portal.PortalException) {
329 throw (com.liferay.portal.PortalException)e;
330 }
331
332 throw new com.liferay.portal.SystemException(e);
333 }
334
335 return (com.liferay.portlet.imagegallery.model.IGImage)returnObj;
336 }
337 catch (com.liferay.portal.SystemException se) {
338 _log.error(se, se);
339 throw se;
340 }
341 }
342
343 private static Log _log = LogFactoryUtil.getLog(IGImageServiceHttp.class);
344 }