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
75 public class IGImageServiceHttp {
76 public static com.liferay.portlet.imagegallery.model.IGImage addImage(
77 HttpPrincipal httpPrincipal, long folderId, java.lang.String name,
78 java.lang.String description, java.io.File file,
79 java.lang.String contentType, java.lang.String[] tagsEntries,
80 boolean addCommunityPermissions, boolean addGuestPermissions)
81 throws com.liferay.portal.SystemException,
82 com.liferay.portal.PortalException {
83 try {
84 Object paramObj0 = new LongWrapper(folderId);
85
86 Object paramObj1 = name;
87
88 if (name == null) {
89 paramObj1 = new NullWrapper("java.lang.String");
90 }
91
92 Object paramObj2 = description;
93
94 if (description == null) {
95 paramObj2 = new NullWrapper("java.lang.String");
96 }
97
98 Object paramObj3 = file;
99
100 if (file == null) {
101 paramObj3 = new NullWrapper("java.io.File");
102 }
103
104 Object paramObj4 = contentType;
105
106 if (contentType == null) {
107 paramObj4 = new NullWrapper("java.lang.String");
108 }
109
110 Object paramObj5 = tagsEntries;
111
112 if (tagsEntries == null) {
113 paramObj5 = new NullWrapper("[Ljava.lang.String;");
114 }
115
116 Object paramObj6 = new BooleanWrapper(addCommunityPermissions);
117
118 Object paramObj7 = new BooleanWrapper(addGuestPermissions);
119
120 MethodWrapper methodWrapper = new MethodWrapper(IGImageServiceUtil.class.getName(),
121 "addImage",
122 new Object[] {
123 paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
124 paramObj5, paramObj6, paramObj7
125 });
126
127 Object returnObj = null;
128
129 try {
130 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
131 }
132 catch (Exception e) {
133 if (e instanceof com.liferay.portal.SystemException) {
134 throw (com.liferay.portal.SystemException)e;
135 }
136
137 if (e instanceof com.liferay.portal.PortalException) {
138 throw (com.liferay.portal.PortalException)e;
139 }
140
141 throw new com.liferay.portal.SystemException(e);
142 }
143
144 return (com.liferay.portlet.imagegallery.model.IGImage)returnObj;
145 }
146 catch (com.liferay.portal.SystemException se) {
147 _log.error(se, se);
148
149 throw se;
150 }
151 }
152
153 public static com.liferay.portlet.imagegallery.model.IGImage addImage(
154 HttpPrincipal httpPrincipal, long folderId, java.lang.String name,
155 java.lang.String description, java.io.File file,
156 java.lang.String contentType, java.lang.String[] tagsEntries,
157 java.lang.String[] communityPermissions,
158 java.lang.String[] guestPermissions)
159 throws com.liferay.portal.SystemException,
160 com.liferay.portal.PortalException {
161 try {
162 Object paramObj0 = new LongWrapper(folderId);
163
164 Object paramObj1 = name;
165
166 if (name == null) {
167 paramObj1 = new NullWrapper("java.lang.String");
168 }
169
170 Object paramObj2 = description;
171
172 if (description == null) {
173 paramObj2 = new NullWrapper("java.lang.String");
174 }
175
176 Object paramObj3 = file;
177
178 if (file == null) {
179 paramObj3 = new NullWrapper("java.io.File");
180 }
181
182 Object paramObj4 = contentType;
183
184 if (contentType == null) {
185 paramObj4 = new NullWrapper("java.lang.String");
186 }
187
188 Object paramObj5 = tagsEntries;
189
190 if (tagsEntries == null) {
191 paramObj5 = new NullWrapper("[Ljava.lang.String;");
192 }
193
194 Object paramObj6 = communityPermissions;
195
196 if (communityPermissions == null) {
197 paramObj6 = new NullWrapper("[Ljava.lang.String;");
198 }
199
200 Object paramObj7 = guestPermissions;
201
202 if (guestPermissions == null) {
203 paramObj7 = new NullWrapper("[Ljava.lang.String;");
204 }
205
206 MethodWrapper methodWrapper = new MethodWrapper(IGImageServiceUtil.class.getName(),
207 "addImage",
208 new Object[] {
209 paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
210 paramObj5, paramObj6, paramObj7
211 });
212
213 Object returnObj = null;
214
215 try {
216 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
217 }
218 catch (Exception e) {
219 if (e instanceof com.liferay.portal.SystemException) {
220 throw (com.liferay.portal.SystemException)e;
221 }
222
223 if (e instanceof com.liferay.portal.PortalException) {
224 throw (com.liferay.portal.PortalException)e;
225 }
226
227 throw new com.liferay.portal.SystemException(e);
228 }
229
230 return (com.liferay.portlet.imagegallery.model.IGImage)returnObj;
231 }
232 catch (com.liferay.portal.SystemException se) {
233 _log.error(se, se);
234
235 throw se;
236 }
237 }
238
239 public static void deleteImage(HttpPrincipal httpPrincipal, long imageId)
240 throws com.liferay.portal.SystemException,
241 com.liferay.portal.PortalException {
242 try {
243 Object paramObj0 = new LongWrapper(imageId);
244
245 MethodWrapper methodWrapper = new MethodWrapper(IGImageServiceUtil.class.getName(),
246 "deleteImage", new Object[] { paramObj0 });
247
248 try {
249 TunnelUtil.invoke(httpPrincipal, methodWrapper);
250 }
251 catch (Exception e) {
252 if (e instanceof com.liferay.portal.SystemException) {
253 throw (com.liferay.portal.SystemException)e;
254 }
255
256 if (e instanceof com.liferay.portal.PortalException) {
257 throw (com.liferay.portal.PortalException)e;
258 }
259
260 throw new com.liferay.portal.SystemException(e);
261 }
262 }
263 catch (com.liferay.portal.SystemException se) {
264 _log.error(se, se);
265
266 throw se;
267 }
268 }
269
270 public static void deleteImageByFolderIdAndNameWithExtension(
271 HttpPrincipal httpPrincipal, long folderId,
272 java.lang.String nameWithExtension)
273 throws com.liferay.portal.SystemException,
274 com.liferay.portal.PortalException {
275 try {
276 Object paramObj0 = new LongWrapper(folderId);
277
278 Object paramObj1 = nameWithExtension;
279
280 if (nameWithExtension == null) {
281 paramObj1 = new NullWrapper("java.lang.String");
282 }
283
284 MethodWrapper methodWrapper = new MethodWrapper(IGImageServiceUtil.class.getName(),
285 "deleteImageByFolderIdAndNameWithExtension",
286 new Object[] { paramObj0, paramObj1 });
287
288 try {
289 TunnelUtil.invoke(httpPrincipal, methodWrapper);
290 }
291 catch (Exception e) {
292 if (e instanceof com.liferay.portal.SystemException) {
293 throw (com.liferay.portal.SystemException)e;
294 }
295
296 if (e instanceof com.liferay.portal.PortalException) {
297 throw (com.liferay.portal.PortalException)e;
298 }
299
300 throw new com.liferay.portal.SystemException(e);
301 }
302 }
303 catch (com.liferay.portal.SystemException se) {
304 _log.error(se, se);
305
306 throw se;
307 }
308 }
309
310 public static com.liferay.portlet.imagegallery.model.IGImage getImage(
311 HttpPrincipal httpPrincipal, long imageId)
312 throws com.liferay.portal.SystemException,
313 com.liferay.portal.PortalException {
314 try {
315 Object paramObj0 = new LongWrapper(imageId);
316
317 MethodWrapper methodWrapper = new MethodWrapper(IGImageServiceUtil.class.getName(),
318 "getImage", new Object[] { paramObj0 });
319
320 Object returnObj = null;
321
322 try {
323 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
324 }
325 catch (Exception e) {
326 if (e instanceof com.liferay.portal.SystemException) {
327 throw (com.liferay.portal.SystemException)e;
328 }
329
330 if (e instanceof com.liferay.portal.PortalException) {
331 throw (com.liferay.portal.PortalException)e;
332 }
333
334 throw new com.liferay.portal.SystemException(e);
335 }
336
337 return (com.liferay.portlet.imagegallery.model.IGImage)returnObj;
338 }
339 catch (com.liferay.portal.SystemException se) {
340 _log.error(se, se);
341
342 throw se;
343 }
344 }
345
346 public static com.liferay.portlet.imagegallery.model.IGImage getImageByFolderIdAndNameWithExtension(
347 HttpPrincipal httpPrincipal, long folderId,
348 java.lang.String nameWithExtension)
349 throws com.liferay.portal.SystemException,
350 com.liferay.portal.PortalException {
351 try {
352 Object paramObj0 = new LongWrapper(folderId);
353
354 Object paramObj1 = nameWithExtension;
355
356 if (nameWithExtension == null) {
357 paramObj1 = new NullWrapper("java.lang.String");
358 }
359
360 MethodWrapper methodWrapper = new MethodWrapper(IGImageServiceUtil.class.getName(),
361 "getImageByFolderIdAndNameWithExtension",
362 new Object[] { paramObj0, paramObj1 });
363
364 Object returnObj = null;
365
366 try {
367 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
368 }
369 catch (Exception e) {
370 if (e instanceof com.liferay.portal.SystemException) {
371 throw (com.liferay.portal.SystemException)e;
372 }
373
374 if (e instanceof com.liferay.portal.PortalException) {
375 throw (com.liferay.portal.PortalException)e;
376 }
377
378 throw new com.liferay.portal.SystemException(e);
379 }
380
381 return (com.liferay.portlet.imagegallery.model.IGImage)returnObj;
382 }
383 catch (com.liferay.portal.SystemException se) {
384 _log.error(se, se);
385
386 throw se;
387 }
388 }
389
390 public static com.liferay.portlet.imagegallery.model.IGImage getImageByLargeImageId(
391 HttpPrincipal httpPrincipal, long largeImageId)
392 throws com.liferay.portal.SystemException,
393 com.liferay.portal.PortalException {
394 try {
395 Object paramObj0 = new LongWrapper(largeImageId);
396
397 MethodWrapper methodWrapper = new MethodWrapper(IGImageServiceUtil.class.getName(),
398 "getImageByLargeImageId", new Object[] { paramObj0 });
399
400 Object returnObj = null;
401
402 try {
403 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
404 }
405 catch (Exception e) {
406 if (e instanceof com.liferay.portal.SystemException) {
407 throw (com.liferay.portal.SystemException)e;
408 }
409
410 if (e instanceof com.liferay.portal.PortalException) {
411 throw (com.liferay.portal.PortalException)e;
412 }
413
414 throw new com.liferay.portal.SystemException(e);
415 }
416
417 return (com.liferay.portlet.imagegallery.model.IGImage)returnObj;
418 }
419 catch (com.liferay.portal.SystemException se) {
420 _log.error(se, se);
421
422 throw se;
423 }
424 }
425
426 public static com.liferay.portlet.imagegallery.model.IGImage getImageBySmallImageId(
427 HttpPrincipal httpPrincipal, long smallImageId)
428 throws com.liferay.portal.SystemException,
429 com.liferay.portal.PortalException {
430 try {
431 Object paramObj0 = new LongWrapper(smallImageId);
432
433 MethodWrapper methodWrapper = new MethodWrapper(IGImageServiceUtil.class.getName(),
434 "getImageBySmallImageId", new Object[] { paramObj0 });
435
436 Object returnObj = null;
437
438 try {
439 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
440 }
441 catch (Exception e) {
442 if (e instanceof com.liferay.portal.SystemException) {
443 throw (com.liferay.portal.SystemException)e;
444 }
445
446 if (e instanceof com.liferay.portal.PortalException) {
447 throw (com.liferay.portal.PortalException)e;
448 }
449
450 throw new com.liferay.portal.SystemException(e);
451 }
452
453 return (com.liferay.portlet.imagegallery.model.IGImage)returnObj;
454 }
455 catch (com.liferay.portal.SystemException se) {
456 _log.error(se, se);
457
458 throw se;
459 }
460 }
461
462 public static java.util.List<com.liferay.portlet.imagegallery.model.IGImage> getImages(
463 HttpPrincipal httpPrincipal, long folderId)
464 throws com.liferay.portal.SystemException,
465 com.liferay.portal.PortalException {
466 try {
467 Object paramObj0 = new LongWrapper(folderId);
468
469 MethodWrapper methodWrapper = new MethodWrapper(IGImageServiceUtil.class.getName(),
470 "getImages", new Object[] { paramObj0 });
471
472 Object returnObj = null;
473
474 try {
475 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
476 }
477 catch (Exception e) {
478 if (e instanceof com.liferay.portal.SystemException) {
479 throw (com.liferay.portal.SystemException)e;
480 }
481
482 if (e instanceof com.liferay.portal.PortalException) {
483 throw (com.liferay.portal.PortalException)e;
484 }
485
486 throw new com.liferay.portal.SystemException(e);
487 }
488
489 return (java.util.List<com.liferay.portlet.imagegallery.model.IGImage>)returnObj;
490 }
491 catch (com.liferay.portal.SystemException se) {
492 _log.error(se, se);
493
494 throw se;
495 }
496 }
497
498 public static com.liferay.portlet.imagegallery.model.IGImage updateImage(
499 HttpPrincipal httpPrincipal, long imageId, long folderId,
500 java.lang.String name, java.lang.String description, java.io.File file,
501 java.lang.String contentType, java.lang.String[] tagsEntries)
502 throws com.liferay.portal.SystemException,
503 com.liferay.portal.PortalException {
504 try {
505 Object paramObj0 = new LongWrapper(imageId);
506
507 Object paramObj1 = new LongWrapper(folderId);
508
509 Object paramObj2 = name;
510
511 if (name == null) {
512 paramObj2 = new NullWrapper("java.lang.String");
513 }
514
515 Object paramObj3 = description;
516
517 if (description == null) {
518 paramObj3 = new NullWrapper("java.lang.String");
519 }
520
521 Object paramObj4 = file;
522
523 if (file == null) {
524 paramObj4 = new NullWrapper("java.io.File");
525 }
526
527 Object paramObj5 = contentType;
528
529 if (contentType == null) {
530 paramObj5 = new NullWrapper("java.lang.String");
531 }
532
533 Object paramObj6 = tagsEntries;
534
535 if (tagsEntries == null) {
536 paramObj6 = new NullWrapper("[Ljava.lang.String;");
537 }
538
539 MethodWrapper methodWrapper = new MethodWrapper(IGImageServiceUtil.class.getName(),
540 "updateImage",
541 new Object[] {
542 paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
543 paramObj5, paramObj6
544 });
545
546 Object returnObj = null;
547
548 try {
549 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
550 }
551 catch (Exception e) {
552 if (e instanceof com.liferay.portal.SystemException) {
553 throw (com.liferay.portal.SystemException)e;
554 }
555
556 if (e instanceof com.liferay.portal.PortalException) {
557 throw (com.liferay.portal.PortalException)e;
558 }
559
560 throw new com.liferay.portal.SystemException(e);
561 }
562
563 return (com.liferay.portlet.imagegallery.model.IGImage)returnObj;
564 }
565 catch (com.liferay.portal.SystemException se) {
566 _log.error(se, se);
567
568 throw se;
569 }
570 }
571
572 private static Log _log = LogFactoryUtil.getLog(IGImageServiceHttp.class);
573 }