001    /**
002     * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portlet.journal.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.journal.service.JournalStructureServiceUtil;
025    
026    /**
027     * <p>
028     * This class provides a HTTP utility for the
029     * {@link com.liferay.portlet.journal.service.JournalStructureServiceUtil} 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       JournalStructureServiceSoap
052     * @see       com.liferay.portal.security.auth.HttpPrincipal
053     * @see       com.liferay.portlet.journal.service.JournalStructureServiceUtil
054     * @generated
055     */
056    public class JournalStructureServiceHttp {
057            public static com.liferay.portlet.journal.model.JournalStructure addStructure(
058                    HttpPrincipal httpPrincipal, long groupId,
059                    java.lang.String structureId, boolean autoStructureId,
060                    java.lang.String parentStructureId, java.lang.String name,
061                    java.lang.String description, java.lang.String xsd,
062                    com.liferay.portal.service.ServiceContext serviceContext)
063                    throws com.liferay.portal.kernel.exception.PortalException,
064                            com.liferay.portal.kernel.exception.SystemException {
065                    try {
066                            MethodKey methodKey = new MethodKey(JournalStructureServiceUtil.class.getName(),
067                                            "addStructure", _addStructureParameterTypes0);
068    
069                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
070                                            structureId, autoStructureId, parentStructureId, name,
071                                            description, xsd, serviceContext);
072    
073                            Object returnObj = null;
074    
075                            try {
076                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
077                            }
078                            catch (Exception e) {
079                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
080                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
081                                    }
082    
083                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
084                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
085                                    }
086    
087                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
088                            }
089    
090                            return (com.liferay.portlet.journal.model.JournalStructure)returnObj;
091                    }
092                    catch (com.liferay.portal.kernel.exception.SystemException se) {
093                            _log.error(se, se);
094    
095                            throw se;
096                    }
097            }
098    
099            public static com.liferay.portlet.journal.model.JournalStructure copyStructure(
100                    HttpPrincipal httpPrincipal, long groupId,
101                    java.lang.String oldStructureId, java.lang.String newStructureId,
102                    boolean autoStructureId)
103                    throws com.liferay.portal.kernel.exception.PortalException,
104                            com.liferay.portal.kernel.exception.SystemException {
105                    try {
106                            MethodKey methodKey = new MethodKey(JournalStructureServiceUtil.class.getName(),
107                                            "copyStructure", _copyStructureParameterTypes1);
108    
109                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
110                                            oldStructureId, newStructureId, autoStructureId);
111    
112                            Object returnObj = null;
113    
114                            try {
115                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
116                            }
117                            catch (Exception e) {
118                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
119                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
120                                    }
121    
122                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
123                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
124                                    }
125    
126                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
127                            }
128    
129                            return (com.liferay.portlet.journal.model.JournalStructure)returnObj;
130                    }
131                    catch (com.liferay.portal.kernel.exception.SystemException se) {
132                            _log.error(se, se);
133    
134                            throw se;
135                    }
136            }
137    
138            public static void deleteStructure(HttpPrincipal httpPrincipal,
139                    long groupId, java.lang.String structureId)
140                    throws com.liferay.portal.kernel.exception.PortalException,
141                            com.liferay.portal.kernel.exception.SystemException {
142                    try {
143                            MethodKey methodKey = new MethodKey(JournalStructureServiceUtil.class.getName(),
144                                            "deleteStructure", _deleteStructureParameterTypes2);
145    
146                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
147                                            structureId);
148    
149                            try {
150                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
151                            }
152                            catch (Exception e) {
153                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
154                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
155                                    }
156    
157                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
158                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
159                                    }
160    
161                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
162                            }
163                    }
164                    catch (com.liferay.portal.kernel.exception.SystemException se) {
165                            _log.error(se, se);
166    
167                            throw se;
168                    }
169            }
170    
171            public static com.liferay.portlet.journal.model.JournalStructure getStructure(
172                    HttpPrincipal httpPrincipal, long groupId, java.lang.String structureId)
173                    throws com.liferay.portal.kernel.exception.PortalException,
174                            com.liferay.portal.kernel.exception.SystemException {
175                    try {
176                            MethodKey methodKey = new MethodKey(JournalStructureServiceUtil.class.getName(),
177                                            "getStructure", _getStructureParameterTypes3);
178    
179                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
180                                            structureId);
181    
182                            Object returnObj = null;
183    
184                            try {
185                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
186                            }
187                            catch (Exception e) {
188                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
189                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
190                                    }
191    
192                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
193                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
194                                    }
195    
196                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
197                            }
198    
199                            return (com.liferay.portlet.journal.model.JournalStructure)returnObj;
200                    }
201                    catch (com.liferay.portal.kernel.exception.SystemException se) {
202                            _log.error(se, se);
203    
204                            throw se;
205                    }
206            }
207    
208            public static com.liferay.portlet.journal.model.JournalStructure updateStructure(
209                    HttpPrincipal httpPrincipal, long groupId,
210                    java.lang.String structureId, java.lang.String parentStructureId,
211                    java.lang.String name, java.lang.String description,
212                    java.lang.String xsd,
213                    com.liferay.portal.service.ServiceContext serviceContext)
214                    throws com.liferay.portal.kernel.exception.PortalException,
215                            com.liferay.portal.kernel.exception.SystemException {
216                    try {
217                            MethodKey methodKey = new MethodKey(JournalStructureServiceUtil.class.getName(),
218                                            "updateStructure", _updateStructureParameterTypes4);
219    
220                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
221                                            structureId, parentStructureId, name, description, xsd,
222                                            serviceContext);
223    
224                            Object returnObj = null;
225    
226                            try {
227                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
228                            }
229                            catch (Exception e) {
230                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
231                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
232                                    }
233    
234                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
235                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
236                                    }
237    
238                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
239                            }
240    
241                            return (com.liferay.portlet.journal.model.JournalStructure)returnObj;
242                    }
243                    catch (com.liferay.portal.kernel.exception.SystemException se) {
244                            _log.error(se, se);
245    
246                            throw se;
247                    }
248            }
249    
250            private static Log _log = LogFactoryUtil.getLog(JournalStructureServiceHttp.class);
251            private static final Class<?>[] _addStructureParameterTypes0 = new Class[] {
252                            long.class, java.lang.String.class, boolean.class,
253                            java.lang.String.class, java.lang.String.class,
254                            java.lang.String.class, java.lang.String.class,
255                            com.liferay.portal.service.ServiceContext.class
256                    };
257            private static final Class<?>[] _copyStructureParameterTypes1 = new Class[] {
258                            long.class, java.lang.String.class, java.lang.String.class,
259                            boolean.class
260                    };
261            private static final Class<?>[] _deleteStructureParameterTypes2 = new Class[] {
262                            long.class, java.lang.String.class
263                    };
264            private static final Class<?>[] _getStructureParameterTypes3 = new Class[] {
265                            long.class, java.lang.String.class
266                    };
267            private static final Class<?>[] _updateStructureParameterTypes4 = new Class[] {
268                            long.class, java.lang.String.class, java.lang.String.class,
269                            java.lang.String.class, java.lang.String.class,
270                            java.lang.String.class,
271                            com.liferay.portal.service.ServiceContext.class
272                    };
273    }