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