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.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.JournalTemplateServiceUtil;
025    
026    /**
027     * <p>
028     * This class provides a HTTP utility for the
029     * {@link com.liferay.portlet.journal.service.JournalTemplateServiceUtil} 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       JournalTemplateServiceSoap
052     * @see       com.liferay.portal.security.auth.HttpPrincipal
053     * @see       com.liferay.portlet.journal.service.JournalTemplateServiceUtil
054     * @generated
055     */
056    public class JournalTemplateServiceHttp {
057            public static com.liferay.portlet.journal.model.JournalTemplate addTemplate(
058                    HttpPrincipal httpPrincipal, long groupId, java.lang.String templateId,
059                    boolean autoTemplateId, java.lang.String structureId,
060                    java.lang.String name, java.lang.String description,
061                    java.lang.String xsl, boolean formatXsl, java.lang.String langType,
062                    boolean cacheable,
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(JournalTemplateServiceUtil.class.getName(),
068                                            "addTemplate", long.class, java.lang.String.class,
069                                            boolean.class, java.lang.String.class,
070                                            java.lang.String.class, java.lang.String.class,
071                                            java.lang.String.class, boolean.class,
072                                            java.lang.String.class, boolean.class,
073                                            com.liferay.portal.service.ServiceContext.class);
074    
075                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
076                                            templateId, autoTemplateId, structureId, name, description,
077                                            xsl, formatXsl, langType, cacheable, serviceContext);
078    
079                            Object returnObj = null;
080    
081                            try {
082                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
083                            }
084                            catch (Exception e) {
085                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
086                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
087                                    }
088    
089                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
090                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
091                                    }
092    
093                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
094                            }
095    
096                            return (com.liferay.portlet.journal.model.JournalTemplate)returnObj;
097                    }
098                    catch (com.liferay.portal.kernel.exception.SystemException se) {
099                            _log.error(se, se);
100    
101                            throw se;
102                    }
103            }
104    
105            public static com.liferay.portlet.journal.model.JournalTemplate addTemplate(
106                    HttpPrincipal httpPrincipal, long groupId, java.lang.String templateId,
107                    boolean autoTemplateId, java.lang.String structureId,
108                    java.lang.String name, java.lang.String description,
109                    java.lang.String xsl, boolean formatXsl, java.lang.String langType,
110                    boolean cacheable, boolean smallImage, java.lang.String smallImageURL,
111                    java.io.File smallFile,
112                    com.liferay.portal.service.ServiceContext serviceContext)
113                    throws com.liferay.portal.kernel.exception.PortalException,
114                            com.liferay.portal.kernel.exception.SystemException {
115                    try {
116                            MethodKey methodKey = new MethodKey(JournalTemplateServiceUtil.class.getName(),
117                                            "addTemplate", long.class, java.lang.String.class,
118                                            boolean.class, java.lang.String.class,
119                                            java.lang.String.class, java.lang.String.class,
120                                            java.lang.String.class, boolean.class,
121                                            java.lang.String.class, boolean.class, boolean.class,
122                                            java.lang.String.class, java.io.File.class,
123                                            com.liferay.portal.service.ServiceContext.class);
124    
125                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
126                                            templateId, autoTemplateId, structureId, name, description,
127                                            xsl, formatXsl, langType, cacheable, smallImage,
128                                            smallImageURL, smallFile, serviceContext);
129    
130                            Object returnObj = null;
131    
132                            try {
133                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
134                            }
135                            catch (Exception e) {
136                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
137                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
138                                    }
139    
140                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
141                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
142                                    }
143    
144                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
145                            }
146    
147                            return (com.liferay.portlet.journal.model.JournalTemplate)returnObj;
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 com.liferay.portlet.journal.model.JournalTemplate copyTemplate(
157                    HttpPrincipal httpPrincipal, long groupId,
158                    java.lang.String oldTemplateId, java.lang.String newTemplateId,
159                    boolean autoTemplateId)
160                    throws com.liferay.portal.kernel.exception.PortalException,
161                            com.liferay.portal.kernel.exception.SystemException {
162                    try {
163                            MethodKey methodKey = new MethodKey(JournalTemplateServiceUtil.class.getName(),
164                                            "copyTemplate", long.class, java.lang.String.class,
165                                            java.lang.String.class, boolean.class);
166    
167                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
168                                            oldTemplateId, newTemplateId, autoTemplateId);
169    
170                            Object returnObj = null;
171    
172                            try {
173                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
174                            }
175                            catch (Exception e) {
176                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
177                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
178                                    }
179    
180                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
181                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
182                                    }
183    
184                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
185                            }
186    
187                            return (com.liferay.portlet.journal.model.JournalTemplate)returnObj;
188                    }
189                    catch (com.liferay.portal.kernel.exception.SystemException se) {
190                            _log.error(se, se);
191    
192                            throw se;
193                    }
194            }
195    
196            public static void deleteTemplate(HttpPrincipal httpPrincipal,
197                    long groupId, java.lang.String templateId)
198                    throws com.liferay.portal.kernel.exception.PortalException,
199                            com.liferay.portal.kernel.exception.SystemException {
200                    try {
201                            MethodKey methodKey = new MethodKey(JournalTemplateServiceUtil.class.getName(),
202                                            "deleteTemplate", long.class, java.lang.String.class);
203    
204                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
205                                            templateId);
206    
207                            try {
208                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
209                            }
210                            catch (Exception e) {
211                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
212                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
213                                    }
214    
215                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
216                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
217                                    }
218    
219                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
220                            }
221                    }
222                    catch (com.liferay.portal.kernel.exception.SystemException se) {
223                            _log.error(se, se);
224    
225                            throw se;
226                    }
227            }
228    
229            public static java.util.List<com.liferay.portlet.journal.model.JournalTemplate> getStructureTemplates(
230                    HttpPrincipal httpPrincipal, long groupId, java.lang.String structureId)
231                    throws com.liferay.portal.kernel.exception.PortalException,
232                            com.liferay.portal.kernel.exception.SystemException {
233                    try {
234                            MethodKey methodKey = new MethodKey(JournalTemplateServiceUtil.class.getName(),
235                                            "getStructureTemplates", long.class, java.lang.String.class);
236    
237                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
238                                            structureId);
239    
240                            Object returnObj = null;
241    
242                            try {
243                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
244                            }
245                            catch (Exception e) {
246                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
247                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
248                                    }
249    
250                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
251                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
252                                    }
253    
254                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
255                            }
256    
257                            return (java.util.List<com.liferay.portlet.journal.model.JournalTemplate>)returnObj;
258                    }
259                    catch (com.liferay.portal.kernel.exception.SystemException se) {
260                            _log.error(se, se);
261    
262                            throw se;
263                    }
264            }
265    
266            public static com.liferay.portlet.journal.model.JournalTemplate getTemplate(
267                    HttpPrincipal httpPrincipal, long groupId, java.lang.String templateId)
268                    throws com.liferay.portal.kernel.exception.PortalException,
269                            com.liferay.portal.kernel.exception.SystemException {
270                    try {
271                            MethodKey methodKey = new MethodKey(JournalTemplateServiceUtil.class.getName(),
272                                            "getTemplate", long.class, java.lang.String.class);
273    
274                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
275                                            templateId);
276    
277                            Object returnObj = null;
278    
279                            try {
280                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
281                            }
282                            catch (Exception e) {
283                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
284                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
285                                    }
286    
287                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
288                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
289                                    }
290    
291                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
292                            }
293    
294                            return (com.liferay.portlet.journal.model.JournalTemplate)returnObj;
295                    }
296                    catch (com.liferay.portal.kernel.exception.SystemException se) {
297                            _log.error(se, se);
298    
299                            throw se;
300                    }
301            }
302    
303            public static com.liferay.portlet.journal.model.JournalTemplate updateTemplate(
304                    HttpPrincipal httpPrincipal, long groupId, java.lang.String templateId,
305                    java.lang.String structureId, java.lang.String name,
306                    java.lang.String description, java.lang.String xsl, boolean formatXsl,
307                    java.lang.String langType, boolean cacheable,
308                    com.liferay.portal.service.ServiceContext serviceContext)
309                    throws com.liferay.portal.kernel.exception.PortalException,
310                            com.liferay.portal.kernel.exception.SystemException {
311                    try {
312                            MethodKey methodKey = new MethodKey(JournalTemplateServiceUtil.class.getName(),
313                                            "updateTemplate", long.class, java.lang.String.class,
314                                            java.lang.String.class, java.lang.String.class,
315                                            java.lang.String.class, java.lang.String.class,
316                                            boolean.class, java.lang.String.class, boolean.class,
317                                            com.liferay.portal.service.ServiceContext.class);
318    
319                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
320                                            templateId, structureId, name, description, xsl, formatXsl,
321                                            langType, cacheable, serviceContext);
322    
323                            Object returnObj = null;
324    
325                            try {
326                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
327                            }
328                            catch (Exception e) {
329                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
330                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
331                                    }
332    
333                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
334                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
335                                    }
336    
337                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
338                            }
339    
340                            return (com.liferay.portlet.journal.model.JournalTemplate)returnObj;
341                    }
342                    catch (com.liferay.portal.kernel.exception.SystemException se) {
343                            _log.error(se, se);
344    
345                            throw se;
346                    }
347            }
348    
349            public static com.liferay.portlet.journal.model.JournalTemplate updateTemplate(
350                    HttpPrincipal httpPrincipal, long groupId, java.lang.String templateId,
351                    java.lang.String structureId, java.lang.String name,
352                    java.lang.String description, java.lang.String xsl, boolean formatXsl,
353                    java.lang.String langType, boolean cacheable, boolean smallImage,
354                    java.lang.String smallImageURL, java.io.File smallFile,
355                    com.liferay.portal.service.ServiceContext serviceContext)
356                    throws com.liferay.portal.kernel.exception.PortalException,
357                            com.liferay.portal.kernel.exception.SystemException {
358                    try {
359                            MethodKey methodKey = new MethodKey(JournalTemplateServiceUtil.class.getName(),
360                                            "updateTemplate", long.class, java.lang.String.class,
361                                            java.lang.String.class, java.lang.String.class,
362                                            java.lang.String.class, java.lang.String.class,
363                                            boolean.class, java.lang.String.class, boolean.class,
364                                            boolean.class, java.lang.String.class, java.io.File.class,
365                                            com.liferay.portal.service.ServiceContext.class);
366    
367                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
368                                            templateId, structureId, name, description, xsl, formatXsl,
369                                            langType, cacheable, smallImage, smallImageURL, smallFile,
370                                            serviceContext);
371    
372                            Object returnObj = null;
373    
374                            try {
375                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
376                            }
377                            catch (Exception e) {
378                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
379                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
380                                    }
381    
382                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
383                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
384                                    }
385    
386                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
387                            }
388    
389                            return (com.liferay.portlet.journal.model.JournalTemplate)returnObj;
390                    }
391                    catch (com.liferay.portal.kernel.exception.SystemException se) {
392                            _log.error(se, se);
393    
394                            throw se;
395                    }
396            }
397    
398            private static Log _log = LogFactoryUtil.getLog(JournalTemplateServiceHttp.class);
399    }