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.portlet.expando.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.http.TunnelUtil;
023    
024    import com.liferay.portlet.expando.service.ExpandoColumnServiceUtil;
025    
026    /**
027     * <p>
028     * This class provides a HTTP utility for the
029     * {@link com.liferay.portlet.expando.service.ExpandoColumnServiceUtil} 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       ExpandoColumnServiceSoap
052     * @see       com.liferay.portal.security.auth.HttpPrincipal
053     * @see       com.liferay.portlet.expando.service.ExpandoColumnServiceUtil
054     * @generated
055     */
056    public class ExpandoColumnServiceHttp {
057            public static com.liferay.portlet.expando.model.ExpandoColumn addColumn(
058                    HttpPrincipal httpPrincipal, long tableId, java.lang.String name,
059                    int type)
060                    throws com.liferay.portal.kernel.exception.PortalException,
061                            com.liferay.portal.kernel.exception.SystemException {
062                    try {
063                            MethodKey methodKey = new MethodKey(ExpandoColumnServiceUtil.class.getName(),
064                                            "addColumn", long.class, java.lang.String.class, int.class);
065    
066                            MethodHandler methodHandler = new MethodHandler(methodKey, tableId,
067                                            name, type);
068    
069                            Object returnObj = null;
070    
071                            try {
072                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
073                            }
074                            catch (Exception e) {
075                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
076                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
077                                    }
078    
079                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
080                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
081                                    }
082    
083                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
084                            }
085    
086                            return (com.liferay.portlet.expando.model.ExpandoColumn)returnObj;
087                    }
088                    catch (com.liferay.portal.kernel.exception.SystemException se) {
089                            _log.error(se, se);
090    
091                            throw se;
092                    }
093            }
094    
095            public static com.liferay.portlet.expando.model.ExpandoColumn addColumn(
096                    HttpPrincipal httpPrincipal, long tableId, java.lang.String name,
097                    int type, java.lang.Object defaultData)
098                    throws com.liferay.portal.kernel.exception.PortalException,
099                            com.liferay.portal.kernel.exception.SystemException {
100                    try {
101                            MethodKey methodKey = new MethodKey(ExpandoColumnServiceUtil.class.getName(),
102                                            "addColumn", long.class, java.lang.String.class, int.class,
103                                            java.lang.Object.class);
104    
105                            MethodHandler methodHandler = new MethodHandler(methodKey, tableId,
106                                            name, type, defaultData);
107    
108                            Object returnObj = null;
109    
110                            try {
111                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
112                            }
113                            catch (Exception e) {
114                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
115                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
116                                    }
117    
118                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
119                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
120                                    }
121    
122                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
123                            }
124    
125                            return (com.liferay.portlet.expando.model.ExpandoColumn)returnObj;
126                    }
127                    catch (com.liferay.portal.kernel.exception.SystemException se) {
128                            _log.error(se, se);
129    
130                            throw se;
131                    }
132            }
133    
134            public static void deleteColumn(HttpPrincipal httpPrincipal, long columnId)
135                    throws com.liferay.portal.kernel.exception.PortalException,
136                            com.liferay.portal.kernel.exception.SystemException {
137                    try {
138                            MethodKey methodKey = new MethodKey(ExpandoColumnServiceUtil.class.getName(),
139                                            "deleteColumn", long.class);
140    
141                            MethodHandler methodHandler = new MethodHandler(methodKey, columnId);
142    
143                            try {
144                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
145                            }
146                            catch (Exception e) {
147                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
148                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
149                                    }
150    
151                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
152                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
153                                    }
154    
155                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
156                            }
157                    }
158                    catch (com.liferay.portal.kernel.exception.SystemException se) {
159                            _log.error(se, se);
160    
161                            throw se;
162                    }
163            }
164    
165            public static com.liferay.portlet.expando.model.ExpandoColumn updateColumn(
166                    HttpPrincipal httpPrincipal, long columnId, java.lang.String name,
167                    int type)
168                    throws com.liferay.portal.kernel.exception.PortalException,
169                            com.liferay.portal.kernel.exception.SystemException {
170                    try {
171                            MethodKey methodKey = new MethodKey(ExpandoColumnServiceUtil.class.getName(),
172                                            "updateColumn", long.class, java.lang.String.class,
173                                            int.class);
174    
175                            MethodHandler methodHandler = new MethodHandler(methodKey,
176                                            columnId, name, type);
177    
178                            Object returnObj = null;
179    
180                            try {
181                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
182                            }
183                            catch (Exception e) {
184                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
185                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
186                                    }
187    
188                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
189                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
190                                    }
191    
192                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
193                            }
194    
195                            return (com.liferay.portlet.expando.model.ExpandoColumn)returnObj;
196                    }
197                    catch (com.liferay.portal.kernel.exception.SystemException se) {
198                            _log.error(se, se);
199    
200                            throw se;
201                    }
202            }
203    
204            public static com.liferay.portlet.expando.model.ExpandoColumn updateColumn(
205                    HttpPrincipal httpPrincipal, long columnId, java.lang.String name,
206                    int type, java.lang.Object defaultData)
207                    throws com.liferay.portal.kernel.exception.PortalException,
208                            com.liferay.portal.kernel.exception.SystemException {
209                    try {
210                            MethodKey methodKey = new MethodKey(ExpandoColumnServiceUtil.class.getName(),
211                                            "updateColumn", long.class, java.lang.String.class,
212                                            int.class, java.lang.Object.class);
213    
214                            MethodHandler methodHandler = new MethodHandler(methodKey,
215                                            columnId, name, type, defaultData);
216    
217                            Object returnObj = null;
218    
219                            try {
220                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
221                            }
222                            catch (Exception e) {
223                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
224                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
225                                    }
226    
227                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
228                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
229                                    }
230    
231                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
232                            }
233    
234                            return (com.liferay.portlet.expando.model.ExpandoColumn)returnObj;
235                    }
236                    catch (com.liferay.portal.kernel.exception.SystemException se) {
237                            _log.error(se, se);
238    
239                            throw se;
240                    }
241            }
242    
243            public static com.liferay.portlet.expando.model.ExpandoColumn updateTypeSettings(
244                    HttpPrincipal httpPrincipal, long columnId,
245                    java.lang.String typeSettings)
246                    throws com.liferay.portal.kernel.exception.PortalException,
247                            com.liferay.portal.kernel.exception.SystemException {
248                    try {
249                            MethodKey methodKey = new MethodKey(ExpandoColumnServiceUtil.class.getName(),
250                                            "updateTypeSettings", long.class, java.lang.String.class);
251    
252                            MethodHandler methodHandler = new MethodHandler(methodKey,
253                                            columnId, typeSettings);
254    
255                            Object returnObj = null;
256    
257                            try {
258                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
259                            }
260                            catch (Exception e) {
261                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
262                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
263                                    }
264    
265                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
266                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
267                                    }
268    
269                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
270                            }
271    
272                            return (com.liferay.portlet.expando.model.ExpandoColumn)returnObj;
273                    }
274                    catch (com.liferay.portal.kernel.exception.SystemException se) {
275                            _log.error(se, se);
276    
277                            throw se;
278                    }
279            }
280    
281            private static Log _log = LogFactoryUtil.getLog(ExpandoColumnServiceHttp.class);
282    }