1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
13   */
14  
15  package com.liferay.portlet.softwarecatalog.service.http;
16  
17  import com.liferay.portal.kernel.log.Log;
18  import com.liferay.portal.kernel.log.LogFactoryUtil;
19  import com.liferay.portal.kernel.util.BooleanWrapper;
20  import com.liferay.portal.kernel.util.LongWrapper;
21  import com.liferay.portal.kernel.util.MethodWrapper;
22  import com.liferay.portal.kernel.util.NullWrapper;
23  import com.liferay.portal.security.auth.HttpPrincipal;
24  import com.liferay.portal.service.http.TunnelUtil;
25  
26  import com.liferay.portlet.softwarecatalog.service.SCProductEntryServiceUtil;
27  
28  /**
29   * <a href="SCProductEntryServiceHttp.java.html"><b><i>View Source</i></b></a>
30   *
31   * <p>
32   * ServiceBuilder generated this class. Modifications in this class will be
33   * overwritten the next time is generated.
34   * </p>
35   *
36   * <p>
37   * This class provides a HTTP utility for the
38   * {@link com.liferay.portlet.softwarecatalog.service.SCProductEntryServiceUtil} service utility. The
39   * static methods of this class calls the same methods of the service utility.
40   * However, the signatures are different because it requires an additional
41   * {@link com.liferay.portal.security.auth.HttpPrincipal} parameter.
42   * </p>
43   *
44   * <p>
45   * The benefits of using the HTTP utility is that it is fast and allows for
46   * tunneling without the cost of serializing to text. The drawback is that it
47   * only works with Java.
48   * </p>
49   *
50   * <p>
51   * Set the property <b>tunnel.servlet.hosts.allowed</b> in portal.properties to
52   * configure security.
53   * </p>
54   *
55   * <p>
56   * The HTTP utility is only generated for remote services.
57   * </p>
58   *
59   * @author    Brian Wing Shun Chan
60   * @see       SCProductEntryServiceSoap
61   * @see       com.liferay.portal.security.auth.HttpPrincipal
62   * @see       com.liferay.portlet.softwarecatalog.service.SCProductEntryServiceUtil
63   * @generated
64   */
65  public class SCProductEntryServiceHttp {
66      public static com.liferay.portlet.softwarecatalog.model.SCProductEntry addProductEntry(
67          HttpPrincipal httpPrincipal, long plid, java.lang.String name,
68          java.lang.String type, java.lang.String tags,
69          java.lang.String shortDescription, java.lang.String longDescription,
70          java.lang.String pageURL, java.lang.String author,
71          java.lang.String repoGroupId, java.lang.String repoArtifactId,
72          long[] licenseIds, java.util.List<byte[]> thumbnails,
73          java.util.List<byte[]> fullImages, boolean addCommunityPermissions,
74          boolean addGuestPermissions)
75          throws com.liferay.portal.PortalException,
76              com.liferay.portal.SystemException {
77          try {
78              Object paramObj0 = new LongWrapper(plid);
79  
80              Object paramObj1 = name;
81  
82              if (name == null) {
83                  paramObj1 = new NullWrapper("java.lang.String");
84              }
85  
86              Object paramObj2 = type;
87  
88              if (type == null) {
89                  paramObj2 = new NullWrapper("java.lang.String");
90              }
91  
92              Object paramObj3 = tags;
93  
94              if (tags == null) {
95                  paramObj3 = new NullWrapper("java.lang.String");
96              }
97  
98              Object paramObj4 = shortDescription;
99  
100             if (shortDescription == null) {
101                 paramObj4 = new NullWrapper("java.lang.String");
102             }
103 
104             Object paramObj5 = longDescription;
105 
106             if (longDescription == null) {
107                 paramObj5 = new NullWrapper("java.lang.String");
108             }
109 
110             Object paramObj6 = pageURL;
111 
112             if (pageURL == null) {
113                 paramObj6 = new NullWrapper("java.lang.String");
114             }
115 
116             Object paramObj7 = author;
117 
118             if (author == null) {
119                 paramObj7 = new NullWrapper("java.lang.String");
120             }
121 
122             Object paramObj8 = repoGroupId;
123 
124             if (repoGroupId == null) {
125                 paramObj8 = new NullWrapper("java.lang.String");
126             }
127 
128             Object paramObj9 = repoArtifactId;
129 
130             if (repoArtifactId == null) {
131                 paramObj9 = new NullWrapper("java.lang.String");
132             }
133 
134             Object paramObj10 = licenseIds;
135 
136             if (licenseIds == null) {
137                 paramObj10 = new NullWrapper("[J");
138             }
139 
140             Object paramObj11 = thumbnails;
141 
142             if (thumbnails == null) {
143                 paramObj11 = new NullWrapper("java.util.List");
144             }
145 
146             Object paramObj12 = fullImages;
147 
148             if (fullImages == null) {
149                 paramObj12 = new NullWrapper("java.util.List");
150             }
151 
152             Object paramObj13 = new BooleanWrapper(addCommunityPermissions);
153 
154             Object paramObj14 = new BooleanWrapper(addGuestPermissions);
155 
156             MethodWrapper methodWrapper = new MethodWrapper(SCProductEntryServiceUtil.class.getName(),
157                     "addProductEntry",
158                     new Object[] {
159                         paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
160                         paramObj5, paramObj6, paramObj7, paramObj8, paramObj9,
161                         paramObj10, paramObj11, paramObj12, paramObj13,
162                         paramObj14
163                     });
164 
165             Object returnObj = null;
166 
167             try {
168                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
169             }
170             catch (Exception e) {
171                 if (e instanceof com.liferay.portal.PortalException) {
172                     throw (com.liferay.portal.PortalException)e;
173                 }
174 
175                 if (e instanceof com.liferay.portal.SystemException) {
176                     throw (com.liferay.portal.SystemException)e;
177                 }
178 
179                 throw new com.liferay.portal.SystemException(e);
180             }
181 
182             return (com.liferay.portlet.softwarecatalog.model.SCProductEntry)returnObj;
183         }
184         catch (com.liferay.portal.SystemException se) {
185             _log.error(se, se);
186 
187             throw se;
188         }
189     }
190 
191     public static com.liferay.portlet.softwarecatalog.model.SCProductEntry addProductEntry(
192         HttpPrincipal httpPrincipal, long plid, java.lang.String name,
193         java.lang.String type, java.lang.String tags,
194         java.lang.String shortDescription, java.lang.String longDescription,
195         java.lang.String pageURL, java.lang.String author,
196         java.lang.String repoGroupId, java.lang.String repoArtifactId,
197         long[] licenseIds, java.util.List<byte[]> thumbnails,
198         java.util.List<byte[]> fullImages,
199         java.lang.String[] communityPermissions,
200         java.lang.String[] guestPermissions)
201         throws com.liferay.portal.PortalException,
202             com.liferay.portal.SystemException {
203         try {
204             Object paramObj0 = new LongWrapper(plid);
205 
206             Object paramObj1 = name;
207 
208             if (name == null) {
209                 paramObj1 = new NullWrapper("java.lang.String");
210             }
211 
212             Object paramObj2 = type;
213 
214             if (type == null) {
215                 paramObj2 = new NullWrapper("java.lang.String");
216             }
217 
218             Object paramObj3 = tags;
219 
220             if (tags == null) {
221                 paramObj3 = new NullWrapper("java.lang.String");
222             }
223 
224             Object paramObj4 = shortDescription;
225 
226             if (shortDescription == null) {
227                 paramObj4 = new NullWrapper("java.lang.String");
228             }
229 
230             Object paramObj5 = longDescription;
231 
232             if (longDescription == null) {
233                 paramObj5 = new NullWrapper("java.lang.String");
234             }
235 
236             Object paramObj6 = pageURL;
237 
238             if (pageURL == null) {
239                 paramObj6 = new NullWrapper("java.lang.String");
240             }
241 
242             Object paramObj7 = author;
243 
244             if (author == null) {
245                 paramObj7 = new NullWrapper("java.lang.String");
246             }
247 
248             Object paramObj8 = repoGroupId;
249 
250             if (repoGroupId == null) {
251                 paramObj8 = new NullWrapper("java.lang.String");
252             }
253 
254             Object paramObj9 = repoArtifactId;
255 
256             if (repoArtifactId == null) {
257                 paramObj9 = new NullWrapper("java.lang.String");
258             }
259 
260             Object paramObj10 = licenseIds;
261 
262             if (licenseIds == null) {
263                 paramObj10 = new NullWrapper("[J");
264             }
265 
266             Object paramObj11 = thumbnails;
267 
268             if (thumbnails == null) {
269                 paramObj11 = new NullWrapper("java.util.List");
270             }
271 
272             Object paramObj12 = fullImages;
273 
274             if (fullImages == null) {
275                 paramObj12 = new NullWrapper("java.util.List");
276             }
277 
278             Object paramObj13 = communityPermissions;
279 
280             if (communityPermissions == null) {
281                 paramObj13 = new NullWrapper("[Ljava.lang.String;");
282             }
283 
284             Object paramObj14 = guestPermissions;
285 
286             if (guestPermissions == null) {
287                 paramObj14 = new NullWrapper("[Ljava.lang.String;");
288             }
289 
290             MethodWrapper methodWrapper = new MethodWrapper(SCProductEntryServiceUtil.class.getName(),
291                     "addProductEntry",
292                     new Object[] {
293                         paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
294                         paramObj5, paramObj6, paramObj7, paramObj8, paramObj9,
295                         paramObj10, paramObj11, paramObj12, paramObj13,
296                         paramObj14
297                     });
298 
299             Object returnObj = null;
300 
301             try {
302                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
303             }
304             catch (Exception e) {
305                 if (e instanceof com.liferay.portal.PortalException) {
306                     throw (com.liferay.portal.PortalException)e;
307                 }
308 
309                 if (e instanceof com.liferay.portal.SystemException) {
310                     throw (com.liferay.portal.SystemException)e;
311                 }
312 
313                 throw new com.liferay.portal.SystemException(e);
314             }
315 
316             return (com.liferay.portlet.softwarecatalog.model.SCProductEntry)returnObj;
317         }
318         catch (com.liferay.portal.SystemException se) {
319             _log.error(se, se);
320 
321             throw se;
322         }
323     }
324 
325     public static void deleteProductEntry(HttpPrincipal httpPrincipal,
326         long productEntryId)
327         throws com.liferay.portal.PortalException,
328             com.liferay.portal.SystemException {
329         try {
330             Object paramObj0 = new LongWrapper(productEntryId);
331 
332             MethodWrapper methodWrapper = new MethodWrapper(SCProductEntryServiceUtil.class.getName(),
333                     "deleteProductEntry", new Object[] { paramObj0 });
334 
335             try {
336                 TunnelUtil.invoke(httpPrincipal, methodWrapper);
337             }
338             catch (Exception e) {
339                 if (e instanceof com.liferay.portal.PortalException) {
340                     throw (com.liferay.portal.PortalException)e;
341                 }
342 
343                 if (e instanceof com.liferay.portal.SystemException) {
344                     throw (com.liferay.portal.SystemException)e;
345                 }
346 
347                 throw new com.liferay.portal.SystemException(e);
348             }
349         }
350         catch (com.liferay.portal.SystemException se) {
351             _log.error(se, se);
352 
353             throw se;
354         }
355     }
356 
357     public static com.liferay.portlet.softwarecatalog.model.SCProductEntry getProductEntry(
358         HttpPrincipal httpPrincipal, long productEntryId)
359         throws com.liferay.portal.PortalException,
360             com.liferay.portal.SystemException {
361         try {
362             Object paramObj0 = new LongWrapper(productEntryId);
363 
364             MethodWrapper methodWrapper = new MethodWrapper(SCProductEntryServiceUtil.class.getName(),
365                     "getProductEntry", new Object[] { paramObj0 });
366 
367             Object returnObj = null;
368 
369             try {
370                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
371             }
372             catch (Exception e) {
373                 if (e instanceof com.liferay.portal.PortalException) {
374                     throw (com.liferay.portal.PortalException)e;
375                 }
376 
377                 if (e instanceof com.liferay.portal.SystemException) {
378                     throw (com.liferay.portal.SystemException)e;
379                 }
380 
381                 throw new com.liferay.portal.SystemException(e);
382             }
383 
384             return (com.liferay.portlet.softwarecatalog.model.SCProductEntry)returnObj;
385         }
386         catch (com.liferay.portal.SystemException se) {
387             _log.error(se, se);
388 
389             throw se;
390         }
391     }
392 
393     public static com.liferay.portlet.softwarecatalog.model.SCProductEntry updateProductEntry(
394         HttpPrincipal httpPrincipal, long productEntryId,
395         java.lang.String name, java.lang.String type, java.lang.String tags,
396         java.lang.String shortDescription, java.lang.String longDescription,
397         java.lang.String pageURL, java.lang.String author,
398         java.lang.String repoGroupId, java.lang.String repoArtifactId,
399         long[] licenseIds, java.util.List<byte[]> thumbnails,
400         java.util.List<byte[]> fullImages)
401         throws com.liferay.portal.PortalException,
402             com.liferay.portal.SystemException {
403         try {
404             Object paramObj0 = new LongWrapper(productEntryId);
405 
406             Object paramObj1 = name;
407 
408             if (name == null) {
409                 paramObj1 = new NullWrapper("java.lang.String");
410             }
411 
412             Object paramObj2 = type;
413 
414             if (type == null) {
415                 paramObj2 = new NullWrapper("java.lang.String");
416             }
417 
418             Object paramObj3 = tags;
419 
420             if (tags == null) {
421                 paramObj3 = new NullWrapper("java.lang.String");
422             }
423 
424             Object paramObj4 = shortDescription;
425 
426             if (shortDescription == null) {
427                 paramObj4 = new NullWrapper("java.lang.String");
428             }
429 
430             Object paramObj5 = longDescription;
431 
432             if (longDescription == null) {
433                 paramObj5 = new NullWrapper("java.lang.String");
434             }
435 
436             Object paramObj6 = pageURL;
437 
438             if (pageURL == null) {
439                 paramObj6 = new NullWrapper("java.lang.String");
440             }
441 
442             Object paramObj7 = author;
443 
444             if (author == null) {
445                 paramObj7 = new NullWrapper("java.lang.String");
446             }
447 
448             Object paramObj8 = repoGroupId;
449 
450             if (repoGroupId == null) {
451                 paramObj8 = new NullWrapper("java.lang.String");
452             }
453 
454             Object paramObj9 = repoArtifactId;
455 
456             if (repoArtifactId == null) {
457                 paramObj9 = new NullWrapper("java.lang.String");
458             }
459 
460             Object paramObj10 = licenseIds;
461 
462             if (licenseIds == null) {
463                 paramObj10 = new NullWrapper("[J");
464             }
465 
466             Object paramObj11 = thumbnails;
467 
468             if (thumbnails == null) {
469                 paramObj11 = new NullWrapper("java.util.List");
470             }
471 
472             Object paramObj12 = fullImages;
473 
474             if (fullImages == null) {
475                 paramObj12 = new NullWrapper("java.util.List");
476             }
477 
478             MethodWrapper methodWrapper = new MethodWrapper(SCProductEntryServiceUtil.class.getName(),
479                     "updateProductEntry",
480                     new Object[] {
481                         paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
482                         paramObj5, paramObj6, paramObj7, paramObj8, paramObj9,
483                         paramObj10, paramObj11, paramObj12
484                     });
485 
486             Object returnObj = null;
487 
488             try {
489                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
490             }
491             catch (Exception e) {
492                 if (e instanceof com.liferay.portal.PortalException) {
493                     throw (com.liferay.portal.PortalException)e;
494                 }
495 
496                 if (e instanceof com.liferay.portal.SystemException) {
497                     throw (com.liferay.portal.SystemException)e;
498                 }
499 
500                 throw new com.liferay.portal.SystemException(e);
501             }
502 
503             return (com.liferay.portlet.softwarecatalog.model.SCProductEntry)returnObj;
504         }
505         catch (com.liferay.portal.SystemException se) {
506             _log.error(se, se);
507 
508             throw se;
509         }
510     }
511 
512     private static Log _log = LogFactoryUtil.getLog(SCProductEntryServiceHttp.class);
513 }