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.security.auth.HttpPrincipal;
022    import com.liferay.portal.kernel.service.LayoutSetPrototypeServiceUtil;
023    import com.liferay.portal.kernel.service.http.TunnelUtil;
024    import com.liferay.portal.kernel.util.MethodHandler;
025    import com.liferay.portal.kernel.util.MethodKey;
026    
027    /**
028     * Provides the HTTP utility for the
029     * {@link LayoutSetPrototypeServiceUtil} 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 HttpPrincipal} parameter.
033     *
034     * <p>
035     * The benefits of using the HTTP utility is that it is fast and allows for
036     * tunneling without the cost of serializing to text. The drawback is that it
037     * only works with Java.
038     * </p>
039     *
040     * <p>
041     * Set the property <b>tunnel.servlet.hosts.allowed</b> in portal.properties to
042     * configure security.
043     * </p>
044     *
045     * <p>
046     * The HTTP utility is only generated for remote services.
047     * </p>
048     *
049     * @author Brian Wing Shun Chan
050     * @see LayoutSetPrototypeServiceSoap
051     * @see HttpPrincipal
052     * @see LayoutSetPrototypeServiceUtil
053     * @generated
054     */
055    @ProviderType
056    public class LayoutSetPrototypeServiceHttp {
057            public static com.liferay.portal.kernel.model.LayoutSetPrototype addLayoutSetPrototype(
058                    HttpPrincipal httpPrincipal,
059                    java.util.Map<java.util.Locale, java.lang.String> nameMap,
060                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
061                    boolean active, boolean layoutsUpdateable,
062                    com.liferay.portal.kernel.service.ServiceContext serviceContext)
063                    throws com.liferay.portal.kernel.exception.PortalException {
064                    try {
065                            MethodKey methodKey = new MethodKey(LayoutSetPrototypeServiceUtil.class,
066                                            "addLayoutSetPrototype",
067                                            _addLayoutSetPrototypeParameterTypes0);
068    
069                            MethodHandler methodHandler = new MethodHandler(methodKey, nameMap,
070                                            descriptionMap, active, layoutsUpdateable, serviceContext);
071    
072                            Object returnObj = null;
073    
074                            try {
075                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
076                            }
077                            catch (Exception e) {
078                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
079                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
080                                    }
081    
082                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
083                            }
084    
085                            return (com.liferay.portal.kernel.model.LayoutSetPrototype)returnObj;
086                    }
087                    catch (com.liferay.portal.kernel.exception.SystemException se) {
088                            _log.error(se, se);
089    
090                            throw se;
091                    }
092            }
093    
094            public static com.liferay.portal.kernel.model.LayoutSetPrototype addLayoutSetPrototype(
095                    HttpPrincipal httpPrincipal,
096                    java.util.Map<java.util.Locale, java.lang.String> nameMap,
097                    java.lang.String description, boolean active,
098                    boolean layoutsUpdateable,
099                    com.liferay.portal.kernel.service.ServiceContext serviceContext)
100                    throws com.liferay.portal.kernel.exception.PortalException {
101                    try {
102                            MethodKey methodKey = new MethodKey(LayoutSetPrototypeServiceUtil.class,
103                                            "addLayoutSetPrototype",
104                                            _addLayoutSetPrototypeParameterTypes1);
105    
106                            MethodHandler methodHandler = new MethodHandler(methodKey, nameMap,
107                                            description, active, layoutsUpdateable, serviceContext);
108    
109                            Object returnObj = null;
110    
111                            try {
112                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
113                            }
114                            catch (Exception e) {
115                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
116                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
117                                    }
118    
119                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
120                            }
121    
122                            return (com.liferay.portal.kernel.model.LayoutSetPrototype)returnObj;
123                    }
124                    catch (com.liferay.portal.kernel.exception.SystemException se) {
125                            _log.error(se, se);
126    
127                            throw se;
128                    }
129            }
130    
131            public static void deleteLayoutSetPrototype(HttpPrincipal httpPrincipal,
132                    long layoutSetPrototypeId)
133                    throws com.liferay.portal.kernel.exception.PortalException {
134                    try {
135                            MethodKey methodKey = new MethodKey(LayoutSetPrototypeServiceUtil.class,
136                                            "deleteLayoutSetPrototype",
137                                            _deleteLayoutSetPrototypeParameterTypes2);
138    
139                            MethodHandler methodHandler = new MethodHandler(methodKey,
140                                            layoutSetPrototypeId);
141    
142                            try {
143                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
144                            }
145                            catch (Exception e) {
146                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
147                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
148                                    }
149    
150                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
151                            }
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 com.liferay.portal.kernel.model.LayoutSetPrototype fetchLayoutSetPrototype(
161                    HttpPrincipal httpPrincipal, long layoutSetPrototypeId)
162                    throws com.liferay.portal.kernel.exception.PortalException {
163                    try {
164                            MethodKey methodKey = new MethodKey(LayoutSetPrototypeServiceUtil.class,
165                                            "fetchLayoutSetPrototype",
166                                            _fetchLayoutSetPrototypeParameterTypes3);
167    
168                            MethodHandler methodHandler = new MethodHandler(methodKey,
169                                            layoutSetPrototypeId);
170    
171                            Object returnObj = null;
172    
173                            try {
174                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
175                            }
176                            catch (Exception e) {
177                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
178                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
179                                    }
180    
181                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
182                            }
183    
184                            return (com.liferay.portal.kernel.model.LayoutSetPrototype)returnObj;
185                    }
186                    catch (com.liferay.portal.kernel.exception.SystemException se) {
187                            _log.error(se, se);
188    
189                            throw se;
190                    }
191            }
192    
193            public static com.liferay.portal.kernel.model.LayoutSetPrototype getLayoutSetPrototype(
194                    HttpPrincipal httpPrincipal, long layoutSetPrototypeId)
195                    throws com.liferay.portal.kernel.exception.PortalException {
196                    try {
197                            MethodKey methodKey = new MethodKey(LayoutSetPrototypeServiceUtil.class,
198                                            "getLayoutSetPrototype",
199                                            _getLayoutSetPrototypeParameterTypes4);
200    
201                            MethodHandler methodHandler = new MethodHandler(methodKey,
202                                            layoutSetPrototypeId);
203    
204                            Object returnObj = null;
205    
206                            try {
207                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
208                            }
209                            catch (Exception e) {
210                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
211                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
212                                    }
213    
214                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
215                            }
216    
217                            return (com.liferay.portal.kernel.model.LayoutSetPrototype)returnObj;
218                    }
219                    catch (com.liferay.portal.kernel.exception.SystemException se) {
220                            _log.error(se, se);
221    
222                            throw se;
223                    }
224            }
225    
226            public static java.util.List<com.liferay.portal.kernel.model.LayoutSetPrototype> search(
227                    HttpPrincipal httpPrincipal, long companyId, java.lang.Boolean active,
228                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.kernel.model.LayoutSetPrototype> obc)
229                    throws com.liferay.portal.kernel.exception.PortalException {
230                    try {
231                            MethodKey methodKey = new MethodKey(LayoutSetPrototypeServiceUtil.class,
232                                            "search", _searchParameterTypes5);
233    
234                            MethodHandler methodHandler = new MethodHandler(methodKey,
235                                            companyId, active, obc);
236    
237                            Object returnObj = null;
238    
239                            try {
240                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
241                            }
242                            catch (Exception e) {
243                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
244                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
245                                    }
246    
247                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
248                            }
249    
250                            return (java.util.List<com.liferay.portal.kernel.model.LayoutSetPrototype>)returnObj;
251                    }
252                    catch (com.liferay.portal.kernel.exception.SystemException se) {
253                            _log.error(se, se);
254    
255                            throw se;
256                    }
257            }
258    
259            public static com.liferay.portal.kernel.model.LayoutSetPrototype updateLayoutSetPrototype(
260                    HttpPrincipal httpPrincipal, long layoutSetPrototypeId,
261                    java.util.Map<java.util.Locale, java.lang.String> nameMap,
262                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
263                    boolean active, boolean layoutsUpdateable,
264                    com.liferay.portal.kernel.service.ServiceContext serviceContext)
265                    throws com.liferay.portal.kernel.exception.PortalException {
266                    try {
267                            MethodKey methodKey = new MethodKey(LayoutSetPrototypeServiceUtil.class,
268                                            "updateLayoutSetPrototype",
269                                            _updateLayoutSetPrototypeParameterTypes6);
270    
271                            MethodHandler methodHandler = new MethodHandler(methodKey,
272                                            layoutSetPrototypeId, nameMap, descriptionMap, active,
273                                            layoutsUpdateable, serviceContext);
274    
275                            Object returnObj = null;
276    
277                            try {
278                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
279                            }
280                            catch (Exception e) {
281                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
282                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
283                                    }
284    
285                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
286                            }
287    
288                            return (com.liferay.portal.kernel.model.LayoutSetPrototype)returnObj;
289                    }
290                    catch (com.liferay.portal.kernel.exception.SystemException se) {
291                            _log.error(se, se);
292    
293                            throw se;
294                    }
295            }
296    
297            public static com.liferay.portal.kernel.model.LayoutSetPrototype updateLayoutSetPrototype(
298                    HttpPrincipal httpPrincipal, long layoutSetPrototypeId,
299                    java.util.Map<java.util.Locale, java.lang.String> nameMap,
300                    java.lang.String description, boolean active,
301                    boolean layoutsUpdateable,
302                    com.liferay.portal.kernel.service.ServiceContext serviceContext)
303                    throws com.liferay.portal.kernel.exception.PortalException {
304                    try {
305                            MethodKey methodKey = new MethodKey(LayoutSetPrototypeServiceUtil.class,
306                                            "updateLayoutSetPrototype",
307                                            _updateLayoutSetPrototypeParameterTypes7);
308    
309                            MethodHandler methodHandler = new MethodHandler(methodKey,
310                                            layoutSetPrototypeId, nameMap, description, active,
311                                            layoutsUpdateable, serviceContext);
312    
313                            Object returnObj = null;
314    
315                            try {
316                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
317                            }
318                            catch (Exception e) {
319                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
320                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
321                                    }
322    
323                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
324                            }
325    
326                            return (com.liferay.portal.kernel.model.LayoutSetPrototype)returnObj;
327                    }
328                    catch (com.liferay.portal.kernel.exception.SystemException se) {
329                            _log.error(se, se);
330    
331                            throw se;
332                    }
333            }
334    
335            public static com.liferay.portal.kernel.model.LayoutSetPrototype updateLayoutSetPrototype(
336                    HttpPrincipal httpPrincipal, long layoutSetPrototypeId,
337                    java.lang.String settings)
338                    throws com.liferay.portal.kernel.exception.PortalException {
339                    try {
340                            MethodKey methodKey = new MethodKey(LayoutSetPrototypeServiceUtil.class,
341                                            "updateLayoutSetPrototype",
342                                            _updateLayoutSetPrototypeParameterTypes8);
343    
344                            MethodHandler methodHandler = new MethodHandler(methodKey,
345                                            layoutSetPrototypeId, settings);
346    
347                            Object returnObj = null;
348    
349                            try {
350                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
351                            }
352                            catch (Exception e) {
353                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
354                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
355                                    }
356    
357                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
358                            }
359    
360                            return (com.liferay.portal.kernel.model.LayoutSetPrototype)returnObj;
361                    }
362                    catch (com.liferay.portal.kernel.exception.SystemException se) {
363                            _log.error(se, se);
364    
365                            throw se;
366                    }
367            }
368    
369            private static Log _log = LogFactoryUtil.getLog(LayoutSetPrototypeServiceHttp.class);
370            private static final Class<?>[] _addLayoutSetPrototypeParameterTypes0 = new Class[] {
371                            java.util.Map.class, java.util.Map.class, boolean.class,
372                            boolean.class,
373                            com.liferay.portal.kernel.service.ServiceContext.class
374                    };
375            private static final Class<?>[] _addLayoutSetPrototypeParameterTypes1 = new Class[] {
376                            java.util.Map.class, java.lang.String.class, boolean.class,
377                            boolean.class,
378                            com.liferay.portal.kernel.service.ServiceContext.class
379                    };
380            private static final Class<?>[] _deleteLayoutSetPrototypeParameterTypes2 = new Class[] {
381                            long.class
382                    };
383            private static final Class<?>[] _fetchLayoutSetPrototypeParameterTypes3 = new Class[] {
384                            long.class
385                    };
386            private static final Class<?>[] _getLayoutSetPrototypeParameterTypes4 = new Class[] {
387                            long.class
388                    };
389            private static final Class<?>[] _searchParameterTypes5 = new Class[] {
390                            long.class, java.lang.Boolean.class,
391                            com.liferay.portal.kernel.util.OrderByComparator.class
392                    };
393            private static final Class<?>[] _updateLayoutSetPrototypeParameterTypes6 = new Class[] {
394                            long.class, java.util.Map.class, java.util.Map.class, boolean.class,
395                            boolean.class,
396                            com.liferay.portal.kernel.service.ServiceContext.class
397                    };
398            private static final Class<?>[] _updateLayoutSetPrototypeParameterTypes7 = new Class[] {
399                            long.class, java.util.Map.class, java.lang.String.class,
400                            boolean.class, boolean.class,
401                            com.liferay.portal.kernel.service.ServiceContext.class
402                    };
403            private static final Class<?>[] _updateLayoutSetPrototypeParameterTypes8 = new Class[] {
404                            long.class, java.lang.String.class
405                    };
406    }