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.IntegerWrapper;
21  import com.liferay.portal.kernel.util.LongWrapper;
22  import com.liferay.portal.kernel.util.MethodWrapper;
23  import com.liferay.portal.kernel.util.NullWrapper;
24  import com.liferay.portal.security.auth.HttpPrincipal;
25  import com.liferay.portal.service.http.TunnelUtil;
26  
27  import com.liferay.portlet.softwarecatalog.service.SCFrameworkVersionServiceUtil;
28  
29  /**
30   * <a href="SCFrameworkVersionServiceHttp.java.html"><b><i>View Source</i></b></a>
31   *
32   * <p>
33   * ServiceBuilder generated this class. Modifications in this class will be
34   * overwritten the next time is generated.
35   * </p>
36   *
37   * <p>
38   * This class provides a HTTP utility for the
39   * {@link com.liferay.portlet.softwarecatalog.service.SCFrameworkVersionServiceUtil} service utility. The
40   * static methods of this class calls the same methods of the service utility.
41   * However, the signatures are different because it requires an additional
42   * {@link com.liferay.portal.security.auth.HttpPrincipal} parameter.
43   * </p>
44   *
45   * <p>
46   * The benefits of using the HTTP utility is that it is fast and allows for
47   * tunneling without the cost of serializing to text. The drawback is that it
48   * only works with Java.
49   * </p>
50   *
51   * <p>
52   * Set the property <b>tunnel.servlet.hosts.allowed</b> in portal.properties to
53   * configure security.
54   * </p>
55   *
56   * <p>
57   * The HTTP utility is only generated for remote services.
58   * </p>
59   *
60   * @author    Brian Wing Shun Chan
61   * @see       SCFrameworkVersionServiceSoap
62   * @see       com.liferay.portal.security.auth.HttpPrincipal
63   * @see       com.liferay.portlet.softwarecatalog.service.SCFrameworkVersionServiceUtil
64   * @generated
65   */
66  public class SCFrameworkVersionServiceHttp {
67      public static com.liferay.portlet.softwarecatalog.model.SCFrameworkVersion addFrameworkVersion(
68          HttpPrincipal httpPrincipal, long plid, java.lang.String name,
69          java.lang.String url, boolean active, int priority,
70          boolean addCommunityPermissions, boolean addGuestPermissions)
71          throws com.liferay.portal.PortalException,
72              com.liferay.portal.SystemException {
73          try {
74              Object paramObj0 = new LongWrapper(plid);
75  
76              Object paramObj1 = name;
77  
78              if (name == null) {
79                  paramObj1 = new NullWrapper("java.lang.String");
80              }
81  
82              Object paramObj2 = url;
83  
84              if (url == null) {
85                  paramObj2 = new NullWrapper("java.lang.String");
86              }
87  
88              Object paramObj3 = new BooleanWrapper(active);
89  
90              Object paramObj4 = new IntegerWrapper(priority);
91  
92              Object paramObj5 = new BooleanWrapper(addCommunityPermissions);
93  
94              Object paramObj6 = new BooleanWrapper(addGuestPermissions);
95  
96              MethodWrapper methodWrapper = new MethodWrapper(SCFrameworkVersionServiceUtil.class.getName(),
97                      "addFrameworkVersion",
98                      new Object[] {
99                          paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
100                         paramObj5, paramObj6
101                     });
102 
103             Object returnObj = null;
104 
105             try {
106                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
107             }
108             catch (Exception e) {
109                 if (e instanceof com.liferay.portal.PortalException) {
110                     throw (com.liferay.portal.PortalException)e;
111                 }
112 
113                 if (e instanceof com.liferay.portal.SystemException) {
114                     throw (com.liferay.portal.SystemException)e;
115                 }
116 
117                 throw new com.liferay.portal.SystemException(e);
118             }
119 
120             return (com.liferay.portlet.softwarecatalog.model.SCFrameworkVersion)returnObj;
121         }
122         catch (com.liferay.portal.SystemException se) {
123             _log.error(se, se);
124 
125             throw se;
126         }
127     }
128 
129     public static com.liferay.portlet.softwarecatalog.model.SCFrameworkVersion addFrameworkVersion(
130         HttpPrincipal httpPrincipal, long plid, java.lang.String name,
131         java.lang.String url, boolean active, int priority,
132         java.lang.String[] communityPermissions,
133         java.lang.String[] guestPermissions)
134         throws com.liferay.portal.PortalException,
135             com.liferay.portal.SystemException {
136         try {
137             Object paramObj0 = new LongWrapper(plid);
138 
139             Object paramObj1 = name;
140 
141             if (name == null) {
142                 paramObj1 = new NullWrapper("java.lang.String");
143             }
144 
145             Object paramObj2 = url;
146 
147             if (url == null) {
148                 paramObj2 = new NullWrapper("java.lang.String");
149             }
150 
151             Object paramObj3 = new BooleanWrapper(active);
152 
153             Object paramObj4 = new IntegerWrapper(priority);
154 
155             Object paramObj5 = communityPermissions;
156 
157             if (communityPermissions == null) {
158                 paramObj5 = new NullWrapper("[Ljava.lang.String;");
159             }
160 
161             Object paramObj6 = guestPermissions;
162 
163             if (guestPermissions == null) {
164                 paramObj6 = new NullWrapper("[Ljava.lang.String;");
165             }
166 
167             MethodWrapper methodWrapper = new MethodWrapper(SCFrameworkVersionServiceUtil.class.getName(),
168                     "addFrameworkVersion",
169                     new Object[] {
170                         paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
171                         paramObj5, paramObj6
172                     });
173 
174             Object returnObj = null;
175 
176             try {
177                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
178             }
179             catch (Exception e) {
180                 if (e instanceof com.liferay.portal.PortalException) {
181                     throw (com.liferay.portal.PortalException)e;
182                 }
183 
184                 if (e instanceof com.liferay.portal.SystemException) {
185                     throw (com.liferay.portal.SystemException)e;
186                 }
187 
188                 throw new com.liferay.portal.SystemException(e);
189             }
190 
191             return (com.liferay.portlet.softwarecatalog.model.SCFrameworkVersion)returnObj;
192         }
193         catch (com.liferay.portal.SystemException se) {
194             _log.error(se, se);
195 
196             throw se;
197         }
198     }
199 
200     public static void deleteFrameworkVersion(HttpPrincipal httpPrincipal,
201         long frameworkVersionId)
202         throws com.liferay.portal.PortalException,
203             com.liferay.portal.SystemException {
204         try {
205             Object paramObj0 = new LongWrapper(frameworkVersionId);
206 
207             MethodWrapper methodWrapper = new MethodWrapper(SCFrameworkVersionServiceUtil.class.getName(),
208                     "deleteFrameworkVersion", new Object[] { paramObj0 });
209 
210             try {
211                 TunnelUtil.invoke(httpPrincipal, methodWrapper);
212             }
213             catch (Exception e) {
214                 if (e instanceof com.liferay.portal.PortalException) {
215                     throw (com.liferay.portal.PortalException)e;
216                 }
217 
218                 if (e instanceof com.liferay.portal.SystemException) {
219                     throw (com.liferay.portal.SystemException)e;
220                 }
221 
222                 throw new com.liferay.portal.SystemException(e);
223             }
224         }
225         catch (com.liferay.portal.SystemException se) {
226             _log.error(se, se);
227 
228             throw se;
229         }
230     }
231 
232     public static com.liferay.portlet.softwarecatalog.model.SCFrameworkVersion getFrameworkVersion(
233         HttpPrincipal httpPrincipal, long frameworkVersionId)
234         throws com.liferay.portal.PortalException,
235             com.liferay.portal.SystemException {
236         try {
237             Object paramObj0 = new LongWrapper(frameworkVersionId);
238 
239             MethodWrapper methodWrapper = new MethodWrapper(SCFrameworkVersionServiceUtil.class.getName(),
240                     "getFrameworkVersion", new Object[] { paramObj0 });
241 
242             Object returnObj = null;
243 
244             try {
245                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
246             }
247             catch (Exception e) {
248                 if (e instanceof com.liferay.portal.PortalException) {
249                     throw (com.liferay.portal.PortalException)e;
250                 }
251 
252                 if (e instanceof com.liferay.portal.SystemException) {
253                     throw (com.liferay.portal.SystemException)e;
254                 }
255 
256                 throw new com.liferay.portal.SystemException(e);
257             }
258 
259             return (com.liferay.portlet.softwarecatalog.model.SCFrameworkVersion)returnObj;
260         }
261         catch (com.liferay.portal.SystemException se) {
262             _log.error(se, se);
263 
264             throw se;
265         }
266     }
267 
268     public static java.util.List<com.liferay.portlet.softwarecatalog.model.SCFrameworkVersion> getFrameworkVersions(
269         HttpPrincipal httpPrincipal, long groupId, boolean active)
270         throws com.liferay.portal.SystemException {
271         try {
272             Object paramObj0 = new LongWrapper(groupId);
273 
274             Object paramObj1 = new BooleanWrapper(active);
275 
276             MethodWrapper methodWrapper = new MethodWrapper(SCFrameworkVersionServiceUtil.class.getName(),
277                     "getFrameworkVersions",
278                     new Object[] { paramObj0, paramObj1 });
279 
280             Object returnObj = null;
281 
282             try {
283                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
284             }
285             catch (Exception e) {
286                 if (e instanceof com.liferay.portal.SystemException) {
287                     throw (com.liferay.portal.SystemException)e;
288                 }
289 
290                 throw new com.liferay.portal.SystemException(e);
291             }
292 
293             return (java.util.List<com.liferay.portlet.softwarecatalog.model.SCFrameworkVersion>)returnObj;
294         }
295         catch (com.liferay.portal.SystemException se) {
296             _log.error(se, se);
297 
298             throw se;
299         }
300     }
301 
302     public static java.util.List<com.liferay.portlet.softwarecatalog.model.SCFrameworkVersion> getFrameworkVersions(
303         HttpPrincipal httpPrincipal, long groupId, boolean active, int start,
304         int end) throws com.liferay.portal.SystemException {
305         try {
306             Object paramObj0 = new LongWrapper(groupId);
307 
308             Object paramObj1 = new BooleanWrapper(active);
309 
310             Object paramObj2 = new IntegerWrapper(start);
311 
312             Object paramObj3 = new IntegerWrapper(end);
313 
314             MethodWrapper methodWrapper = new MethodWrapper(SCFrameworkVersionServiceUtil.class.getName(),
315                     "getFrameworkVersions",
316                     new Object[] { paramObj0, paramObj1, paramObj2, paramObj3 });
317 
318             Object returnObj = null;
319 
320             try {
321                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
322             }
323             catch (Exception e) {
324                 if (e instanceof com.liferay.portal.SystemException) {
325                     throw (com.liferay.portal.SystemException)e;
326                 }
327 
328                 throw new com.liferay.portal.SystemException(e);
329             }
330 
331             return (java.util.List<com.liferay.portlet.softwarecatalog.model.SCFrameworkVersion>)returnObj;
332         }
333         catch (com.liferay.portal.SystemException se) {
334             _log.error(se, se);
335 
336             throw se;
337         }
338     }
339 
340     public static com.liferay.portlet.softwarecatalog.model.SCFrameworkVersion updateFrameworkVersion(
341         HttpPrincipal httpPrincipal, long frameworkVersionId,
342         java.lang.String name, java.lang.String url, boolean active,
343         int priority)
344         throws com.liferay.portal.PortalException,
345             com.liferay.portal.SystemException {
346         try {
347             Object paramObj0 = new LongWrapper(frameworkVersionId);
348 
349             Object paramObj1 = name;
350 
351             if (name == null) {
352                 paramObj1 = new NullWrapper("java.lang.String");
353             }
354 
355             Object paramObj2 = url;
356 
357             if (url == null) {
358                 paramObj2 = new NullWrapper("java.lang.String");
359             }
360 
361             Object paramObj3 = new BooleanWrapper(active);
362 
363             Object paramObj4 = new IntegerWrapper(priority);
364 
365             MethodWrapper methodWrapper = new MethodWrapper(SCFrameworkVersionServiceUtil.class.getName(),
366                     "updateFrameworkVersion",
367                     new Object[] {
368                         paramObj0, paramObj1, paramObj2, paramObj3, paramObj4
369                     });
370 
371             Object returnObj = null;
372 
373             try {
374                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
375             }
376             catch (Exception e) {
377                 if (e instanceof com.liferay.portal.PortalException) {
378                     throw (com.liferay.portal.PortalException)e;
379                 }
380 
381                 if (e instanceof com.liferay.portal.SystemException) {
382                     throw (com.liferay.portal.SystemException)e;
383                 }
384 
385                 throw new com.liferay.portal.SystemException(e);
386             }
387 
388             return (com.liferay.portlet.softwarecatalog.model.SCFrameworkVersion)returnObj;
389         }
390         catch (com.liferay.portal.SystemException se) {
391             _log.error(se, se);
392 
393             throw se;
394         }
395     }
396 
397     private static Log _log = LogFactoryUtil.getLog(SCFrameworkVersionServiceHttp.class);
398 }