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.portal.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.LayoutPrototypeServiceUtil;
025    
026    /**
027     * Provides the HTTP utility for the
028     * {@link LayoutPrototypeServiceUtil} 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 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 LayoutPrototypeServiceSoap
050     * @see HttpPrincipal
051     * @see LayoutPrototypeServiceUtil
052     * @generated
053     */
054    @ProviderType
055    public class LayoutPrototypeServiceHttp {
056            public static com.liferay.portal.model.LayoutPrototype addLayoutPrototype(
057                    HttpPrincipal httpPrincipal,
058                    java.util.Map<java.util.Locale, java.lang.String> nameMap,
059                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
060                    boolean active, com.liferay.portal.service.ServiceContext serviceContext)
061                    throws com.liferay.portal.kernel.exception.PortalException {
062                    try {
063                            MethodKey methodKey = new MethodKey(LayoutPrototypeServiceUtil.class,
064                                            "addLayoutPrototype", _addLayoutPrototypeParameterTypes0);
065    
066                            MethodHandler methodHandler = new MethodHandler(methodKey, nameMap,
067                                            descriptionMap, active, serviceContext);
068    
069                            Object returnObj = null;
070    
071                            try {
072                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
073                            }
074                            catch (Exception e) {
075                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
076                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
077                                    }
078    
079                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
080                            }
081    
082                            return (com.liferay.portal.model.LayoutPrototype)returnObj;
083                    }
084                    catch (com.liferay.portal.kernel.exception.SystemException se) {
085                            _log.error(se, se);
086    
087                            throw se;
088                    }
089            }
090    
091            public static com.liferay.portal.model.LayoutPrototype addLayoutPrototype(
092                    HttpPrincipal httpPrincipal,
093                    java.util.Map<java.util.Locale, java.lang.String> nameMap,
094                    java.lang.String description, boolean active)
095                    throws com.liferay.portal.kernel.exception.PortalException {
096                    try {
097                            MethodKey methodKey = new MethodKey(LayoutPrototypeServiceUtil.class,
098                                            "addLayoutPrototype", _addLayoutPrototypeParameterTypes1);
099    
100                            MethodHandler methodHandler = new MethodHandler(methodKey, nameMap,
101                                            description, active);
102    
103                            Object returnObj = null;
104    
105                            try {
106                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
107                            }
108                            catch (Exception e) {
109                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
110                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
111                                    }
112    
113                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
114                            }
115    
116                            return (com.liferay.portal.model.LayoutPrototype)returnObj;
117                    }
118                    catch (com.liferay.portal.kernel.exception.SystemException se) {
119                            _log.error(se, se);
120    
121                            throw se;
122                    }
123            }
124    
125            public static com.liferay.portal.model.LayoutPrototype addLayoutPrototype(
126                    HttpPrincipal httpPrincipal,
127                    java.util.Map<java.util.Locale, java.lang.String> nameMap,
128                    java.lang.String description, boolean active,
129                    com.liferay.portal.service.ServiceContext serviceContext)
130                    throws com.liferay.portal.kernel.exception.PortalException {
131                    try {
132                            MethodKey methodKey = new MethodKey(LayoutPrototypeServiceUtil.class,
133                                            "addLayoutPrototype", _addLayoutPrototypeParameterTypes2);
134    
135                            MethodHandler methodHandler = new MethodHandler(methodKey, nameMap,
136                                            description, active, serviceContext);
137    
138                            Object returnObj = null;
139    
140                            try {
141                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
142                            }
143                            catch (Exception e) {
144                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
145                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
146                                    }
147    
148                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
149                            }
150    
151                            return (com.liferay.portal.model.LayoutPrototype)returnObj;
152                    }
153                    catch (com.liferay.portal.kernel.exception.SystemException se) {
154                            _log.error(se, se);
155    
156                            throw se;
157                    }
158            }
159    
160            public static void deleteLayoutPrototype(HttpPrincipal httpPrincipal,
161                    long layoutPrototypeId)
162                    throws com.liferay.portal.kernel.exception.PortalException {
163                    try {
164                            MethodKey methodKey = new MethodKey(LayoutPrototypeServiceUtil.class,
165                                            "deleteLayoutPrototype",
166                                            _deleteLayoutPrototypeParameterTypes3);
167    
168                            MethodHandler methodHandler = new MethodHandler(methodKey,
169                                            layoutPrototypeId);
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.portal.model.LayoutPrototype fetchLayoutPrototype(
190                    HttpPrincipal httpPrincipal, long layoutPrototypeId)
191                    throws com.liferay.portal.kernel.exception.PortalException {
192                    try {
193                            MethodKey methodKey = new MethodKey(LayoutPrototypeServiceUtil.class,
194                                            "fetchLayoutPrototype", _fetchLayoutPrototypeParameterTypes4);
195    
196                            MethodHandler methodHandler = new MethodHandler(methodKey,
197                                            layoutPrototypeId);
198    
199                            Object returnObj = null;
200    
201                            try {
202                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
203                            }
204                            catch (Exception e) {
205                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
206                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
207                                    }
208    
209                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
210                            }
211    
212                            return (com.liferay.portal.model.LayoutPrototype)returnObj;
213                    }
214                    catch (com.liferay.portal.kernel.exception.SystemException se) {
215                            _log.error(se, se);
216    
217                            throw se;
218                    }
219            }
220    
221            public static com.liferay.portal.model.LayoutPrototype getLayoutPrototype(
222                    HttpPrincipal httpPrincipal, long layoutPrototypeId)
223                    throws com.liferay.portal.kernel.exception.PortalException {
224                    try {
225                            MethodKey methodKey = new MethodKey(LayoutPrototypeServiceUtil.class,
226                                            "getLayoutPrototype", _getLayoutPrototypeParameterTypes5);
227    
228                            MethodHandler methodHandler = new MethodHandler(methodKey,
229                                            layoutPrototypeId);
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.portal.model.LayoutPrototype)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 java.util.List<com.liferay.portal.model.LayoutPrototype> search(
254                    HttpPrincipal httpPrincipal, long companyId, java.lang.Boolean active,
255                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.LayoutPrototype> obc)
256                    throws com.liferay.portal.kernel.exception.PortalException {
257                    try {
258                            MethodKey methodKey = new MethodKey(LayoutPrototypeServiceUtil.class,
259                                            "search", _searchParameterTypes6);
260    
261                            MethodHandler methodHandler = new MethodHandler(methodKey,
262                                            companyId, active, obc);
263    
264                            Object returnObj = null;
265    
266                            try {
267                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
268                            }
269                            catch (Exception e) {
270                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
271                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
272                                    }
273    
274                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
275                            }
276    
277                            return (java.util.List<com.liferay.portal.model.LayoutPrototype>)returnObj;
278                    }
279                    catch (com.liferay.portal.kernel.exception.SystemException se) {
280                            _log.error(se, se);
281    
282                            throw se;
283                    }
284            }
285    
286            public static com.liferay.portal.model.LayoutPrototype updateLayoutPrototype(
287                    HttpPrincipal httpPrincipal, long layoutPrototypeId,
288                    java.util.Map<java.util.Locale, java.lang.String> nameMap,
289                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
290                    boolean active, com.liferay.portal.service.ServiceContext serviceContext)
291                    throws com.liferay.portal.kernel.exception.PortalException {
292                    try {
293                            MethodKey methodKey = new MethodKey(LayoutPrototypeServiceUtil.class,
294                                            "updateLayoutPrototype",
295                                            _updateLayoutPrototypeParameterTypes7);
296    
297                            MethodHandler methodHandler = new MethodHandler(methodKey,
298                                            layoutPrototypeId, nameMap, descriptionMap, active,
299                                            serviceContext);
300    
301                            Object returnObj = null;
302    
303                            try {
304                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
305                            }
306                            catch (Exception e) {
307                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
308                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
309                                    }
310    
311                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
312                            }
313    
314                            return (com.liferay.portal.model.LayoutPrototype)returnObj;
315                    }
316                    catch (com.liferay.portal.kernel.exception.SystemException se) {
317                            _log.error(se, se);
318    
319                            throw se;
320                    }
321            }
322    
323            public static com.liferay.portal.model.LayoutPrototype updateLayoutPrototype(
324                    HttpPrincipal httpPrincipal, long layoutPrototypeId,
325                    java.util.Map<java.util.Locale, java.lang.String> nameMap,
326                    java.lang.String description, boolean active)
327                    throws com.liferay.portal.kernel.exception.PortalException {
328                    try {
329                            MethodKey methodKey = new MethodKey(LayoutPrototypeServiceUtil.class,
330                                            "updateLayoutPrototype",
331                                            _updateLayoutPrototypeParameterTypes8);
332    
333                            MethodHandler methodHandler = new MethodHandler(methodKey,
334                                            layoutPrototypeId, nameMap, description, active);
335    
336                            Object returnObj = null;
337    
338                            try {
339                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
340                            }
341                            catch (Exception e) {
342                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
343                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
344                                    }
345    
346                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
347                            }
348    
349                            return (com.liferay.portal.model.LayoutPrototype)returnObj;
350                    }
351                    catch (com.liferay.portal.kernel.exception.SystemException se) {
352                            _log.error(se, se);
353    
354                            throw se;
355                    }
356            }
357    
358            public static com.liferay.portal.model.LayoutPrototype updateLayoutPrototype(
359                    HttpPrincipal httpPrincipal, long layoutPrototypeId,
360                    java.util.Map<java.util.Locale, java.lang.String> nameMap,
361                    java.lang.String description, boolean active,
362                    com.liferay.portal.service.ServiceContext serviceContext)
363                    throws com.liferay.portal.kernel.exception.PortalException {
364                    try {
365                            MethodKey methodKey = new MethodKey(LayoutPrototypeServiceUtil.class,
366                                            "updateLayoutPrototype",
367                                            _updateLayoutPrototypeParameterTypes9);
368    
369                            MethodHandler methodHandler = new MethodHandler(methodKey,
370                                            layoutPrototypeId, nameMap, description, active,
371                                            serviceContext);
372    
373                            Object returnObj = null;
374    
375                            try {
376                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
377                            }
378                            catch (Exception e) {
379                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
380                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
381                                    }
382    
383                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
384                            }
385    
386                            return (com.liferay.portal.model.LayoutPrototype)returnObj;
387                    }
388                    catch (com.liferay.portal.kernel.exception.SystemException se) {
389                            _log.error(se, se);
390    
391                            throw se;
392                    }
393            }
394    
395            private static Log _log = LogFactoryUtil.getLog(LayoutPrototypeServiceHttp.class);
396            private static final Class<?>[] _addLayoutPrototypeParameterTypes0 = new Class[] {
397                            java.util.Map.class, java.util.Map.class, boolean.class,
398                            com.liferay.portal.service.ServiceContext.class
399                    };
400            private static final Class<?>[] _addLayoutPrototypeParameterTypes1 = new Class[] {
401                            java.util.Map.class, java.lang.String.class, boolean.class
402                    };
403            private static final Class<?>[] _addLayoutPrototypeParameterTypes2 = new Class[] {
404                            java.util.Map.class, java.lang.String.class, boolean.class,
405                            com.liferay.portal.service.ServiceContext.class
406                    };
407            private static final Class<?>[] _deleteLayoutPrototypeParameterTypes3 = new Class[] {
408                            long.class
409                    };
410            private static final Class<?>[] _fetchLayoutPrototypeParameterTypes4 = new Class[] {
411                            long.class
412                    };
413            private static final Class<?>[] _getLayoutPrototypeParameterTypes5 = new Class[] {
414                            long.class
415                    };
416            private static final Class<?>[] _searchParameterTypes6 = new Class[] {
417                            long.class, java.lang.Boolean.class,
418                            com.liferay.portal.kernel.util.OrderByComparator.class
419                    };
420            private static final Class<?>[] _updateLayoutPrototypeParameterTypes7 = new Class[] {
421                            long.class, java.util.Map.class, java.util.Map.class, boolean.class,
422                            com.liferay.portal.service.ServiceContext.class
423                    };
424            private static final Class<?>[] _updateLayoutPrototypeParameterTypes8 = new Class[] {
425                            long.class, java.util.Map.class, java.lang.String.class,
426                            boolean.class
427                    };
428            private static final Class<?>[] _updateLayoutPrototypeParameterTypes9 = new Class[] {
429                            long.class, java.util.Map.class, java.lang.String.class,
430                            boolean.class, com.liferay.portal.service.ServiceContext.class
431                    };
432    }