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