001
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.BooleanWrapper;
020 import com.liferay.portal.kernel.util.IntegerWrapper;
021 import com.liferay.portal.kernel.util.LongWrapper;
022 import com.liferay.portal.kernel.util.MethodWrapper;
023 import com.liferay.portal.kernel.util.NullWrapper;
024 import com.liferay.portal.security.auth.HttpPrincipal;
025 import com.liferay.portal.service.http.TunnelUtil;
026
027 import com.liferay.portlet.softwarecatalog.service.SCProductVersionServiceUtil;
028
029
059 public class SCProductVersionServiceHttp {
060 public static com.liferay.portlet.softwarecatalog.model.SCProductVersion addProductVersion(
061 HttpPrincipal httpPrincipal, long productEntryId,
062 java.lang.String version, java.lang.String changeLog,
063 java.lang.String downloadPageURL, java.lang.String directDownloadURL,
064 boolean testDirectDownloadURL, boolean repoStoreArtifact,
065 long[] frameworkVersionIds,
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 = new LongWrapper(productEntryId);
071
072 Object paramObj1 = version;
073
074 if (version == null) {
075 paramObj1 = new NullWrapper("java.lang.String");
076 }
077
078 Object paramObj2 = changeLog;
079
080 if (changeLog == null) {
081 paramObj2 = new NullWrapper("java.lang.String");
082 }
083
084 Object paramObj3 = downloadPageURL;
085
086 if (downloadPageURL == null) {
087 paramObj3 = new NullWrapper("java.lang.String");
088 }
089
090 Object paramObj4 = directDownloadURL;
091
092 if (directDownloadURL == null) {
093 paramObj4 = new NullWrapper("java.lang.String");
094 }
095
096 Object paramObj5 = new BooleanWrapper(testDirectDownloadURL);
097
098 Object paramObj6 = new BooleanWrapper(repoStoreArtifact);
099
100 Object paramObj7 = frameworkVersionIds;
101
102 if (frameworkVersionIds == null) {
103 paramObj7 = new NullWrapper("[J");
104 }
105
106 Object paramObj8 = serviceContext;
107
108 if (serviceContext == null) {
109 paramObj8 = new NullWrapper(
110 "com.liferay.portal.service.ServiceContext");
111 }
112
113 MethodWrapper methodWrapper = new MethodWrapper(SCProductVersionServiceUtil.class.getName(),
114 "addProductVersion",
115 new Object[] {
116 paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
117 paramObj5, paramObj6, paramObj7, paramObj8
118 });
119
120 Object returnObj = null;
121
122 try {
123 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
124 }
125 catch (Exception e) {
126 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
127 throw (com.liferay.portal.kernel.exception.PortalException)e;
128 }
129
130 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
131 throw (com.liferay.portal.kernel.exception.SystemException)e;
132 }
133
134 throw new com.liferay.portal.kernel.exception.SystemException(e);
135 }
136
137 return (com.liferay.portlet.softwarecatalog.model.SCProductVersion)returnObj;
138 }
139 catch (com.liferay.portal.kernel.exception.SystemException se) {
140 _log.error(se, se);
141
142 throw se;
143 }
144 }
145
146 public static void deleteProductVersion(HttpPrincipal httpPrincipal,
147 long productVersionId)
148 throws com.liferay.portal.kernel.exception.PortalException,
149 com.liferay.portal.kernel.exception.SystemException {
150 try {
151 Object paramObj0 = new LongWrapper(productVersionId);
152
153 MethodWrapper methodWrapper = new MethodWrapper(SCProductVersionServiceUtil.class.getName(),
154 "deleteProductVersion", new Object[] { paramObj0 });
155
156 try {
157 TunnelUtil.invoke(httpPrincipal, methodWrapper);
158 }
159 catch (Exception e) {
160 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
161 throw (com.liferay.portal.kernel.exception.PortalException)e;
162 }
163
164 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
165 throw (com.liferay.portal.kernel.exception.SystemException)e;
166 }
167
168 throw new com.liferay.portal.kernel.exception.SystemException(e);
169 }
170 }
171 catch (com.liferay.portal.kernel.exception.SystemException se) {
172 _log.error(se, se);
173
174 throw se;
175 }
176 }
177
178 public static com.liferay.portlet.softwarecatalog.model.SCProductVersion getProductVersion(
179 HttpPrincipal httpPrincipal, long productVersionId)
180 throws com.liferay.portal.kernel.exception.PortalException,
181 com.liferay.portal.kernel.exception.SystemException {
182 try {
183 Object paramObj0 = new LongWrapper(productVersionId);
184
185 MethodWrapper methodWrapper = new MethodWrapper(SCProductVersionServiceUtil.class.getName(),
186 "getProductVersion", new Object[] { paramObj0 });
187
188 Object returnObj = null;
189
190 try {
191 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
192 }
193 catch (Exception e) {
194 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
195 throw (com.liferay.portal.kernel.exception.PortalException)e;
196 }
197
198 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
199 throw (com.liferay.portal.kernel.exception.SystemException)e;
200 }
201
202 throw new com.liferay.portal.kernel.exception.SystemException(e);
203 }
204
205 return (com.liferay.portlet.softwarecatalog.model.SCProductVersion)returnObj;
206 }
207 catch (com.liferay.portal.kernel.exception.SystemException se) {
208 _log.error(se, se);
209
210 throw se;
211 }
212 }
213
214 public static java.util.List<com.liferay.portlet.softwarecatalog.model.SCProductVersion> getProductVersions(
215 HttpPrincipal httpPrincipal, long productEntryId, int start, int end)
216 throws com.liferay.portal.kernel.exception.PortalException,
217 com.liferay.portal.kernel.exception.SystemException {
218 try {
219 Object paramObj0 = new LongWrapper(productEntryId);
220
221 Object paramObj1 = new IntegerWrapper(start);
222
223 Object paramObj2 = new IntegerWrapper(end);
224
225 MethodWrapper methodWrapper = new MethodWrapper(SCProductVersionServiceUtil.class.getName(),
226 "getProductVersions",
227 new Object[] { paramObj0, paramObj1, paramObj2 });
228
229 Object returnObj = null;
230
231 try {
232 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
233 }
234 catch (Exception e) {
235 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
236 throw (com.liferay.portal.kernel.exception.PortalException)e;
237 }
238
239 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
240 throw (com.liferay.portal.kernel.exception.SystemException)e;
241 }
242
243 throw new com.liferay.portal.kernel.exception.SystemException(e);
244 }
245
246 return (java.util.List<com.liferay.portlet.softwarecatalog.model.SCProductVersion>)returnObj;
247 }
248 catch (com.liferay.portal.kernel.exception.SystemException se) {
249 _log.error(se, se);
250
251 throw se;
252 }
253 }
254
255 public static int getProductVersionsCount(HttpPrincipal httpPrincipal,
256 long productEntryId)
257 throws com.liferay.portal.kernel.exception.PortalException,
258 com.liferay.portal.kernel.exception.SystemException {
259 try {
260 Object paramObj0 = new LongWrapper(productEntryId);
261
262 MethodWrapper methodWrapper = new MethodWrapper(SCProductVersionServiceUtil.class.getName(),
263 "getProductVersionsCount", new Object[] { paramObj0 });
264
265 Object returnObj = null;
266
267 try {
268 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
269 }
270 catch (Exception e) {
271 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
272 throw (com.liferay.portal.kernel.exception.PortalException)e;
273 }
274
275 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
276 throw (com.liferay.portal.kernel.exception.SystemException)e;
277 }
278
279 throw new com.liferay.portal.kernel.exception.SystemException(e);
280 }
281
282 return ((Integer)returnObj).intValue();
283 }
284 catch (com.liferay.portal.kernel.exception.SystemException se) {
285 _log.error(se, se);
286
287 throw se;
288 }
289 }
290
291 public static com.liferay.portlet.softwarecatalog.model.SCProductVersion updateProductVersion(
292 HttpPrincipal httpPrincipal, long productVersionId,
293 java.lang.String version, java.lang.String changeLog,
294 java.lang.String downloadPageURL, java.lang.String directDownloadURL,
295 boolean testDirectDownloadURL, boolean repoStoreArtifact,
296 long[] frameworkVersionIds)
297 throws com.liferay.portal.kernel.exception.PortalException,
298 com.liferay.portal.kernel.exception.SystemException {
299 try {
300 Object paramObj0 = new LongWrapper(productVersionId);
301
302 Object paramObj1 = version;
303
304 if (version == null) {
305 paramObj1 = new NullWrapper("java.lang.String");
306 }
307
308 Object paramObj2 = changeLog;
309
310 if (changeLog == null) {
311 paramObj2 = new NullWrapper("java.lang.String");
312 }
313
314 Object paramObj3 = downloadPageURL;
315
316 if (downloadPageURL == null) {
317 paramObj3 = new NullWrapper("java.lang.String");
318 }
319
320 Object paramObj4 = directDownloadURL;
321
322 if (directDownloadURL == null) {
323 paramObj4 = new NullWrapper("java.lang.String");
324 }
325
326 Object paramObj5 = new BooleanWrapper(testDirectDownloadURL);
327
328 Object paramObj6 = new BooleanWrapper(repoStoreArtifact);
329
330 Object paramObj7 = frameworkVersionIds;
331
332 if (frameworkVersionIds == null) {
333 paramObj7 = new NullWrapper("[J");
334 }
335
336 MethodWrapper methodWrapper = new MethodWrapper(SCProductVersionServiceUtil.class.getName(),
337 "updateProductVersion",
338 new Object[] {
339 paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
340 paramObj5, paramObj6, paramObj7
341 });
342
343 Object returnObj = null;
344
345 try {
346 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
347 }
348 catch (Exception e) {
349 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
350 throw (com.liferay.portal.kernel.exception.PortalException)e;
351 }
352
353 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
354 throw (com.liferay.portal.kernel.exception.SystemException)e;
355 }
356
357 throw new com.liferay.portal.kernel.exception.SystemException(e);
358 }
359
360 return (com.liferay.portlet.softwarecatalog.model.SCProductVersion)returnObj;
361 }
362 catch (com.liferay.portal.kernel.exception.SystemException se) {
363 _log.error(se, se);
364
365 throw se;
366 }
367 }
368
369 private static Log _log = LogFactoryUtil.getLog(SCProductVersionServiceHttp.class);
370 }