001    /**
002     * Copyright (c) 2000-2010 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.BooleanWrapper;
020    import com.liferay.portal.kernel.util.LongWrapper;
021    import com.liferay.portal.kernel.util.MethodWrapper;
022    import com.liferay.portal.kernel.util.NullWrapper;
023    import com.liferay.portal.security.auth.HttpPrincipal;
024    import com.liferay.portal.service.LayoutSetServiceUtil;
025    
026    /**
027     * <p>
028     * This class provides a HTTP utility for the
029     * {@link com.liferay.portal.service.LayoutSetServiceUtil} service utility. The
030     * static methods of this class calls the same methods of the service utility.
031     * However, the signatures are different because it requires an additional
032     * {@link com.liferay.portal.security.auth.HttpPrincipal} parameter.
033     * </p>
034     *
035     * <p>
036     * The benefits of using the HTTP utility is that it is fast and allows for
037     * tunneling without the cost of serializing to text. The drawback is that it
038     * only works with Java.
039     * </p>
040     *
041     * <p>
042     * Set the property <b>tunnel.servlet.hosts.allowed</b> in portal.properties to
043     * configure security.
044     * </p>
045     *
046     * <p>
047     * The HTTP utility is only generated for remote services.
048     * </p>
049     *
050     * @author    Brian Wing Shun Chan
051     * @see       LayoutSetServiceSoap
052     * @see       com.liferay.portal.security.auth.HttpPrincipal
053     * @see       com.liferay.portal.service.LayoutSetServiceUtil
054     * @generated
055     */
056    public class LayoutSetServiceHttp {
057            public static void updateLogo(HttpPrincipal httpPrincipal, long groupId,
058                    boolean privateLayout, boolean logo, java.io.File file)
059                    throws com.liferay.portal.kernel.exception.PortalException,
060                            com.liferay.portal.kernel.exception.SystemException {
061                    try {
062                            Object paramObj0 = new LongWrapper(groupId);
063    
064                            Object paramObj1 = new BooleanWrapper(privateLayout);
065    
066                            Object paramObj2 = new BooleanWrapper(logo);
067    
068                            Object paramObj3 = file;
069    
070                            if (file == null) {
071                                    paramObj3 = new NullWrapper("java.io.File");
072                            }
073    
074                            MethodWrapper methodWrapper = new MethodWrapper(LayoutSetServiceUtil.class.getName(),
075                                            "updateLogo",
076                                            new Object[] { paramObj0, paramObj1, paramObj2, paramObj3 });
077    
078                            try {
079                                    TunnelUtil.invoke(httpPrincipal, methodWrapper);
080                            }
081                            catch (Exception e) {
082                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
083                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
084                                    }
085    
086                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
087                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
088                                    }
089    
090                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
091                            }
092                    }
093                    catch (com.liferay.portal.kernel.exception.SystemException se) {
094                            _log.error(se, se);
095    
096                            throw se;
097                    }
098            }
099    
100            public static com.liferay.portal.model.LayoutSet updateLookAndFeel(
101                    HttpPrincipal httpPrincipal, long groupId, boolean privateLayout,
102                    java.lang.String themeId, java.lang.String colorSchemeId,
103                    java.lang.String css, boolean wapTheme)
104                    throws com.liferay.portal.kernel.exception.PortalException,
105                            com.liferay.portal.kernel.exception.SystemException {
106                    try {
107                            Object paramObj0 = new LongWrapper(groupId);
108    
109                            Object paramObj1 = new BooleanWrapper(privateLayout);
110    
111                            Object paramObj2 = themeId;
112    
113                            if (themeId == null) {
114                                    paramObj2 = new NullWrapper("java.lang.String");
115                            }
116    
117                            Object paramObj3 = colorSchemeId;
118    
119                            if (colorSchemeId == null) {
120                                    paramObj3 = new NullWrapper("java.lang.String");
121                            }
122    
123                            Object paramObj4 = css;
124    
125                            if (css == null) {
126                                    paramObj4 = new NullWrapper("java.lang.String");
127                            }
128    
129                            Object paramObj5 = new BooleanWrapper(wapTheme);
130    
131                            MethodWrapper methodWrapper = new MethodWrapper(LayoutSetServiceUtil.class.getName(),
132                                            "updateLookAndFeel",
133                                            new Object[] {
134                                                    paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
135                                                    paramObj5
136                                            });
137    
138                            Object returnObj = null;
139    
140                            try {
141                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
142                            }
143                            catch (Exception e) {
144                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
145                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
146                                    }
147    
148                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
149                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
150                                    }
151    
152                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
153                            }
154    
155                            return (com.liferay.portal.model.LayoutSet)returnObj;
156                    }
157                    catch (com.liferay.portal.kernel.exception.SystemException se) {
158                            _log.error(se, se);
159    
160                            throw se;
161                    }
162            }
163    
164            public static com.liferay.portal.model.LayoutSet updateSettings(
165                    HttpPrincipal httpPrincipal, long groupId, boolean privateLayout,
166                    java.lang.String settings)
167                    throws com.liferay.portal.kernel.exception.PortalException,
168                            com.liferay.portal.kernel.exception.SystemException {
169                    try {
170                            Object paramObj0 = new LongWrapper(groupId);
171    
172                            Object paramObj1 = new BooleanWrapper(privateLayout);
173    
174                            Object paramObj2 = settings;
175    
176                            if (settings == null) {
177                                    paramObj2 = new NullWrapper("java.lang.String");
178                            }
179    
180                            MethodWrapper methodWrapper = new MethodWrapper(LayoutSetServiceUtil.class.getName(),
181                                            "updateSettings",
182                                            new Object[] { paramObj0, paramObj1, paramObj2 });
183    
184                            Object returnObj = null;
185    
186                            try {
187                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
188                            }
189                            catch (Exception e) {
190                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
191                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
192                                    }
193    
194                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
195                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
196                                    }
197    
198                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
199                            }
200    
201                            return (com.liferay.portal.model.LayoutSet)returnObj;
202                    }
203                    catch (com.liferay.portal.kernel.exception.SystemException se) {
204                            _log.error(se, se);
205    
206                            throw se;
207                    }
208            }
209    
210            public static com.liferay.portal.model.LayoutSet updateVirtualHost(
211                    HttpPrincipal httpPrincipal, long groupId, boolean privateLayout,
212                    java.lang.String virtualHost)
213                    throws com.liferay.portal.kernel.exception.PortalException,
214                            com.liferay.portal.kernel.exception.SystemException {
215                    try {
216                            Object paramObj0 = new LongWrapper(groupId);
217    
218                            Object paramObj1 = new BooleanWrapper(privateLayout);
219    
220                            Object paramObj2 = virtualHost;
221    
222                            if (virtualHost == null) {
223                                    paramObj2 = new NullWrapper("java.lang.String");
224                            }
225    
226                            MethodWrapper methodWrapper = new MethodWrapper(LayoutSetServiceUtil.class.getName(),
227                                            "updateVirtualHost",
228                                            new Object[] { paramObj0, paramObj1, paramObj2 });
229    
230                            Object returnObj = null;
231    
232                            try {
233                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
234                            }
235                            catch (Exception e) {
236                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
237                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
238                                    }
239    
240                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
241                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
242                                    }
243    
244                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
245                            }
246    
247                            return (com.liferay.portal.model.LayoutSet)returnObj;
248                    }
249                    catch (com.liferay.portal.kernel.exception.SystemException se) {
250                            _log.error(se, se);
251    
252                            throw se;
253                    }
254            }
255    
256            private static Log _log = LogFactoryUtil.getLog(LayoutSetServiceHttp.class);
257    }