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                    java.lang.String layoutSetPrototypeUuid)
059                    throws com.liferay.portal.kernel.exception.PortalException,
060                            com.liferay.portal.kernel.exception.SystemException {
061                    try {
062                            MethodKey methodKey = new MethodKey(LayoutSetServiceUtil.class,
063                                            "updateLayoutSetPrototypeLinkEnabled",
064                                            _updateLayoutSetPrototypeLinkEnabledParameterTypes0);
065    
066                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
067                                            privateLayout, layoutSetPrototypeLinkEnabled,
068                                            layoutSetPrototypeUuid);
069    
070                            try {
071                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
072                            }
073                            catch (Exception e) {
074                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
075                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
076                                    }
077    
078                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
079                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
080                                    }
081    
082                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
083                            }
084                    }
085                    catch (com.liferay.portal.kernel.exception.SystemException se) {
086                            _log.error(se, se);
087    
088                            throw se;
089                    }
090            }
091    
092            public static void updateLogo(HttpPrincipal httpPrincipal, long groupId,
093                    boolean privateLayout, boolean logo, byte[] bytes)
094                    throws com.liferay.portal.kernel.exception.PortalException,
095                            com.liferay.portal.kernel.exception.SystemException {
096                    try {
097                            MethodKey methodKey = new MethodKey(LayoutSetServiceUtil.class,
098                                            "updateLogo", _updateLogoParameterTypes1);
099    
100                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
101                                            privateLayout, logo, bytes);
102    
103                            try {
104                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
105                            }
106                            catch (Exception e) {
107                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
108                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
109                                    }
110    
111                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
112                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
113                                    }
114    
115                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
116                            }
117                    }
118                    catch (com.liferay.portal.kernel.exception.SystemException se) {
119                            _log.error(se, se);
120    
121                            throw se;
122                    }
123            }
124    
125            public static void updateLogo(HttpPrincipal httpPrincipal, long groupId,
126                    boolean privateLayout, boolean logo, java.io.File file)
127                    throws com.liferay.portal.kernel.exception.PortalException,
128                            com.liferay.portal.kernel.exception.SystemException {
129                    try {
130                            MethodKey methodKey = new MethodKey(LayoutSetServiceUtil.class,
131                                            "updateLogo", _updateLogoParameterTypes2);
132    
133                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
134                                            privateLayout, logo, file);
135    
136                            try {
137                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
138                            }
139                            catch (Exception e) {
140                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
141                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
142                                    }
143    
144                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
145                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
146                                    }
147    
148                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
149                            }
150                    }
151                    catch (com.liferay.portal.kernel.exception.SystemException se) {
152                            _log.error(se, se);
153    
154                            throw se;
155                    }
156            }
157    
158            public static void updateLogo(HttpPrincipal httpPrincipal, long groupId,
159                    boolean privateLayout, boolean logo, java.io.InputStream inputStream)
160                    throws com.liferay.portal.kernel.exception.PortalException,
161                            com.liferay.portal.kernel.exception.SystemException {
162                    try {
163                            MethodKey methodKey = new MethodKey(LayoutSetServiceUtil.class,
164                                            "updateLogo", _updateLogoParameterTypes3);
165    
166                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
167                                            privateLayout, logo, inputStream);
168    
169                            try {
170                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
171                            }
172                            catch (Exception e) {
173                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
174                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
175                                    }
176    
177                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
178                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
179                                    }
180    
181                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
182                            }
183                    }
184                    catch (com.liferay.portal.kernel.exception.SystemException se) {
185                            _log.error(se, se);
186    
187                            throw se;
188                    }
189            }
190    
191            public static void updateLogo(HttpPrincipal httpPrincipal, long groupId,
192                    boolean privateLayout, boolean logo, java.io.InputStream inputStream,
193                    boolean cleanUpStream)
194                    throws com.liferay.portal.kernel.exception.PortalException,
195                            com.liferay.portal.kernel.exception.SystemException {
196                    try {
197                            MethodKey methodKey = new MethodKey(LayoutSetServiceUtil.class,
198                                            "updateLogo", _updateLogoParameterTypes4);
199    
200                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
201                                            privateLayout, logo, inputStream, cleanUpStream);
202    
203                            try {
204                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
205                            }
206                            catch (Exception e) {
207                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
208                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
209                                    }
210    
211                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
212                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
213                                    }
214    
215                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
216                            }
217                    }
218                    catch (com.liferay.portal.kernel.exception.SystemException se) {
219                            _log.error(se, se);
220    
221                            throw se;
222                    }
223            }
224    
225            public static com.liferay.portal.model.LayoutSet updateLookAndFeel(
226                    HttpPrincipal httpPrincipal, long groupId, boolean privateLayout,
227                    java.lang.String themeId, java.lang.String colorSchemeId,
228                    java.lang.String css, boolean wapTheme)
229                    throws com.liferay.portal.kernel.exception.PortalException,
230                            com.liferay.portal.kernel.exception.SystemException {
231                    try {
232                            MethodKey methodKey = new MethodKey(LayoutSetServiceUtil.class,
233                                            "updateLookAndFeel", _updateLookAndFeelParameterTypes5);
234    
235                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
236                                            privateLayout, themeId, colorSchemeId, css, wapTheme);
237    
238                            Object returnObj = null;
239    
240                            try {
241                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
242                            }
243                            catch (Exception e) {
244                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
245                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
246                                    }
247    
248                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
249                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
250                                    }
251    
252                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
253                            }
254    
255                            return (com.liferay.portal.model.LayoutSet)returnObj;
256                    }
257                    catch (com.liferay.portal.kernel.exception.SystemException se) {
258                            _log.error(se, se);
259    
260                            throw se;
261                    }
262            }
263    
264            public static com.liferay.portal.model.LayoutSet updateSettings(
265                    HttpPrincipal httpPrincipal, long groupId, boolean privateLayout,
266                    java.lang.String settings)
267                    throws com.liferay.portal.kernel.exception.PortalException,
268                            com.liferay.portal.kernel.exception.SystemException {
269                    try {
270                            MethodKey methodKey = new MethodKey(LayoutSetServiceUtil.class,
271                                            "updateSettings", _updateSettingsParameterTypes6);
272    
273                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
274                                            privateLayout, settings);
275    
276                            Object returnObj = null;
277    
278                            try {
279                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
280                            }
281                            catch (Exception e) {
282                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
283                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
284                                    }
285    
286                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
287                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
288                                    }
289    
290                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
291                            }
292    
293                            return (com.liferay.portal.model.LayoutSet)returnObj;
294                    }
295                    catch (com.liferay.portal.kernel.exception.SystemException se) {
296                            _log.error(se, se);
297    
298                            throw se;
299                    }
300            }
301    
302            public static com.liferay.portal.model.LayoutSet updateVirtualHost(
303                    HttpPrincipal httpPrincipal, long groupId, boolean privateLayout,
304                    java.lang.String virtualHost)
305                    throws com.liferay.portal.kernel.exception.PortalException,
306                            com.liferay.portal.kernel.exception.SystemException {
307                    try {
308                            MethodKey methodKey = new MethodKey(LayoutSetServiceUtil.class,
309                                            "updateVirtualHost", _updateVirtualHostParameterTypes7);
310    
311                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
312                                            privateLayout, virtualHost);
313    
314                            Object returnObj = null;
315    
316                            try {
317                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
318                            }
319                            catch (Exception e) {
320                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
321                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
322                                    }
323    
324                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
325                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
326                                    }
327    
328                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
329                            }
330    
331                            return (com.liferay.portal.model.LayoutSet)returnObj;
332                    }
333                    catch (com.liferay.portal.kernel.exception.SystemException se) {
334                            _log.error(se, se);
335    
336                            throw se;
337                    }
338            }
339    
340            private static Log _log = LogFactoryUtil.getLog(LayoutSetServiceHttp.class);
341            private static final Class<?>[] _updateLayoutSetPrototypeLinkEnabledParameterTypes0 =
342                    new Class[] {
343                            long.class, boolean.class, boolean.class, java.lang.String.class
344                    };
345            private static final Class<?>[] _updateLogoParameterTypes1 = new Class[] {
346                            long.class, boolean.class, boolean.class, byte[].class
347                    };
348            private static final Class<?>[] _updateLogoParameterTypes2 = new Class[] {
349                            long.class, boolean.class, boolean.class, java.io.File.class
350                    };
351            private static final Class<?>[] _updateLogoParameterTypes3 = new Class[] {
352                            long.class, boolean.class, boolean.class, java.io.InputStream.class
353                    };
354            private static final Class<?>[] _updateLogoParameterTypes4 = new Class[] {
355                            long.class, boolean.class, boolean.class, java.io.InputStream.class,
356                            boolean.class
357                    };
358            private static final Class<?>[] _updateLookAndFeelParameterTypes5 = new Class[] {
359                            long.class, boolean.class, java.lang.String.class,
360                            java.lang.String.class, java.lang.String.class, boolean.class
361                    };
362            private static final Class<?>[] _updateSettingsParameterTypes6 = new Class[] {
363                            long.class, boolean.class, java.lang.String.class
364                    };
365            private static final Class<?>[] _updateVirtualHostParameterTypes7 = new Class[] {
366                            long.class, boolean.class, java.lang.String.class
367                    };
368    }