001    /**
002     * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
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 allowModifications, boolean allowLayoutAddition,
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, allowModifications,
070                                            allowLayoutAddition, 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                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
083                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
084                                    }
085    
086                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
087                            }
088    
089                            return (com.liferay.portal.model.LayoutSetPrototype)returnObj;
090                    }
091                    catch (com.liferay.portal.kernel.exception.SystemException se) {
092                            _log.error(se, se);
093    
094                            throw se;
095                    }
096            }
097    
098            public static void deleteLayoutSetPrototype(HttpPrincipal httpPrincipal,
099                    long layoutSetPrototypeId)
100                    throws com.liferay.portal.kernel.exception.PortalException,
101                            com.liferay.portal.kernel.exception.SystemException {
102                    try {
103                            MethodKey methodKey = new MethodKey(LayoutSetPrototypeServiceUtil.class.getName(),
104                                            "deleteLayoutSetPrototype",
105                                            _deleteLayoutSetPrototypeParameterTypes1);
106    
107                            MethodHandler methodHandler = new MethodHandler(methodKey,
108                                            layoutSetPrototypeId);
109    
110                            try {
111                                    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                    catch (com.liferay.portal.kernel.exception.SystemException se) {
126                            _log.error(se, se);
127    
128                            throw se;
129                    }
130            }
131    
132            public static com.liferay.portal.model.LayoutSetPrototype getLayoutSetPrototype(
133                    HttpPrincipal httpPrincipal, long layoutSetPrototypeId)
134                    throws com.liferay.portal.kernel.exception.PortalException,
135                            com.liferay.portal.kernel.exception.SystemException {
136                    try {
137                            MethodKey methodKey = new MethodKey(LayoutSetPrototypeServiceUtil.class.getName(),
138                                            "getLayoutSetPrototype",
139                                            _getLayoutSetPrototypeParameterTypes2);
140    
141                            MethodHandler methodHandler = new MethodHandler(methodKey,
142                                            layoutSetPrototypeId);
143    
144                            Object returnObj = null;
145    
146                            try {
147                                    returnObj = 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                            return (com.liferay.portal.model.LayoutSetPrototype)returnObj;
162                    }
163                    catch (com.liferay.portal.kernel.exception.SystemException se) {
164                            _log.error(se, se);
165    
166                            throw se;
167                    }
168            }
169    
170            public static java.util.List<com.liferay.portal.model.LayoutSetPrototype> search(
171                    HttpPrincipal httpPrincipal, long companyId, java.lang.Boolean active,
172                    com.liferay.portal.kernel.util.OrderByComparator obc)
173                    throws com.liferay.portal.kernel.exception.PortalException,
174                            com.liferay.portal.kernel.exception.SystemException {
175                    try {
176                            MethodKey methodKey = new MethodKey(LayoutSetPrototypeServiceUtil.class.getName(),
177                                            "search", _searchParameterTypes3);
178    
179                            MethodHandler methodHandler = new MethodHandler(methodKey,
180                                            companyId, active, obc);
181    
182                            Object returnObj = null;
183    
184                            try {
185                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
186                            }
187                            catch (Exception e) {
188                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
189                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
190                                    }
191    
192                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
193                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
194                                    }
195    
196                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
197                            }
198    
199                            return (java.util.List<com.liferay.portal.model.LayoutSetPrototype>)returnObj;
200                    }
201                    catch (com.liferay.portal.kernel.exception.SystemException se) {
202                            _log.error(se, se);
203    
204                            throw se;
205                    }
206            }
207    
208            public static com.liferay.portal.model.LayoutSetPrototype updateLayoutSetPrototype(
209                    HttpPrincipal httpPrincipal, long layoutSetPrototypeId,
210                    java.util.Map<java.util.Locale, java.lang.String> nameMap,
211                    java.lang.String description, boolean active,
212                    boolean allowModifications, boolean allowLayoutAddition,
213                    com.liferay.portal.service.ServiceContext serviceContext)
214                    throws com.liferay.portal.kernel.exception.PortalException,
215                            com.liferay.portal.kernel.exception.SystemException {
216                    try {
217                            MethodKey methodKey = new MethodKey(LayoutSetPrototypeServiceUtil.class.getName(),
218                                            "updateLayoutSetPrototype",
219                                            _updateLayoutSetPrototypeParameterTypes4);
220    
221                            MethodHandler methodHandler = new MethodHandler(methodKey,
222                                            layoutSetPrototypeId, nameMap, description, active,
223                                            allowModifications, allowLayoutAddition, serviceContext);
224    
225                            Object returnObj = null;
226    
227                            try {
228                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
229                            }
230                            catch (Exception e) {
231                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
232                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
233                                    }
234    
235                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
236                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
237                                    }
238    
239                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
240                            }
241    
242                            return (com.liferay.portal.model.LayoutSetPrototype)returnObj;
243                    }
244                    catch (com.liferay.portal.kernel.exception.SystemException se) {
245                            _log.error(se, se);
246    
247                            throw se;
248                    }
249            }
250    
251            public static com.liferay.portal.model.LayoutSetPrototype updateLayoutSetPrototype(
252                    HttpPrincipal httpPrincipal, long layoutSetPrototypeId,
253                    java.lang.String settings)
254                    throws com.liferay.portal.kernel.exception.PortalException,
255                            com.liferay.portal.kernel.exception.SystemException {
256                    try {
257                            MethodKey methodKey = new MethodKey(LayoutSetPrototypeServiceUtil.class.getName(),
258                                            "updateLayoutSetPrototype",
259                                            _updateLayoutSetPrototypeParameterTypes5);
260    
261                            MethodHandler methodHandler = new MethodHandler(methodKey,
262                                            layoutSetPrototypeId, settings);
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                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
275                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
276                                    }
277    
278                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
279                            }
280    
281                            return (com.liferay.portal.model.LayoutSetPrototype)returnObj;
282                    }
283                    catch (com.liferay.portal.kernel.exception.SystemException se) {
284                            _log.error(se, se);
285    
286                            throw se;
287                    }
288            }
289    
290            private static Log _log = LogFactoryUtil.getLog(LayoutSetPrototypeServiceHttp.class);
291            private static final Class<?>[] _addLayoutSetPrototypeParameterTypes0 = new Class[] {
292                            java.util.Map.class, java.lang.String.class, boolean.class,
293                            boolean.class, boolean.class,
294                            com.liferay.portal.service.ServiceContext.class
295                    };
296            private static final Class<?>[] _deleteLayoutSetPrototypeParameterTypes1 = new Class[] {
297                            long.class
298                    };
299            private static final Class<?>[] _getLayoutSetPrototypeParameterTypes2 = new Class[] {
300                            long.class
301                    };
302            private static final Class<?>[] _searchParameterTypes3 = new Class[] {
303                            long.class, java.lang.Boolean.class,
304                            com.liferay.portal.kernel.util.OrderByComparator.class
305                    };
306            private static final Class<?>[] _updateLayoutSetPrototypeParameterTypes4 = new Class[] {
307                            long.class, java.util.Map.class, java.lang.String.class,
308                            boolean.class, boolean.class, boolean.class,
309                            com.liferay.portal.service.ServiceContext.class
310                    };
311            private static final Class<?>[] _updateLayoutSetPrototypeParameterTypes5 = new Class[] {
312                            long.class, java.lang.String.class
313                    };
314    }