001    /**
002     * Copyright (c) 2000-2011 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 updateLogo(HttpPrincipal httpPrincipal, long groupId,
091                    boolean privateLayout, boolean logo, java.io.InputStream inputStream)
092                    throws com.liferay.portal.kernel.exception.PortalException,
093                            com.liferay.portal.kernel.exception.SystemException {
094                    try {
095                            MethodKey methodKey = new MethodKey(LayoutSetServiceUtil.class.getName(),
096                                            "updateLogo", _updateLogoParameterTypes1);
097    
098                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
099                                            privateLayout, logo, inputStream);
100    
101                            try {
102                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
103                            }
104                            catch (Exception e) {
105                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
106                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
107                                    }
108    
109                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
110                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
111                                    }
112    
113                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
114                            }
115                    }
116                    catch (com.liferay.portal.kernel.exception.SystemException se) {
117                            _log.error(se, se);
118    
119                            throw se;
120                    }
121            }
122    
123            public static void updateLogo(HttpPrincipal httpPrincipal, long groupId,
124                    boolean privateLayout, boolean logo, java.io.InputStream inputStream,
125                    boolean cleanUpStream)
126                    throws com.liferay.portal.kernel.exception.PortalException,
127                            com.liferay.portal.kernel.exception.SystemException {
128                    try {
129                            MethodKey methodKey = new MethodKey(LayoutSetServiceUtil.class.getName(),
130                                            "updateLogo", _updateLogoParameterTypes2);
131    
132                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
133                                            privateLayout, logo, inputStream, cleanUpStream);
134    
135                            try {
136                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
137                            }
138                            catch (Exception e) {
139                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
140                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
141                                    }
142    
143                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
144                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
145                                    }
146    
147                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
148                            }
149                    }
150                    catch (com.liferay.portal.kernel.exception.SystemException se) {
151                            _log.error(se, se);
152    
153                            throw se;
154                    }
155            }
156    
157            public static com.liferay.portal.model.LayoutSet updateLookAndFeel(
158                    HttpPrincipal httpPrincipal, long groupId, boolean privateLayout,
159                    java.lang.String themeId, java.lang.String colorSchemeId,
160                    java.lang.String css, boolean wapTheme)
161                    throws com.liferay.portal.kernel.exception.PortalException,
162                            com.liferay.portal.kernel.exception.SystemException {
163                    try {
164                            MethodKey methodKey = new MethodKey(LayoutSetServiceUtil.class.getName(),
165                                            "updateLookAndFeel", _updateLookAndFeelParameterTypes3);
166    
167                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
168                                            privateLayout, themeId, colorSchemeId, css, wapTheme);
169    
170                            Object returnObj = null;
171    
172                            try {
173                                    returnObj = 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                            return (com.liferay.portal.model.LayoutSet)returnObj;
188                    }
189                    catch (com.liferay.portal.kernel.exception.SystemException se) {
190                            _log.error(se, se);
191    
192                            throw se;
193                    }
194            }
195    
196            public static com.liferay.portal.model.LayoutSet updateSettings(
197                    HttpPrincipal httpPrincipal, long groupId, boolean privateLayout,
198                    java.lang.String settings)
199                    throws com.liferay.portal.kernel.exception.PortalException,
200                            com.liferay.portal.kernel.exception.SystemException {
201                    try {
202                            MethodKey methodKey = new MethodKey(LayoutSetServiceUtil.class.getName(),
203                                            "updateSettings", _updateSettingsParameterTypes4);
204    
205                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
206                                            privateLayout, settings);
207    
208                            Object returnObj = null;
209    
210                            try {
211                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
212                            }
213                            catch (Exception e) {
214                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
215                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
216                                    }
217    
218                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
219                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
220                                    }
221    
222                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
223                            }
224    
225                            return (com.liferay.portal.model.LayoutSet)returnObj;
226                    }
227                    catch (com.liferay.portal.kernel.exception.SystemException se) {
228                            _log.error(se, se);
229    
230                            throw se;
231                    }
232            }
233    
234            public static com.liferay.portal.model.LayoutSet updateVirtualHost(
235                    HttpPrincipal httpPrincipal, long groupId, boolean privateLayout,
236                    java.lang.String virtualHost)
237                    throws com.liferay.portal.kernel.exception.PortalException,
238                            com.liferay.portal.kernel.exception.SystemException {
239                    try {
240                            MethodKey methodKey = new MethodKey(LayoutSetServiceUtil.class.getName(),
241                                            "updateVirtualHost", _updateVirtualHostParameterTypes5);
242    
243                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
244                                            privateLayout, virtualHost);
245    
246                            Object returnObj = null;
247    
248                            try {
249                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
250                            }
251                            catch (Exception e) {
252                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
253                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
254                                    }
255    
256                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
257                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
258                                    }
259    
260                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
261                            }
262    
263                            return (com.liferay.portal.model.LayoutSet)returnObj;
264                    }
265                    catch (com.liferay.portal.kernel.exception.SystemException se) {
266                            _log.error(se, se);
267    
268                            throw se;
269                    }
270            }
271    
272            private static Log _log = LogFactoryUtil.getLog(LayoutSetServiceHttp.class);
273            private static final Class<?>[] _updateLayoutSetPrototypeLinkEnabledParameterTypes0 =
274                    new Class[] { long.class, boolean.class, boolean.class };
275            private static final Class<?>[] _updateLogoParameterTypes1 = new Class[] {
276                            long.class, boolean.class, boolean.class, java.io.InputStream.class
277                    };
278            private static final Class<?>[] _updateLogoParameterTypes2 = new Class[] {
279                            long.class, boolean.class, boolean.class, java.io.InputStream.class,
280                            boolean.class
281                    };
282            private static final Class<?>[] _updateLookAndFeelParameterTypes3 = new Class[] {
283                            long.class, boolean.class, java.lang.String.class,
284                            java.lang.String.class, java.lang.String.class, boolean.class
285                    };
286            private static final Class<?>[] _updateSettingsParameterTypes4 = new Class[] {
287                            long.class, boolean.class, java.lang.String.class
288                    };
289            private static final Class<?>[] _updateVirtualHostParameterTypes5 = new Class[] {
290                            long.class, boolean.class, java.lang.String.class
291                    };
292    }