001    /**
002     * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portlet.journal.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.journal.service.JournalFolderServiceUtil;
025    
026    /**
027     * <p>
028     * This class provides a HTTP utility for the
029     * {@link com.liferay.portlet.journal.service.JournalFolderServiceUtil} service utility. The
030     * static methods of this class calls the same methods of the service utility.
031     * However, the signatures are different because it requires an additional
032     * {@link com.liferay.portal.security.auth.HttpPrincipal} parameter.
033     * </p>
034     *
035     * <p>
036     * The benefits of using the HTTP utility is that it is fast and allows for
037     * tunneling without the cost of serializing to text. The drawback is that it
038     * only works with Java.
039     * </p>
040     *
041     * <p>
042     * Set the property <b>tunnel.servlet.hosts.allowed</b> in portal.properties to
043     * configure security.
044     * </p>
045     *
046     * <p>
047     * The HTTP utility is only generated for remote services.
048     * </p>
049     *
050     * @author    Brian Wing Shun Chan
051     * @see       JournalFolderServiceSoap
052     * @see       com.liferay.portal.security.auth.HttpPrincipal
053     * @see       com.liferay.portlet.journal.service.JournalFolderServiceUtil
054     * @generated
055     */
056    public class JournalFolderServiceHttp {
057            public static com.liferay.portlet.journal.model.JournalFolder addFolder(
058                    HttpPrincipal httpPrincipal, long groupId, 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(JournalFolderServiceUtil.class,
065                                            "addFolder", _addFolderParameterTypes0);
066    
067                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
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.journal.model.JournalFolder)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(JournalFolderServiceUtil.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.journal.model.JournalFolder 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(JournalFolderServiceUtil.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.journal.model.JournalFolder)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.journal.model.JournalFolder> getFolders(
164                    HttpPrincipal httpPrincipal, long groupId)
165                    throws com.liferay.portal.kernel.exception.SystemException {
166                    try {
167                            MethodKey methodKey = new MethodKey(JournalFolderServiceUtil.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.journal.model.JournalFolder>)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.journal.model.JournalFolder> getFolders(
195                    HttpPrincipal httpPrincipal, long groupId, long parentFolderId)
196                    throws com.liferay.portal.kernel.exception.SystemException {
197                    try {
198                            MethodKey methodKey = new MethodKey(JournalFolderServiceUtil.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.journal.model.JournalFolder>)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.journal.model.JournalFolder> 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(JournalFolderServiceUtil.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.journal.model.JournalFolder>)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 java.util.List<java.lang.Object> getFoldersAndArticles(
260                    HttpPrincipal httpPrincipal, long groupId, long folderId, int start,
261                    int end, com.liferay.portal.kernel.util.OrderByComparator obc)
262                    throws com.liferay.portal.kernel.exception.SystemException {
263                    try {
264                            MethodKey methodKey = new MethodKey(JournalFolderServiceUtil.class,
265                                            "getFoldersAndArticles",
266                                            _getFoldersAndArticlesParameterTypes6);
267    
268                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
269                                            folderId, start, end, obc);
270    
271                            Object returnObj = null;
272    
273                            try {
274                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
275                            }
276                            catch (Exception e) {
277                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
278                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
279                                    }
280    
281                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
282                            }
283    
284                            return (java.util.List<java.lang.Object>)returnObj;
285                    }
286                    catch (com.liferay.portal.kernel.exception.SystemException se) {
287                            _log.error(se, se);
288    
289                            throw se;
290                    }
291            }
292    
293            public static int getFoldersAndArticlesCount(HttpPrincipal httpPrincipal,
294                    long groupId, java.util.List<java.lang.Long> folderIds, int status)
295                    throws com.liferay.portal.kernel.exception.SystemException {
296                    try {
297                            MethodKey methodKey = new MethodKey(JournalFolderServiceUtil.class,
298                                            "getFoldersAndArticlesCount",
299                                            _getFoldersAndArticlesCountParameterTypes7);
300    
301                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
302                                            folderIds, status);
303    
304                            Object returnObj = null;
305    
306                            try {
307                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
308                            }
309                            catch (Exception e) {
310                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
311                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
312                                    }
313    
314                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
315                            }
316    
317                            return ((Integer)returnObj).intValue();
318                    }
319                    catch (com.liferay.portal.kernel.exception.SystemException se) {
320                            _log.error(se, se);
321    
322                            throw se;
323                    }
324            }
325    
326            public static int getFoldersAndArticlesCount(HttpPrincipal httpPrincipal,
327                    long groupId, long folderId)
328                    throws com.liferay.portal.kernel.exception.SystemException {
329                    try {
330                            MethodKey methodKey = new MethodKey(JournalFolderServiceUtil.class,
331                                            "getFoldersAndArticlesCount",
332                                            _getFoldersAndArticlesCountParameterTypes8);
333    
334                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
335                                            folderId);
336    
337                            Object returnObj = null;
338    
339                            try {
340                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
341                            }
342                            catch (Exception e) {
343                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
344                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
345                                    }
346    
347                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
348                            }
349    
350                            return ((Integer)returnObj).intValue();
351                    }
352                    catch (com.liferay.portal.kernel.exception.SystemException se) {
353                            _log.error(se, se);
354    
355                            throw se;
356                    }
357            }
358    
359            public static int getFoldersAndArticlesCount(HttpPrincipal httpPrincipal,
360                    long groupId, long folderId, int status)
361                    throws com.liferay.portal.kernel.exception.SystemException {
362                    try {
363                            MethodKey methodKey = new MethodKey(JournalFolderServiceUtil.class,
364                                            "getFoldersAndArticlesCount",
365                                            _getFoldersAndArticlesCountParameterTypes9);
366    
367                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
368                                            folderId, status);
369    
370                            Object returnObj = null;
371    
372                            try {
373                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
374                            }
375                            catch (Exception e) {
376                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
377                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
378                                    }
379    
380                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
381                            }
382    
383                            return ((Integer)returnObj).intValue();
384                    }
385                    catch (com.liferay.portal.kernel.exception.SystemException se) {
386                            _log.error(se, se);
387    
388                            throw se;
389                    }
390            }
391    
392            public static int getFoldersCount(HttpPrincipal httpPrincipal,
393                    long groupId, long parentFolderId)
394                    throws com.liferay.portal.kernel.exception.SystemException {
395                    try {
396                            MethodKey methodKey = new MethodKey(JournalFolderServiceUtil.class,
397                                            "getFoldersCount", _getFoldersCountParameterTypes10);
398    
399                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
400                                            parentFolderId);
401    
402                            Object returnObj = null;
403    
404                            try {
405                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
406                            }
407                            catch (Exception e) {
408                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
409                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
410                                    }
411    
412                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
413                            }
414    
415                            return ((Integer)returnObj).intValue();
416                    }
417                    catch (com.liferay.portal.kernel.exception.SystemException se) {
418                            _log.error(se, se);
419    
420                            throw se;
421                    }
422            }
423    
424            public static void getSubfolderIds(HttpPrincipal httpPrincipal,
425                    java.util.List<java.lang.Long> folderIds, long groupId, long folderId)
426                    throws com.liferay.portal.kernel.exception.SystemException {
427                    try {
428                            MethodKey methodKey = new MethodKey(JournalFolderServiceUtil.class,
429                                            "getSubfolderIds", _getSubfolderIdsParameterTypes11);
430    
431                            MethodHandler methodHandler = new MethodHandler(methodKey,
432                                            folderIds, groupId, folderId);
433    
434                            try {
435                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
436                            }
437                            catch (Exception e) {
438                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
439                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
440                                    }
441    
442                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
443                            }
444                    }
445                    catch (com.liferay.portal.kernel.exception.SystemException se) {
446                            _log.error(se, se);
447    
448                            throw se;
449                    }
450            }
451    
452            public static java.util.List<java.lang.Long> getSubfolderIds(
453                    HttpPrincipal httpPrincipal, long groupId, long folderId,
454                    boolean recurse)
455                    throws com.liferay.portal.kernel.exception.SystemException {
456                    try {
457                            MethodKey methodKey = new MethodKey(JournalFolderServiceUtil.class,
458                                            "getSubfolderIds", _getSubfolderIdsParameterTypes12);
459    
460                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
461                                            folderId, recurse);
462    
463                            Object returnObj = null;
464    
465                            try {
466                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
467                            }
468                            catch (Exception e) {
469                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
470                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
471                                    }
472    
473                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
474                            }
475    
476                            return (java.util.List<java.lang.Long>)returnObj;
477                    }
478                    catch (com.liferay.portal.kernel.exception.SystemException se) {
479                            _log.error(se, se);
480    
481                            throw se;
482                    }
483            }
484    
485            public static com.liferay.portlet.journal.model.JournalFolder moveFolder(
486                    HttpPrincipal httpPrincipal, long folderId, long parentFolderId,
487                    com.liferay.portal.service.ServiceContext serviceContext)
488                    throws com.liferay.portal.kernel.exception.PortalException,
489                            com.liferay.portal.kernel.exception.SystemException {
490                    try {
491                            MethodKey methodKey = new MethodKey(JournalFolderServiceUtil.class,
492                                            "moveFolder", _moveFolderParameterTypes13);
493    
494                            MethodHandler methodHandler = new MethodHandler(methodKey,
495                                            folderId, parentFolderId, serviceContext);
496    
497                            Object returnObj = null;
498    
499                            try {
500                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
501                            }
502                            catch (Exception e) {
503                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
504                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
505                                    }
506    
507                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
508                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
509                                    }
510    
511                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
512                            }
513    
514                            return (com.liferay.portlet.journal.model.JournalFolder)returnObj;
515                    }
516                    catch (com.liferay.portal.kernel.exception.SystemException se) {
517                            _log.error(se, se);
518    
519                            throw se;
520                    }
521            }
522    
523            public static com.liferay.portlet.journal.model.JournalFolder updateFolder(
524                    HttpPrincipal httpPrincipal, long folderId, long parentFolderId,
525                    java.lang.String name, java.lang.String description,
526                    boolean mergeWithParentFolder,
527                    com.liferay.portal.service.ServiceContext serviceContext)
528                    throws com.liferay.portal.kernel.exception.PortalException,
529                            com.liferay.portal.kernel.exception.SystemException {
530                    try {
531                            MethodKey methodKey = new MethodKey(JournalFolderServiceUtil.class,
532                                            "updateFolder", _updateFolderParameterTypes14);
533    
534                            MethodHandler methodHandler = new MethodHandler(methodKey,
535                                            folderId, parentFolderId, name, description,
536                                            mergeWithParentFolder, serviceContext);
537    
538                            Object returnObj = null;
539    
540                            try {
541                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
542                            }
543                            catch (Exception e) {
544                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
545                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
546                                    }
547    
548                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
549                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
550                                    }
551    
552                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
553                            }
554    
555                            return (com.liferay.portlet.journal.model.JournalFolder)returnObj;
556                    }
557                    catch (com.liferay.portal.kernel.exception.SystemException se) {
558                            _log.error(se, se);
559    
560                            throw se;
561                    }
562            }
563    
564            private static Log _log = LogFactoryUtil.getLog(JournalFolderServiceHttp.class);
565            private static final Class<?>[] _addFolderParameterTypes0 = new Class[] {
566                            long.class, long.class, java.lang.String.class,
567                            java.lang.String.class,
568                            com.liferay.portal.service.ServiceContext.class
569                    };
570            private static final Class<?>[] _deleteFolderParameterTypes1 = new Class[] {
571                            long.class
572                    };
573            private static final Class<?>[] _getFolderParameterTypes2 = new Class[] {
574                            long.class
575                    };
576            private static final Class<?>[] _getFoldersParameterTypes3 = new Class[] {
577                            long.class
578                    };
579            private static final Class<?>[] _getFoldersParameterTypes4 = new Class[] {
580                            long.class, long.class
581                    };
582            private static final Class<?>[] _getFoldersParameterTypes5 = new Class[] {
583                            long.class, long.class, int.class, int.class
584                    };
585            private static final Class<?>[] _getFoldersAndArticlesParameterTypes6 = new Class[] {
586                            long.class, long.class, int.class, int.class,
587                            com.liferay.portal.kernel.util.OrderByComparator.class
588                    };
589            private static final Class<?>[] _getFoldersAndArticlesCountParameterTypes7 = new Class[] {
590                            long.class, java.util.List.class, int.class
591                    };
592            private static final Class<?>[] _getFoldersAndArticlesCountParameterTypes8 = new Class[] {
593                            long.class, long.class
594                    };
595            private static final Class<?>[] _getFoldersAndArticlesCountParameterTypes9 = new Class[] {
596                            long.class, long.class, int.class
597                    };
598            private static final Class<?>[] _getFoldersCountParameterTypes10 = new Class[] {
599                            long.class, long.class
600                    };
601            private static final Class<?>[] _getSubfolderIdsParameterTypes11 = new Class[] {
602                            java.util.List.class, long.class, long.class
603                    };
604            private static final Class<?>[] _getSubfolderIdsParameterTypes12 = new Class[] {
605                            long.class, long.class, boolean.class
606                    };
607            private static final Class<?>[] _moveFolderParameterTypes13 = new Class[] {
608                            long.class, long.class,
609                            com.liferay.portal.service.ServiceContext.class
610                    };
611            private static final Class<?>[] _updateFolderParameterTypes14 = new Class[] {
612                            long.class, long.class, java.lang.String.class,
613                            java.lang.String.class, boolean.class,
614                            com.liferay.portal.service.ServiceContext.class
615                    };
616    }