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.LayoutRevisionServiceUtil;
023    
024    /**
025     * Provides the HTTP utility for the
026     * {@link com.liferay.portal.service.LayoutRevisionServiceUtil} 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 LayoutRevisionServiceSoap
048     * @see com.liferay.portal.security.auth.HttpPrincipal
049     * @see com.liferay.portal.service.LayoutRevisionServiceUtil
050     * @generated
051     */
052    public class LayoutRevisionServiceHttp {
053            public static com.liferay.portal.model.LayoutRevision addLayoutRevision(
054                    HttpPrincipal httpPrincipal, long userId, long layoutSetBranchId,
055                    long layoutBranchId, long parentLayoutRevisionId, boolean head,
056                    long plid, long portletPreferencesPlid, boolean privateLayout,
057                    java.lang.String name, java.lang.String title,
058                    java.lang.String description, java.lang.String keywords,
059                    java.lang.String robots, java.lang.String typeSettings,
060                    boolean iconImage, long iconImageId, java.lang.String themeId,
061                    java.lang.String colorSchemeId, java.lang.String wapThemeId,
062                    java.lang.String wapColorSchemeId, java.lang.String css,
063                    com.liferay.portal.service.ServiceContext serviceContext)
064                    throws com.liferay.portal.kernel.exception.PortalException,
065                            com.liferay.portal.kernel.exception.SystemException {
066                    try {
067                            MethodKey methodKey = new MethodKey(LayoutRevisionServiceUtil.class,
068                                            "addLayoutRevision", _addLayoutRevisionParameterTypes0);
069    
070                            MethodHandler methodHandler = new MethodHandler(methodKey, userId,
071                                            layoutSetBranchId, layoutBranchId, parentLayoutRevisionId,
072                                            head, plid, portletPreferencesPlid, privateLayout, name,
073                                            title, description, keywords, robots, typeSettings,
074                                            iconImage, iconImageId, themeId, colorSchemeId, wapThemeId,
075                                            wapColorSchemeId, css, serviceContext);
076    
077                            Object returnObj = null;
078    
079                            try {
080                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
081                            }
082                            catch (Exception e) {
083                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
084                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
085                                    }
086    
087                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
088                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
089                                    }
090    
091                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
092                            }
093    
094                            return (com.liferay.portal.model.LayoutRevision)returnObj;
095                    }
096                    catch (com.liferay.portal.kernel.exception.SystemException se) {
097                            _log.error(se, se);
098    
099                            throw se;
100                    }
101            }
102    
103            private static Log _log = LogFactoryUtil.getLog(LayoutRevisionServiceHttp.class);
104            private static final Class<?>[] _addLayoutRevisionParameterTypes0 = new Class[] {
105                            long.class, long.class, long.class, long.class, boolean.class,
106                            long.class, long.class, boolean.class, java.lang.String.class,
107                            java.lang.String.class, java.lang.String.class,
108                            java.lang.String.class, java.lang.String.class,
109                            java.lang.String.class, boolean.class, long.class,
110                            java.lang.String.class, java.lang.String.class,
111                            java.lang.String.class, java.lang.String.class,
112                            java.lang.String.class,
113                            com.liferay.portal.service.ServiceContext.class
114                    };
115    }