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