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