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.getName(),
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.getName(),
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.getName(),
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.getName(),
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.getName(),
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> search(
230                    HttpPrincipal httpPrincipal, long companyId, long[] groupIds,
231                    java.lang.String keywords, boolean includeBasicFileEntryType,
232                    int start, int end,
233                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
234                    throws com.liferay.portal.kernel.exception.SystemException {
235                    try {
236                            MethodKey methodKey = new MethodKey(DLFileEntryTypeServiceUtil.class.getName(),
237                                            "search", _searchParameterTypes5);
238    
239                            MethodHandler methodHandler = new MethodHandler(methodKey,
240                                            companyId, groupIds, keywords, includeBasicFileEntryType,
241                                            start, end, orderByComparator);
242    
243                            Object returnObj = null;
244    
245                            try {
246                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
247                            }
248                            catch (Exception e) {
249                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
250                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
251                                    }
252    
253                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
254                            }
255    
256                            return (java.util.List<com.liferay.portlet.documentlibrary.model.DLFileEntryType>)returnObj;
257                    }
258                    catch (com.liferay.portal.kernel.exception.SystemException se) {
259                            _log.error(se, se);
260    
261                            throw se;
262                    }
263            }
264    
265            public static int searchCount(HttpPrincipal httpPrincipal, long companyId,
266                    long[] groupIds, java.lang.String keywords,
267                    boolean includeBasicFileEntryType)
268                    throws com.liferay.portal.kernel.exception.SystemException {
269                    try {
270                            MethodKey methodKey = new MethodKey(DLFileEntryTypeServiceUtil.class.getName(),
271                                            "searchCount", _searchCountParameterTypes6);
272    
273                            MethodHandler methodHandler = new MethodHandler(methodKey,
274                                            companyId, groupIds, keywords, includeBasicFileEntryType);
275    
276                            Object returnObj = null;
277    
278                            try {
279                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
280                            }
281                            catch (Exception e) {
282                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
283                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
284                                    }
285    
286                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
287                            }
288    
289                            return ((Integer)returnObj).intValue();
290                    }
291                    catch (com.liferay.portal.kernel.exception.SystemException se) {
292                            _log.error(se, se);
293    
294                            throw se;
295                    }
296            }
297    
298            public static void updateFileEntryType(HttpPrincipal httpPrincipal,
299                    long fileEntryTypeId, java.lang.String name,
300                    java.lang.String description, long[] ddmStructureIds,
301                    com.liferay.portal.service.ServiceContext serviceContext)
302                    throws com.liferay.portal.kernel.exception.PortalException,
303                            com.liferay.portal.kernel.exception.SystemException {
304                    try {
305                            MethodKey methodKey = new MethodKey(DLFileEntryTypeServiceUtil.class.getName(),
306                                            "updateFileEntryType", _updateFileEntryTypeParameterTypes7);
307    
308                            MethodHandler methodHandler = new MethodHandler(methodKey,
309                                            fileEntryTypeId, name, description, ddmStructureIds,
310                                            serviceContext);
311    
312                            try {
313                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
314                            }
315                            catch (Exception e) {
316                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
317                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
318                                    }
319    
320                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
321                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
322                                    }
323    
324                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
325                            }
326                    }
327                    catch (com.liferay.portal.kernel.exception.SystemException se) {
328                            _log.error(se, se);
329    
330                            throw se;
331                    }
332            }
333    
334            private static Log _log = LogFactoryUtil.getLog(DLFileEntryTypeServiceHttp.class);
335            private static final Class<?>[] _addFileEntryTypeParameterTypes0 = new Class[] {
336                            long.class, java.lang.String.class, java.lang.String.class,
337                            long[].class, com.liferay.portal.service.ServiceContext.class
338                    };
339            private static final Class<?>[] _deleteFileEntryTypeParameterTypes1 = new Class[] {
340                            long.class
341                    };
342            private static final Class<?>[] _getFileEntryTypeParameterTypes2 = new Class[] {
343                            long.class
344                    };
345            private static final Class<?>[] _getFileEntryTypesParameterTypes3 = new Class[] {
346                            long[].class
347                    };
348            private static final Class<?>[] _getFileEntryTypesCountParameterTypes4 = new Class[] {
349                            long[].class
350                    };
351            private static final Class<?>[] _searchParameterTypes5 = new Class[] {
352                            long.class, long[].class, java.lang.String.class, boolean.class,
353                            int.class, int.class,
354                            com.liferay.portal.kernel.util.OrderByComparator.class
355                    };
356            private static final Class<?>[] _searchCountParameterTypes6 = new Class[] {
357                            long.class, long[].class, java.lang.String.class, boolean.class
358                    };
359            private static final Class<?>[] _updateFileEntryTypeParameterTypes7 = new Class[] {
360                            long.class, java.lang.String.class, java.lang.String.class,
361                            long[].class, com.liferay.portal.service.ServiceContext.class
362                    };
363    }