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