001    /**
002     * Copyright (c) 2000-2013 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     * Provides the HTTP utility for the
026     * {@link com.liferay.portal.service.LayoutSetServiceUtil} service utility. The
027     * static methods of this class calls the same methods of the service utility.
028     * However, the signatures are different because it requires an additional
029     * {@link com.liferay.portal.security.auth.HttpPrincipal} parameter.
030     *
031     * <p>
032     * The benefits of using the HTTP utility is that it is fast and allows for
033     * tunneling without the cost of serializing to text. The drawback is that it
034     * only works with Java.
035     * </p>
036     *
037     * <p>
038     * Set the property <b>tunnel.servlet.hosts.allowed</b> in portal.properties to
039     * configure security.
040     * </p>
041     *
042     * <p>
043     * The HTTP utility is only generated for remote services.
044     * </p>
045     *
046     * @author Brian Wing Shun Chan
047     * @see LayoutSetServiceSoap
048     * @see com.liferay.portal.security.auth.HttpPrincipal
049     * @see com.liferay.portal.service.LayoutSetServiceUtil
050     * @generated
051     */
052    public class LayoutSetServiceHttp {
053            public static void updateLayoutSetPrototypeLinkEnabled(
054                    HttpPrincipal httpPrincipal, long groupId, boolean privateLayout,
055                    boolean layoutSetPrototypeLinkEnabled,
056                    java.lang.String layoutSetPrototypeUuid)
057                    throws com.liferay.portal.kernel.exception.PortalException,
058                            com.liferay.portal.kernel.exception.SystemException {
059                    try {
060                            MethodKey methodKey = new MethodKey(LayoutSetServiceUtil.class,
061                                            "updateLayoutSetPrototypeLinkEnabled",
062                                            _updateLayoutSetPrototypeLinkEnabledParameterTypes0);
063    
064                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
065                                            privateLayout, layoutSetPrototypeLinkEnabled,
066                                            layoutSetPrototypeUuid);
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, byte[] bytes)
092                    throws com.liferay.portal.kernel.exception.PortalException,
093                            com.liferay.portal.kernel.exception.SystemException {
094                    try {
095                            MethodKey methodKey = new MethodKey(LayoutSetServiceUtil.class,
096                                            "updateLogo", _updateLogoParameterTypes1);
097    
098                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
099                                            privateLayout, logo, bytes);
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.File file)
125                    throws com.liferay.portal.kernel.exception.PortalException,
126                            com.liferay.portal.kernel.exception.SystemException {
127                    try {
128                            MethodKey methodKey = new MethodKey(LayoutSetServiceUtil.class,
129                                            "updateLogo", _updateLogoParameterTypes2);
130    
131                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
132                                            privateLayout, logo, file);
133    
134                            try {
135                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
136                            }
137                            catch (Exception e) {
138                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
139                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
140                                    }
141    
142                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
143                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
144                                    }
145    
146                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
147                            }
148                    }
149                    catch (com.liferay.portal.kernel.exception.SystemException se) {
150                            _log.error(se, se);
151    
152                            throw se;
153                    }
154            }
155    
156            public static void updateLogo(HttpPrincipal httpPrincipal, long groupId,
157                    boolean privateLayout, boolean logo, java.io.InputStream inputStream)
158                    throws com.liferay.portal.kernel.exception.PortalException,
159                            com.liferay.portal.kernel.exception.SystemException {
160                    try {
161                            MethodKey methodKey = new MethodKey(LayoutSetServiceUtil.class,
162                                            "updateLogo", _updateLogoParameterTypes3);
163    
164                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
165                                            privateLayout, logo, inputStream);
166    
167                            try {
168                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
169                            }
170                            catch (Exception e) {
171                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
172                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
173                                    }
174    
175                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
176                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
177                                    }
178    
179                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
180                            }
181                    }
182                    catch (com.liferay.portal.kernel.exception.SystemException se) {
183                            _log.error(se, se);
184    
185                            throw se;
186                    }
187            }
188    
189            public static void updateLogo(HttpPrincipal httpPrincipal, long groupId,
190                    boolean privateLayout, boolean logo, java.io.InputStream inputStream,
191                    boolean cleanUpStream)
192                    throws com.liferay.portal.kernel.exception.PortalException,
193                            com.liferay.portal.kernel.exception.SystemException {
194                    try {
195                            MethodKey methodKey = new MethodKey(LayoutSetServiceUtil.class,
196                                            "updateLogo", _updateLogoParameterTypes4);
197    
198                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
199                                            privateLayout, logo, inputStream, cleanUpStream);
200    
201                            try {
202                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
203                            }
204                            catch (Exception e) {
205                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
206                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
207                                    }
208    
209                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
210                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
211                                    }
212    
213                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
214                            }
215                    }
216                    catch (com.liferay.portal.kernel.exception.SystemException se) {
217                            _log.error(se, se);
218    
219                            throw se;
220                    }
221            }
222    
223            public static com.liferay.portal.model.LayoutSet updateLookAndFeel(
224                    HttpPrincipal httpPrincipal, long groupId, boolean privateLayout,
225                    java.lang.String themeId, java.lang.String colorSchemeId,
226                    java.lang.String css, boolean wapTheme)
227                    throws com.liferay.portal.kernel.exception.PortalException,
228                            com.liferay.portal.kernel.exception.SystemException {
229                    try {
230                            MethodKey methodKey = new MethodKey(LayoutSetServiceUtil.class,
231                                            "updateLookAndFeel", _updateLookAndFeelParameterTypes5);
232    
233                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
234                                            privateLayout, themeId, colorSchemeId, css, wapTheme);
235    
236                            Object returnObj = null;
237    
238                            try {
239                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
240                            }
241                            catch (Exception e) {
242                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
243                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
244                                    }
245    
246                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
247                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
248                                    }
249    
250                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
251                            }
252    
253                            return (com.liferay.portal.model.LayoutSet)returnObj;
254                    }
255                    catch (com.liferay.portal.kernel.exception.SystemException se) {
256                            _log.error(se, se);
257    
258                            throw se;
259                    }
260            }
261    
262            public static com.liferay.portal.model.LayoutSet updateSettings(
263                    HttpPrincipal httpPrincipal, long groupId, boolean privateLayout,
264                    java.lang.String settings)
265                    throws com.liferay.portal.kernel.exception.PortalException,
266                            com.liferay.portal.kernel.exception.SystemException {
267                    try {
268                            MethodKey methodKey = new MethodKey(LayoutSetServiceUtil.class,
269                                            "updateSettings", _updateSettingsParameterTypes6);
270    
271                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
272                                            privateLayout, settings);
273    
274                            Object returnObj = null;
275    
276                            try {
277                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
278                            }
279                            catch (Exception e) {
280                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
281                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
282                                    }
283    
284                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
285                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
286                                    }
287    
288                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
289                            }
290    
291                            return (com.liferay.portal.model.LayoutSet)returnObj;
292                    }
293                    catch (com.liferay.portal.kernel.exception.SystemException se) {
294                            _log.error(se, se);
295    
296                            throw se;
297                    }
298            }
299    
300            public static com.liferay.portal.model.LayoutSet updateVirtualHost(
301                    HttpPrincipal httpPrincipal, long groupId, boolean privateLayout,
302                    java.lang.String virtualHost)
303                    throws com.liferay.portal.kernel.exception.PortalException,
304                            com.liferay.portal.kernel.exception.SystemException {
305                    try {
306                            MethodKey methodKey = new MethodKey(LayoutSetServiceUtil.class,
307                                            "updateVirtualHost", _updateVirtualHostParameterTypes7);
308    
309                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
310                                            privateLayout, virtualHost);
311    
312                            Object returnObj = null;
313    
314                            try {
315                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
316                            }
317                            catch (Exception e) {
318                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
319                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
320                                    }
321    
322                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
323                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
324                                    }
325    
326                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
327                            }
328    
329                            return (com.liferay.portal.model.LayoutSet)returnObj;
330                    }
331                    catch (com.liferay.portal.kernel.exception.SystemException se) {
332                            _log.error(se, se);
333    
334                            throw se;
335                    }
336            }
337    
338            private static Log _log = LogFactoryUtil.getLog(LayoutSetServiceHttp.class);
339            private static final Class<?>[] _updateLayoutSetPrototypeLinkEnabledParameterTypes0 =
340                    new Class[] {
341                            long.class, boolean.class, boolean.class, java.lang.String.class
342                    };
343            private static final Class<?>[] _updateLogoParameterTypes1 = new Class[] {
344                            long.class, boolean.class, boolean.class, byte[].class
345                    };
346            private static final Class<?>[] _updateLogoParameterTypes2 = new Class[] {
347                            long.class, boolean.class, boolean.class, java.io.File.class
348                    };
349            private static final Class<?>[] _updateLogoParameterTypes3 = new Class[] {
350                            long.class, boolean.class, boolean.class, java.io.InputStream.class
351                    };
352            private static final Class<?>[] _updateLogoParameterTypes4 = new Class[] {
353                            long.class, boolean.class, boolean.class, java.io.InputStream.class,
354                            boolean.class
355                    };
356            private static final Class<?>[] _updateLookAndFeelParameterTypes5 = new Class[] {
357                            long.class, boolean.class, java.lang.String.class,
358                            java.lang.String.class, java.lang.String.class, boolean.class
359                    };
360            private static final Class<?>[] _updateSettingsParameterTypes6 = new Class[] {
361                            long.class, boolean.class, java.lang.String.class
362                    };
363            private static final Class<?>[] _updateVirtualHostParameterTypes7 = new Class[] {
364                            long.class, boolean.class, java.lang.String.class
365                    };
366    }