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.portal.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.LayoutPrototypeServiceUtil;
023    
024    /**
025     * <p>
026     * This class provides a HTTP utility for the
027     * {@link com.liferay.portal.service.LayoutPrototypeServiceUtil} service utility. The
028     * static methods of this class calls the same methods of the service utility.
029     * However, the signatures are different because it requires an additional
030     * {@link com.liferay.portal.security.auth.HttpPrincipal} parameter.
031     * </p>
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    public class LayoutPrototypeServiceHttp {
055            public static com.liferay.portal.model.LayoutPrototype addLayoutPrototype(
056                    HttpPrincipal httpPrincipal,
057                    java.util.Map<java.util.Locale, java.lang.String> nameMap,
058                    java.lang.String description, boolean active)
059                    throws com.liferay.portal.kernel.exception.PortalException,
060                            com.liferay.portal.kernel.exception.SystemException {
061                    try {
062                            MethodKey methodKey = new MethodKey(LayoutPrototypeServiceUtil.class,
063                                            "addLayoutPrototype", _addLayoutPrototypeParameterTypes0);
064    
065                            MethodHandler methodHandler = new MethodHandler(methodKey, nameMap,
066                                            description, active);
067    
068                            Object returnObj = null;
069    
070                            try {
071                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
072                            }
073                            catch (Exception e) {
074                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
075                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
076                                    }
077    
078                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
079                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
080                                    }
081    
082                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
083                            }
084    
085                            return (com.liferay.portal.model.LayoutPrototype)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.model.LayoutPrototype addLayoutPrototype(
095                    HttpPrincipal httpPrincipal,
096                    java.util.Map<java.util.Locale, java.lang.String> nameMap,
097                    java.lang.String description, boolean active,
098                    com.liferay.portal.service.ServiceContext serviceContext)
099                    throws com.liferay.portal.kernel.exception.PortalException,
100                            com.liferay.portal.kernel.exception.SystemException {
101                    try {
102                            MethodKey methodKey = new MethodKey(LayoutPrototypeServiceUtil.class,
103                                            "addLayoutPrototype", _addLayoutPrototypeParameterTypes1);
104    
105                            MethodHandler methodHandler = new MethodHandler(methodKey, nameMap,
106                                            description, active, serviceContext);
107    
108                            Object returnObj = null;
109    
110                            try {
111                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
112                            }
113                            catch (Exception e) {
114                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
115                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
116                                    }
117    
118                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
119                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
120                                    }
121    
122                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
123                            }
124    
125                            return (com.liferay.portal.model.LayoutPrototype)returnObj;
126                    }
127                    catch (com.liferay.portal.kernel.exception.SystemException se) {
128                            _log.error(se, se);
129    
130                            throw se;
131                    }
132            }
133    
134            public static void deleteLayoutPrototype(HttpPrincipal httpPrincipal,
135                    long layoutPrototypeId)
136                    throws com.liferay.portal.kernel.exception.PortalException,
137                            com.liferay.portal.kernel.exception.SystemException {
138                    try {
139                            MethodKey methodKey = new MethodKey(LayoutPrototypeServiceUtil.class,
140                                            "deleteLayoutPrototype",
141                                            _deleteLayoutPrototypeParameterTypes2);
142    
143                            MethodHandler methodHandler = new MethodHandler(methodKey,
144                                            layoutPrototypeId);
145    
146                            try {
147                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
148                            }
149                            catch (Exception e) {
150                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
151                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
152                                    }
153    
154                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
155                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
156                                    }
157    
158                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
159                            }
160                    }
161                    catch (com.liferay.portal.kernel.exception.SystemException se) {
162                            _log.error(se, se);
163    
164                            throw se;
165                    }
166            }
167    
168            public static com.liferay.portal.model.LayoutPrototype getLayoutPrototype(
169                    HttpPrincipal httpPrincipal, long layoutPrototypeId)
170                    throws com.liferay.portal.kernel.exception.PortalException,
171                            com.liferay.portal.kernel.exception.SystemException {
172                    try {
173                            MethodKey methodKey = new MethodKey(LayoutPrototypeServiceUtil.class,
174                                            "getLayoutPrototype", _getLayoutPrototypeParameterTypes3);
175    
176                            MethodHandler methodHandler = new MethodHandler(methodKey,
177                                            layoutPrototypeId);
178    
179                            Object returnObj = null;
180    
181                            try {
182                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
183                            }
184                            catch (Exception e) {
185                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
186                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
187                                    }
188    
189                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
190                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
191                                    }
192    
193                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
194                            }
195    
196                            return (com.liferay.portal.model.LayoutPrototype)returnObj;
197                    }
198                    catch (com.liferay.portal.kernel.exception.SystemException se) {
199                            _log.error(se, se);
200    
201                            throw se;
202                    }
203            }
204    
205            public static java.util.List<com.liferay.portal.model.LayoutPrototype> search(
206                    HttpPrincipal httpPrincipal, long companyId, java.lang.Boolean active,
207                    com.liferay.portal.kernel.util.OrderByComparator obc)
208                    throws com.liferay.portal.kernel.exception.PortalException,
209                            com.liferay.portal.kernel.exception.SystemException {
210                    try {
211                            MethodKey methodKey = new MethodKey(LayoutPrototypeServiceUtil.class,
212                                            "search", _searchParameterTypes4);
213    
214                            MethodHandler methodHandler = new MethodHandler(methodKey,
215                                            companyId, active, obc);
216    
217                            Object returnObj = null;
218    
219                            try {
220                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
221                            }
222                            catch (Exception e) {
223                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
224                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
225                                    }
226    
227                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
228                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
229                                    }
230    
231                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
232                            }
233    
234                            return (java.util.List<com.liferay.portal.model.LayoutPrototype>)returnObj;
235                    }
236                    catch (com.liferay.portal.kernel.exception.SystemException se) {
237                            _log.error(se, se);
238    
239                            throw se;
240                    }
241            }
242    
243            public static com.liferay.portal.model.LayoutPrototype updateLayoutPrototype(
244                    HttpPrincipal httpPrincipal, long layoutPrototypeId,
245                    java.util.Map<java.util.Locale, java.lang.String> nameMap,
246                    java.lang.String description, boolean active)
247                    throws com.liferay.portal.kernel.exception.PortalException,
248                            com.liferay.portal.kernel.exception.SystemException {
249                    try {
250                            MethodKey methodKey = new MethodKey(LayoutPrototypeServiceUtil.class,
251                                            "updateLayoutPrototype",
252                                            _updateLayoutPrototypeParameterTypes5);
253    
254                            MethodHandler methodHandler = new MethodHandler(methodKey,
255                                            layoutPrototypeId, nameMap, description, active);
256    
257                            Object returnObj = null;
258    
259                            try {
260                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
261                            }
262                            catch (Exception e) {
263                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
264                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
265                                    }
266    
267                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
268                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
269                                    }
270    
271                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
272                            }
273    
274                            return (com.liferay.portal.model.LayoutPrototype)returnObj;
275                    }
276                    catch (com.liferay.portal.kernel.exception.SystemException se) {
277                            _log.error(se, se);
278    
279                            throw se;
280                    }
281            }
282    
283            public static com.liferay.portal.model.LayoutPrototype updateLayoutPrototype(
284                    HttpPrincipal httpPrincipal, long layoutPrototypeId,
285                    java.util.Map<java.util.Locale, java.lang.String> nameMap,
286                    java.lang.String description, boolean active,
287                    com.liferay.portal.service.ServiceContext serviceContext)
288                    throws com.liferay.portal.kernel.exception.PortalException,
289                            com.liferay.portal.kernel.exception.SystemException {
290                    try {
291                            MethodKey methodKey = new MethodKey(LayoutPrototypeServiceUtil.class,
292                                            "updateLayoutPrototype",
293                                            _updateLayoutPrototypeParameterTypes6);
294    
295                            MethodHandler methodHandler = new MethodHandler(methodKey,
296                                            layoutPrototypeId, nameMap, description, active,
297                                            serviceContext);
298    
299                            Object returnObj = null;
300    
301                            try {
302                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
303                            }
304                            catch (Exception e) {
305                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
306                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
307                                    }
308    
309                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
310                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
311                                    }
312    
313                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
314                            }
315    
316                            return (com.liferay.portal.model.LayoutPrototype)returnObj;
317                    }
318                    catch (com.liferay.portal.kernel.exception.SystemException se) {
319                            _log.error(se, se);
320    
321                            throw se;
322                    }
323            }
324    
325            private static Log _log = LogFactoryUtil.getLog(LayoutPrototypeServiceHttp.class);
326            private static final Class<?>[] _addLayoutPrototypeParameterTypes0 = new Class[] {
327                            java.util.Map.class, java.lang.String.class, boolean.class
328                    };
329            private static final Class<?>[] _addLayoutPrototypeParameterTypes1 = new Class[] {
330                            java.util.Map.class, java.lang.String.class, boolean.class,
331                            com.liferay.portal.service.ServiceContext.class
332                    };
333            private static final Class<?>[] _deleteLayoutPrototypeParameterTypes2 = new Class[] {
334                            long.class
335                    };
336            private static final Class<?>[] _getLayoutPrototypeParameterTypes3 = new Class[] {
337                            long.class
338                    };
339            private static final Class<?>[] _searchParameterTypes4 = new Class[] {
340                            long.class, java.lang.Boolean.class,
341                            com.liferay.portal.kernel.util.OrderByComparator.class
342                    };
343            private static final Class<?>[] _updateLayoutPrototypeParameterTypes5 = new Class[] {
344                            long.class, java.util.Map.class, java.lang.String.class,
345                            boolean.class
346                    };
347            private static final Class<?>[] _updateLayoutPrototypeParameterTypes6 = new Class[] {
348                            long.class, java.util.Map.class, java.lang.String.class,
349                            boolean.class, com.liferay.portal.service.ServiceContext.class
350                    };
351    }