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.SCProductEntryServiceUtil;
025
026
056 public class SCProductEntryServiceHttp {
057 public static com.liferay.portlet.softwarecatalog.model.SCProductEntry addProductEntry(
058 HttpPrincipal httpPrincipal, java.lang.String name,
059 java.lang.String type, java.lang.String tags,
060 java.lang.String shortDescription, java.lang.String longDescription,
061 java.lang.String pageURL, java.lang.String author,
062 java.lang.String repoGroupId, java.lang.String repoArtifactId,
063 long[] licenseIds, java.util.List<byte[]> thumbnails,
064 java.util.List<byte[]> fullImages,
065 com.liferay.portal.service.ServiceContext serviceContext)
066 throws com.liferay.portal.kernel.exception.PortalException,
067 com.liferay.portal.kernel.exception.SystemException {
068 try {
069 MethodKey methodKey = new MethodKey(SCProductEntryServiceUtil.class.getName(),
070 "addProductEntry", java.lang.String.class,
071 java.lang.String.class, java.lang.String.class,
072 java.lang.String.class, java.lang.String.class,
073 java.lang.String.class, java.lang.String.class,
074 java.lang.String.class, java.lang.String.class,
075 long[].class, java.util.List.class, java.util.List.class,
076 com.liferay.portal.service.ServiceContext.class);
077
078 MethodHandler methodHandler = new MethodHandler(methodKey, name,
079 type, tags, shortDescription, longDescription, pageURL,
080 author, repoGroupId, repoArtifactId, licenseIds,
081 thumbnails, fullImages, serviceContext);
082
083 Object returnObj = null;
084
085 try {
086 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
087 }
088 catch (Exception e) {
089 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
090 throw (com.liferay.portal.kernel.exception.PortalException)e;
091 }
092
093 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
094 throw (com.liferay.portal.kernel.exception.SystemException)e;
095 }
096
097 throw new com.liferay.portal.kernel.exception.SystemException(e);
098 }
099
100 return (com.liferay.portlet.softwarecatalog.model.SCProductEntry)returnObj;
101 }
102 catch (com.liferay.portal.kernel.exception.SystemException se) {
103 _log.error(se, se);
104
105 throw se;
106 }
107 }
108
109 public static void deleteProductEntry(HttpPrincipal httpPrincipal,
110 long productEntryId)
111 throws com.liferay.portal.kernel.exception.PortalException,
112 com.liferay.portal.kernel.exception.SystemException {
113 try {
114 MethodKey methodKey = new MethodKey(SCProductEntryServiceUtil.class.getName(),
115 "deleteProductEntry", long.class);
116
117 MethodHandler methodHandler = new MethodHandler(methodKey,
118 productEntryId);
119
120 try {
121 TunnelUtil.invoke(httpPrincipal, methodHandler);
122 }
123 catch (Exception e) {
124 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
125 throw (com.liferay.portal.kernel.exception.PortalException)e;
126 }
127
128 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
129 throw (com.liferay.portal.kernel.exception.SystemException)e;
130 }
131
132 throw new com.liferay.portal.kernel.exception.SystemException(e);
133 }
134 }
135 catch (com.liferay.portal.kernel.exception.SystemException se) {
136 _log.error(se, se);
137
138 throw se;
139 }
140 }
141
142 public static com.liferay.portlet.softwarecatalog.model.SCProductEntry getProductEntry(
143 HttpPrincipal httpPrincipal, long productEntryId)
144 throws com.liferay.portal.kernel.exception.PortalException,
145 com.liferay.portal.kernel.exception.SystemException {
146 try {
147 MethodKey methodKey = new MethodKey(SCProductEntryServiceUtil.class.getName(),
148 "getProductEntry", long.class);
149
150 MethodHandler methodHandler = new MethodHandler(methodKey,
151 productEntryId);
152
153 Object returnObj = null;
154
155 try {
156 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
157 }
158 catch (Exception e) {
159 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
160 throw (com.liferay.portal.kernel.exception.PortalException)e;
161 }
162
163 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
164 throw (com.liferay.portal.kernel.exception.SystemException)e;
165 }
166
167 throw new com.liferay.portal.kernel.exception.SystemException(e);
168 }
169
170 return (com.liferay.portlet.softwarecatalog.model.SCProductEntry)returnObj;
171 }
172 catch (com.liferay.portal.kernel.exception.SystemException se) {
173 _log.error(se, se);
174
175 throw se;
176 }
177 }
178
179 public static com.liferay.portlet.softwarecatalog.model.SCProductEntry updateProductEntry(
180 HttpPrincipal httpPrincipal, long productEntryId,
181 java.lang.String name, java.lang.String type, java.lang.String tags,
182 java.lang.String shortDescription, java.lang.String longDescription,
183 java.lang.String pageURL, java.lang.String author,
184 java.lang.String repoGroupId, java.lang.String repoArtifactId,
185 long[] licenseIds, java.util.List<byte[]> thumbnails,
186 java.util.List<byte[]> fullImages)
187 throws com.liferay.portal.kernel.exception.PortalException,
188 com.liferay.portal.kernel.exception.SystemException {
189 try {
190 MethodKey methodKey = new MethodKey(SCProductEntryServiceUtil.class.getName(),
191 "updateProductEntry", long.class, java.lang.String.class,
192 java.lang.String.class, java.lang.String.class,
193 java.lang.String.class, java.lang.String.class,
194 java.lang.String.class, java.lang.String.class,
195 java.lang.String.class, java.lang.String.class,
196 long[].class, java.util.List.class, java.util.List.class);
197
198 MethodHandler methodHandler = new MethodHandler(methodKey,
199 productEntryId, name, type, tags, shortDescription,
200 longDescription, pageURL, author, repoGroupId,
201 repoArtifactId, licenseIds, thumbnails, fullImages);
202
203 Object returnObj = null;
204
205 try {
206 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
207 }
208 catch (Exception e) {
209 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
210 throw (com.liferay.portal.kernel.exception.PortalException)e;
211 }
212
213 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
214 throw (com.liferay.portal.kernel.exception.SystemException)e;
215 }
216
217 throw new com.liferay.portal.kernel.exception.SystemException(e);
218 }
219
220 return (com.liferay.portlet.softwarecatalog.model.SCProductEntry)returnObj;
221 }
222 catch (com.liferay.portal.kernel.exception.SystemException se) {
223 _log.error(se, se);
224
225 throw se;
226 }
227 }
228
229 private static Log _log = LogFactoryUtil.getLog(SCProductEntryServiceHttp.class);
230 }