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.dynamicdatalists.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.dynamicdatalists.service.DDLRecordSetServiceUtil;
025    
026    /**
027     * Provides the HTTP utility for the
028     * {@link com.liferay.portlet.dynamicdatalists.service.DDLRecordSetServiceUtil} service utility. The
029     * static methods of this class calls the same methods of the service utility.
030     * However, the signatures are different because it requires an additional
031     * {@link com.liferay.portal.security.auth.HttpPrincipal} parameter.
032     *
033     * <p>
034     * The benefits of using the HTTP utility is that it is fast and allows for
035     * tunneling without the cost of serializing to text. The drawback is that it
036     * only works with Java.
037     * </p>
038     *
039     * <p>
040     * Set the property <b>tunnel.servlet.hosts.allowed</b> in portal.properties to
041     * configure security.
042     * </p>
043     *
044     * <p>
045     * The HTTP utility is only generated for remote services.
046     * </p>
047     *
048     * @author Brian Wing Shun Chan
049     * @see DDLRecordSetServiceSoap
050     * @see com.liferay.portal.security.auth.HttpPrincipal
051     * @see com.liferay.portlet.dynamicdatalists.service.DDLRecordSetServiceUtil
052     * @generated
053     */
054    public class DDLRecordSetServiceHttp {
055            public static com.liferay.portlet.dynamicdatalists.model.DDLRecordSet addRecordSet(
056                    HttpPrincipal httpPrincipal, long groupId, long ddmStructureId,
057                    java.lang.String recordSetKey,
058                    java.util.Map<java.util.Locale, java.lang.String> nameMap,
059                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
060                    int minDisplayRows, int scope,
061                    com.liferay.portal.service.ServiceContext serviceContext)
062                    throws com.liferay.portal.kernel.exception.PortalException,
063                            com.liferay.portal.kernel.exception.SystemException {
064                    try {
065                            MethodKey methodKey = new MethodKey(DDLRecordSetServiceUtil.class,
066                                            "addRecordSet", _addRecordSetParameterTypes0);
067    
068                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
069                                            ddmStructureId, recordSetKey, nameMap, descriptionMap,
070                                            minDisplayRows, scope, 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.dynamicdatalists.model.DDLRecordSet)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 void deleteRecordSet(HttpPrincipal httpPrincipal,
099                    long recordSetId)
100                    throws com.liferay.portal.kernel.exception.PortalException,
101                            com.liferay.portal.kernel.exception.SystemException {
102                    try {
103                            MethodKey methodKey = new MethodKey(DDLRecordSetServiceUtil.class,
104                                            "deleteRecordSet", _deleteRecordSetParameterTypes1);
105    
106                            MethodHandler methodHandler = new MethodHandler(methodKey,
107                                            recordSetId);
108    
109                            try {
110                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
111                            }
112                            catch (Exception e) {
113                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
114                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
115                                    }
116    
117                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
118                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
119                                    }
120    
121                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
122                            }
123                    }
124                    catch (com.liferay.portal.kernel.exception.SystemException se) {
125                            _log.error(se, se);
126    
127                            throw se;
128                    }
129            }
130    
131            public static com.liferay.portlet.dynamicdatalists.model.DDLRecordSet getRecordSet(
132                    HttpPrincipal httpPrincipal, long recordSetId)
133                    throws com.liferay.portal.kernel.exception.PortalException,
134                            com.liferay.portal.kernel.exception.SystemException {
135                    try {
136                            MethodKey methodKey = new MethodKey(DDLRecordSetServiceUtil.class,
137                                            "getRecordSet", _getRecordSetParameterTypes2);
138    
139                            MethodHandler methodHandler = new MethodHandler(methodKey,
140                                            recordSetId);
141    
142                            Object returnObj = null;
143    
144                            try {
145                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
146                            }
147                            catch (Exception e) {
148                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
149                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
150                                    }
151    
152                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
153                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
154                                    }
155    
156                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
157                            }
158    
159                            return (com.liferay.portlet.dynamicdatalists.model.DDLRecordSet)returnObj;
160                    }
161                    catch (com.liferay.portal.kernel.exception.SystemException se) {
162                            _log.error(se, se);
163    
164                            throw se;
165                    }
166            }
167    
168            public static java.util.List<com.liferay.portlet.dynamicdatalists.model.DDLRecordSet> search(
169                    HttpPrincipal httpPrincipal, long companyId, long groupId,
170                    java.lang.String keywords, int scope, int start, int end,
171                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
172                    throws com.liferay.portal.kernel.exception.SystemException {
173                    try {
174                            MethodKey methodKey = new MethodKey(DDLRecordSetServiceUtil.class,
175                                            "search", _searchParameterTypes3);
176    
177                            MethodHandler methodHandler = new MethodHandler(methodKey,
178                                            companyId, groupId, keywords, scope, start, end,
179                                            orderByComparator);
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.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 (java.util.List<com.liferay.portlet.dynamicdatalists.model.DDLRecordSet>)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 java.util.List<com.liferay.portlet.dynamicdatalists.model.DDLRecordSet> search(
204                    HttpPrincipal httpPrincipal, long companyId, long groupId,
205                    java.lang.String name, java.lang.String description, int scope,
206                    boolean andOperator, int start, int end,
207                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
208                    throws com.liferay.portal.kernel.exception.SystemException {
209                    try {
210                            MethodKey methodKey = new MethodKey(DDLRecordSetServiceUtil.class,
211                                            "search", _searchParameterTypes4);
212    
213                            MethodHandler methodHandler = new MethodHandler(methodKey,
214                                            companyId, groupId, name, description, scope, andOperator,
215                                            start, end, orderByComparator);
216    
217                            Object returnObj = null;
218    
219                            try {
220                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
221                            }
222                            catch (Exception e) {
223                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
224                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
225                                    }
226    
227                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
228                            }
229    
230                            return (java.util.List<com.liferay.portlet.dynamicdatalists.model.DDLRecordSet>)returnObj;
231                    }
232                    catch (com.liferay.portal.kernel.exception.SystemException se) {
233                            _log.error(se, se);
234    
235                            throw se;
236                    }
237            }
238    
239            public static int searchCount(HttpPrincipal httpPrincipal, long companyId,
240                    long groupId, java.lang.String keywords, int scope)
241                    throws com.liferay.portal.kernel.exception.SystemException {
242                    try {
243                            MethodKey methodKey = new MethodKey(DDLRecordSetServiceUtil.class,
244                                            "searchCount", _searchCountParameterTypes5);
245    
246                            MethodHandler methodHandler = new MethodHandler(methodKey,
247                                            companyId, groupId, keywords, scope);
248    
249                            Object returnObj = null;
250    
251                            try {
252                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
253                            }
254                            catch (Exception e) {
255                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
256                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
257                                    }
258    
259                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
260                            }
261    
262                            return ((Integer)returnObj).intValue();
263                    }
264                    catch (com.liferay.portal.kernel.exception.SystemException se) {
265                            _log.error(se, se);
266    
267                            throw se;
268                    }
269            }
270    
271            public static int searchCount(HttpPrincipal httpPrincipal, long companyId,
272                    long groupId, java.lang.String name, java.lang.String description,
273                    int scope, boolean andOperator)
274                    throws com.liferay.portal.kernel.exception.SystemException {
275                    try {
276                            MethodKey methodKey = new MethodKey(DDLRecordSetServiceUtil.class,
277                                            "searchCount", _searchCountParameterTypes6);
278    
279                            MethodHandler methodHandler = new MethodHandler(methodKey,
280                                            companyId, groupId, name, description, scope, andOperator);
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 ((Integer)returnObj).intValue();
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 com.liferay.portlet.dynamicdatalists.model.DDLRecordSet updateMinDisplayRows(
305                    HttpPrincipal httpPrincipal, long recordSetId, int minDisplayRows,
306                    com.liferay.portal.service.ServiceContext serviceContext)
307                    throws com.liferay.portal.kernel.exception.PortalException,
308                            com.liferay.portal.kernel.exception.SystemException {
309                    try {
310                            MethodKey methodKey = new MethodKey(DDLRecordSetServiceUtil.class,
311                                            "updateMinDisplayRows", _updateMinDisplayRowsParameterTypes7);
312    
313                            MethodHandler methodHandler = new MethodHandler(methodKey,
314                                            recordSetId, minDisplayRows, serviceContext);
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.PortalException) {
323                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
324                                    }
325    
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 (com.liferay.portlet.dynamicdatalists.model.DDLRecordSet)returnObj;
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.dynamicdatalists.model.DDLRecordSet updateRecordSet(
343                    HttpPrincipal httpPrincipal, long recordSetId, long ddmStructureId,
344                    java.util.Map<java.util.Locale, java.lang.String> nameMap,
345                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
346                    int minDisplayRows,
347                    com.liferay.portal.service.ServiceContext serviceContext)
348                    throws com.liferay.portal.kernel.exception.PortalException,
349                            com.liferay.portal.kernel.exception.SystemException {
350                    try {
351                            MethodKey methodKey = new MethodKey(DDLRecordSetServiceUtil.class,
352                                            "updateRecordSet", _updateRecordSetParameterTypes8);
353    
354                            MethodHandler methodHandler = new MethodHandler(methodKey,
355                                            recordSetId, ddmStructureId, nameMap, descriptionMap,
356                                            minDisplayRows, serviceContext);
357    
358                            Object returnObj = null;
359    
360                            try {
361                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
362                            }
363                            catch (Exception e) {
364                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
365                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
366                                    }
367    
368                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
369                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
370                                    }
371    
372                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
373                            }
374    
375                            return (com.liferay.portlet.dynamicdatalists.model.DDLRecordSet)returnObj;
376                    }
377                    catch (com.liferay.portal.kernel.exception.SystemException se) {
378                            _log.error(se, se);
379    
380                            throw se;
381                    }
382            }
383    
384            public static com.liferay.portlet.dynamicdatalists.model.DDLRecordSet updateRecordSet(
385                    HttpPrincipal httpPrincipal, long groupId, long ddmStructureId,
386                    java.lang.String recordSetKey,
387                    java.util.Map<java.util.Locale, java.lang.String> nameMap,
388                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
389                    int minDisplayRows,
390                    com.liferay.portal.service.ServiceContext serviceContext)
391                    throws com.liferay.portal.kernel.exception.PortalException,
392                            com.liferay.portal.kernel.exception.SystemException {
393                    try {
394                            MethodKey methodKey = new MethodKey(DDLRecordSetServiceUtil.class,
395                                            "updateRecordSet", _updateRecordSetParameterTypes9);
396    
397                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
398                                            ddmStructureId, recordSetKey, nameMap, descriptionMap,
399                                            minDisplayRows, serviceContext);
400    
401                            Object returnObj = null;
402    
403                            try {
404                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
405                            }
406                            catch (Exception e) {
407                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
408                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
409                                    }
410    
411                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
412                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
413                                    }
414    
415                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
416                            }
417    
418                            return (com.liferay.portlet.dynamicdatalists.model.DDLRecordSet)returnObj;
419                    }
420                    catch (com.liferay.portal.kernel.exception.SystemException se) {
421                            _log.error(se, se);
422    
423                            throw se;
424                    }
425            }
426    
427            private static Log _log = LogFactoryUtil.getLog(DDLRecordSetServiceHttp.class);
428            private static final Class<?>[] _addRecordSetParameterTypes0 = new Class[] {
429                            long.class, long.class, java.lang.String.class, java.util.Map.class,
430                            java.util.Map.class, int.class, int.class,
431                            com.liferay.portal.service.ServiceContext.class
432                    };
433            private static final Class<?>[] _deleteRecordSetParameterTypes1 = new Class[] {
434                            long.class
435                    };
436            private static final Class<?>[] _getRecordSetParameterTypes2 = new Class[] {
437                            long.class
438                    };
439            private static final Class<?>[] _searchParameterTypes3 = new Class[] {
440                            long.class, long.class, java.lang.String.class, int.class, int.class,
441                            int.class, com.liferay.portal.kernel.util.OrderByComparator.class
442                    };
443            private static final Class<?>[] _searchParameterTypes4 = new Class[] {
444                            long.class, long.class, java.lang.String.class,
445                            java.lang.String.class, int.class, boolean.class, int.class,
446                            int.class, com.liferay.portal.kernel.util.OrderByComparator.class
447                    };
448            private static final Class<?>[] _searchCountParameterTypes5 = new Class[] {
449                            long.class, long.class, java.lang.String.class, int.class
450                    };
451            private static final Class<?>[] _searchCountParameterTypes6 = new Class[] {
452                            long.class, long.class, java.lang.String.class,
453                            java.lang.String.class, int.class, boolean.class
454                    };
455            private static final Class<?>[] _updateMinDisplayRowsParameterTypes7 = new Class[] {
456                            long.class, int.class,
457                            com.liferay.portal.service.ServiceContext.class
458                    };
459            private static final Class<?>[] _updateRecordSetParameterTypes8 = new Class[] {
460                            long.class, long.class, java.util.Map.class, java.util.Map.class,
461                            int.class, com.liferay.portal.service.ServiceContext.class
462                    };
463            private static final Class<?>[] _updateRecordSetParameterTypes9 = new Class[] {
464                            long.class, long.class, java.lang.String.class, java.util.Map.class,
465                            java.util.Map.class, int.class,
466                            com.liferay.portal.service.ServiceContext.class
467                    };
468    }