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.LongWrapper;
29 import com.liferay.portal.kernel.util.MethodWrapper;
30 import com.liferay.portal.kernel.util.NullWrapper;
31 import com.liferay.portal.security.auth.HttpPrincipal;
32 import com.liferay.portal.service.http.TunnelUtil;
33
34 import com.liferay.portlet.softwarecatalog.service.SCLicenseServiceUtil;
35
36
73 public class SCLicenseServiceHttp {
74 public static com.liferay.portlet.softwarecatalog.model.SCLicense addLicense(
75 HttpPrincipal httpPrincipal, java.lang.String name,
76 java.lang.String url, boolean openSource, boolean active,
77 boolean recommended)
78 throws com.liferay.portal.PortalException,
79 com.liferay.portal.SystemException {
80 try {
81 Object paramObj0 = name;
82
83 if (name == null) {
84 paramObj0 = new NullWrapper("java.lang.String");
85 }
86
87 Object paramObj1 = url;
88
89 if (url == null) {
90 paramObj1 = new NullWrapper("java.lang.String");
91 }
92
93 Object paramObj2 = new BooleanWrapper(openSource);
94
95 Object paramObj3 = new BooleanWrapper(active);
96
97 Object paramObj4 = new BooleanWrapper(recommended);
98
99 MethodWrapper methodWrapper = new MethodWrapper(SCLicenseServiceUtil.class.getName(),
100 "addLicense",
101 new Object[] {
102 paramObj0, paramObj1, paramObj2, paramObj3, paramObj4
103 });
104
105 Object returnObj = null;
106
107 try {
108 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
109 }
110 catch (Exception e) {
111 if (e instanceof com.liferay.portal.PortalException) {
112 throw (com.liferay.portal.PortalException)e;
113 }
114
115 if (e instanceof com.liferay.portal.SystemException) {
116 throw (com.liferay.portal.SystemException)e;
117 }
118
119 throw new com.liferay.portal.SystemException(e);
120 }
121
122 return (com.liferay.portlet.softwarecatalog.model.SCLicense)returnObj;
123 }
124 catch (com.liferay.portal.SystemException se) {
125 _log.error(se, se);
126
127 throw se;
128 }
129 }
130
131 public static void deleteLicense(HttpPrincipal httpPrincipal, long licenseId)
132 throws com.liferay.portal.PortalException,
133 com.liferay.portal.SystemException {
134 try {
135 Object paramObj0 = new LongWrapper(licenseId);
136
137 MethodWrapper methodWrapper = new MethodWrapper(SCLicenseServiceUtil.class.getName(),
138 "deleteLicense", new Object[] { paramObj0 });
139
140 try {
141 TunnelUtil.invoke(httpPrincipal, methodWrapper);
142 }
143 catch (Exception e) {
144 if (e instanceof com.liferay.portal.PortalException) {
145 throw (com.liferay.portal.PortalException)e;
146 }
147
148 if (e instanceof com.liferay.portal.SystemException) {
149 throw (com.liferay.portal.SystemException)e;
150 }
151
152 throw new com.liferay.portal.SystemException(e);
153 }
154 }
155 catch (com.liferay.portal.SystemException se) {
156 _log.error(se, se);
157
158 throw se;
159 }
160 }
161
162 public static com.liferay.portlet.softwarecatalog.model.SCLicense getLicense(
163 HttpPrincipal httpPrincipal, long licenseId)
164 throws com.liferay.portal.PortalException,
165 com.liferay.portal.SystemException {
166 try {
167 Object paramObj0 = new LongWrapper(licenseId);
168
169 MethodWrapper methodWrapper = new MethodWrapper(SCLicenseServiceUtil.class.getName(),
170 "getLicense", new Object[] { paramObj0 });
171
172 Object returnObj = null;
173
174 try {
175 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
176 }
177 catch (Exception e) {
178 if (e instanceof com.liferay.portal.PortalException) {
179 throw (com.liferay.portal.PortalException)e;
180 }
181
182 if (e instanceof com.liferay.portal.SystemException) {
183 throw (com.liferay.portal.SystemException)e;
184 }
185
186 throw new com.liferay.portal.SystemException(e);
187 }
188
189 return (com.liferay.portlet.softwarecatalog.model.SCLicense)returnObj;
190 }
191 catch (com.liferay.portal.SystemException se) {
192 _log.error(se, se);
193
194 throw se;
195 }
196 }
197
198 public static com.liferay.portlet.softwarecatalog.model.SCLicense updateLicense(
199 HttpPrincipal httpPrincipal, long licenseId, java.lang.String name,
200 java.lang.String url, boolean openSource, boolean active,
201 boolean recommended)
202 throws com.liferay.portal.PortalException,
203 com.liferay.portal.SystemException {
204 try {
205 Object paramObj0 = new LongWrapper(licenseId);
206
207 Object paramObj1 = name;
208
209 if (name == null) {
210 paramObj1 = new NullWrapper("java.lang.String");
211 }
212
213 Object paramObj2 = url;
214
215 if (url == null) {
216 paramObj2 = new NullWrapper("java.lang.String");
217 }
218
219 Object paramObj3 = new BooleanWrapper(openSource);
220
221 Object paramObj4 = new BooleanWrapper(active);
222
223 Object paramObj5 = new BooleanWrapper(recommended);
224
225 MethodWrapper methodWrapper = new MethodWrapper(SCLicenseServiceUtil.class.getName(),
226 "updateLicense",
227 new Object[] {
228 paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
229 paramObj5
230 });
231
232 Object returnObj = null;
233
234 try {
235 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
236 }
237 catch (Exception e) {
238 if (e instanceof com.liferay.portal.PortalException) {
239 throw (com.liferay.portal.PortalException)e;
240 }
241
242 if (e instanceof com.liferay.portal.SystemException) {
243 throw (com.liferay.portal.SystemException)e;
244 }
245
246 throw new com.liferay.portal.SystemException(e);
247 }
248
249 return (com.liferay.portlet.softwarecatalog.model.SCLicense)returnObj;
250 }
251 catch (com.liferay.portal.SystemException se) {
252 _log.error(se, se);
253
254 throw se;
255 }
256 }
257
258 private static Log _log = LogFactoryUtil.getLog(SCLicenseServiceHttp.class);
259 }