1
22
23 package com.liferay.portlet.softwarecatalog.service.http;
24
25 import com.liferay.portal.kernel.log.Log;
26 import com.liferay.portal.kernel.log.LogFactoryUtil;
27 import com.liferay.portal.kernel.util.BooleanWrapper;
28 import com.liferay.portal.kernel.util.IntegerWrapper;
29 import com.liferay.portal.kernel.util.LongWrapper;
30 import com.liferay.portal.kernel.util.MethodWrapper;
31 import com.liferay.portal.kernel.util.NullWrapper;
32 import com.liferay.portal.security.auth.HttpPrincipal;
33 import com.liferay.portal.service.http.TunnelUtil;
34
35 import com.liferay.portlet.softwarecatalog.service.SCProductVersionServiceUtil;
36
37
76 public class SCProductVersionServiceHttp {
77 public static com.liferay.portlet.softwarecatalog.model.SCProductVersion addProductVersion(
78 HttpPrincipal httpPrincipal, long productEntryId,
79 java.lang.String version, java.lang.String changeLog,
80 java.lang.String downloadPageURL, java.lang.String directDownloadURL,
81 boolean repoStoreArtifact, long[] frameworkVersionIds,
82 boolean addCommunityPermissions, boolean addGuestPermissions)
83 throws com.liferay.portal.SystemException,
84 com.liferay.portal.PortalException {
85 try {
86 Object paramObj0 = new LongWrapper(productEntryId);
87
88 Object paramObj1 = version;
89
90 if (version == null) {
91 paramObj1 = new NullWrapper("java.lang.String");
92 }
93
94 Object paramObj2 = changeLog;
95
96 if (changeLog == null) {
97 paramObj2 = new NullWrapper("java.lang.String");
98 }
99
100 Object paramObj3 = downloadPageURL;
101
102 if (downloadPageURL == null) {
103 paramObj3 = new NullWrapper("java.lang.String");
104 }
105
106 Object paramObj4 = directDownloadURL;
107
108 if (directDownloadURL == null) {
109 paramObj4 = new NullWrapper("java.lang.String");
110 }
111
112 Object paramObj5 = new BooleanWrapper(repoStoreArtifact);
113
114 Object paramObj6 = frameworkVersionIds;
115
116 if (frameworkVersionIds == null) {
117 paramObj6 = new NullWrapper("[J");
118 }
119
120 Object paramObj7 = new BooleanWrapper(addCommunityPermissions);
121
122 Object paramObj8 = new BooleanWrapper(addGuestPermissions);
123
124 MethodWrapper methodWrapper = new MethodWrapper(SCProductVersionServiceUtil.class.getName(),
125 "addProductVersion",
126 new Object[] {
127 paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
128 paramObj5, paramObj6, paramObj7, paramObj8
129 });
130
131 Object returnObj = null;
132
133 try {
134 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
135 }
136 catch (Exception e) {
137 if (e instanceof com.liferay.portal.SystemException) {
138 throw (com.liferay.portal.SystemException)e;
139 }
140
141 if (e instanceof com.liferay.portal.PortalException) {
142 throw (com.liferay.portal.PortalException)e;
143 }
144
145 throw new com.liferay.portal.SystemException(e);
146 }
147
148 return (com.liferay.portlet.softwarecatalog.model.SCProductVersion)returnObj;
149 }
150 catch (com.liferay.portal.SystemException se) {
151 _log.error(se, se);
152
153 throw se;
154 }
155 }
156
157 public static com.liferay.portlet.softwarecatalog.model.SCProductVersion addProductVersion(
158 HttpPrincipal httpPrincipal, long productEntryId,
159 java.lang.String version, java.lang.String changeLog,
160 java.lang.String downloadPageURL, java.lang.String directDownloadURL,
161 boolean repoStoreArtifact, long[] frameworkVersionIds,
162 java.lang.String[] communityPermissions,
163 java.lang.String[] guestPermissions)
164 throws com.liferay.portal.SystemException,
165 com.liferay.portal.PortalException {
166 try {
167 Object paramObj0 = new LongWrapper(productEntryId);
168
169 Object paramObj1 = version;
170
171 if (version == null) {
172 paramObj1 = new NullWrapper("java.lang.String");
173 }
174
175 Object paramObj2 = changeLog;
176
177 if (changeLog == null) {
178 paramObj2 = new NullWrapper("java.lang.String");
179 }
180
181 Object paramObj3 = downloadPageURL;
182
183 if (downloadPageURL == null) {
184 paramObj3 = new NullWrapper("java.lang.String");
185 }
186
187 Object paramObj4 = directDownloadURL;
188
189 if (directDownloadURL == null) {
190 paramObj4 = new NullWrapper("java.lang.String");
191 }
192
193 Object paramObj5 = new BooleanWrapper(repoStoreArtifact);
194
195 Object paramObj6 = frameworkVersionIds;
196
197 if (frameworkVersionIds == null) {
198 paramObj6 = new NullWrapper("[J");
199 }
200
201 Object paramObj7 = communityPermissions;
202
203 if (communityPermissions == null) {
204 paramObj7 = new NullWrapper("[Ljava.lang.String;");
205 }
206
207 Object paramObj8 = guestPermissions;
208
209 if (guestPermissions == null) {
210 paramObj8 = new NullWrapper("[Ljava.lang.String;");
211 }
212
213 MethodWrapper methodWrapper = new MethodWrapper(SCProductVersionServiceUtil.class.getName(),
214 "addProductVersion",
215 new Object[] {
216 paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
217 paramObj5, paramObj6, paramObj7, paramObj8
218 });
219
220 Object returnObj = null;
221
222 try {
223 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
224 }
225 catch (Exception e) {
226 if (e instanceof com.liferay.portal.SystemException) {
227 throw (com.liferay.portal.SystemException)e;
228 }
229
230 if (e instanceof com.liferay.portal.PortalException) {
231 throw (com.liferay.portal.PortalException)e;
232 }
233
234 throw new com.liferay.portal.SystemException(e);
235 }
236
237 return (com.liferay.portlet.softwarecatalog.model.SCProductVersion)returnObj;
238 }
239 catch (com.liferay.portal.SystemException se) {
240 _log.error(se, se);
241
242 throw se;
243 }
244 }
245
246 public static void deleteProductVersion(HttpPrincipal httpPrincipal,
247 long productVersionId)
248 throws com.liferay.portal.SystemException,
249 com.liferay.portal.PortalException {
250 try {
251 Object paramObj0 = new LongWrapper(productVersionId);
252
253 MethodWrapper methodWrapper = new MethodWrapper(SCProductVersionServiceUtil.class.getName(),
254 "deleteProductVersion", new Object[] { paramObj0 });
255
256 try {
257 TunnelUtil.invoke(httpPrincipal, methodWrapper);
258 }
259 catch (Exception e) {
260 if (e instanceof com.liferay.portal.SystemException) {
261 throw (com.liferay.portal.SystemException)e;
262 }
263
264 if (e instanceof com.liferay.portal.PortalException) {
265 throw (com.liferay.portal.PortalException)e;
266 }
267
268 throw new com.liferay.portal.SystemException(e);
269 }
270 }
271 catch (com.liferay.portal.SystemException se) {
272 _log.error(se, se);
273
274 throw se;
275 }
276 }
277
278 public static com.liferay.portlet.softwarecatalog.model.SCProductVersion getProductVersion(
279 HttpPrincipal httpPrincipal, long productVersionId)
280 throws com.liferay.portal.SystemException,
281 com.liferay.portal.PortalException {
282 try {
283 Object paramObj0 = new LongWrapper(productVersionId);
284
285 MethodWrapper methodWrapper = new MethodWrapper(SCProductVersionServiceUtil.class.getName(),
286 "getProductVersion", new Object[] { paramObj0 });
287
288 Object returnObj = null;
289
290 try {
291 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
292 }
293 catch (Exception e) {
294 if (e instanceof com.liferay.portal.SystemException) {
295 throw (com.liferay.portal.SystemException)e;
296 }
297
298 if (e instanceof com.liferay.portal.PortalException) {
299 throw (com.liferay.portal.PortalException)e;
300 }
301
302 throw new com.liferay.portal.SystemException(e);
303 }
304
305 return (com.liferay.portlet.softwarecatalog.model.SCProductVersion)returnObj;
306 }
307 catch (com.liferay.portal.SystemException se) {
308 _log.error(se, se);
309
310 throw se;
311 }
312 }
313
314 public static java.util.List<com.liferay.portlet.softwarecatalog.model.SCProductVersion> getProductVersions(
315 HttpPrincipal httpPrincipal, long productEntryId, int begin, int end)
316 throws com.liferay.portal.SystemException,
317 com.liferay.portal.PortalException {
318 try {
319 Object paramObj0 = new LongWrapper(productEntryId);
320
321 Object paramObj1 = new IntegerWrapper(begin);
322
323 Object paramObj2 = new IntegerWrapper(end);
324
325 MethodWrapper methodWrapper = new MethodWrapper(SCProductVersionServiceUtil.class.getName(),
326 "getProductVersions",
327 new Object[] { paramObj0, paramObj1, paramObj2 });
328
329 Object returnObj = null;
330
331 try {
332 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
333 }
334 catch (Exception e) {
335 if (e instanceof com.liferay.portal.SystemException) {
336 throw (com.liferay.portal.SystemException)e;
337 }
338
339 if (e instanceof com.liferay.portal.PortalException) {
340 throw (com.liferay.portal.PortalException)e;
341 }
342
343 throw new com.liferay.portal.SystemException(e);
344 }
345
346 return (java.util.List<com.liferay.portlet.softwarecatalog.model.SCProductVersion>)returnObj;
347 }
348 catch (com.liferay.portal.SystemException se) {
349 _log.error(se, se);
350
351 throw se;
352 }
353 }
354
355 public static int getProductVersionsCount(HttpPrincipal httpPrincipal,
356 long productEntryId)
357 throws com.liferay.portal.SystemException,
358 com.liferay.portal.PortalException {
359 try {
360 Object paramObj0 = new LongWrapper(productEntryId);
361
362 MethodWrapper methodWrapper = new MethodWrapper(SCProductVersionServiceUtil.class.getName(),
363 "getProductVersionsCount", new Object[] { paramObj0 });
364
365 Object returnObj = null;
366
367 try {
368 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
369 }
370 catch (Exception e) {
371 if (e instanceof com.liferay.portal.SystemException) {
372 throw (com.liferay.portal.SystemException)e;
373 }
374
375 if (e instanceof com.liferay.portal.PortalException) {
376 throw (com.liferay.portal.PortalException)e;
377 }
378
379 throw new com.liferay.portal.SystemException(e);
380 }
381
382 return ((Integer)returnObj).intValue();
383 }
384 catch (com.liferay.portal.SystemException se) {
385 _log.error(se, se);
386
387 throw se;
388 }
389 }
390
391 public static com.liferay.portlet.softwarecatalog.model.SCProductVersion updateProductVersion(
392 HttpPrincipal httpPrincipal, long productVersionId,
393 java.lang.String version, java.lang.String changeLog,
394 java.lang.String downloadPageURL, java.lang.String directDownloadURL,
395 boolean repoStoreArtifact, long[] frameworkVersionIds)
396 throws com.liferay.portal.SystemException,
397 com.liferay.portal.PortalException {
398 try {
399 Object paramObj0 = new LongWrapper(productVersionId);
400
401 Object paramObj1 = version;
402
403 if (version == null) {
404 paramObj1 = new NullWrapper("java.lang.String");
405 }
406
407 Object paramObj2 = changeLog;
408
409 if (changeLog == null) {
410 paramObj2 = new NullWrapper("java.lang.String");
411 }
412
413 Object paramObj3 = downloadPageURL;
414
415 if (downloadPageURL == null) {
416 paramObj3 = new NullWrapper("java.lang.String");
417 }
418
419 Object paramObj4 = directDownloadURL;
420
421 if (directDownloadURL == null) {
422 paramObj4 = new NullWrapper("java.lang.String");
423 }
424
425 Object paramObj5 = new BooleanWrapper(repoStoreArtifact);
426
427 Object paramObj6 = frameworkVersionIds;
428
429 if (frameworkVersionIds == null) {
430 paramObj6 = new NullWrapper("[J");
431 }
432
433 MethodWrapper methodWrapper = new MethodWrapper(SCProductVersionServiceUtil.class.getName(),
434 "updateProductVersion",
435 new Object[] {
436 paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
437 paramObj5, paramObj6
438 });
439
440 Object returnObj = null;
441
442 try {
443 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
444 }
445 catch (Exception e) {
446 if (e instanceof com.liferay.portal.SystemException) {
447 throw (com.liferay.portal.SystemException)e;
448 }
449
450 if (e instanceof com.liferay.portal.PortalException) {
451 throw (com.liferay.portal.PortalException)e;
452 }
453
454 throw new com.liferay.portal.SystemException(e);
455 }
456
457 return (com.liferay.portlet.softwarecatalog.model.SCProductVersion)returnObj;
458 }
459 catch (com.liferay.portal.SystemException se) {
460 _log.error(se, se);
461
462 throw se;
463 }
464 }
465
466 private static Log _log = LogFactoryUtil.getLog(SCProductVersionServiceHttp.class);
467 }