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.LayoutSetPrototypeServiceUtil;
023    
024    /**
025     * <p>
026     * This class provides a HTTP utility for the
027     * {@link com.liferay.portal.service.LayoutSetPrototypeServiceUtil} 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       LayoutSetPrototypeServiceSoap
050     * @see       com.liferay.portal.security.auth.HttpPrincipal
051     * @see       com.liferay.portal.service.LayoutSetPrototypeServiceUtil
052     * @generated
053     */
054    public class LayoutSetPrototypeServiceHttp {
055            public static com.liferay.portal.model.LayoutSetPrototype addLayoutSetPrototype(
056                    HttpPrincipal httpPrincipal,
057                    java.util.Map<java.util.Locale, java.lang.String> nameMap,
058                    java.lang.String description, boolean active,
059                    boolean layoutsUpdateable,
060                    com.liferay.portal.service.ServiceContext serviceContext)
061                    throws com.liferay.portal.kernel.exception.PortalException,
062                            com.liferay.portal.kernel.exception.SystemException {
063                    try {
064                            MethodKey methodKey = new MethodKey(LayoutSetPrototypeServiceUtil.class.getName(),
065                                            "addLayoutSetPrototype",
066                                            _addLayoutSetPrototypeParameterTypes0);
067    
068                            MethodHandler methodHandler = new MethodHandler(methodKey, nameMap,
069                                            description, active, layoutsUpdateable, serviceContext);
070    
071                            Object returnObj = null;
072    
073                            try {
074                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
075                            }
076                            catch (Exception e) {
077                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
078                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
079                                    }
080    
081                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
082                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
083                                    }
084    
085                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
086                            }
087    
088                            return (com.liferay.portal.model.LayoutSetPrototype)returnObj;
089                    }
090                    catch (com.liferay.portal.kernel.exception.SystemException se) {
091                            _log.error(se, se);
092    
093                            throw se;
094                    }
095            }
096    
097            public static void deleteLayoutSetPrototype(HttpPrincipal httpPrincipal,
098                    long layoutSetPrototypeId)
099                    throws com.liferay.portal.kernel.exception.PortalException,
100                            com.liferay.portal.kernel.exception.SystemException {
101                    try {
102                            MethodKey methodKey = new MethodKey(LayoutSetPrototypeServiceUtil.class.getName(),
103                                            "deleteLayoutSetPrototype",
104                                            _deleteLayoutSetPrototypeParameterTypes1);
105    
106                            MethodHandler methodHandler = new MethodHandler(methodKey,
107                                            layoutSetPrototypeId);
108    
109                            try {
110                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
111                            }
112                            catch (Exception e) {
113                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
114                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
115                                    }
116    
117                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
118                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
119                                    }
120    
121                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
122                            }
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 com.liferay.portal.model.LayoutSetPrototype getLayoutSetPrototype(
132                    HttpPrincipal httpPrincipal, long layoutSetPrototypeId)
133                    throws com.liferay.portal.kernel.exception.PortalException,
134                            com.liferay.portal.kernel.exception.SystemException {
135                    try {
136                            MethodKey methodKey = new MethodKey(LayoutSetPrototypeServiceUtil.class.getName(),
137                                            "getLayoutSetPrototype",
138                                            _getLayoutSetPrototypeParameterTypes2);
139    
140                            MethodHandler methodHandler = new MethodHandler(methodKey,
141                                            layoutSetPrototypeId);
142    
143                            Object returnObj = null;
144    
145                            try {
146                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
147                            }
148                            catch (Exception e) {
149                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
150                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
151                                    }
152    
153                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
154                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
155                                    }
156    
157                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
158                            }
159    
160                            return (com.liferay.portal.model.LayoutSetPrototype)returnObj;
161                    }
162                    catch (com.liferay.portal.kernel.exception.SystemException se) {
163                            _log.error(se, se);
164    
165                            throw se;
166                    }
167            }
168    
169            public static java.util.List<com.liferay.portal.model.LayoutSetPrototype> search(
170                    HttpPrincipal httpPrincipal, long companyId, java.lang.Boolean active,
171                    com.liferay.portal.kernel.util.OrderByComparator obc)
172                    throws com.liferay.portal.kernel.exception.PortalException,
173                            com.liferay.portal.kernel.exception.SystemException {
174                    try {
175                            MethodKey methodKey = new MethodKey(LayoutSetPrototypeServiceUtil.class.getName(),
176                                            "search", _searchParameterTypes3);
177    
178                            MethodHandler methodHandler = new MethodHandler(methodKey,
179                                            companyId, active, obc);
180    
181                            Object returnObj = null;
182    
183                            try {
184                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
185                            }
186                            catch (Exception e) {
187                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
188                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
189                                    }
190    
191                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
192                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
193                                    }
194    
195                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
196                            }
197    
198                            return (java.util.List<com.liferay.portal.model.LayoutSetPrototype>)returnObj;
199                    }
200                    catch (com.liferay.portal.kernel.exception.SystemException se) {
201                            _log.error(se, se);
202    
203                            throw se;
204                    }
205            }
206    
207            public static com.liferay.portal.model.LayoutSetPrototype updateLayoutSetPrototype(
208                    HttpPrincipal httpPrincipal, long layoutSetPrototypeId,
209                    java.util.Map<java.util.Locale, java.lang.String> nameMap,
210                    java.lang.String description, boolean active,
211                    boolean layoutsUpdateable,
212                    com.liferay.portal.service.ServiceContext serviceContext)
213                    throws com.liferay.portal.kernel.exception.PortalException,
214                            com.liferay.portal.kernel.exception.SystemException {
215                    try {
216                            MethodKey methodKey = new MethodKey(LayoutSetPrototypeServiceUtil.class.getName(),
217                                            "updateLayoutSetPrototype",
218                                            _updateLayoutSetPrototypeParameterTypes4);
219    
220                            MethodHandler methodHandler = new MethodHandler(methodKey,
221                                            layoutSetPrototypeId, nameMap, description, active,
222                                            layoutsUpdateable, serviceContext);
223    
224                            Object returnObj = null;
225    
226                            try {
227                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
228                            }
229                            catch (Exception e) {
230                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
231                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
232                                    }
233    
234                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
235                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
236                                    }
237    
238                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
239                            }
240    
241                            return (com.liferay.portal.model.LayoutSetPrototype)returnObj;
242                    }
243                    catch (com.liferay.portal.kernel.exception.SystemException se) {
244                            _log.error(se, se);
245    
246                            throw se;
247                    }
248            }
249    
250            public static com.liferay.portal.model.LayoutSetPrototype updateLayoutSetPrototype(
251                    HttpPrincipal httpPrincipal, long layoutSetPrototypeId,
252                    java.lang.String settings)
253                    throws com.liferay.portal.kernel.exception.PortalException,
254                            com.liferay.portal.kernel.exception.SystemException {
255                    try {
256                            MethodKey methodKey = new MethodKey(LayoutSetPrototypeServiceUtil.class.getName(),
257                                            "updateLayoutSetPrototype",
258                                            _updateLayoutSetPrototypeParameterTypes5);
259    
260                            MethodHandler methodHandler = new MethodHandler(methodKey,
261                                            layoutSetPrototypeId, settings);
262    
263                            Object returnObj = null;
264    
265                            try {
266                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
267                            }
268                            catch (Exception e) {
269                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
270                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
271                                    }
272    
273                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
274                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
275                                    }
276    
277                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
278                            }
279    
280                            return (com.liferay.portal.model.LayoutSetPrototype)returnObj;
281                    }
282                    catch (com.liferay.portal.kernel.exception.SystemException se) {
283                            _log.error(se, se);
284    
285                            throw se;
286                    }
287            }
288    
289            private static Log _log = LogFactoryUtil.getLog(LayoutSetPrototypeServiceHttp.class);
290            private static final Class<?>[] _addLayoutSetPrototypeParameterTypes0 = new Class[] {
291                            java.util.Map.class, java.lang.String.class, boolean.class,
292                            boolean.class, com.liferay.portal.service.ServiceContext.class
293                    };
294            private static final Class<?>[] _deleteLayoutSetPrototypeParameterTypes1 = new Class[] {
295                            long.class
296                    };
297            private static final Class<?>[] _getLayoutSetPrototypeParameterTypes2 = new Class[] {
298                            long.class
299                    };
300            private static final Class<?>[] _searchParameterTypes3 = new Class[] {
301                            long.class, java.lang.Boolean.class,
302                            com.liferay.portal.kernel.util.OrderByComparator.class
303                    };
304            private static final Class<?>[] _updateLayoutSetPrototypeParameterTypes4 = new Class[] {
305                            long.class, java.util.Map.class, java.lang.String.class,
306                            boolean.class, boolean.class,
307                            com.liferay.portal.service.ServiceContext.class
308                    };
309            private static final Class<?>[] _updateLayoutSetPrototypeParameterTypes5 = new Class[] {
310                            long.class, java.lang.String.class
311                    };
312    }