001    /**
002     * Copyright (c) 2000-2010 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.imagegallery.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.imagegallery.service.IGFolderServiceUtil;
025    
026    /**
027     * <p>
028     * This class provides a HTTP utility for the
029     * {@link com.liferay.portlet.imagegallery.service.IGFolderServiceUtil} 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       IGFolderServiceSoap
052     * @see       com.liferay.portal.security.auth.HttpPrincipal
053     * @see       com.liferay.portlet.imagegallery.service.IGFolderServiceUtil
054     * @generated
055     */
056    public class IGFolderServiceHttp {
057            public static com.liferay.portlet.imagegallery.model.IGFolder 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(IGFolderServiceUtil.class.getName(),
065                                            "addFolder", long.class, java.lang.String.class,
066                                            java.lang.String.class,
067                                            com.liferay.portal.service.ServiceContext.class);
068    
069                            MethodHandler methodHandler = new MethodHandler(methodKey,
070                                            parentFolderId, name, description, serviceContext);
071    
072                            Object returnObj = null;
073    
074                            try {
075                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
076                            }
077                            catch (Exception e) {
078                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
079                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
080                                    }
081    
082                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
083                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
084                                    }
085    
086                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
087                            }
088    
089                            return (com.liferay.portlet.imagegallery.model.IGFolder)returnObj;
090                    }
091                    catch (com.liferay.portal.kernel.exception.SystemException se) {
092                            _log.error(se, se);
093    
094                            throw se;
095                    }
096            }
097    
098            public static com.liferay.portlet.imagegallery.model.IGFolder copyFolder(
099                    HttpPrincipal httpPrincipal, long sourceFolderId, long parentFolderId,
100                    java.lang.String name, java.lang.String description,
101                    com.liferay.portal.service.ServiceContext serviceContext)
102                    throws com.liferay.portal.kernel.exception.PortalException,
103                            com.liferay.portal.kernel.exception.SystemException {
104                    try {
105                            MethodKey methodKey = new MethodKey(IGFolderServiceUtil.class.getName(),
106                                            "copyFolder", long.class, long.class,
107                                            java.lang.String.class, java.lang.String.class,
108                                            com.liferay.portal.service.ServiceContext.class);
109    
110                            MethodHandler methodHandler = new MethodHandler(methodKey,
111                                            sourceFolderId, parentFolderId, name, description,
112                                            serviceContext);
113    
114                            Object returnObj = null;
115    
116                            try {
117                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
118                            }
119                            catch (Exception e) {
120                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
121                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
122                                    }
123    
124                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
125                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
126                                    }
127    
128                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
129                            }
130    
131                            return (com.liferay.portlet.imagegallery.model.IGFolder)returnObj;
132                    }
133                    catch (com.liferay.portal.kernel.exception.SystemException se) {
134                            _log.error(se, se);
135    
136                            throw se;
137                    }
138            }
139    
140            public static void deleteFolder(HttpPrincipal httpPrincipal, long folderId)
141                    throws com.liferay.portal.kernel.exception.PortalException,
142                            com.liferay.portal.kernel.exception.SystemException {
143                    try {
144                            MethodKey methodKey = new MethodKey(IGFolderServiceUtil.class.getName(),
145                                            "deleteFolder", long.class);
146    
147                            MethodHandler methodHandler = new MethodHandler(methodKey, folderId);
148    
149                            try {
150                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
151                            }
152                            catch (Exception e) {
153                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
154                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
155                                    }
156    
157                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
158                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
159                                    }
160    
161                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
162                            }
163                    }
164                    catch (com.liferay.portal.kernel.exception.SystemException se) {
165                            _log.error(se, se);
166    
167                            throw se;
168                    }
169            }
170    
171            public static com.liferay.portlet.imagegallery.model.IGFolder getFolder(
172                    HttpPrincipal httpPrincipal, long folderId)
173                    throws com.liferay.portal.kernel.exception.PortalException,
174                            com.liferay.portal.kernel.exception.SystemException {
175                    try {
176                            MethodKey methodKey = new MethodKey(IGFolderServiceUtil.class.getName(),
177                                            "getFolder", long.class);
178    
179                            MethodHandler methodHandler = new MethodHandler(methodKey, folderId);
180    
181                            Object returnObj = null;
182    
183                            try {
184                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
185                            }
186                            catch (Exception e) {
187                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
188                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
189                                    }
190    
191                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
192                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
193                                    }
194    
195                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
196                            }
197    
198                            return (com.liferay.portlet.imagegallery.model.IGFolder)returnObj;
199                    }
200                    catch (com.liferay.portal.kernel.exception.SystemException se) {
201                            _log.error(se, se);
202    
203                            throw se;
204                    }
205            }
206    
207            public static com.liferay.portlet.imagegallery.model.IGFolder getFolder(
208                    HttpPrincipal httpPrincipal, long groupId, long parentFolderId,
209                    java.lang.String name)
210                    throws com.liferay.portal.kernel.exception.PortalException,
211                            com.liferay.portal.kernel.exception.SystemException {
212                    try {
213                            MethodKey methodKey = new MethodKey(IGFolderServiceUtil.class.getName(),
214                                            "getFolder", long.class, long.class, java.lang.String.class);
215    
216                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
217                                            parentFolderId, name);
218    
219                            Object returnObj = null;
220    
221                            try {
222                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
223                            }
224                            catch (Exception e) {
225                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
226                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
227                                    }
228    
229                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
230                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
231                                    }
232    
233                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
234                            }
235    
236                            return (com.liferay.portlet.imagegallery.model.IGFolder)returnObj;
237                    }
238                    catch (com.liferay.portal.kernel.exception.SystemException se) {
239                            _log.error(se, se);
240    
241                            throw se;
242                    }
243            }
244    
245            public static java.util.List<com.liferay.portlet.imagegallery.model.IGFolder> getFolders(
246                    HttpPrincipal httpPrincipal, long groupId, long parentFolderId)
247                    throws com.liferay.portal.kernel.exception.SystemException {
248                    try {
249                            MethodKey methodKey = new MethodKey(IGFolderServiceUtil.class.getName(),
250                                            "getFolders", long.class, long.class);
251    
252                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
253                                            parentFolderId);
254    
255                            Object returnObj = null;
256    
257                            try {
258                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
259                            }
260                            catch (Exception e) {
261                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
262                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
263                                    }
264    
265                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
266                            }
267    
268                            return (java.util.List<com.liferay.portlet.imagegallery.model.IGFolder>)returnObj;
269                    }
270                    catch (com.liferay.portal.kernel.exception.SystemException se) {
271                            _log.error(se, se);
272    
273                            throw se;
274                    }
275            }
276    
277            public static java.util.List<com.liferay.portlet.imagegallery.model.IGFolder> getFolders(
278                    HttpPrincipal httpPrincipal, long groupId, long parentFolderId,
279                    int start, int end)
280                    throws com.liferay.portal.kernel.exception.SystemException {
281                    try {
282                            MethodKey methodKey = new MethodKey(IGFolderServiceUtil.class.getName(),
283                                            "getFolders", long.class, long.class, int.class, int.class);
284    
285                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
286                                            parentFolderId, start, end);
287    
288                            Object returnObj = null;
289    
290                            try {
291                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
292                            }
293                            catch (Exception e) {
294                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
295                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
296                                    }
297    
298                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
299                            }
300    
301                            return (java.util.List<com.liferay.portlet.imagegallery.model.IGFolder>)returnObj;
302                    }
303                    catch (com.liferay.portal.kernel.exception.SystemException se) {
304                            _log.error(se, se);
305    
306                            throw se;
307                    }
308            }
309    
310            public static int getFoldersCount(HttpPrincipal httpPrincipal,
311                    long groupId, long parentFolderId)
312                    throws com.liferay.portal.kernel.exception.SystemException {
313                    try {
314                            MethodKey methodKey = new MethodKey(IGFolderServiceUtil.class.getName(),
315                                            "getFoldersCount", long.class, long.class);
316    
317                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
318                                            parentFolderId);
319    
320                            Object returnObj = null;
321    
322                            try {
323                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
324                            }
325                            catch (Exception e) {
326                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
327                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
328                                    }
329    
330                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
331                            }
332    
333                            return ((Integer)returnObj).intValue();
334                    }
335                    catch (com.liferay.portal.kernel.exception.SystemException se) {
336                            _log.error(se, se);
337    
338                            throw se;
339                    }
340            }
341    
342            public static com.liferay.portlet.imagegallery.model.IGFolder updateFolder(
343                    HttpPrincipal httpPrincipal, long folderId, long parentFolderId,
344                    java.lang.String name, java.lang.String description,
345                    boolean mergeWithParentFolder,
346                    com.liferay.portal.service.ServiceContext serviceContext)
347                    throws com.liferay.portal.kernel.exception.PortalException,
348                            com.liferay.portal.kernel.exception.SystemException {
349                    try {
350                            MethodKey methodKey = new MethodKey(IGFolderServiceUtil.class.getName(),
351                                            "updateFolder", long.class, long.class,
352                                            java.lang.String.class, java.lang.String.class,
353                                            boolean.class,
354                                            com.liferay.portal.service.ServiceContext.class);
355    
356                            MethodHandler methodHandler = new MethodHandler(methodKey,
357                                            folderId, parentFolderId, name, description,
358                                            mergeWithParentFolder, serviceContext);
359    
360                            Object returnObj = null;
361    
362                            try {
363                                    returnObj = 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                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
371                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
372                                    }
373    
374                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
375                            }
376    
377                            return (com.liferay.portlet.imagegallery.model.IGFolder)returnObj;
378                    }
379                    catch (com.liferay.portal.kernel.exception.SystemException se) {
380                            _log.error(se, se);
381    
382                            throw se;
383                    }
384            }
385    
386            private static Log _log = LogFactoryUtil.getLog(IGFolderServiceHttp.class);
387    }