001
014
015 package com.liferay.portlet.bookmarks.service.http;
016
017 import com.liferay.portal.kernel.log.Log;
018 import com.liferay.portal.kernel.log.LogFactoryUtil;
019 import com.liferay.portal.kernel.util.MethodHandler;
020 import com.liferay.portal.kernel.util.MethodKey;
021 import com.liferay.portal.security.auth.HttpPrincipal;
022 import com.liferay.portal.service.http.TunnelUtil;
023
024 import com.liferay.portlet.bookmarks.service.BookmarksFolderServiceUtil;
025
026
056 public class BookmarksFolderServiceHttp {
057 public static com.liferay.portlet.bookmarks.model.BookmarksFolder addFolder(
058 HttpPrincipal httpPrincipal, long parentFolderId,
059 java.lang.String name, java.lang.String description,
060 com.liferay.portal.service.ServiceContext serviceContext)
061 throws com.liferay.portal.kernel.exception.PortalException,
062 com.liferay.portal.kernel.exception.SystemException {
063 try {
064 MethodKey methodKey = new MethodKey(BookmarksFolderServiceUtil.class,
065 "addFolder", _addFolderParameterTypes0);
066
067 MethodHandler methodHandler = new MethodHandler(methodKey,
068 parentFolderId, name, description, serviceContext);
069
070 Object returnObj = null;
071
072 try {
073 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
074 }
075 catch (Exception e) {
076 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
077 throw (com.liferay.portal.kernel.exception.PortalException)e;
078 }
079
080 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
081 throw (com.liferay.portal.kernel.exception.SystemException)e;
082 }
083
084 throw new com.liferay.portal.kernel.exception.SystemException(e);
085 }
086
087 return (com.liferay.portlet.bookmarks.model.BookmarksFolder)returnObj;
088 }
089 catch (com.liferay.portal.kernel.exception.SystemException se) {
090 _log.error(se, se);
091
092 throw se;
093 }
094 }
095
096 public static void deleteFolder(HttpPrincipal httpPrincipal, long folderId)
097 throws com.liferay.portal.kernel.exception.PortalException,
098 com.liferay.portal.kernel.exception.SystemException {
099 try {
100 MethodKey methodKey = new MethodKey(BookmarksFolderServiceUtil.class,
101 "deleteFolder", _deleteFolderParameterTypes1);
102
103 MethodHandler methodHandler = new MethodHandler(methodKey, folderId);
104
105 try {
106 TunnelUtil.invoke(httpPrincipal, methodHandler);
107 }
108 catch (Exception e) {
109 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
110 throw (com.liferay.portal.kernel.exception.PortalException)e;
111 }
112
113 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
114 throw (com.liferay.portal.kernel.exception.SystemException)e;
115 }
116
117 throw new com.liferay.portal.kernel.exception.SystemException(e);
118 }
119 }
120 catch (com.liferay.portal.kernel.exception.SystemException se) {
121 _log.error(se, se);
122
123 throw se;
124 }
125 }
126
127 public static com.liferay.portlet.bookmarks.model.BookmarksFolder getFolder(
128 HttpPrincipal httpPrincipal, long folderId)
129 throws com.liferay.portal.kernel.exception.PortalException,
130 com.liferay.portal.kernel.exception.SystemException {
131 try {
132 MethodKey methodKey = new MethodKey(BookmarksFolderServiceUtil.class,
133 "getFolder", _getFolderParameterTypes2);
134
135 MethodHandler methodHandler = new MethodHandler(methodKey, folderId);
136
137 Object returnObj = null;
138
139 try {
140 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
141 }
142 catch (Exception e) {
143 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
144 throw (com.liferay.portal.kernel.exception.PortalException)e;
145 }
146
147 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
148 throw (com.liferay.portal.kernel.exception.SystemException)e;
149 }
150
151 throw new com.liferay.portal.kernel.exception.SystemException(e);
152 }
153
154 return (com.liferay.portlet.bookmarks.model.BookmarksFolder)returnObj;
155 }
156 catch (com.liferay.portal.kernel.exception.SystemException se) {
157 _log.error(se, se);
158
159 throw se;
160 }
161 }
162
163 public static java.util.List<com.liferay.portlet.bookmarks.model.BookmarksFolder> getFolders(
164 HttpPrincipal httpPrincipal, long groupId)
165 throws com.liferay.portal.kernel.exception.SystemException {
166 try {
167 MethodKey methodKey = new MethodKey(BookmarksFolderServiceUtil.class,
168 "getFolders", _getFoldersParameterTypes3);
169
170 MethodHandler methodHandler = new MethodHandler(methodKey, groupId);
171
172 Object returnObj = null;
173
174 try {
175 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
176 }
177 catch (Exception e) {
178 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
179 throw (com.liferay.portal.kernel.exception.SystemException)e;
180 }
181
182 throw new com.liferay.portal.kernel.exception.SystemException(e);
183 }
184
185 return (java.util.List<com.liferay.portlet.bookmarks.model.BookmarksFolder>)returnObj;
186 }
187 catch (com.liferay.portal.kernel.exception.SystemException se) {
188 _log.error(se, se);
189
190 throw se;
191 }
192 }
193
194 public static java.util.List<com.liferay.portlet.bookmarks.model.BookmarksFolder> getFolders(
195 HttpPrincipal httpPrincipal, long groupId, long parentFolderId)
196 throws com.liferay.portal.kernel.exception.SystemException {
197 try {
198 MethodKey methodKey = new MethodKey(BookmarksFolderServiceUtil.class,
199 "getFolders", _getFoldersParameterTypes4);
200
201 MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
202 parentFolderId);
203
204 Object returnObj = null;
205
206 try {
207 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
208 }
209 catch (Exception e) {
210 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
211 throw (com.liferay.portal.kernel.exception.SystemException)e;
212 }
213
214 throw new com.liferay.portal.kernel.exception.SystemException(e);
215 }
216
217 return (java.util.List<com.liferay.portlet.bookmarks.model.BookmarksFolder>)returnObj;
218 }
219 catch (com.liferay.portal.kernel.exception.SystemException se) {
220 _log.error(se, se);
221
222 throw se;
223 }
224 }
225
226 public static java.util.List<com.liferay.portlet.bookmarks.model.BookmarksFolder> getFolders(
227 HttpPrincipal httpPrincipal, long groupId, long parentFolderId,
228 int start, int end)
229 throws com.liferay.portal.kernel.exception.SystemException {
230 try {
231 MethodKey methodKey = new MethodKey(BookmarksFolderServiceUtil.class,
232 "getFolders", _getFoldersParameterTypes5);
233
234 MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
235 parentFolderId, start, end);
236
237 Object returnObj = null;
238
239 try {
240 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
241 }
242 catch (Exception e) {
243 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
244 throw (com.liferay.portal.kernel.exception.SystemException)e;
245 }
246
247 throw new com.liferay.portal.kernel.exception.SystemException(e);
248 }
249
250 return (java.util.List<com.liferay.portlet.bookmarks.model.BookmarksFolder>)returnObj;
251 }
252 catch (com.liferay.portal.kernel.exception.SystemException se) {
253 _log.error(se, se);
254
255 throw se;
256 }
257 }
258
259 public static int getFoldersCount(HttpPrincipal httpPrincipal,
260 long groupId, long parentFolderId)
261 throws com.liferay.portal.kernel.exception.SystemException {
262 try {
263 MethodKey methodKey = new MethodKey(BookmarksFolderServiceUtil.class,
264 "getFoldersCount", _getFoldersCountParameterTypes6);
265
266 MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
267 parentFolderId);
268
269 Object returnObj = null;
270
271 try {
272 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
273 }
274 catch (Exception e) {
275 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
276 throw (com.liferay.portal.kernel.exception.SystemException)e;
277 }
278
279 throw new com.liferay.portal.kernel.exception.SystemException(e);
280 }
281
282 return ((Integer)returnObj).intValue();
283 }
284 catch (com.liferay.portal.kernel.exception.SystemException se) {
285 _log.error(se, se);
286
287 throw se;
288 }
289 }
290
291 public static void getSubfolderIds(HttpPrincipal httpPrincipal,
292 java.util.List<java.lang.Long> folderIds, long groupId, long folderId)
293 throws com.liferay.portal.kernel.exception.SystemException {
294 try {
295 MethodKey methodKey = new MethodKey(BookmarksFolderServiceUtil.class,
296 "getSubfolderIds", _getSubfolderIdsParameterTypes7);
297
298 MethodHandler methodHandler = new MethodHandler(methodKey,
299 folderIds, groupId, folderId);
300
301 try {
302 TunnelUtil.invoke(httpPrincipal, methodHandler);
303 }
304 catch (Exception e) {
305 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
306 throw (com.liferay.portal.kernel.exception.SystemException)e;
307 }
308
309 throw new com.liferay.portal.kernel.exception.SystemException(e);
310 }
311 }
312 catch (com.liferay.portal.kernel.exception.SystemException se) {
313 _log.error(se, se);
314
315 throw se;
316 }
317 }
318
319 public static void subscribeFolder(HttpPrincipal httpPrincipal,
320 long groupId, long folderId)
321 throws com.liferay.portal.kernel.exception.PortalException,
322 com.liferay.portal.kernel.exception.SystemException {
323 try {
324 MethodKey methodKey = new MethodKey(BookmarksFolderServiceUtil.class,
325 "subscribeFolder", _subscribeFolderParameterTypes8);
326
327 MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
328 folderId);
329
330 try {
331 TunnelUtil.invoke(httpPrincipal, methodHandler);
332 }
333 catch (Exception e) {
334 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
335 throw (com.liferay.portal.kernel.exception.PortalException)e;
336 }
337
338 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
339 throw (com.liferay.portal.kernel.exception.SystemException)e;
340 }
341
342 throw new com.liferay.portal.kernel.exception.SystemException(e);
343 }
344 }
345 catch (com.liferay.portal.kernel.exception.SystemException se) {
346 _log.error(se, se);
347
348 throw se;
349 }
350 }
351
352 public static void unsubscribeFolder(HttpPrincipal httpPrincipal,
353 long groupId, long folderId)
354 throws com.liferay.portal.kernel.exception.PortalException,
355 com.liferay.portal.kernel.exception.SystemException {
356 try {
357 MethodKey methodKey = new MethodKey(BookmarksFolderServiceUtil.class,
358 "unsubscribeFolder", _unsubscribeFolderParameterTypes9);
359
360 MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
361 folderId);
362
363 try {
364 TunnelUtil.invoke(httpPrincipal, methodHandler);
365 }
366 catch (Exception e) {
367 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
368 throw (com.liferay.portal.kernel.exception.PortalException)e;
369 }
370
371 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
372 throw (com.liferay.portal.kernel.exception.SystemException)e;
373 }
374
375 throw new com.liferay.portal.kernel.exception.SystemException(e);
376 }
377 }
378 catch (com.liferay.portal.kernel.exception.SystemException se) {
379 _log.error(se, se);
380
381 throw se;
382 }
383 }
384
385 public static com.liferay.portlet.bookmarks.model.BookmarksFolder updateFolder(
386 HttpPrincipal httpPrincipal, long folderId, long parentFolderId,
387 java.lang.String name, java.lang.String description,
388 boolean mergeWithParentFolder,
389 com.liferay.portal.service.ServiceContext serviceContext)
390 throws com.liferay.portal.kernel.exception.PortalException,
391 com.liferay.portal.kernel.exception.SystemException {
392 try {
393 MethodKey methodKey = new MethodKey(BookmarksFolderServiceUtil.class,
394 "updateFolder", _updateFolderParameterTypes10);
395
396 MethodHandler methodHandler = new MethodHandler(methodKey,
397 folderId, parentFolderId, name, description,
398 mergeWithParentFolder, serviceContext);
399
400 Object returnObj = null;
401
402 try {
403 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
404 }
405 catch (Exception e) {
406 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
407 throw (com.liferay.portal.kernel.exception.PortalException)e;
408 }
409
410 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
411 throw (com.liferay.portal.kernel.exception.SystemException)e;
412 }
413
414 throw new com.liferay.portal.kernel.exception.SystemException(e);
415 }
416
417 return (com.liferay.portlet.bookmarks.model.BookmarksFolder)returnObj;
418 }
419 catch (com.liferay.portal.kernel.exception.SystemException se) {
420 _log.error(se, se);
421
422 throw se;
423 }
424 }
425
426 private static Log _log = LogFactoryUtil.getLog(BookmarksFolderServiceHttp.class);
427 private static final Class<?>[] _addFolderParameterTypes0 = new Class[] {
428 long.class, java.lang.String.class, java.lang.String.class,
429 com.liferay.portal.service.ServiceContext.class
430 };
431 private static final Class<?>[] _deleteFolderParameterTypes1 = new Class[] {
432 long.class
433 };
434 private static final Class<?>[] _getFolderParameterTypes2 = new Class[] {
435 long.class
436 };
437 private static final Class<?>[] _getFoldersParameterTypes3 = new Class[] {
438 long.class
439 };
440 private static final Class<?>[] _getFoldersParameterTypes4 = new Class[] {
441 long.class, long.class
442 };
443 private static final Class<?>[] _getFoldersParameterTypes5 = new Class[] {
444 long.class, long.class, int.class, int.class
445 };
446 private static final Class<?>[] _getFoldersCountParameterTypes6 = new Class[] {
447 long.class, long.class
448 };
449 private static final Class<?>[] _getSubfolderIdsParameterTypes7 = new Class[] {
450 java.util.List.class, long.class, long.class
451 };
452 private static final Class<?>[] _subscribeFolderParameterTypes8 = new Class[] {
453 long.class, long.class
454 };
455 private static final Class<?>[] _unsubscribeFolderParameterTypes9 = new Class[] {
456 long.class, long.class
457 };
458 private static final Class<?>[] _updateFolderParameterTypes10 = new Class[] {
459 long.class, long.class, java.lang.String.class,
460 java.lang.String.class, boolean.class,
461 com.liferay.portal.service.ServiceContext.class
462 };
463 }