001    /**
002     * Copyright (c) 2000-present 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 aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.log.Log;
020    import com.liferay.portal.kernel.log.LogFactoryUtil;
021    import com.liferay.portal.kernel.util.MethodHandler;
022    import com.liferay.portal.kernel.util.MethodKey;
023    import com.liferay.portal.security.auth.HttpPrincipal;
024    import com.liferay.portal.service.http.TunnelUtil;
025    
026    import com.liferay.portlet.dynamicdatalists.service.DDLRecordServiceUtil;
027    
028    /**
029     * Provides the HTTP utility for the
030     * {@link com.liferay.portlet.dynamicdatalists.service.DDLRecordServiceUtil} service utility. The
031     * static methods of this class calls the same methods of the service utility.
032     * However, the signatures are different because it requires an additional
033     * {@link com.liferay.portal.security.auth.HttpPrincipal} parameter.
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 DDLRecordServiceSoap
052     * @see com.liferay.portal.security.auth.HttpPrincipal
053     * @see com.liferay.portlet.dynamicdatalists.service.DDLRecordServiceUtil
054     * @generated
055     */
056    @ProviderType
057    public class DDLRecordServiceHttp {
058            public static com.liferay.portlet.dynamicdatalists.model.DDLRecord addRecord(
059                    HttpPrincipal httpPrincipal, long groupId, long recordSetId,
060                    int displayIndex,
061                    com.liferay.portlet.dynamicdatamapping.storage.DDMFormValues ddmFormValues,
062                    com.liferay.portal.service.ServiceContext serviceContext)
063                    throws com.liferay.portal.kernel.exception.PortalException {
064                    try {
065                            MethodKey methodKey = new MethodKey(DDLRecordServiceUtil.class,
066                                            "addRecord", _addRecordParameterTypes0);
067    
068                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
069                                            recordSetId, displayIndex, ddmFormValues, serviceContext);
070    
071                            Object returnObj = null;
072    
073                            try {
074                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
075                            }
076                            catch (Exception e) {
077                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
078                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
079                                    }
080    
081                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
082                            }
083    
084                            return (com.liferay.portlet.dynamicdatalists.model.DDLRecord)returnObj;
085                    }
086                    catch (com.liferay.portal.kernel.exception.SystemException se) {
087                            _log.error(se, se);
088    
089                            throw se;
090                    }
091            }
092    
093            public static com.liferay.portlet.dynamicdatalists.model.DDLRecord addRecord(
094                    HttpPrincipal httpPrincipal, long groupId, long recordSetId,
095                    int displayIndex,
096                    com.liferay.portlet.dynamicdatamapping.storage.Fields fields,
097                    com.liferay.portal.service.ServiceContext serviceContext)
098                    throws com.liferay.portal.kernel.exception.PortalException {
099                    try {
100                            MethodKey methodKey = new MethodKey(DDLRecordServiceUtil.class,
101                                            "addRecord", _addRecordParameterTypes1);
102    
103                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
104                                            recordSetId, displayIndex, fields, serviceContext);
105    
106                            Object returnObj = null;
107    
108                            try {
109                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
110                            }
111                            catch (Exception e) {
112                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
113                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
114                                    }
115    
116                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
117                            }
118    
119                            return (com.liferay.portlet.dynamicdatalists.model.DDLRecord)returnObj;
120                    }
121                    catch (com.liferay.portal.kernel.exception.SystemException se) {
122                            _log.error(se, se);
123    
124                            throw se;
125                    }
126            }
127    
128            public static com.liferay.portlet.dynamicdatalists.model.DDLRecord addRecord(
129                    HttpPrincipal httpPrincipal, long groupId, long recordSetId,
130                    int displayIndex,
131                    java.util.Map<java.lang.String, java.io.Serializable> fieldsMap,
132                    com.liferay.portal.service.ServiceContext serviceContext)
133                    throws com.liferay.portal.kernel.exception.PortalException {
134                    try {
135                            MethodKey methodKey = new MethodKey(DDLRecordServiceUtil.class,
136                                            "addRecord", _addRecordParameterTypes2);
137    
138                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
139                                            recordSetId, displayIndex, fieldsMap, serviceContext);
140    
141                            Object returnObj = null;
142    
143                            try {
144                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
145                            }
146                            catch (Exception e) {
147                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
148                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
149                                    }
150    
151                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
152                            }
153    
154                            return (com.liferay.portlet.dynamicdatalists.model.DDLRecord)returnObj;
155                    }
156                    catch (com.liferay.portal.kernel.exception.SystemException se) {
157                            _log.error(se, se);
158    
159                            throw se;
160                    }
161            }
162    
163            public static void deleteRecord(HttpPrincipal httpPrincipal, long recordId)
164                    throws com.liferay.portal.kernel.exception.PortalException {
165                    try {
166                            MethodKey methodKey = new MethodKey(DDLRecordServiceUtil.class,
167                                            "deleteRecord", _deleteRecordParameterTypes3);
168    
169                            MethodHandler methodHandler = new MethodHandler(methodKey, recordId);
170    
171                            try {
172                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
173                            }
174                            catch (Exception e) {
175                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
176                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
177                                    }
178    
179                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
180                            }
181                    }
182                    catch (com.liferay.portal.kernel.exception.SystemException se) {
183                            _log.error(se, se);
184    
185                            throw se;
186                    }
187            }
188    
189            public static com.liferay.portlet.dynamicdatalists.model.DDLRecord deleteRecordLocale(
190                    HttpPrincipal httpPrincipal, long recordId, java.util.Locale locale,
191                    com.liferay.portal.service.ServiceContext serviceContext)
192                    throws com.liferay.portal.kernel.exception.PortalException {
193                    try {
194                            MethodKey methodKey = new MethodKey(DDLRecordServiceUtil.class,
195                                            "deleteRecordLocale", _deleteRecordLocaleParameterTypes4);
196    
197                            MethodHandler methodHandler = new MethodHandler(methodKey,
198                                            recordId, locale, serviceContext);
199    
200                            Object returnObj = null;
201    
202                            try {
203                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
204                            }
205                            catch (Exception e) {
206                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
207                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
208                                    }
209    
210                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
211                            }
212    
213                            return (com.liferay.portlet.dynamicdatalists.model.DDLRecord)returnObj;
214                    }
215                    catch (com.liferay.portal.kernel.exception.SystemException se) {
216                            _log.error(se, se);
217    
218                            throw se;
219                    }
220            }
221    
222            public static com.liferay.portlet.dynamicdatalists.model.DDLRecord getRecord(
223                    HttpPrincipal httpPrincipal, long recordId)
224                    throws com.liferay.portal.kernel.exception.PortalException {
225                    try {
226                            MethodKey methodKey = new MethodKey(DDLRecordServiceUtil.class,
227                                            "getRecord", _getRecordParameterTypes5);
228    
229                            MethodHandler methodHandler = new MethodHandler(methodKey, recordId);
230    
231                            Object returnObj = null;
232    
233                            try {
234                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
235                            }
236                            catch (Exception e) {
237                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
238                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
239                                    }
240    
241                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
242                            }
243    
244                            return (com.liferay.portlet.dynamicdatalists.model.DDLRecord)returnObj;
245                    }
246                    catch (com.liferay.portal.kernel.exception.SystemException se) {
247                            _log.error(se, se);
248    
249                            throw se;
250                    }
251            }
252    
253            public static void revertRecord(HttpPrincipal httpPrincipal, long recordId,
254                    java.lang.String version,
255                    com.liferay.portal.service.ServiceContext serviceContext)
256                    throws com.liferay.portal.kernel.exception.PortalException {
257                    try {
258                            MethodKey methodKey = new MethodKey(DDLRecordServiceUtil.class,
259                                            "revertRecord", _revertRecordParameterTypes6);
260    
261                            MethodHandler methodHandler = new MethodHandler(methodKey,
262                                            recordId, version, serviceContext);
263    
264                            try {
265                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
266                            }
267                            catch (Exception e) {
268                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
269                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
270                                    }
271    
272                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
273                            }
274                    }
275                    catch (com.liferay.portal.kernel.exception.SystemException se) {
276                            _log.error(se, se);
277    
278                            throw se;
279                    }
280            }
281    
282            public static void revertRecordVersion(HttpPrincipal httpPrincipal,
283                    long recordId, java.lang.String version,
284                    com.liferay.portal.service.ServiceContext serviceContext)
285                    throws com.liferay.portal.kernel.exception.PortalException {
286                    try {
287                            MethodKey methodKey = new MethodKey(DDLRecordServiceUtil.class,
288                                            "revertRecordVersion", _revertRecordVersionParameterTypes7);
289    
290                            MethodHandler methodHandler = new MethodHandler(methodKey,
291                                            recordId, version, serviceContext);
292    
293                            try {
294                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
295                            }
296                            catch (Exception e) {
297                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
298                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
299                                    }
300    
301                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
302                            }
303                    }
304                    catch (com.liferay.portal.kernel.exception.SystemException se) {
305                            _log.error(se, se);
306    
307                            throw se;
308                    }
309            }
310    
311            public static com.liferay.portlet.dynamicdatalists.model.DDLRecord updateRecord(
312                    HttpPrincipal httpPrincipal, long recordId, boolean majorVersion,
313                    int displayIndex,
314                    com.liferay.portlet.dynamicdatamapping.storage.DDMFormValues ddmFormValues,
315                    com.liferay.portal.service.ServiceContext serviceContext)
316                    throws com.liferay.portal.kernel.exception.PortalException {
317                    try {
318                            MethodKey methodKey = new MethodKey(DDLRecordServiceUtil.class,
319                                            "updateRecord", _updateRecordParameterTypes8);
320    
321                            MethodHandler methodHandler = new MethodHandler(methodKey,
322                                            recordId, majorVersion, displayIndex, ddmFormValues,
323                                            serviceContext);
324    
325                            Object returnObj = null;
326    
327                            try {
328                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
329                            }
330                            catch (Exception e) {
331                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
332                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
333                                    }
334    
335                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
336                            }
337    
338                            return (com.liferay.portlet.dynamicdatalists.model.DDLRecord)returnObj;
339                    }
340                    catch (com.liferay.portal.kernel.exception.SystemException se) {
341                            _log.error(se, se);
342    
343                            throw se;
344                    }
345            }
346    
347            public static com.liferay.portlet.dynamicdatalists.model.DDLRecord updateRecord(
348                    HttpPrincipal httpPrincipal, long recordId, boolean majorVersion,
349                    int displayIndex,
350                    com.liferay.portlet.dynamicdatamapping.storage.Fields fields,
351                    boolean mergeFields,
352                    com.liferay.portal.service.ServiceContext serviceContext)
353                    throws com.liferay.portal.kernel.exception.PortalException {
354                    try {
355                            MethodKey methodKey = new MethodKey(DDLRecordServiceUtil.class,
356                                            "updateRecord", _updateRecordParameterTypes9);
357    
358                            MethodHandler methodHandler = new MethodHandler(methodKey,
359                                            recordId, majorVersion, displayIndex, fields, mergeFields,
360                                            serviceContext);
361    
362                            Object returnObj = null;
363    
364                            try {
365                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
366                            }
367                            catch (Exception e) {
368                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
369                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
370                                    }
371    
372                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
373                            }
374    
375                            return (com.liferay.portlet.dynamicdatalists.model.DDLRecord)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.DDLRecord updateRecord(
385                    HttpPrincipal httpPrincipal, long recordId, int displayIndex,
386                    java.util.Map<java.lang.String, java.io.Serializable> fieldsMap,
387                    boolean mergeFields,
388                    com.liferay.portal.service.ServiceContext serviceContext)
389                    throws com.liferay.portal.kernel.exception.PortalException {
390                    try {
391                            MethodKey methodKey = new MethodKey(DDLRecordServiceUtil.class,
392                                            "updateRecord", _updateRecordParameterTypes10);
393    
394                            MethodHandler methodHandler = new MethodHandler(methodKey,
395                                            recordId, displayIndex, fieldsMap, mergeFields,
396                                            serviceContext);
397    
398                            Object returnObj = null;
399    
400                            try {
401                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
402                            }
403                            catch (Exception e) {
404                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
405                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
406                                    }
407    
408                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
409                            }
410    
411                            return (com.liferay.portlet.dynamicdatalists.model.DDLRecord)returnObj;
412                    }
413                    catch (com.liferay.portal.kernel.exception.SystemException se) {
414                            _log.error(se, se);
415    
416                            throw se;
417                    }
418            }
419    
420            private static Log _log = LogFactoryUtil.getLog(DDLRecordServiceHttp.class);
421            private static final Class<?>[] _addRecordParameterTypes0 = new Class[] {
422                            long.class, long.class, int.class,
423                            com.liferay.portlet.dynamicdatamapping.storage.DDMFormValues.class,
424                            com.liferay.portal.service.ServiceContext.class
425                    };
426            private static final Class<?>[] _addRecordParameterTypes1 = new Class[] {
427                            long.class, long.class, int.class,
428                            com.liferay.portlet.dynamicdatamapping.storage.Fields.class,
429                            com.liferay.portal.service.ServiceContext.class
430                    };
431            private static final Class<?>[] _addRecordParameterTypes2 = new Class[] {
432                            long.class, long.class, int.class, java.util.Map.class,
433                            com.liferay.portal.service.ServiceContext.class
434                    };
435            private static final Class<?>[] _deleteRecordParameterTypes3 = new Class[] {
436                            long.class
437                    };
438            private static final Class<?>[] _deleteRecordLocaleParameterTypes4 = new Class[] {
439                            long.class, java.util.Locale.class,
440                            com.liferay.portal.service.ServiceContext.class
441                    };
442            private static final Class<?>[] _getRecordParameterTypes5 = new Class[] {
443                            long.class
444                    };
445            private static final Class<?>[] _revertRecordParameterTypes6 = new Class[] {
446                            long.class, java.lang.String.class,
447                            com.liferay.portal.service.ServiceContext.class
448                    };
449            private static final Class<?>[] _revertRecordVersionParameterTypes7 = new Class[] {
450                            long.class, java.lang.String.class,
451                            com.liferay.portal.service.ServiceContext.class
452                    };
453            private static final Class<?>[] _updateRecordParameterTypes8 = new Class[] {
454                            long.class, boolean.class, int.class,
455                            com.liferay.portlet.dynamicdatamapping.storage.DDMFormValues.class,
456                            com.liferay.portal.service.ServiceContext.class
457                    };
458            private static final Class<?>[] _updateRecordParameterTypes9 = new Class[] {
459                            long.class, boolean.class, int.class,
460                            com.liferay.portlet.dynamicdatamapping.storage.Fields.class,
461                            boolean.class, com.liferay.portal.service.ServiceContext.class
462                    };
463            private static final Class<?>[] _updateRecordParameterTypes10 = new Class[] {
464                            long.class, int.class, java.util.Map.class, boolean.class,
465                            com.liferay.portal.service.ServiceContext.class
466                    };
467    }