001    /**
002     * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
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", _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.imagegallery.model.IGFolder)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 com.liferay.portlet.imagegallery.model.IGFolder copyFolder(
097                    HttpPrincipal httpPrincipal, long sourceFolderId, long parentFolderId,
098                    java.lang.String name, java.lang.String description,
099                    com.liferay.portal.service.ServiceContext serviceContext)
100                    throws com.liferay.portal.kernel.exception.PortalException,
101                            com.liferay.portal.kernel.exception.SystemException {
102                    try {
103                            MethodKey methodKey = new MethodKey(IGFolderServiceUtil.class.getName(),
104                                            "copyFolder", _copyFolderParameterTypes1);
105    
106                            MethodHandler methodHandler = new MethodHandler(methodKey,
107                                            sourceFolderId, parentFolderId, name, description,
108                                            serviceContext);
109    
110                            Object returnObj = null;
111    
112                            try {
113                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
114                            }
115                            catch (Exception e) {
116                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
117                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
118                                    }
119    
120                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
121                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
122                                    }
123    
124                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
125                            }
126    
127                            return (com.liferay.portlet.imagegallery.model.IGFolder)returnObj;
128                    }
129                    catch (com.liferay.portal.kernel.exception.SystemException se) {
130                            _log.error(se, se);
131    
132                            throw se;
133                    }
134            }
135    
136            public static void deleteFolder(HttpPrincipal httpPrincipal, long folderId)
137                    throws com.liferay.portal.kernel.exception.PortalException,
138                            com.liferay.portal.kernel.exception.SystemException {
139                    try {
140                            MethodKey methodKey = new MethodKey(IGFolderServiceUtil.class.getName(),
141                                            "deleteFolder", _deleteFolderParameterTypes2);
142    
143                            MethodHandler methodHandler = new MethodHandler(methodKey, folderId);
144    
145                            try {
146                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
147                            }
148                            catch (Exception e) {
149                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
150                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
151                                    }
152    
153                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
154                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
155                                    }
156    
157                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
158                            }
159                    }
160                    catch (com.liferay.portal.kernel.exception.SystemException se) {
161                            _log.error(se, se);
162    
163                            throw se;
164                    }
165            }
166    
167            public static com.liferay.portlet.imagegallery.model.IGFolder getFolder(
168                    HttpPrincipal httpPrincipal, long folderId)
169                    throws com.liferay.portal.kernel.exception.PortalException,
170                            com.liferay.portal.kernel.exception.SystemException {
171                    try {
172                            MethodKey methodKey = new MethodKey(IGFolderServiceUtil.class.getName(),
173                                            "getFolder", _getFolderParameterTypes3);
174    
175                            MethodHandler methodHandler = new MethodHandler(methodKey, folderId);
176    
177                            Object returnObj = null;
178    
179                            try {
180                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
181                            }
182                            catch (Exception e) {
183                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
184                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
185                                    }
186    
187                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
188                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
189                                    }
190    
191                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
192                            }
193    
194                            return (com.liferay.portlet.imagegallery.model.IGFolder)returnObj;
195                    }
196                    catch (com.liferay.portal.kernel.exception.SystemException se) {
197                            _log.error(se, se);
198    
199                            throw se;
200                    }
201            }
202    
203            public static com.liferay.portlet.imagegallery.model.IGFolder getFolder(
204                    HttpPrincipal httpPrincipal, long groupId, long parentFolderId,
205                    java.lang.String name)
206                    throws com.liferay.portal.kernel.exception.PortalException,
207                            com.liferay.portal.kernel.exception.SystemException {
208                    try {
209                            MethodKey methodKey = new MethodKey(IGFolderServiceUtil.class.getName(),
210                                            "getFolder", _getFolderParameterTypes4);
211    
212                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
213                                            parentFolderId, name);
214    
215                            Object returnObj = null;
216    
217                            try {
218                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
219                            }
220                            catch (Exception e) {
221                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
222                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
223                                    }
224    
225                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
226                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
227                                    }
228    
229                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
230                            }
231    
232                            return (com.liferay.portlet.imagegallery.model.IGFolder)returnObj;
233                    }
234                    catch (com.liferay.portal.kernel.exception.SystemException se) {
235                            _log.error(se, se);
236    
237                            throw se;
238                    }
239            }
240    
241            public static java.util.List<com.liferay.portlet.imagegallery.model.IGFolder> getFolders(
242                    HttpPrincipal httpPrincipal, long groupId, long parentFolderId)
243                    throws com.liferay.portal.kernel.exception.SystemException {
244                    try {
245                            MethodKey methodKey = new MethodKey(IGFolderServiceUtil.class.getName(),
246                                            "getFolders", _getFoldersParameterTypes5);
247    
248                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
249                                            parentFolderId);
250    
251                            Object returnObj = null;
252    
253                            try {
254                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
255                            }
256                            catch (Exception e) {
257                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
258                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
259                                    }
260    
261                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
262                            }
263    
264                            return (java.util.List<com.liferay.portlet.imagegallery.model.IGFolder>)returnObj;
265                    }
266                    catch (com.liferay.portal.kernel.exception.SystemException se) {
267                            _log.error(se, se);
268    
269                            throw se;
270                    }
271            }
272    
273            public static java.util.List<com.liferay.portlet.imagegallery.model.IGFolder> getFolders(
274                    HttpPrincipal httpPrincipal, long groupId, long parentFolderId,
275                    int start, int end)
276                    throws com.liferay.portal.kernel.exception.SystemException {
277                    try {
278                            MethodKey methodKey = new MethodKey(IGFolderServiceUtil.class.getName(),
279                                            "getFolders", _getFoldersParameterTypes6);
280    
281                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
282                                            parentFolderId, start, end);
283    
284                            Object returnObj = null;
285    
286                            try {
287                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
288                            }
289                            catch (Exception e) {
290                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
291                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
292                                    }
293    
294                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
295                            }
296    
297                            return (java.util.List<com.liferay.portlet.imagegallery.model.IGFolder>)returnObj;
298                    }
299                    catch (com.liferay.portal.kernel.exception.SystemException se) {
300                            _log.error(se, se);
301    
302                            throw se;
303                    }
304            }
305    
306            public static int getFoldersCount(HttpPrincipal httpPrincipal,
307                    long groupId, long parentFolderId)
308                    throws com.liferay.portal.kernel.exception.SystemException {
309                    try {
310                            MethodKey methodKey = new MethodKey(IGFolderServiceUtil.class.getName(),
311                                            "getFoldersCount", _getFoldersCountParameterTypes7);
312    
313                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
314                                            parentFolderId);
315    
316                            Object returnObj = null;
317    
318                            try {
319                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
320                            }
321                            catch (Exception e) {
322                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
323                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
324                                    }
325    
326                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
327                            }
328    
329                            return ((Integer)returnObj).intValue();
330                    }
331                    catch (com.liferay.portal.kernel.exception.SystemException se) {
332                            _log.error(se, se);
333    
334                            throw se;
335                    }
336            }
337    
338            public static com.liferay.portlet.imagegallery.model.IGFolder updateFolder(
339                    HttpPrincipal httpPrincipal, long folderId, long parentFolderId,
340                    java.lang.String name, java.lang.String description,
341                    boolean mergeWithParentFolder,
342                    com.liferay.portal.service.ServiceContext serviceContext)
343                    throws com.liferay.portal.kernel.exception.PortalException,
344                            com.liferay.portal.kernel.exception.SystemException {
345                    try {
346                            MethodKey methodKey = new MethodKey(IGFolderServiceUtil.class.getName(),
347                                            "updateFolder", _updateFolderParameterTypes8);
348    
349                            MethodHandler methodHandler = new MethodHandler(methodKey,
350                                            folderId, parentFolderId, name, description,
351                                            mergeWithParentFolder, serviceContext);
352    
353                            Object returnObj = null;
354    
355                            try {
356                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
357                            }
358                            catch (Exception e) {
359                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
360                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
361                                    }
362    
363                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
364                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
365                                    }
366    
367                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
368                            }
369    
370                            return (com.liferay.portlet.imagegallery.model.IGFolder)returnObj;
371                    }
372                    catch (com.liferay.portal.kernel.exception.SystemException se) {
373                            _log.error(se, se);
374    
375                            throw se;
376                    }
377            }
378    
379            private static Log _log = LogFactoryUtil.getLog(IGFolderServiceHttp.class);
380            private static final Class<?>[] _addFolderParameterTypes0 = new Class[] {
381                            long.class, java.lang.String.class, java.lang.String.class,
382                            com.liferay.portal.service.ServiceContext.class
383                    };
384            private static final Class<?>[] _copyFolderParameterTypes1 = new Class[] {
385                            long.class, long.class, java.lang.String.class,
386                            java.lang.String.class,
387                            com.liferay.portal.service.ServiceContext.class
388                    };
389            private static final Class<?>[] _deleteFolderParameterTypes2 = new Class[] {
390                            long.class
391                    };
392            private static final Class<?>[] _getFolderParameterTypes3 = new Class[] {
393                            long.class
394                    };
395            private static final Class<?>[] _getFolderParameterTypes4 = new Class[] {
396                            long.class, long.class, java.lang.String.class
397                    };
398            private static final Class<?>[] _getFoldersParameterTypes5 = new Class[] {
399                            long.class, long.class
400                    };
401            private static final Class<?>[] _getFoldersParameterTypes6 = new Class[] {
402                            long.class, long.class, int.class, int.class
403                    };
404            private static final Class<?>[] _getFoldersCountParameterTypes7 = new Class[] {
405                            long.class, long.class
406                    };
407            private static final Class<?>[] _updateFolderParameterTypes8 = new Class[] {
408                            long.class, long.class, java.lang.String.class,
409                            java.lang.String.class, boolean.class,
410                            com.liferay.portal.service.ServiceContext.class
411                    };
412    }