001    /**
002     * Copyright (c) 2000-2012 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.LayoutSetServiceUtil;
023    
024    /**
025     * <p>
026     * This class provides a HTTP utility for the
027     * {@link com.liferay.portal.service.LayoutSetServiceUtil} 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       LayoutSetServiceSoap
050     * @see       com.liferay.portal.security.auth.HttpPrincipal
051     * @see       com.liferay.portal.service.LayoutSetServiceUtil
052     * @generated
053     */
054    public class LayoutSetServiceHttp {
055            public static void updateLayoutSetPrototypeLinkEnabled(
056                    HttpPrincipal httpPrincipal, long groupId, boolean privateLayout,
057                    boolean layoutSetPrototypeLinkEnabled)
058                    throws com.liferay.portal.kernel.exception.PortalException,
059                            com.liferay.portal.kernel.exception.SystemException {
060                    try {
061                            MethodKey methodKey = new MethodKey(LayoutSetServiceUtil.class.getName(),
062                                            "updateLayoutSetPrototypeLinkEnabled",
063                                            _updateLayoutSetPrototypeLinkEnabledParameterTypes0);
064    
065                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
066                                            privateLayout, layoutSetPrototypeLinkEnabled);
067    
068                            try {
069                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
070                            }
071                            catch (Exception e) {
072                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
073                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
074                                    }
075    
076                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
077                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
078                                    }
079    
080                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
081                            }
082                    }
083                    catch (com.liferay.portal.kernel.exception.SystemException se) {
084                            _log.error(se, se);
085    
086                            throw se;
087                    }
088            }
089    
090            public static void updateLayoutSetPrototypeLinkEnabled(
091                    HttpPrincipal httpPrincipal, long groupId, boolean privateLayout,
092                    boolean layoutSetPrototypeLinkEnabled,
093                    java.lang.String layoutSetPrototypeUuid)
094                    throws com.liferay.portal.kernel.exception.PortalException,
095                            com.liferay.portal.kernel.exception.SystemException {
096                    try {
097                            MethodKey methodKey = new MethodKey(LayoutSetServiceUtil.class.getName(),
098                                            "updateLayoutSetPrototypeLinkEnabled",
099                                            _updateLayoutSetPrototypeLinkEnabledParameterTypes1);
100    
101                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
102                                            privateLayout, layoutSetPrototypeLinkEnabled,
103                                            layoutSetPrototypeUuid);
104    
105                            try {
106                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
107                            }
108                            catch (Exception e) {
109                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
110                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
111                                    }
112    
113                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
114                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
115                                    }
116    
117                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
118                            }
119                    }
120                    catch (com.liferay.portal.kernel.exception.SystemException se) {
121                            _log.error(se, se);
122    
123                            throw se;
124                    }
125            }
126    
127            public static void updateLogo(HttpPrincipal httpPrincipal, long groupId,
128                    boolean privateLayout, boolean logo, java.io.InputStream inputStream)
129                    throws com.liferay.portal.kernel.exception.PortalException,
130                            com.liferay.portal.kernel.exception.SystemException {
131                    try {
132                            MethodKey methodKey = new MethodKey(LayoutSetServiceUtil.class.getName(),
133                                            "updateLogo", _updateLogoParameterTypes2);
134    
135                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
136                                            privateLayout, logo, inputStream);
137    
138                            try {
139                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
140                            }
141                            catch (Exception e) {
142                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
143                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
144                                    }
145    
146                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
147                                            throw (com.liferay.portal.kernel.exception.SystemException)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 void updateLogo(HttpPrincipal httpPrincipal, long groupId,
161                    boolean privateLayout, boolean logo, java.io.InputStream inputStream,
162                    boolean cleanUpStream)
163                    throws com.liferay.portal.kernel.exception.PortalException,
164                            com.liferay.portal.kernel.exception.SystemException {
165                    try {
166                            MethodKey methodKey = new MethodKey(LayoutSetServiceUtil.class.getName(),
167                                            "updateLogo", _updateLogoParameterTypes3);
168    
169                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
170                                            privateLayout, logo, inputStream, cleanUpStream);
171    
172                            try {
173                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
174                            }
175                            catch (Exception e) {
176                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
177                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
178                                    }
179    
180                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
181                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
182                                    }
183    
184                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
185                            }
186                    }
187                    catch (com.liferay.portal.kernel.exception.SystemException se) {
188                            _log.error(se, se);
189    
190                            throw se;
191                    }
192            }
193    
194            public static com.liferay.portal.model.LayoutSet updateLookAndFeel(
195                    HttpPrincipal httpPrincipal, long groupId, boolean privateLayout,
196                    java.lang.String themeId, java.lang.String colorSchemeId,
197                    java.lang.String css, boolean wapTheme)
198                    throws com.liferay.portal.kernel.exception.PortalException,
199                            com.liferay.portal.kernel.exception.SystemException {
200                    try {
201                            MethodKey methodKey = new MethodKey(LayoutSetServiceUtil.class.getName(),
202                                            "updateLookAndFeel", _updateLookAndFeelParameterTypes4);
203    
204                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
205                                            privateLayout, themeId, colorSchemeId, css, wapTheme);
206    
207                            Object returnObj = null;
208    
209                            try {
210                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
211                            }
212                            catch (Exception e) {
213                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
214                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
215                                    }
216    
217                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
218                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
219                                    }
220    
221                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
222                            }
223    
224                            return (com.liferay.portal.model.LayoutSet)returnObj;
225                    }
226                    catch (com.liferay.portal.kernel.exception.SystemException se) {
227                            _log.error(se, se);
228    
229                            throw se;
230                    }
231            }
232    
233            public static com.liferay.portal.model.LayoutSet updateSettings(
234                    HttpPrincipal httpPrincipal, long groupId, boolean privateLayout,
235                    java.lang.String settings)
236                    throws com.liferay.portal.kernel.exception.PortalException,
237                            com.liferay.portal.kernel.exception.SystemException {
238                    try {
239                            MethodKey methodKey = new MethodKey(LayoutSetServiceUtil.class.getName(),
240                                            "updateSettings", _updateSettingsParameterTypes5);
241    
242                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
243                                            privateLayout, settings);
244    
245                            Object returnObj = null;
246    
247                            try {
248                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
249                            }
250                            catch (Exception e) {
251                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
252                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
253                                    }
254    
255                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
256                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
257                                    }
258    
259                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
260                            }
261    
262                            return (com.liferay.portal.model.LayoutSet)returnObj;
263                    }
264                    catch (com.liferay.portal.kernel.exception.SystemException se) {
265                            _log.error(se, se);
266    
267                            throw se;
268                    }
269            }
270    
271            public static com.liferay.portal.model.LayoutSet updateVirtualHost(
272                    HttpPrincipal httpPrincipal, long groupId, boolean privateLayout,
273                    java.lang.String virtualHost)
274                    throws com.liferay.portal.kernel.exception.PortalException,
275                            com.liferay.portal.kernel.exception.SystemException {
276                    try {
277                            MethodKey methodKey = new MethodKey(LayoutSetServiceUtil.class.getName(),
278                                            "updateVirtualHost", _updateVirtualHostParameterTypes6);
279    
280                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
281                                            privateLayout, virtualHost);
282    
283                            Object returnObj = null;
284    
285                            try {
286                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
287                            }
288                            catch (Exception e) {
289                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
290                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
291                                    }
292    
293                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
294                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
295                                    }
296    
297                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
298                            }
299    
300                            return (com.liferay.portal.model.LayoutSet)returnObj;
301                    }
302                    catch (com.liferay.portal.kernel.exception.SystemException se) {
303                            _log.error(se, se);
304    
305                            throw se;
306                    }
307            }
308    
309            private static Log _log = LogFactoryUtil.getLog(LayoutSetServiceHttp.class);
310            private static final Class<?>[] _updateLayoutSetPrototypeLinkEnabledParameterTypes0 =
311                    new Class[] { long.class, boolean.class, boolean.class };
312            private static final Class<?>[] _updateLayoutSetPrototypeLinkEnabledParameterTypes1 =
313                    new Class[] {
314                            long.class, boolean.class, boolean.class, java.lang.String.class
315                    };
316            private static final Class<?>[] _updateLogoParameterTypes2 = new Class[] {
317                            long.class, boolean.class, boolean.class, java.io.InputStream.class
318                    };
319            private static final Class<?>[] _updateLogoParameterTypes3 = new Class[] {
320                            long.class, boolean.class, boolean.class, java.io.InputStream.class,
321                            boolean.class
322                    };
323            private static final Class<?>[] _updateLookAndFeelParameterTypes4 = new Class[] {
324                            long.class, boolean.class, java.lang.String.class,
325                            java.lang.String.class, java.lang.String.class, boolean.class
326                    };
327            private static final Class<?>[] _updateSettingsParameterTypes5 = new Class[] {
328                            long.class, boolean.class, java.lang.String.class
329                    };
330            private static final Class<?>[] _updateVirtualHostParameterTypes6 = new Class[] {
331                            long.class, boolean.class, java.lang.String.class
332                    };
333    }