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.MethodHandler;
020 import com.liferay.portal.kernel.util.MethodKey;
021 import com.liferay.portal.security.auth.HttpPrincipal;
022 import com.liferay.portal.service.http.TunnelUtil;
023
024 import com.liferay.portlet.softwarecatalog.service.SCProductVersionServiceUtil;
025
026
054 public class SCProductVersionServiceHttp {
055 public static com.liferay.portlet.softwarecatalog.model.SCProductVersion addProductVersion(
056 HttpPrincipal httpPrincipal, long productEntryId,
057 java.lang.String version, java.lang.String changeLog,
058 java.lang.String downloadPageURL, java.lang.String directDownloadURL,
059 boolean testDirectDownloadURL, boolean repoStoreArtifact,
060 long[] frameworkVersionIds,
061 com.liferay.portal.service.ServiceContext serviceContext)
062 throws com.liferay.portal.kernel.exception.PortalException,
063 com.liferay.portal.kernel.exception.SystemException {
064 try {
065 MethodKey methodKey = new MethodKey(SCProductVersionServiceUtil.class,
066 "addProductVersion", _addProductVersionParameterTypes0);
067
068 MethodHandler methodHandler = new MethodHandler(methodKey,
069 productEntryId, version, changeLog, downloadPageURL,
070 directDownloadURL, testDirectDownloadURL,
071 repoStoreArtifact, frameworkVersionIds, serviceContext);
072
073 Object returnObj = null;
074
075 try {
076 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
077 }
078 catch (Exception e) {
079 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
080 throw (com.liferay.portal.kernel.exception.PortalException)e;
081 }
082
083 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
084 throw (com.liferay.portal.kernel.exception.SystemException)e;
085 }
086
087 throw new com.liferay.portal.kernel.exception.SystemException(e);
088 }
089
090 return (com.liferay.portlet.softwarecatalog.model.SCProductVersion)returnObj;
091 }
092 catch (com.liferay.portal.kernel.exception.SystemException se) {
093 _log.error(se, se);
094
095 throw se;
096 }
097 }
098
099 public static void deleteProductVersion(HttpPrincipal httpPrincipal,
100 long productVersionId)
101 throws com.liferay.portal.kernel.exception.PortalException,
102 com.liferay.portal.kernel.exception.SystemException {
103 try {
104 MethodKey methodKey = new MethodKey(SCProductVersionServiceUtil.class,
105 "deleteProductVersion", _deleteProductVersionParameterTypes1);
106
107 MethodHandler methodHandler = new MethodHandler(methodKey,
108 productVersionId);
109
110 try {
111 TunnelUtil.invoke(httpPrincipal, methodHandler);
112 }
113 catch (Exception e) {
114 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
115 throw (com.liferay.portal.kernel.exception.PortalException)e;
116 }
117
118 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
119 throw (com.liferay.portal.kernel.exception.SystemException)e;
120 }
121
122 throw new com.liferay.portal.kernel.exception.SystemException(e);
123 }
124 }
125 catch (com.liferay.portal.kernel.exception.SystemException se) {
126 _log.error(se, se);
127
128 throw se;
129 }
130 }
131
132 public static com.liferay.portlet.softwarecatalog.model.SCProductVersion getProductVersion(
133 HttpPrincipal httpPrincipal, long productVersionId)
134 throws com.liferay.portal.kernel.exception.PortalException,
135 com.liferay.portal.kernel.exception.SystemException {
136 try {
137 MethodKey methodKey = new MethodKey(SCProductVersionServiceUtil.class,
138 "getProductVersion", _getProductVersionParameterTypes2);
139
140 MethodHandler methodHandler = new MethodHandler(methodKey,
141 productVersionId);
142
143 Object returnObj = null;
144
145 try {
146 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
147 }
148 catch (Exception e) {
149 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
150 throw (com.liferay.portal.kernel.exception.PortalException)e;
151 }
152
153 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
154 throw (com.liferay.portal.kernel.exception.SystemException)e;
155 }
156
157 throw new com.liferay.portal.kernel.exception.SystemException(e);
158 }
159
160 return (com.liferay.portlet.softwarecatalog.model.SCProductVersion)returnObj;
161 }
162 catch (com.liferay.portal.kernel.exception.SystemException se) {
163 _log.error(se, se);
164
165 throw se;
166 }
167 }
168
169 public static java.util.List<com.liferay.portlet.softwarecatalog.model.SCProductVersion> getProductVersions(
170 HttpPrincipal httpPrincipal, long productEntryId, int start, int end)
171 throws com.liferay.portal.kernel.exception.PortalException,
172 com.liferay.portal.kernel.exception.SystemException {
173 try {
174 MethodKey methodKey = new MethodKey(SCProductVersionServiceUtil.class,
175 "getProductVersions", _getProductVersionsParameterTypes3);
176
177 MethodHandler methodHandler = new MethodHandler(methodKey,
178 productEntryId, start, end);
179
180 Object returnObj = null;
181
182 try {
183 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
184 }
185 catch (Exception e) {
186 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
187 throw (com.liferay.portal.kernel.exception.PortalException)e;
188 }
189
190 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
191 throw (com.liferay.portal.kernel.exception.SystemException)e;
192 }
193
194 throw new com.liferay.portal.kernel.exception.SystemException(e);
195 }
196
197 return (java.util.List<com.liferay.portlet.softwarecatalog.model.SCProductVersion>)returnObj;
198 }
199 catch (com.liferay.portal.kernel.exception.SystemException se) {
200 _log.error(se, se);
201
202 throw se;
203 }
204 }
205
206 public static int getProductVersionsCount(HttpPrincipal httpPrincipal,
207 long productEntryId)
208 throws com.liferay.portal.kernel.exception.PortalException,
209 com.liferay.portal.kernel.exception.SystemException {
210 try {
211 MethodKey methodKey = new MethodKey(SCProductVersionServiceUtil.class,
212 "getProductVersionsCount",
213 _getProductVersionsCountParameterTypes4);
214
215 MethodHandler methodHandler = new MethodHandler(methodKey,
216 productEntryId);
217
218 Object returnObj = null;
219
220 try {
221 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
222 }
223 catch (Exception e) {
224 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
225 throw (com.liferay.portal.kernel.exception.PortalException)e;
226 }
227
228 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
229 throw (com.liferay.portal.kernel.exception.SystemException)e;
230 }
231
232 throw new com.liferay.portal.kernel.exception.SystemException(e);
233 }
234
235 return ((Integer)returnObj).intValue();
236 }
237 catch (com.liferay.portal.kernel.exception.SystemException se) {
238 _log.error(se, se);
239
240 throw se;
241 }
242 }
243
244 public static com.liferay.portlet.softwarecatalog.model.SCProductVersion updateProductVersion(
245 HttpPrincipal httpPrincipal, long productVersionId,
246 java.lang.String version, java.lang.String changeLog,
247 java.lang.String downloadPageURL, java.lang.String directDownloadURL,
248 boolean testDirectDownloadURL, boolean repoStoreArtifact,
249 long[] frameworkVersionIds)
250 throws com.liferay.portal.kernel.exception.PortalException,
251 com.liferay.portal.kernel.exception.SystemException {
252 try {
253 MethodKey methodKey = new MethodKey(SCProductVersionServiceUtil.class,
254 "updateProductVersion", _updateProductVersionParameterTypes5);
255
256 MethodHandler methodHandler = new MethodHandler(methodKey,
257 productVersionId, version, changeLog, downloadPageURL,
258 directDownloadURL, testDirectDownloadURL,
259 repoStoreArtifact, frameworkVersionIds);
260
261 Object returnObj = null;
262
263 try {
264 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
265 }
266 catch (Exception e) {
267 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
268 throw (com.liferay.portal.kernel.exception.PortalException)e;
269 }
270
271 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
272 throw (com.liferay.portal.kernel.exception.SystemException)e;
273 }
274
275 throw new com.liferay.portal.kernel.exception.SystemException(e);
276 }
277
278 return (com.liferay.portlet.softwarecatalog.model.SCProductVersion)returnObj;
279 }
280 catch (com.liferay.portal.kernel.exception.SystemException se) {
281 _log.error(se, se);
282
283 throw se;
284 }
285 }
286
287 private static Log _log = LogFactoryUtil.getLog(SCProductVersionServiceHttp.class);
288 private static final Class<?>[] _addProductVersionParameterTypes0 = new Class[] {
289 long.class, java.lang.String.class, java.lang.String.class,
290 java.lang.String.class, java.lang.String.class, boolean.class,
291 boolean.class, long[].class,
292 com.liferay.portal.service.ServiceContext.class
293 };
294 private static final Class<?>[] _deleteProductVersionParameterTypes1 = new Class[] {
295 long.class
296 };
297 private static final Class<?>[] _getProductVersionParameterTypes2 = new Class[] {
298 long.class
299 };
300 private static final Class<?>[] _getProductVersionsParameterTypes3 = new Class[] {
301 long.class, int.class, int.class
302 };
303 private static final Class<?>[] _getProductVersionsCountParameterTypes4 = new Class[] {
304 long.class
305 };
306 private static final Class<?>[] _updateProductVersionParameterTypes5 = new Class[] {
307 long.class, java.lang.String.class, java.lang.String.class,
308 java.lang.String.class, java.lang.String.class, boolean.class,
309 boolean.class, long[].class
310 };
311 }