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 com.liferay.portal.service.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 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 LayoutPrototypeServiceSoap
050     * @see com.liferay.portal.security.auth.HttpPrincipal
051     * @see com.liferay.portal.service.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 getLayoutPrototype(
190                    HttpPrincipal httpPrincipal, long layoutPrototypeId)
191                    throws com.liferay.portal.kernel.exception.PortalException {
192                    try {
193                            MethodKey methodKey = new MethodKey(LayoutPrototypeServiceUtil.class,
194                                            "getLayoutPrototype", _getLayoutPrototypeParameterTypes4);
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 java.util.List<com.liferay.portal.model.LayoutPrototype> search(
222                    HttpPrincipal httpPrincipal, long companyId, java.lang.Boolean active,
223                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.LayoutPrototype> obc)
224                    throws com.liferay.portal.kernel.exception.PortalException {
225                    try {
226                            MethodKey methodKey = new MethodKey(LayoutPrototypeServiceUtil.class,
227                                            "search", _searchParameterTypes5);
228    
229                            MethodHandler methodHandler = new MethodHandler(methodKey,
230                                            companyId, active, obc);
231    
232                            Object returnObj = null;
233    
234                            try {
235                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
236                            }
237                            catch (Exception e) {
238                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
239                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
240                                    }
241    
242                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
243                            }
244    
245                            return (java.util.List<com.liferay.portal.model.LayoutPrototype>)returnObj;
246                    }
247                    catch (com.liferay.portal.kernel.exception.SystemException se) {
248                            _log.error(se, se);
249    
250                            throw se;
251                    }
252            }
253    
254            public static com.liferay.portal.model.LayoutPrototype updateLayoutPrototype(
255                    HttpPrincipal httpPrincipal, long layoutPrototypeId,
256                    java.util.Map<java.util.Locale, java.lang.String> nameMap,
257                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
258                    boolean active, com.liferay.portal.service.ServiceContext serviceContext)
259                    throws com.liferay.portal.kernel.exception.PortalException {
260                    try {
261                            MethodKey methodKey = new MethodKey(LayoutPrototypeServiceUtil.class,
262                                            "updateLayoutPrototype",
263                                            _updateLayoutPrototypeParameterTypes6);
264    
265                            MethodHandler methodHandler = new MethodHandler(methodKey,
266                                            layoutPrototypeId, nameMap, descriptionMap, active,
267                                            serviceContext);
268    
269                            Object returnObj = null;
270    
271                            try {
272                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
273                            }
274                            catch (Exception e) {
275                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
276                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
277                                    }
278    
279                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
280                            }
281    
282                            return (com.liferay.portal.model.LayoutPrototype)returnObj;
283                    }
284                    catch (com.liferay.portal.kernel.exception.SystemException se) {
285                            _log.error(se, se);
286    
287                            throw se;
288                    }
289            }
290    
291            public static com.liferay.portal.model.LayoutPrototype updateLayoutPrototype(
292                    HttpPrincipal httpPrincipal, long layoutPrototypeId,
293                    java.util.Map<java.util.Locale, java.lang.String> nameMap,
294                    java.lang.String description, boolean active)
295                    throws com.liferay.portal.kernel.exception.PortalException {
296                    try {
297                            MethodKey methodKey = new MethodKey(LayoutPrototypeServiceUtil.class,
298                                            "updateLayoutPrototype",
299                                            _updateLayoutPrototypeParameterTypes7);
300    
301                            MethodHandler methodHandler = new MethodHandler(methodKey,
302                                            layoutPrototypeId, nameMap, description, active);
303    
304                            Object returnObj = null;
305    
306                            try {
307                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
308                            }
309                            catch (Exception e) {
310                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
311                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
312                                    }
313    
314                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
315                            }
316    
317                            return (com.liferay.portal.model.LayoutPrototype)returnObj;
318                    }
319                    catch (com.liferay.portal.kernel.exception.SystemException se) {
320                            _log.error(se, se);
321    
322                            throw se;
323                    }
324            }
325    
326            public static com.liferay.portal.model.LayoutPrototype updateLayoutPrototype(
327                    HttpPrincipal httpPrincipal, long layoutPrototypeId,
328                    java.util.Map<java.util.Locale, java.lang.String> nameMap,
329                    java.lang.String description, boolean active,
330                    com.liferay.portal.service.ServiceContext serviceContext)
331                    throws com.liferay.portal.kernel.exception.PortalException {
332                    try {
333                            MethodKey methodKey = new MethodKey(LayoutPrototypeServiceUtil.class,
334                                            "updateLayoutPrototype",
335                                            _updateLayoutPrototypeParameterTypes8);
336    
337                            MethodHandler methodHandler = new MethodHandler(methodKey,
338                                            layoutPrototypeId, nameMap, description, active,
339                                            serviceContext);
340    
341                            Object returnObj = null;
342    
343                            try {
344                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
345                            }
346                            catch (Exception e) {
347                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
348                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
349                                    }
350    
351                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
352                            }
353    
354                            return (com.liferay.portal.model.LayoutPrototype)returnObj;
355                    }
356                    catch (com.liferay.portal.kernel.exception.SystemException se) {
357                            _log.error(se, se);
358    
359                            throw se;
360                    }
361            }
362    
363            private static Log _log = LogFactoryUtil.getLog(LayoutPrototypeServiceHttp.class);
364            private static final Class<?>[] _addLayoutPrototypeParameterTypes0 = new Class[] {
365                            java.util.Map.class, java.util.Map.class, boolean.class,
366                            com.liferay.portal.service.ServiceContext.class
367                    };
368            private static final Class<?>[] _addLayoutPrototypeParameterTypes1 = new Class[] {
369                            java.util.Map.class, java.lang.String.class, boolean.class
370                    };
371            private static final Class<?>[] _addLayoutPrototypeParameterTypes2 = new Class[] {
372                            java.util.Map.class, java.lang.String.class, boolean.class,
373                            com.liferay.portal.service.ServiceContext.class
374                    };
375            private static final Class<?>[] _deleteLayoutPrototypeParameterTypes3 = new Class[] {
376                            long.class
377                    };
378            private static final Class<?>[] _getLayoutPrototypeParameterTypes4 = new Class[] {
379                            long.class
380                    };
381            private static final Class<?>[] _searchParameterTypes5 = new Class[] {
382                            long.class, java.lang.Boolean.class,
383                            com.liferay.portal.kernel.util.OrderByComparator.class
384                    };
385            private static final Class<?>[] _updateLayoutPrototypeParameterTypes6 = new Class[] {
386                            long.class, java.util.Map.class, java.util.Map.class, boolean.class,
387                            com.liferay.portal.service.ServiceContext.class
388                    };
389            private static final Class<?>[] _updateLayoutPrototypeParameterTypes7 = new Class[] {
390                            long.class, java.util.Map.class, java.lang.String.class,
391                            boolean.class
392                    };
393            private static final Class<?>[] _updateLayoutPrototypeParameterTypes8 = new Class[] {
394                            long.class, java.util.Map.class, java.lang.String.class,
395                            boolean.class, com.liferay.portal.service.ServiceContext.class
396                    };
397    }