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.dynamicdatamapping.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.dynamicdatamapping.service.DDMStructureServiceUtil;
025    
026    /**
027     * <p>
028     * This class provides a HTTP utility for the
029     * {@link com.liferay.portlet.dynamicdatamapping.service.DDMStructureServiceUtil} 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       DDMStructureServiceSoap
052     * @see       com.liferay.portal.security.auth.HttpPrincipal
053     * @see       com.liferay.portlet.dynamicdatamapping.service.DDMStructureServiceUtil
054     * @generated
055     */
056    public class DDMStructureServiceHttp {
057            public static com.liferay.portlet.dynamicdatamapping.model.DDMStructure addStructure(
058                    HttpPrincipal httpPrincipal, long groupId, long classNameId,
059                    java.lang.String structureKey,
060                    java.util.Map<java.util.Locale, java.lang.String> nameMap,
061                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
062                    java.lang.String xsd, java.lang.String storageType, int type,
063                    com.liferay.portal.service.ServiceContext serviceContext)
064                    throws com.liferay.portal.kernel.exception.PortalException,
065                            com.liferay.portal.kernel.exception.SystemException {
066                    try {
067                            MethodKey methodKey = new MethodKey(DDMStructureServiceUtil.class.getName(),
068                                            "addStructure", _addStructureParameterTypes0);
069    
070                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
071                                            classNameId, structureKey, nameMap, descriptionMap, xsd,
072                                            storageType, type, serviceContext);
073    
074                            Object returnObj = null;
075    
076                            try {
077                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
078                            }
079                            catch (Exception e) {
080                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
081                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
082                                    }
083    
084                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
085                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
086                                    }
087    
088                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
089                            }
090    
091                            return (com.liferay.portlet.dynamicdatamapping.model.DDMStructure)returnObj;
092                    }
093                    catch (com.liferay.portal.kernel.exception.SystemException se) {
094                            _log.error(se, se);
095    
096                            throw se;
097                    }
098            }
099    
100            public static com.liferay.portlet.dynamicdatamapping.model.DDMStructure copyStructure(
101                    HttpPrincipal httpPrincipal, long structureId,
102                    java.util.Map<java.util.Locale, java.lang.String> nameMap,
103                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
104                    com.liferay.portal.service.ServiceContext serviceContext)
105                    throws com.liferay.portal.kernel.exception.PortalException,
106                            com.liferay.portal.kernel.exception.SystemException {
107                    try {
108                            MethodKey methodKey = new MethodKey(DDMStructureServiceUtil.class.getName(),
109                                            "copyStructure", _copyStructureParameterTypes1);
110    
111                            MethodHandler methodHandler = new MethodHandler(methodKey,
112                                            structureId, nameMap, descriptionMap, serviceContext);
113    
114                            Object returnObj = null;
115    
116                            try {
117                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
118                            }
119                            catch (Exception e) {
120                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
121                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
122                                    }
123    
124                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
125                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
126                                    }
127    
128                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
129                            }
130    
131                            return (com.liferay.portlet.dynamicdatamapping.model.DDMStructure)returnObj;
132                    }
133                    catch (com.liferay.portal.kernel.exception.SystemException se) {
134                            _log.error(se, se);
135    
136                            throw se;
137                    }
138            }
139    
140            public static void deleteStructure(HttpPrincipal httpPrincipal,
141                    long structureId)
142                    throws com.liferay.portal.kernel.exception.PortalException,
143                            com.liferay.portal.kernel.exception.SystemException {
144                    try {
145                            MethodKey methodKey = new MethodKey(DDMStructureServiceUtil.class.getName(),
146                                            "deleteStructure", _deleteStructureParameterTypes2);
147    
148                            MethodHandler methodHandler = new MethodHandler(methodKey,
149                                            structureId);
150    
151                            try {
152                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
153                            }
154                            catch (Exception e) {
155                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
156                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
157                                    }
158    
159                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
160                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
161                                    }
162    
163                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
164                            }
165                    }
166                    catch (com.liferay.portal.kernel.exception.SystemException se) {
167                            _log.error(se, se);
168    
169                            throw se;
170                    }
171            }
172    
173            public static com.liferay.portlet.dynamicdatamapping.model.DDMStructure fetchStructure(
174                    HttpPrincipal httpPrincipal, long groupId, java.lang.String structureKey)
175                    throws com.liferay.portal.kernel.exception.PortalException,
176                            com.liferay.portal.kernel.exception.SystemException {
177                    try {
178                            MethodKey methodKey = new MethodKey(DDMStructureServiceUtil.class.getName(),
179                                            "fetchStructure", _fetchStructureParameterTypes3);
180    
181                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
182                                            structureKey);
183    
184                            Object returnObj = null;
185    
186                            try {
187                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
188                            }
189                            catch (Exception e) {
190                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
191                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
192                                    }
193    
194                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
195                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
196                                    }
197    
198                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
199                            }
200    
201                            return (com.liferay.portlet.dynamicdatamapping.model.DDMStructure)returnObj;
202                    }
203                    catch (com.liferay.portal.kernel.exception.SystemException se) {
204                            _log.error(se, se);
205    
206                            throw se;
207                    }
208            }
209    
210            public static com.liferay.portlet.dynamicdatamapping.model.DDMStructure getStructure(
211                    HttpPrincipal httpPrincipal, long structureId)
212                    throws com.liferay.portal.kernel.exception.PortalException,
213                            com.liferay.portal.kernel.exception.SystemException {
214                    try {
215                            MethodKey methodKey = new MethodKey(DDMStructureServiceUtil.class.getName(),
216                                            "getStructure", _getStructureParameterTypes4);
217    
218                            MethodHandler methodHandler = new MethodHandler(methodKey,
219                                            structureId);
220    
221                            Object returnObj = null;
222    
223                            try {
224                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
225                            }
226                            catch (Exception e) {
227                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
228                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
229                                    }
230    
231                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
232                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
233                                    }
234    
235                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
236                            }
237    
238                            return (com.liferay.portlet.dynamicdatamapping.model.DDMStructure)returnObj;
239                    }
240                    catch (com.liferay.portal.kernel.exception.SystemException se) {
241                            _log.error(se, se);
242    
243                            throw se;
244                    }
245            }
246    
247            public static java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMStructure> search(
248                    HttpPrincipal httpPrincipal, long companyId, long[] groupIds,
249                    long[] classNameIds, java.lang.String keywords, int start, int end,
250                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
251                    throws com.liferay.portal.kernel.exception.SystemException {
252                    try {
253                            MethodKey methodKey = new MethodKey(DDMStructureServiceUtil.class.getName(),
254                                            "search", _searchParameterTypes5);
255    
256                            MethodHandler methodHandler = new MethodHandler(methodKey,
257                                            companyId, groupIds, classNameIds, keywords, start, end,
258                                            orderByComparator);
259    
260                            Object returnObj = null;
261    
262                            try {
263                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
264                            }
265                            catch (Exception e) {
266                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
267                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
268                                    }
269    
270                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
271                            }
272    
273                            return (java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMStructure>)returnObj;
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 java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMStructure> search(
283                    HttpPrincipal httpPrincipal, long companyId, long[] groupIds,
284                    long[] classNameIds, java.lang.String name,
285                    java.lang.String description, java.lang.String storageType, int type,
286                    boolean andOperator, int start, int end,
287                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
288                    throws com.liferay.portal.kernel.exception.SystemException {
289                    try {
290                            MethodKey methodKey = new MethodKey(DDMStructureServiceUtil.class.getName(),
291                                            "search", _searchParameterTypes6);
292    
293                            MethodHandler methodHandler = new MethodHandler(methodKey,
294                                            companyId, groupIds, classNameIds, name, description,
295                                            storageType, type, andOperator, start, end,
296                                            orderByComparator);
297    
298                            Object returnObj = null;
299    
300                            try {
301                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
302                            }
303                            catch (Exception e) {
304                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
305                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
306                                    }
307    
308                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
309                            }
310    
311                            return (java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMStructure>)returnObj;
312                    }
313                    catch (com.liferay.portal.kernel.exception.SystemException se) {
314                            _log.error(se, se);
315    
316                            throw se;
317                    }
318            }
319    
320            public static int searchCount(HttpPrincipal httpPrincipal, long companyId,
321                    long[] groupIds, long[] classNameIds, java.lang.String keywords)
322                    throws com.liferay.portal.kernel.exception.SystemException {
323                    try {
324                            MethodKey methodKey = new MethodKey(DDMStructureServiceUtil.class.getName(),
325                                            "searchCount", _searchCountParameterTypes7);
326    
327                            MethodHandler methodHandler = new MethodHandler(methodKey,
328                                            companyId, groupIds, classNameIds, keywords);
329    
330                            Object returnObj = null;
331    
332                            try {
333                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
334                            }
335                            catch (Exception e) {
336                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
337                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
338                                    }
339    
340                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
341                            }
342    
343                            return ((Integer)returnObj).intValue();
344                    }
345                    catch (com.liferay.portal.kernel.exception.SystemException se) {
346                            _log.error(se, se);
347    
348                            throw se;
349                    }
350            }
351    
352            public static int searchCount(HttpPrincipal httpPrincipal, long companyId,
353                    long[] groupIds, long[] classNameIds, java.lang.String name,
354                    java.lang.String description, java.lang.String storageType, int type,
355                    boolean andOperator)
356                    throws com.liferay.portal.kernel.exception.SystemException {
357                    try {
358                            MethodKey methodKey = new MethodKey(DDMStructureServiceUtil.class.getName(),
359                                            "searchCount", _searchCountParameterTypes8);
360    
361                            MethodHandler methodHandler = new MethodHandler(methodKey,
362                                            companyId, groupIds, classNameIds, name, description,
363                                            storageType, type, andOperator);
364    
365                            Object returnObj = null;
366    
367                            try {
368                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
369                            }
370                            catch (Exception e) {
371                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
372                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
373                                    }
374    
375                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
376                            }
377    
378                            return ((Integer)returnObj).intValue();
379                    }
380                    catch (com.liferay.portal.kernel.exception.SystemException se) {
381                            _log.error(se, se);
382    
383                            throw se;
384                    }
385            }
386    
387            public static com.liferay.portlet.dynamicdatamapping.model.DDMStructure updateStructure(
388                    HttpPrincipal httpPrincipal, long structureId,
389                    java.util.Map<java.util.Locale, java.lang.String> nameMap,
390                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
391                    java.lang.String xsd,
392                    com.liferay.portal.service.ServiceContext serviceContext)
393                    throws com.liferay.portal.kernel.exception.PortalException,
394                            com.liferay.portal.kernel.exception.SystemException {
395                    try {
396                            MethodKey methodKey = new MethodKey(DDMStructureServiceUtil.class.getName(),
397                                            "updateStructure", _updateStructureParameterTypes9);
398    
399                            MethodHandler methodHandler = new MethodHandler(methodKey,
400                                            structureId, nameMap, descriptionMap, xsd, serviceContext);
401    
402                            Object returnObj = null;
403    
404                            try {
405                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
406                            }
407                            catch (Exception e) {
408                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
409                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
410                                    }
411    
412                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
413                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
414                                    }
415    
416                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
417                            }
418    
419                            return (com.liferay.portlet.dynamicdatamapping.model.DDMStructure)returnObj;
420                    }
421                    catch (com.liferay.portal.kernel.exception.SystemException se) {
422                            _log.error(se, se);
423    
424                            throw se;
425                    }
426            }
427    
428            public static com.liferay.portlet.dynamicdatamapping.model.DDMStructure updateStructure(
429                    HttpPrincipal httpPrincipal, long groupId,
430                    java.lang.String structureKey,
431                    java.util.Map<java.util.Locale, java.lang.String> nameMap,
432                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
433                    java.lang.String xsd,
434                    com.liferay.portal.service.ServiceContext serviceContext)
435                    throws com.liferay.portal.kernel.exception.PortalException,
436                            com.liferay.portal.kernel.exception.SystemException {
437                    try {
438                            MethodKey methodKey = new MethodKey(DDMStructureServiceUtil.class.getName(),
439                                            "updateStructure", _updateStructureParameterTypes10);
440    
441                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
442                                            structureKey, nameMap, descriptionMap, xsd, serviceContext);
443    
444                            Object returnObj = null;
445    
446                            try {
447                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
448                            }
449                            catch (Exception e) {
450                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
451                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
452                                    }
453    
454                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
455                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
456                                    }
457    
458                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
459                            }
460    
461                            return (com.liferay.portlet.dynamicdatamapping.model.DDMStructure)returnObj;
462                    }
463                    catch (com.liferay.portal.kernel.exception.SystemException se) {
464                            _log.error(se, se);
465    
466                            throw se;
467                    }
468            }
469    
470            private static Log _log = LogFactoryUtil.getLog(DDMStructureServiceHttp.class);
471            private static final Class<?>[] _addStructureParameterTypes0 = new Class[] {
472                            long.class, long.class, java.lang.String.class, java.util.Map.class,
473                            java.util.Map.class, java.lang.String.class, java.lang.String.class,
474                            int.class, com.liferay.portal.service.ServiceContext.class
475                    };
476            private static final Class<?>[] _copyStructureParameterTypes1 = new Class[] {
477                            long.class, java.util.Map.class, java.util.Map.class,
478                            com.liferay.portal.service.ServiceContext.class
479                    };
480            private static final Class<?>[] _deleteStructureParameterTypes2 = new Class[] {
481                            long.class
482                    };
483            private static final Class<?>[] _fetchStructureParameterTypes3 = new Class[] {
484                            long.class, java.lang.String.class
485                    };
486            private static final Class<?>[] _getStructureParameterTypes4 = new Class[] {
487                            long.class
488                    };
489            private static final Class<?>[] _searchParameterTypes5 = new Class[] {
490                            long.class, long[].class, long[].class, java.lang.String.class,
491                            int.class, int.class,
492                            com.liferay.portal.kernel.util.OrderByComparator.class
493                    };
494            private static final Class<?>[] _searchParameterTypes6 = new Class[] {
495                            long.class, long[].class, long[].class, java.lang.String.class,
496                            java.lang.String.class, java.lang.String.class, int.class,
497                            boolean.class, int.class, int.class,
498                            com.liferay.portal.kernel.util.OrderByComparator.class
499                    };
500            private static final Class<?>[] _searchCountParameterTypes7 = new Class[] {
501                            long.class, long[].class, long[].class, java.lang.String.class
502                    };
503            private static final Class<?>[] _searchCountParameterTypes8 = new Class[] {
504                            long.class, long[].class, long[].class, java.lang.String.class,
505                            java.lang.String.class, java.lang.String.class, int.class,
506                            boolean.class
507                    };
508            private static final Class<?>[] _updateStructureParameterTypes9 = new Class[] {
509                            long.class, java.util.Map.class, java.util.Map.class,
510                            java.lang.String.class,
511                            com.liferay.portal.service.ServiceContext.class
512                    };
513            private static final Class<?>[] _updateStructureParameterTypes10 = new Class[] {
514                            long.class, java.lang.String.class, java.util.Map.class,
515                            java.util.Map.class, java.lang.String.class,
516                            com.liferay.portal.service.ServiceContext.class
517                    };
518    }