001    /**
002     * Copyright (c) 2000-present 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.wiki.service.http;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.log.Log;
020    import com.liferay.portal.kernel.log.LogFactoryUtil;
021    import com.liferay.portal.kernel.util.MethodHandler;
022    import com.liferay.portal.kernel.util.MethodKey;
023    import com.liferay.portal.security.auth.HttpPrincipal;
024    import com.liferay.portal.service.http.TunnelUtil;
025    
026    import com.liferay.portlet.wiki.service.WikiNodeServiceUtil;
027    
028    /**
029     * Provides the HTTP utility for the
030     * {@link com.liferay.portlet.wiki.service.WikiNodeServiceUtil} service utility. The
031     * static methods of this class calls the same methods of the service utility.
032     * However, the signatures are different because it requires an additional
033     * {@link com.liferay.portal.security.auth.HttpPrincipal} parameter.
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 WikiNodeServiceSoap
052     * @see com.liferay.portal.security.auth.HttpPrincipal
053     * @see com.liferay.portlet.wiki.service.WikiNodeServiceUtil
054     * @generated
055     */
056    @ProviderType
057    public class WikiNodeServiceHttp {
058            public static com.liferay.portlet.wiki.model.WikiNode addNode(
059                    HttpPrincipal httpPrincipal, java.lang.String name,
060                    java.lang.String description,
061                    com.liferay.portal.service.ServiceContext serviceContext)
062                    throws com.liferay.portal.kernel.exception.PortalException {
063                    try {
064                            MethodKey methodKey = new MethodKey(WikiNodeServiceUtil.class,
065                                            "addNode", _addNodeParameterTypes0);
066    
067                            MethodHandler methodHandler = new MethodHandler(methodKey, name,
068                                            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                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
081                            }
082    
083                            return (com.liferay.portlet.wiki.model.WikiNode)returnObj;
084                    }
085                    catch (com.liferay.portal.kernel.exception.SystemException se) {
086                            _log.error(se, se);
087    
088                            throw se;
089                    }
090            }
091    
092            public static void deleteNode(HttpPrincipal httpPrincipal, long nodeId)
093                    throws com.liferay.portal.kernel.exception.PortalException {
094                    try {
095                            MethodKey methodKey = new MethodKey(WikiNodeServiceUtil.class,
096                                            "deleteNode", _deleteNodeParameterTypes1);
097    
098                            MethodHandler methodHandler = new MethodHandler(methodKey, nodeId);
099    
100                            try {
101                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
102                            }
103                            catch (Exception e) {
104                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
105                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
106                                    }
107    
108                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
109                            }
110                    }
111                    catch (com.liferay.portal.kernel.exception.SystemException se) {
112                            _log.error(se, se);
113    
114                            throw se;
115                    }
116            }
117    
118            public static com.liferay.portlet.wiki.model.WikiNode getNode(
119                    HttpPrincipal httpPrincipal, long nodeId)
120                    throws com.liferay.portal.kernel.exception.PortalException {
121                    try {
122                            MethodKey methodKey = new MethodKey(WikiNodeServiceUtil.class,
123                                            "getNode", _getNodeParameterTypes2);
124    
125                            MethodHandler methodHandler = new MethodHandler(methodKey, nodeId);
126    
127                            Object returnObj = null;
128    
129                            try {
130                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
131                            }
132                            catch (Exception e) {
133                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
134                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
135                                    }
136    
137                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
138                            }
139    
140                            return (com.liferay.portlet.wiki.model.WikiNode)returnObj;
141                    }
142                    catch (com.liferay.portal.kernel.exception.SystemException se) {
143                            _log.error(se, se);
144    
145                            throw se;
146                    }
147            }
148    
149            public static com.liferay.portlet.wiki.model.WikiNode getNode(
150                    HttpPrincipal httpPrincipal, long groupId, java.lang.String name)
151                    throws com.liferay.portal.kernel.exception.PortalException {
152                    try {
153                            MethodKey methodKey = new MethodKey(WikiNodeServiceUtil.class,
154                                            "getNode", _getNodeParameterTypes3);
155    
156                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
157                                            name);
158    
159                            Object returnObj = null;
160    
161                            try {
162                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
163                            }
164                            catch (Exception e) {
165                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
166                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
167                                    }
168    
169                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
170                            }
171    
172                            return (com.liferay.portlet.wiki.model.WikiNode)returnObj;
173                    }
174                    catch (com.liferay.portal.kernel.exception.SystemException se) {
175                            _log.error(se, se);
176    
177                            throw se;
178                    }
179            }
180    
181            public static java.util.List<com.liferay.portlet.wiki.model.WikiNode> getNodes(
182                    HttpPrincipal httpPrincipal, long groupId)
183                    throws com.liferay.portal.kernel.exception.PortalException {
184                    try {
185                            MethodKey methodKey = new MethodKey(WikiNodeServiceUtil.class,
186                                            "getNodes", _getNodesParameterTypes4);
187    
188                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId);
189    
190                            Object returnObj = null;
191    
192                            try {
193                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
194                            }
195                            catch (Exception e) {
196                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
197                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
198                                    }
199    
200                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
201                            }
202    
203                            return (java.util.List<com.liferay.portlet.wiki.model.WikiNode>)returnObj;
204                    }
205                    catch (com.liferay.portal.kernel.exception.SystemException se) {
206                            _log.error(se, se);
207    
208                            throw se;
209                    }
210            }
211    
212            public static java.util.List<com.liferay.portlet.wiki.model.WikiNode> getNodes(
213                    HttpPrincipal httpPrincipal, long groupId, int status)
214                    throws com.liferay.portal.kernel.exception.PortalException {
215                    try {
216                            MethodKey methodKey = new MethodKey(WikiNodeServiceUtil.class,
217                                            "getNodes", _getNodesParameterTypes5);
218    
219                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
220                                            status);
221    
222                            Object returnObj = null;
223    
224                            try {
225                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
226                            }
227                            catch (Exception e) {
228                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
229                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
230                                    }
231    
232                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
233                            }
234    
235                            return (java.util.List<com.liferay.portlet.wiki.model.WikiNode>)returnObj;
236                    }
237                    catch (com.liferay.portal.kernel.exception.SystemException se) {
238                            _log.error(se, se);
239    
240                            throw se;
241                    }
242            }
243    
244            public static java.util.List<com.liferay.portlet.wiki.model.WikiNode> getNodes(
245                    HttpPrincipal httpPrincipal, long groupId, int start, int end) {
246                    try {
247                            MethodKey methodKey = new MethodKey(WikiNodeServiceUtil.class,
248                                            "getNodes", _getNodesParameterTypes6);
249    
250                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
251                                            start, end);
252    
253                            Object returnObj = null;
254    
255                            try {
256                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
257                            }
258                            catch (Exception e) {
259                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
260                            }
261    
262                            return (java.util.List<com.liferay.portlet.wiki.model.WikiNode>)returnObj;
263                    }
264                    catch (com.liferay.portal.kernel.exception.SystemException se) {
265                            _log.error(se, se);
266    
267                            throw se;
268                    }
269            }
270    
271            public static java.util.List<com.liferay.portlet.wiki.model.WikiNode> getNodes(
272                    HttpPrincipal httpPrincipal, long groupId, int status, int start,
273                    int end) {
274                    try {
275                            MethodKey methodKey = new MethodKey(WikiNodeServiceUtil.class,
276                                            "getNodes", _getNodesParameterTypes7);
277    
278                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
279                                            status, start, end);
280    
281                            Object returnObj = null;
282    
283                            try {
284                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
285                            }
286                            catch (Exception e) {
287                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
288                            }
289    
290                            return (java.util.List<com.liferay.portlet.wiki.model.WikiNode>)returnObj;
291                    }
292                    catch (com.liferay.portal.kernel.exception.SystemException se) {
293                            _log.error(se, se);
294    
295                            throw se;
296                    }
297            }
298    
299            public static int getNodesCount(HttpPrincipal httpPrincipal, long groupId) {
300                    try {
301                            MethodKey methodKey = new MethodKey(WikiNodeServiceUtil.class,
302                                            "getNodesCount", _getNodesCountParameterTypes8);
303    
304                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId);
305    
306                            Object returnObj = null;
307    
308                            try {
309                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
310                            }
311                            catch (Exception e) {
312                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
313                            }
314    
315                            return ((Integer)returnObj).intValue();
316                    }
317                    catch (com.liferay.portal.kernel.exception.SystemException se) {
318                            _log.error(se, se);
319    
320                            throw se;
321                    }
322            }
323    
324            public static int getNodesCount(HttpPrincipal httpPrincipal, long groupId,
325                    int status) {
326                    try {
327                            MethodKey methodKey = new MethodKey(WikiNodeServiceUtil.class,
328                                            "getNodesCount", _getNodesCountParameterTypes9);
329    
330                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
331                                            status);
332    
333                            Object returnObj = null;
334    
335                            try {
336                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
337                            }
338                            catch (Exception e) {
339                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
340                            }
341    
342                            return ((Integer)returnObj).intValue();
343                    }
344                    catch (com.liferay.portal.kernel.exception.SystemException se) {
345                            _log.error(se, se);
346    
347                            throw se;
348                    }
349            }
350    
351            public static void importPages(HttpPrincipal httpPrincipal, long nodeId,
352                    java.lang.String importer, java.io.InputStream[] inputStreams,
353                    java.util.Map<java.lang.String, java.lang.String[]> options)
354                    throws com.liferay.portal.kernel.exception.PortalException {
355                    try {
356                            MethodKey methodKey = new MethodKey(WikiNodeServiceUtil.class,
357                                            "importPages", _importPagesParameterTypes10);
358    
359                            MethodHandler methodHandler = new MethodHandler(methodKey, nodeId,
360                                            importer, inputStreams, options);
361    
362                            try {
363                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
364                            }
365                            catch (Exception e) {
366                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
367                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
368                                    }
369    
370                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
371                            }
372                    }
373                    catch (com.liferay.portal.kernel.exception.SystemException se) {
374                            _log.error(se, se);
375    
376                            throw se;
377                    }
378            }
379    
380            public static com.liferay.portlet.wiki.model.WikiNode moveNodeToTrash(
381                    HttpPrincipal httpPrincipal, long nodeId)
382                    throws com.liferay.portal.kernel.exception.PortalException {
383                    try {
384                            MethodKey methodKey = new MethodKey(WikiNodeServiceUtil.class,
385                                            "moveNodeToTrash", _moveNodeToTrashParameterTypes11);
386    
387                            MethodHandler methodHandler = new MethodHandler(methodKey, nodeId);
388    
389                            Object returnObj = null;
390    
391                            try {
392                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
393                            }
394                            catch (Exception e) {
395                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
396                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
397                                    }
398    
399                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
400                            }
401    
402                            return (com.liferay.portlet.wiki.model.WikiNode)returnObj;
403                    }
404                    catch (com.liferay.portal.kernel.exception.SystemException se) {
405                            _log.error(se, se);
406    
407                            throw se;
408                    }
409            }
410    
411            public static void restoreNodeFromTrash(HttpPrincipal httpPrincipal,
412                    long nodeId) throws com.liferay.portal.kernel.exception.PortalException {
413                    try {
414                            MethodKey methodKey = new MethodKey(WikiNodeServiceUtil.class,
415                                            "restoreNodeFromTrash",
416                                            _restoreNodeFromTrashParameterTypes12);
417    
418                            MethodHandler methodHandler = new MethodHandler(methodKey, nodeId);
419    
420                            try {
421                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
422                            }
423                            catch (Exception e) {
424                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
425                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
426                                    }
427    
428                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
429                            }
430                    }
431                    catch (com.liferay.portal.kernel.exception.SystemException se) {
432                            _log.error(se, se);
433    
434                            throw se;
435                    }
436            }
437    
438            public static void subscribeNode(HttpPrincipal httpPrincipal, long nodeId)
439                    throws com.liferay.portal.kernel.exception.PortalException {
440                    try {
441                            MethodKey methodKey = new MethodKey(WikiNodeServiceUtil.class,
442                                            "subscribeNode", _subscribeNodeParameterTypes13);
443    
444                            MethodHandler methodHandler = new MethodHandler(methodKey, nodeId);
445    
446                            try {
447                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
448                            }
449                            catch (Exception e) {
450                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
451                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
452                                    }
453    
454                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
455                            }
456                    }
457                    catch (com.liferay.portal.kernel.exception.SystemException se) {
458                            _log.error(se, se);
459    
460                            throw se;
461                    }
462            }
463    
464            public static void unsubscribeNode(HttpPrincipal httpPrincipal, long nodeId)
465                    throws com.liferay.portal.kernel.exception.PortalException {
466                    try {
467                            MethodKey methodKey = new MethodKey(WikiNodeServiceUtil.class,
468                                            "unsubscribeNode", _unsubscribeNodeParameterTypes14);
469    
470                            MethodHandler methodHandler = new MethodHandler(methodKey, nodeId);
471    
472                            try {
473                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
474                            }
475                            catch (Exception e) {
476                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
477                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
478                                    }
479    
480                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
481                            }
482                    }
483                    catch (com.liferay.portal.kernel.exception.SystemException se) {
484                            _log.error(se, se);
485    
486                            throw se;
487                    }
488            }
489    
490            public static com.liferay.portlet.wiki.model.WikiNode updateNode(
491                    HttpPrincipal httpPrincipal, long nodeId, java.lang.String name,
492                    java.lang.String description,
493                    com.liferay.portal.service.ServiceContext serviceContext)
494                    throws com.liferay.portal.kernel.exception.PortalException {
495                    try {
496                            MethodKey methodKey = new MethodKey(WikiNodeServiceUtil.class,
497                                            "updateNode", _updateNodeParameterTypes15);
498    
499                            MethodHandler methodHandler = new MethodHandler(methodKey, nodeId,
500                                            name, description, serviceContext);
501    
502                            Object returnObj = null;
503    
504                            try {
505                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
506                            }
507                            catch (Exception e) {
508                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
509                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
510                                    }
511    
512                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
513                            }
514    
515                            return (com.liferay.portlet.wiki.model.WikiNode)returnObj;
516                    }
517                    catch (com.liferay.portal.kernel.exception.SystemException se) {
518                            _log.error(se, se);
519    
520                            throw se;
521                    }
522            }
523    
524            private static Log _log = LogFactoryUtil.getLog(WikiNodeServiceHttp.class);
525            private static final Class<?>[] _addNodeParameterTypes0 = new Class[] {
526                            java.lang.String.class, java.lang.String.class,
527                            com.liferay.portal.service.ServiceContext.class
528                    };
529            private static final Class<?>[] _deleteNodeParameterTypes1 = new Class[] {
530                            long.class
531                    };
532            private static final Class<?>[] _getNodeParameterTypes2 = new Class[] {
533                            long.class
534                    };
535            private static final Class<?>[] _getNodeParameterTypes3 = new Class[] {
536                            long.class, java.lang.String.class
537                    };
538            private static final Class<?>[] _getNodesParameterTypes4 = new Class[] {
539                            long.class
540                    };
541            private static final Class<?>[] _getNodesParameterTypes5 = new Class[] {
542                            long.class, int.class
543                    };
544            private static final Class<?>[] _getNodesParameterTypes6 = new Class[] {
545                            long.class, int.class, int.class
546                    };
547            private static final Class<?>[] _getNodesParameterTypes7 = new Class[] {
548                            long.class, int.class, int.class, int.class
549                    };
550            private static final Class<?>[] _getNodesCountParameterTypes8 = new Class[] {
551                            long.class
552                    };
553            private static final Class<?>[] _getNodesCountParameterTypes9 = new Class[] {
554                            long.class, int.class
555                    };
556            private static final Class<?>[] _importPagesParameterTypes10 = new Class[] {
557                            long.class, java.lang.String.class, java.io.InputStream[].class,
558                            java.util.Map.class
559                    };
560            private static final Class<?>[] _moveNodeToTrashParameterTypes11 = new Class[] {
561                            long.class
562                    };
563            private static final Class<?>[] _restoreNodeFromTrashParameterTypes12 = new Class[] {
564                            long.class
565                    };
566            private static final Class<?>[] _subscribeNodeParameterTypes13 = new Class[] {
567                            long.class
568                    };
569            private static final Class<?>[] _unsubscribeNodeParameterTypes14 = new Class[] {
570                            long.class
571                    };
572            private static final Class<?>[] _updateNodeParameterTypes15 = new Class[] {
573                            long.class, java.lang.String.class, java.lang.String.class,
574                            com.liferay.portal.service.ServiceContext.class
575                    };
576    }