1
14
15 package com.liferay.portlet.imagegallery.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.LongWrapper;
20 import com.liferay.portal.kernel.util.MethodWrapper;
21 import com.liferay.portal.kernel.util.NullWrapper;
22 import com.liferay.portal.security.auth.HttpPrincipal;
23 import com.liferay.portal.service.http.TunnelUtil;
24
25 import com.liferay.portlet.imagegallery.service.IGImageServiceUtil;
26
27
64 public class IGImageServiceHttp {
65 public static com.liferay.portlet.imagegallery.model.IGImage addImage(
66 HttpPrincipal httpPrincipal, long folderId, java.lang.String name,
67 java.lang.String description, java.io.File file,
68 java.lang.String contentType,
69 com.liferay.portal.service.ServiceContext serviceContext)
70 throws com.liferay.portal.PortalException,
71 com.liferay.portal.SystemException {
72 try {
73 Object paramObj0 = new LongWrapper(folderId);
74
75 Object paramObj1 = name;
76
77 if (name == null) {
78 paramObj1 = new NullWrapper("java.lang.String");
79 }
80
81 Object paramObj2 = description;
82
83 if (description == null) {
84 paramObj2 = new NullWrapper("java.lang.String");
85 }
86
87 Object paramObj3 = file;
88
89 if (file == null) {
90 paramObj3 = new NullWrapper("java.io.File");
91 }
92
93 Object paramObj4 = contentType;
94
95 if (contentType == null) {
96 paramObj4 = new NullWrapper("java.lang.String");
97 }
98
99 Object paramObj5 = serviceContext;
100
101 if (serviceContext == null) {
102 paramObj5 = new NullWrapper(
103 "com.liferay.portal.service.ServiceContext");
104 }
105
106 MethodWrapper methodWrapper = new MethodWrapper(IGImageServiceUtil.class.getName(),
107 "addImage",
108 new Object[] {
109 paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
110 paramObj5
111 });
112
113 Object returnObj = null;
114
115 try {
116 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
117 }
118 catch (Exception e) {
119 if (e instanceof com.liferay.portal.PortalException) {
120 throw (com.liferay.portal.PortalException)e;
121 }
122
123 if (e instanceof com.liferay.portal.SystemException) {
124 throw (com.liferay.portal.SystemException)e;
125 }
126
127 throw new com.liferay.portal.SystemException(e);
128 }
129
130 return (com.liferay.portlet.imagegallery.model.IGImage)returnObj;
131 }
132 catch (com.liferay.portal.SystemException se) {
133 _log.error(se, se);
134
135 throw se;
136 }
137 }
138
139 public static void deleteImage(HttpPrincipal httpPrincipal, long imageId)
140 throws com.liferay.portal.PortalException,
141 com.liferay.portal.SystemException {
142 try {
143 Object paramObj0 = new LongWrapper(imageId);
144
145 MethodWrapper methodWrapper = new MethodWrapper(IGImageServiceUtil.class.getName(),
146 "deleteImage", new Object[] { paramObj0 });
147
148 try {
149 TunnelUtil.invoke(httpPrincipal, methodWrapper);
150 }
151 catch (Exception e) {
152 if (e instanceof com.liferay.portal.PortalException) {
153 throw (com.liferay.portal.PortalException)e;
154 }
155
156 if (e instanceof com.liferay.portal.SystemException) {
157 throw (com.liferay.portal.SystemException)e;
158 }
159
160 throw new com.liferay.portal.SystemException(e);
161 }
162 }
163 catch (com.liferay.portal.SystemException se) {
164 _log.error(se, se);
165
166 throw se;
167 }
168 }
169
170 public static void deleteImageByFolderIdAndNameWithExtension(
171 HttpPrincipal httpPrincipal, long folderId,
172 java.lang.String nameWithExtension)
173 throws com.liferay.portal.PortalException,
174 com.liferay.portal.SystemException {
175 try {
176 Object paramObj0 = new LongWrapper(folderId);
177
178 Object paramObj1 = nameWithExtension;
179
180 if (nameWithExtension == null) {
181 paramObj1 = new NullWrapper("java.lang.String");
182 }
183
184 MethodWrapper methodWrapper = new MethodWrapper(IGImageServiceUtil.class.getName(),
185 "deleteImageByFolderIdAndNameWithExtension",
186 new Object[] { paramObj0, paramObj1 });
187
188 try {
189 TunnelUtil.invoke(httpPrincipal, methodWrapper);
190 }
191 catch (Exception e) {
192 if (e instanceof com.liferay.portal.PortalException) {
193 throw (com.liferay.portal.PortalException)e;
194 }
195
196 if (e instanceof com.liferay.portal.SystemException) {
197 throw (com.liferay.portal.SystemException)e;
198 }
199
200 throw new com.liferay.portal.SystemException(e);
201 }
202 }
203 catch (com.liferay.portal.SystemException se) {
204 _log.error(se, se);
205
206 throw se;
207 }
208 }
209
210 public static com.liferay.portlet.imagegallery.model.IGImage getImage(
211 HttpPrincipal httpPrincipal, long imageId)
212 throws com.liferay.portal.PortalException,
213 com.liferay.portal.SystemException {
214 try {
215 Object paramObj0 = new LongWrapper(imageId);
216
217 MethodWrapper methodWrapper = new MethodWrapper(IGImageServiceUtil.class.getName(),
218 "getImage", new Object[] { paramObj0 });
219
220 Object returnObj = null;
221
222 try {
223 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
224 }
225 catch (Exception e) {
226 if (e instanceof com.liferay.portal.PortalException) {
227 throw (com.liferay.portal.PortalException)e;
228 }
229
230 if (e instanceof com.liferay.portal.SystemException) {
231 throw (com.liferay.portal.SystemException)e;
232 }
233
234 throw new com.liferay.portal.SystemException(e);
235 }
236
237 return (com.liferay.portlet.imagegallery.model.IGImage)returnObj;
238 }
239 catch (com.liferay.portal.SystemException se) {
240 _log.error(se, se);
241
242 throw se;
243 }
244 }
245
246 public static com.liferay.portlet.imagegallery.model.IGImage getImageByFolderIdAndNameWithExtension(
247 HttpPrincipal httpPrincipal, long folderId,
248 java.lang.String nameWithExtension)
249 throws com.liferay.portal.PortalException,
250 com.liferay.portal.SystemException {
251 try {
252 Object paramObj0 = new LongWrapper(folderId);
253
254 Object paramObj1 = nameWithExtension;
255
256 if (nameWithExtension == null) {
257 paramObj1 = new NullWrapper("java.lang.String");
258 }
259
260 MethodWrapper methodWrapper = new MethodWrapper(IGImageServiceUtil.class.getName(),
261 "getImageByFolderIdAndNameWithExtension",
262 new Object[] { paramObj0, paramObj1 });
263
264 Object returnObj = null;
265
266 try {
267 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
268 }
269 catch (Exception e) {
270 if (e instanceof com.liferay.portal.PortalException) {
271 throw (com.liferay.portal.PortalException)e;
272 }
273
274 if (e instanceof com.liferay.portal.SystemException) {
275 throw (com.liferay.portal.SystemException)e;
276 }
277
278 throw new com.liferay.portal.SystemException(e);
279 }
280
281 return (com.liferay.portlet.imagegallery.model.IGImage)returnObj;
282 }
283 catch (com.liferay.portal.SystemException se) {
284 _log.error(se, se);
285
286 throw se;
287 }
288 }
289
290 public static com.liferay.portlet.imagegallery.model.IGImage getImageByLargeImageId(
291 HttpPrincipal httpPrincipal, long largeImageId)
292 throws com.liferay.portal.PortalException,
293 com.liferay.portal.SystemException {
294 try {
295 Object paramObj0 = new LongWrapper(largeImageId);
296
297 MethodWrapper methodWrapper = new MethodWrapper(IGImageServiceUtil.class.getName(),
298 "getImageByLargeImageId", new Object[] { paramObj0 });
299
300 Object returnObj = null;
301
302 try {
303 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
304 }
305 catch (Exception e) {
306 if (e instanceof com.liferay.portal.PortalException) {
307 throw (com.liferay.portal.PortalException)e;
308 }
309
310 if (e instanceof com.liferay.portal.SystemException) {
311 throw (com.liferay.portal.SystemException)e;
312 }
313
314 throw new com.liferay.portal.SystemException(e);
315 }
316
317 return (com.liferay.portlet.imagegallery.model.IGImage)returnObj;
318 }
319 catch (com.liferay.portal.SystemException se) {
320 _log.error(se, se);
321
322 throw se;
323 }
324 }
325
326 public static com.liferay.portlet.imagegallery.model.IGImage getImageBySmallImageId(
327 HttpPrincipal httpPrincipal, long smallImageId)
328 throws com.liferay.portal.PortalException,
329 com.liferay.portal.SystemException {
330 try {
331 Object paramObj0 = new LongWrapper(smallImageId);
332
333 MethodWrapper methodWrapper = new MethodWrapper(IGImageServiceUtil.class.getName(),
334 "getImageBySmallImageId", new Object[] { paramObj0 });
335
336 Object returnObj = null;
337
338 try {
339 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
340 }
341 catch (Exception e) {
342 if (e instanceof com.liferay.portal.PortalException) {
343 throw (com.liferay.portal.PortalException)e;
344 }
345
346 if (e instanceof com.liferay.portal.SystemException) {
347 throw (com.liferay.portal.SystemException)e;
348 }
349
350 throw new com.liferay.portal.SystemException(e);
351 }
352
353 return (com.liferay.portlet.imagegallery.model.IGImage)returnObj;
354 }
355 catch (com.liferay.portal.SystemException se) {
356 _log.error(se, se);
357
358 throw se;
359 }
360 }
361
362 public static java.util.List<com.liferay.portlet.imagegallery.model.IGImage> getImages(
363 HttpPrincipal httpPrincipal, long folderId)
364 throws com.liferay.portal.PortalException,
365 com.liferay.portal.SystemException {
366 try {
367 Object paramObj0 = new LongWrapper(folderId);
368
369 MethodWrapper methodWrapper = new MethodWrapper(IGImageServiceUtil.class.getName(),
370 "getImages", new Object[] { paramObj0 });
371
372 Object returnObj = null;
373
374 try {
375 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
376 }
377 catch (Exception e) {
378 if (e instanceof com.liferay.portal.PortalException) {
379 throw (com.liferay.portal.PortalException)e;
380 }
381
382 if (e instanceof com.liferay.portal.SystemException) {
383 throw (com.liferay.portal.SystemException)e;
384 }
385
386 throw new com.liferay.portal.SystemException(e);
387 }
388
389 return (java.util.List<com.liferay.portlet.imagegallery.model.IGImage>)returnObj;
390 }
391 catch (com.liferay.portal.SystemException se) {
392 _log.error(se, se);
393
394 throw se;
395 }
396 }
397
398 public static com.liferay.portlet.imagegallery.model.IGImage updateImage(
399 HttpPrincipal httpPrincipal, long imageId, long folderId,
400 java.lang.String name, java.lang.String description, java.io.File file,
401 java.lang.String contentType,
402 com.liferay.portal.service.ServiceContext serviceContext)
403 throws com.liferay.portal.PortalException,
404 com.liferay.portal.SystemException {
405 try {
406 Object paramObj0 = new LongWrapper(imageId);
407
408 Object paramObj1 = new LongWrapper(folderId);
409
410 Object paramObj2 = name;
411
412 if (name == null) {
413 paramObj2 = new NullWrapper("java.lang.String");
414 }
415
416 Object paramObj3 = description;
417
418 if (description == null) {
419 paramObj3 = new NullWrapper("java.lang.String");
420 }
421
422 Object paramObj4 = file;
423
424 if (file == null) {
425 paramObj4 = new NullWrapper("java.io.File");
426 }
427
428 Object paramObj5 = contentType;
429
430 if (contentType == null) {
431 paramObj5 = new NullWrapper("java.lang.String");
432 }
433
434 Object paramObj6 = serviceContext;
435
436 if (serviceContext == null) {
437 paramObj6 = new NullWrapper(
438 "com.liferay.portal.service.ServiceContext");
439 }
440
441 MethodWrapper methodWrapper = new MethodWrapper(IGImageServiceUtil.class.getName(),
442 "updateImage",
443 new Object[] {
444 paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
445 paramObj5, paramObj6
446 });
447
448 Object returnObj = null;
449
450 try {
451 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
452 }
453 catch (Exception e) {
454 if (e instanceof com.liferay.portal.PortalException) {
455 throw (com.liferay.portal.PortalException)e;
456 }
457
458 if (e instanceof com.liferay.portal.SystemException) {
459 throw (com.liferay.portal.SystemException)e;
460 }
461
462 throw new com.liferay.portal.SystemException(e);
463 }
464
465 return (com.liferay.portlet.imagegallery.model.IGImage)returnObj;
466 }
467 catch (com.liferay.portal.SystemException se) {
468 _log.error(se, se);
469
470 throw se;
471 }
472 }
473
474 private static Log _log = LogFactoryUtil.getLog(IGImageServiceHttp.class);
475 }