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.BooleanWrapper;
020    import com.liferay.portal.kernel.util.LongWrapper;
021    import com.liferay.portal.kernel.util.MethodWrapper;
022    import com.liferay.portal.kernel.util.NullWrapper;
023    import com.liferay.portal.security.auth.HttpPrincipal;
024    import com.liferay.portal.service.http.TunnelUtil;
025    
026    import com.liferay.portlet.imagegallery.service.IGFolderServiceUtil;
027    
028    /**
029     * <p>
030     * This class provides a HTTP utility for the
031     * {@link com.liferay.portlet.imagegallery.service.IGFolderServiceUtil} service utility. The
032     * static methods of this class calls the same methods of the service utility.
033     * However, the signatures are different because it requires an additional
034     * {@link com.liferay.portal.security.auth.HttpPrincipal} parameter.
035     * </p>
036     *
037     * <p>
038     * The benefits of using the HTTP utility is that it is fast and allows for
039     * tunneling without the cost of serializing to text. The drawback is that it
040     * only works with Java.
041     * </p>
042     *
043     * <p>
044     * Set the property <b>tunnel.servlet.hosts.allowed</b> in portal.properties to
045     * configure security.
046     * </p>
047     *
048     * <p>
049     * The HTTP utility is only generated for remote services.
050     * </p>
051     *
052     * @author    Brian Wing Shun Chan
053     * @see       IGFolderServiceSoap
054     * @see       com.liferay.portal.security.auth.HttpPrincipal
055     * @see       com.liferay.portlet.imagegallery.service.IGFolderServiceUtil
056     * @generated
057     */
058    public class IGFolderServiceHttp {
059            public static com.liferay.portlet.imagegallery.model.IGFolder addFolder(
060                    HttpPrincipal httpPrincipal, long parentFolderId,
061                    java.lang.String name, java.lang.String description,
062                    com.liferay.portal.service.ServiceContext serviceContext)
063                    throws com.liferay.portal.kernel.exception.PortalException,
064                            com.liferay.portal.kernel.exception.SystemException {
065                    try {
066                            Object paramObj0 = new LongWrapper(parentFolderId);
067    
068                            Object paramObj1 = name;
069    
070                            if (name == null) {
071                                    paramObj1 = new NullWrapper("java.lang.String");
072                            }
073    
074                            Object paramObj2 = description;
075    
076                            if (description == null) {
077                                    paramObj2 = new NullWrapper("java.lang.String");
078                            }
079    
080                            Object paramObj3 = serviceContext;
081    
082                            if (serviceContext == null) {
083                                    paramObj3 = new NullWrapper(
084                                                    "com.liferay.portal.service.ServiceContext");
085                            }
086    
087                            MethodWrapper methodWrapper = new MethodWrapper(IGFolderServiceUtil.class.getName(),
088                                            "addFolder",
089                                            new Object[] { paramObj0, paramObj1, paramObj2, paramObj3 });
090    
091                            Object returnObj = null;
092    
093                            try {
094                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
095                            }
096                            catch (Exception e) {
097                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
098                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
099                                    }
100    
101                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
102                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
103                                    }
104    
105                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
106                            }
107    
108                            return (com.liferay.portlet.imagegallery.model.IGFolder)returnObj;
109                    }
110                    catch (com.liferay.portal.kernel.exception.SystemException se) {
111                            _log.error(se, se);
112    
113                            throw se;
114                    }
115            }
116    
117            public static com.liferay.portlet.imagegallery.model.IGFolder copyFolder(
118                    HttpPrincipal httpPrincipal, long sourceFolderId, long parentFolderId,
119                    java.lang.String name, java.lang.String description,
120                    com.liferay.portal.service.ServiceContext serviceContext)
121                    throws com.liferay.portal.kernel.exception.PortalException,
122                            com.liferay.portal.kernel.exception.SystemException {
123                    try {
124                            Object paramObj0 = new LongWrapper(sourceFolderId);
125    
126                            Object paramObj1 = new LongWrapper(parentFolderId);
127    
128                            Object paramObj2 = name;
129    
130                            if (name == null) {
131                                    paramObj2 = new NullWrapper("java.lang.String");
132                            }
133    
134                            Object paramObj3 = description;
135    
136                            if (description == null) {
137                                    paramObj3 = new NullWrapper("java.lang.String");
138                            }
139    
140                            Object paramObj4 = serviceContext;
141    
142                            if (serviceContext == null) {
143                                    paramObj4 = new NullWrapper(
144                                                    "com.liferay.portal.service.ServiceContext");
145                            }
146    
147                            MethodWrapper methodWrapper = new MethodWrapper(IGFolderServiceUtil.class.getName(),
148                                            "copyFolder",
149                                            new Object[] {
150                                                    paramObj0, paramObj1, paramObj2, paramObj3, paramObj4
151                                            });
152    
153                            Object returnObj = null;
154    
155                            try {
156                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
157                            }
158                            catch (Exception e) {
159                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
160                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
161                                    }
162    
163                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
164                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
165                                    }
166    
167                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
168                            }
169    
170                            return (com.liferay.portlet.imagegallery.model.IGFolder)returnObj;
171                    }
172                    catch (com.liferay.portal.kernel.exception.SystemException se) {
173                            _log.error(se, se);
174    
175                            throw se;
176                    }
177            }
178    
179            public static void deleteFolder(HttpPrincipal httpPrincipal, long folderId)
180                    throws com.liferay.portal.kernel.exception.PortalException,
181                            com.liferay.portal.kernel.exception.SystemException {
182                    try {
183                            Object paramObj0 = new LongWrapper(folderId);
184    
185                            MethodWrapper methodWrapper = new MethodWrapper(IGFolderServiceUtil.class.getName(),
186                                            "deleteFolder", new Object[] { paramObj0 });
187    
188                            try {
189                                    TunnelUtil.invoke(httpPrincipal, methodWrapper);
190                            }
191                            catch (Exception e) {
192                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
193                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
194                                    }
195    
196                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
197                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
198                                    }
199    
200                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
201                            }
202                    }
203                    catch (com.liferay.portal.kernel.exception.SystemException se) {
204                            _log.error(se, se);
205    
206                            throw se;
207                    }
208            }
209    
210            public static com.liferay.portlet.imagegallery.model.IGFolder getFolder(
211                    HttpPrincipal httpPrincipal, long folderId)
212                    throws com.liferay.portal.kernel.exception.PortalException,
213                            com.liferay.portal.kernel.exception.SystemException {
214                    try {
215                            Object paramObj0 = new LongWrapper(folderId);
216    
217                            MethodWrapper methodWrapper = new MethodWrapper(IGFolderServiceUtil.class.getName(),
218                                            "getFolder", new Object[] { paramObj0 });
219    
220                            Object returnObj = null;
221    
222                            try {
223                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
224                            }
225                            catch (Exception e) {
226                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
227                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
228                                    }
229    
230                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
231                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
232                                    }
233    
234                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
235                            }
236    
237                            return (com.liferay.portlet.imagegallery.model.IGFolder)returnObj;
238                    }
239                    catch (com.liferay.portal.kernel.exception.SystemException se) {
240                            _log.error(se, se);
241    
242                            throw se;
243                    }
244            }
245    
246            public static com.liferay.portlet.imagegallery.model.IGFolder getFolder(
247                    HttpPrincipal httpPrincipal, long groupId, long parentFolderId,
248                    java.lang.String name)
249                    throws com.liferay.portal.kernel.exception.PortalException,
250                            com.liferay.portal.kernel.exception.SystemException {
251                    try {
252                            Object paramObj0 = new LongWrapper(groupId);
253    
254                            Object paramObj1 = new LongWrapper(parentFolderId);
255    
256                            Object paramObj2 = name;
257    
258                            if (name == null) {
259                                    paramObj2 = new NullWrapper("java.lang.String");
260                            }
261    
262                            MethodWrapper methodWrapper = new MethodWrapper(IGFolderServiceUtil.class.getName(),
263                                            "getFolder",
264                                            new Object[] { paramObj0, paramObj1, paramObj2 });
265    
266                            Object returnObj = null;
267    
268                            try {
269                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
270                            }
271                            catch (Exception e) {
272                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
273                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
274                                    }
275    
276                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
277                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
278                                    }
279    
280                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
281                            }
282    
283                            return (com.liferay.portlet.imagegallery.model.IGFolder)returnObj;
284                    }
285                    catch (com.liferay.portal.kernel.exception.SystemException se) {
286                            _log.error(se, se);
287    
288                            throw se;
289                    }
290            }
291    
292            public static java.util.List<com.liferay.portlet.imagegallery.model.IGFolder> getFolders(
293                    HttpPrincipal httpPrincipal, long groupId, long parentFolderId)
294                    throws com.liferay.portal.kernel.exception.PortalException,
295                            com.liferay.portal.kernel.exception.SystemException {
296                    try {
297                            Object paramObj0 = new LongWrapper(groupId);
298    
299                            Object paramObj1 = new LongWrapper(parentFolderId);
300    
301                            MethodWrapper methodWrapper = new MethodWrapper(IGFolderServiceUtil.class.getName(),
302                                            "getFolders", new Object[] { paramObj0, paramObj1 });
303    
304                            Object returnObj = null;
305    
306                            try {
307                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
308                            }
309                            catch (Exception e) {
310                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
311                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
312                                    }
313    
314                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
315                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
316                                    }
317    
318                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
319                            }
320    
321                            return (java.util.List<com.liferay.portlet.imagegallery.model.IGFolder>)returnObj;
322                    }
323                    catch (com.liferay.portal.kernel.exception.SystemException se) {
324                            _log.error(se, se);
325    
326                            throw se;
327                    }
328            }
329    
330            public static com.liferay.portlet.imagegallery.model.IGFolder updateFolder(
331                    HttpPrincipal httpPrincipal, long folderId, long parentFolderId,
332                    java.lang.String name, java.lang.String description,
333                    boolean mergeWithParentFolder,
334                    com.liferay.portal.service.ServiceContext serviceContext)
335                    throws com.liferay.portal.kernel.exception.PortalException,
336                            com.liferay.portal.kernel.exception.SystemException {
337                    try {
338                            Object paramObj0 = new LongWrapper(folderId);
339    
340                            Object paramObj1 = new LongWrapper(parentFolderId);
341    
342                            Object paramObj2 = name;
343    
344                            if (name == null) {
345                                    paramObj2 = new NullWrapper("java.lang.String");
346                            }
347    
348                            Object paramObj3 = description;
349    
350                            if (description == null) {
351                                    paramObj3 = new NullWrapper("java.lang.String");
352                            }
353    
354                            Object paramObj4 = new BooleanWrapper(mergeWithParentFolder);
355    
356                            Object paramObj5 = serviceContext;
357    
358                            if (serviceContext == null) {
359                                    paramObj5 = new NullWrapper(
360                                                    "com.liferay.portal.service.ServiceContext");
361                            }
362    
363                            MethodWrapper methodWrapper = new MethodWrapper(IGFolderServiceUtil.class.getName(),
364                                            "updateFolder",
365                                            new Object[] {
366                                                    paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
367                                                    paramObj5
368                                            });
369    
370                            Object returnObj = null;
371    
372                            try {
373                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
374                            }
375                            catch (Exception e) {
376                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
377                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
378                                    }
379    
380                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
381                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
382                                    }
383    
384                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
385                            }
386    
387                            return (com.liferay.portlet.imagegallery.model.IGFolder)returnObj;
388                    }
389                    catch (com.liferay.portal.kernel.exception.SystemException se) {
390                            _log.error(se, se);
391    
392                            throw se;
393                    }
394            }
395    
396            private static Log _log = LogFactoryUtil.getLog(IGFolderServiceHttp.class);
397    }