001    /**
002     * Copyright (c) 2000-2010 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                    throws com.liferay.portal.kernel.exception.PortalException,
060                            com.liferay.portal.kernel.exception.SystemException {
061                    try {
062                            MethodKey methodKey = new MethodKey(LayoutSetPrototypeServiceUtil.class.getName(),
063                                            "addLayoutSetPrototype",
064                                            _addLayoutSetPrototypeParameterTypes0);
065    
066                            MethodHandler methodHandler = new MethodHandler(methodKey, nameMap,
067                                            description, active);
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                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
080                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
081                                    }
082    
083                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
084                            }
085    
086                            return (com.liferay.portal.model.LayoutSetPrototype)returnObj;
087                    }
088                    catch (com.liferay.portal.kernel.exception.SystemException se) {
089                            _log.error(se, se);
090    
091                            throw se;
092                    }
093            }
094    
095            public static void deleteLayoutSetPrototype(HttpPrincipal httpPrincipal,
096                    long layoutSetPrototypeId)
097                    throws com.liferay.portal.kernel.exception.PortalException,
098                            com.liferay.portal.kernel.exception.SystemException {
099                    try {
100                            MethodKey methodKey = new MethodKey(LayoutSetPrototypeServiceUtil.class.getName(),
101                                            "deleteLayoutSetPrototype",
102                                            _deleteLayoutSetPrototypeParameterTypes1);
103    
104                            MethodHandler methodHandler = new MethodHandler(methodKey,
105                                            layoutSetPrototypeId);
106    
107                            try {
108                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
109                            }
110                            catch (Exception e) {
111                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
112                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
113                                    }
114    
115                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
116                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
117                                    }
118    
119                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
120                            }
121                    }
122                    catch (com.liferay.portal.kernel.exception.SystemException se) {
123                            _log.error(se, se);
124    
125                            throw se;
126                    }
127            }
128    
129            public static com.liferay.portal.model.LayoutSetPrototype getLayoutSetPrototype(
130                    HttpPrincipal httpPrincipal, long layoutSetPrototypeId)
131                    throws com.liferay.portal.kernel.exception.PortalException,
132                            com.liferay.portal.kernel.exception.SystemException {
133                    try {
134                            MethodKey methodKey = new MethodKey(LayoutSetPrototypeServiceUtil.class.getName(),
135                                            "getLayoutSetPrototype",
136                                            _getLayoutSetPrototypeParameterTypes2);
137    
138                            MethodHandler methodHandler = new MethodHandler(methodKey,
139                                            layoutSetPrototypeId);
140    
141                            Object returnObj = null;
142    
143                            try {
144                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
145                            }
146                            catch (Exception e) {
147                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
148                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
149                                    }
150    
151                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
152                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
153                                    }
154    
155                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
156                            }
157    
158                            return (com.liferay.portal.model.LayoutSetPrototype)returnObj;
159                    }
160                    catch (com.liferay.portal.kernel.exception.SystemException se) {
161                            _log.error(se, se);
162    
163                            throw se;
164                    }
165            }
166    
167            public static java.util.List<com.liferay.portal.model.LayoutSetPrototype> search(
168                    HttpPrincipal httpPrincipal, long companyId, java.lang.Boolean active,
169                    com.liferay.portal.kernel.util.OrderByComparator obc)
170                    throws com.liferay.portal.kernel.exception.PortalException,
171                            com.liferay.portal.kernel.exception.SystemException {
172                    try {
173                            MethodKey methodKey = new MethodKey(LayoutSetPrototypeServiceUtil.class.getName(),
174                                            "search", _searchParameterTypes3);
175    
176                            MethodHandler methodHandler = new MethodHandler(methodKey,
177                                            companyId, active, obc);
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 (java.util.List<com.liferay.portal.model.LayoutSetPrototype>)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 com.liferay.portal.model.LayoutSetPrototype updateLayoutSetPrototype(
206                    HttpPrincipal httpPrincipal, long layoutSetPrototypeId,
207                    java.util.Map<java.util.Locale, java.lang.String> nameMap,
208                    java.lang.String description, boolean active)
209                    throws com.liferay.portal.kernel.exception.PortalException,
210                            com.liferay.portal.kernel.exception.SystemException {
211                    try {
212                            MethodKey methodKey = new MethodKey(LayoutSetPrototypeServiceUtil.class.getName(),
213                                            "updateLayoutSetPrototype",
214                                            _updateLayoutSetPrototypeParameterTypes4);
215    
216                            MethodHandler methodHandler = new MethodHandler(methodKey,
217                                            layoutSetPrototypeId, nameMap, description, active);
218    
219                            Object returnObj = null;
220    
221                            try {
222                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
223                            }
224                            catch (Exception e) {
225                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
226                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
227                                    }
228    
229                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
230                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
231                                    }
232    
233                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
234                            }
235    
236                            return (com.liferay.portal.model.LayoutSetPrototype)returnObj;
237                    }
238                    catch (com.liferay.portal.kernel.exception.SystemException se) {
239                            _log.error(se, se);
240    
241                            throw se;
242                    }
243            }
244    
245            private static Log _log = LogFactoryUtil.getLog(LayoutSetPrototypeServiceHttp.class);
246            private static final Class<?>[] _addLayoutSetPrototypeParameterTypes0 = new Class[] {
247                            java.util.Map.class, java.lang.String.class, boolean.class
248                    };
249            private static final Class<?>[] _deleteLayoutSetPrototypeParameterTypes1 = new Class[] {
250                            long.class
251                    };
252            private static final Class<?>[] _getLayoutSetPrototypeParameterTypes2 = new Class[] {
253                            long.class
254                    };
255            private static final Class<?>[] _searchParameterTypes3 = new Class[] {
256                            long.class, java.lang.Boolean.class,
257                            com.liferay.portal.kernel.util.OrderByComparator.class
258                    };
259            private static final Class<?>[] _updateLayoutSetPrototypeParameterTypes4 = new Class[] {
260                            long.class, java.util.Map.class, java.lang.String.class,
261                            boolean.class
262                    };
263    }