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.softwarecatalog.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.LongWrapper;
020    import com.liferay.portal.kernel.util.MethodWrapper;
021    import com.liferay.portal.kernel.util.NullWrapper;
022    import com.liferay.portal.security.auth.HttpPrincipal;
023    import com.liferay.portal.service.http.TunnelUtil;
024    
025    import com.liferay.portlet.softwarecatalog.service.SCProductEntryServiceUtil;
026    
027    /**
028     * <p>
029     * This class provides a HTTP utility for the
030     * {@link com.liferay.portlet.softwarecatalog.service.SCProductEntryServiceUtil} service utility. The
031     * static methods of this class calls the same methods of the service utility.
032     * However, the signatures are different because it requires an additional
033     * {@link com.liferay.portal.security.auth.HttpPrincipal} parameter.
034     * </p>
035     *
036     * <p>
037     * The benefits of using the HTTP utility is that it is fast and allows for
038     * tunneling without the cost of serializing to text. The drawback is that it
039     * only works with Java.
040     * </p>
041     *
042     * <p>
043     * Set the property <b>tunnel.servlet.hosts.allowed</b> in portal.properties to
044     * configure security.
045     * </p>
046     *
047     * <p>
048     * The HTTP utility is only generated for remote services.
049     * </p>
050     *
051     * @author    Brian Wing Shun Chan
052     * @see       SCProductEntryServiceSoap
053     * @see       com.liferay.portal.security.auth.HttpPrincipal
054     * @see       com.liferay.portlet.softwarecatalog.service.SCProductEntryServiceUtil
055     * @generated
056     */
057    public class SCProductEntryServiceHttp {
058            public static com.liferay.portlet.softwarecatalog.model.SCProductEntry addProductEntry(
059                    HttpPrincipal httpPrincipal, java.lang.String name,
060                    java.lang.String type, java.lang.String tags,
061                    java.lang.String shortDescription, java.lang.String longDescription,
062                    java.lang.String pageURL, java.lang.String author,
063                    java.lang.String repoGroupId, java.lang.String repoArtifactId,
064                    long[] licenseIds, java.util.List<byte[]> thumbnails,
065                    java.util.List<byte[]> fullImages,
066                    com.liferay.portal.service.ServiceContext serviceContext)
067                    throws com.liferay.portal.kernel.exception.PortalException,
068                            com.liferay.portal.kernel.exception.SystemException {
069                    try {
070                            Object paramObj0 = name;
071    
072                            if (name == null) {
073                                    paramObj0 = new NullWrapper("java.lang.String");
074                            }
075    
076                            Object paramObj1 = type;
077    
078                            if (type == null) {
079                                    paramObj1 = new NullWrapper("java.lang.String");
080                            }
081    
082                            Object paramObj2 = tags;
083    
084                            if (tags == null) {
085                                    paramObj2 = new NullWrapper("java.lang.String");
086                            }
087    
088                            Object paramObj3 = shortDescription;
089    
090                            if (shortDescription == null) {
091                                    paramObj3 = new NullWrapper("java.lang.String");
092                            }
093    
094                            Object paramObj4 = longDescription;
095    
096                            if (longDescription == null) {
097                                    paramObj4 = new NullWrapper("java.lang.String");
098                            }
099    
100                            Object paramObj5 = pageURL;
101    
102                            if (pageURL == null) {
103                                    paramObj5 = new NullWrapper("java.lang.String");
104                            }
105    
106                            Object paramObj6 = author;
107    
108                            if (author == null) {
109                                    paramObj6 = new NullWrapper("java.lang.String");
110                            }
111    
112                            Object paramObj7 = repoGroupId;
113    
114                            if (repoGroupId == null) {
115                                    paramObj7 = new NullWrapper("java.lang.String");
116                            }
117    
118                            Object paramObj8 = repoArtifactId;
119    
120                            if (repoArtifactId == null) {
121                                    paramObj8 = new NullWrapper("java.lang.String");
122                            }
123    
124                            Object paramObj9 = licenseIds;
125    
126                            if (licenseIds == null) {
127                                    paramObj9 = new NullWrapper("[J");
128                            }
129    
130                            Object paramObj10 = thumbnails;
131    
132                            if (thumbnails == null) {
133                                    paramObj10 = new NullWrapper("java.util.List");
134                            }
135    
136                            Object paramObj11 = fullImages;
137    
138                            if (fullImages == null) {
139                                    paramObj11 = new NullWrapper("java.util.List");
140                            }
141    
142                            Object paramObj12 = serviceContext;
143    
144                            if (serviceContext == null) {
145                                    paramObj12 = new NullWrapper(
146                                                    "com.liferay.portal.service.ServiceContext");
147                            }
148    
149                            MethodWrapper methodWrapper = new MethodWrapper(SCProductEntryServiceUtil.class.getName(),
150                                            "addProductEntry",
151                                            new Object[] {
152                                                    paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
153                                                    paramObj5, paramObj6, paramObj7, paramObj8, paramObj9,
154                                                    paramObj10, paramObj11, paramObj12
155                                            });
156    
157                            Object returnObj = null;
158    
159                            try {
160                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
161                            }
162                            catch (Exception e) {
163                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
164                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
165                                    }
166    
167                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
168                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
169                                    }
170    
171                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
172                            }
173    
174                            return (com.liferay.portlet.softwarecatalog.model.SCProductEntry)returnObj;
175                    }
176                    catch (com.liferay.portal.kernel.exception.SystemException se) {
177                            _log.error(se, se);
178    
179                            throw se;
180                    }
181            }
182    
183            public static void deleteProductEntry(HttpPrincipal httpPrincipal,
184                    long productEntryId)
185                    throws com.liferay.portal.kernel.exception.PortalException,
186                            com.liferay.portal.kernel.exception.SystemException {
187                    try {
188                            Object paramObj0 = new LongWrapper(productEntryId);
189    
190                            MethodWrapper methodWrapper = new MethodWrapper(SCProductEntryServiceUtil.class.getName(),
191                                            "deleteProductEntry", new Object[] { paramObj0 });
192    
193                            try {
194                                    TunnelUtil.invoke(httpPrincipal, methodWrapper);
195                            }
196                            catch (Exception e) {
197                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
198                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
199                                    }
200    
201                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
202                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
203                                    }
204    
205                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
206                            }
207                    }
208                    catch (com.liferay.portal.kernel.exception.SystemException se) {
209                            _log.error(se, se);
210    
211                            throw se;
212                    }
213            }
214    
215            public static com.liferay.portlet.softwarecatalog.model.SCProductEntry getProductEntry(
216                    HttpPrincipal httpPrincipal, long productEntryId)
217                    throws com.liferay.portal.kernel.exception.PortalException,
218                            com.liferay.portal.kernel.exception.SystemException {
219                    try {
220                            Object paramObj0 = new LongWrapper(productEntryId);
221    
222                            MethodWrapper methodWrapper = new MethodWrapper(SCProductEntryServiceUtil.class.getName(),
223                                            "getProductEntry", new Object[] { paramObj0 });
224    
225                            Object returnObj = null;
226    
227                            try {
228                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
229                            }
230                            catch (Exception e) {
231                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
232                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
233                                    }
234    
235                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
236                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
237                                    }
238    
239                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
240                            }
241    
242                            return (com.liferay.portlet.softwarecatalog.model.SCProductEntry)returnObj;
243                    }
244                    catch (com.liferay.portal.kernel.exception.SystemException se) {
245                            _log.error(se, se);
246    
247                            throw se;
248                    }
249            }
250    
251            public static com.liferay.portlet.softwarecatalog.model.SCProductEntry updateProductEntry(
252                    HttpPrincipal httpPrincipal, long productEntryId,
253                    java.lang.String name, java.lang.String type, java.lang.String tags,
254                    java.lang.String shortDescription, java.lang.String longDescription,
255                    java.lang.String pageURL, java.lang.String author,
256                    java.lang.String repoGroupId, java.lang.String repoArtifactId,
257                    long[] licenseIds, java.util.List<byte[]> thumbnails,
258                    java.util.List<byte[]> fullImages)
259                    throws com.liferay.portal.kernel.exception.PortalException,
260                            com.liferay.portal.kernel.exception.SystemException {
261                    try {
262                            Object paramObj0 = new LongWrapper(productEntryId);
263    
264                            Object paramObj1 = name;
265    
266                            if (name == null) {
267                                    paramObj1 = new NullWrapper("java.lang.String");
268                            }
269    
270                            Object paramObj2 = type;
271    
272                            if (type == null) {
273                                    paramObj2 = new NullWrapper("java.lang.String");
274                            }
275    
276                            Object paramObj3 = tags;
277    
278                            if (tags == null) {
279                                    paramObj3 = new NullWrapper("java.lang.String");
280                            }
281    
282                            Object paramObj4 = shortDescription;
283    
284                            if (shortDescription == null) {
285                                    paramObj4 = new NullWrapper("java.lang.String");
286                            }
287    
288                            Object paramObj5 = longDescription;
289    
290                            if (longDescription == null) {
291                                    paramObj5 = new NullWrapper("java.lang.String");
292                            }
293    
294                            Object paramObj6 = pageURL;
295    
296                            if (pageURL == null) {
297                                    paramObj6 = new NullWrapper("java.lang.String");
298                            }
299    
300                            Object paramObj7 = author;
301    
302                            if (author == null) {
303                                    paramObj7 = new NullWrapper("java.lang.String");
304                            }
305    
306                            Object paramObj8 = repoGroupId;
307    
308                            if (repoGroupId == null) {
309                                    paramObj8 = new NullWrapper("java.lang.String");
310                            }
311    
312                            Object paramObj9 = repoArtifactId;
313    
314                            if (repoArtifactId == null) {
315                                    paramObj9 = new NullWrapper("java.lang.String");
316                            }
317    
318                            Object paramObj10 = licenseIds;
319    
320                            if (licenseIds == null) {
321                                    paramObj10 = new NullWrapper("[J");
322                            }
323    
324                            Object paramObj11 = thumbnails;
325    
326                            if (thumbnails == null) {
327                                    paramObj11 = new NullWrapper("java.util.List");
328                            }
329    
330                            Object paramObj12 = fullImages;
331    
332                            if (fullImages == null) {
333                                    paramObj12 = new NullWrapper("java.util.List");
334                            }
335    
336                            MethodWrapper methodWrapper = new MethodWrapper(SCProductEntryServiceUtil.class.getName(),
337                                            "updateProductEntry",
338                                            new Object[] {
339                                                    paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
340                                                    paramObj5, paramObj6, paramObj7, paramObj8, paramObj9,
341                                                    paramObj10, paramObj11, paramObj12
342                                            });
343    
344                            Object returnObj = null;
345    
346                            try {
347                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
348                            }
349                            catch (Exception e) {
350                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
351                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
352                                    }
353    
354                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
355                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
356                                    }
357    
358                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
359                            }
360    
361                            return (com.liferay.portlet.softwarecatalog.model.SCProductEntry)returnObj;
362                    }
363                    catch (com.liferay.portal.kernel.exception.SystemException se) {
364                            _log.error(se, se);
365    
366                            throw se;
367                    }
368            }
369    
370            private static Log _log = LogFactoryUtil.getLog(SCProductEntryServiceHttp.class);
371    }