1
22
23 package com.liferay.portlet.shopping.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.shopping.service.ShoppingCategoryServiceUtil;
35
36
73 public class ShoppingCategoryServiceHttp {
74 public static com.liferay.portlet.shopping.model.ShoppingCategory addCategory(
75 HttpPrincipal httpPrincipal, long plid, long parentCategoryId,
76 java.lang.String name, java.lang.String description,
77 boolean addCommunityPermissions, boolean addGuestPermissions)
78 throws com.liferay.portal.SystemException,
79 com.liferay.portal.PortalException {
80 try {
81 Object paramObj0 = new LongWrapper(plid);
82 Object paramObj1 = new LongWrapper(parentCategoryId);
83 Object paramObj2 = name;
84
85 if (name == null) {
86 paramObj2 = new NullWrapper("java.lang.String");
87 }
88
89 Object paramObj3 = description;
90
91 if (description == null) {
92 paramObj3 = new NullWrapper("java.lang.String");
93 }
94
95 Object paramObj4 = new BooleanWrapper(addCommunityPermissions);
96 Object paramObj5 = new BooleanWrapper(addGuestPermissions);
97 MethodWrapper methodWrapper = new MethodWrapper(ShoppingCategoryServiceUtil.class.getName(),
98 "addCategory",
99 new Object[] {
100 paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
101 paramObj5
102 });
103 Object returnObj = null;
104
105 try {
106 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
107 }
108 catch (Exception e) {
109 if (e instanceof com.liferay.portal.SystemException) {
110 throw (com.liferay.portal.SystemException)e;
111 }
112
113 if (e instanceof com.liferay.portal.PortalException) {
114 throw (com.liferay.portal.PortalException)e;
115 }
116
117 throw new com.liferay.portal.SystemException(e);
118 }
119
120 return (com.liferay.portlet.shopping.model.ShoppingCategory)returnObj;
121 }
122 catch (com.liferay.portal.SystemException se) {
123 _log.error(se, se);
124 throw se;
125 }
126 }
127
128 public static com.liferay.portlet.shopping.model.ShoppingCategory addCategory(
129 HttpPrincipal httpPrincipal, long plid, long parentCategoryId,
130 java.lang.String name, java.lang.String description,
131 java.lang.String[] communityPermissions,
132 java.lang.String[] guestPermissions)
133 throws com.liferay.portal.SystemException,
134 com.liferay.portal.PortalException {
135 try {
136 Object paramObj0 = new LongWrapper(plid);
137 Object paramObj1 = new LongWrapper(parentCategoryId);
138 Object paramObj2 = name;
139
140 if (name == null) {
141 paramObj2 = new NullWrapper("java.lang.String");
142 }
143
144 Object paramObj3 = description;
145
146 if (description == null) {
147 paramObj3 = new NullWrapper("java.lang.String");
148 }
149
150 Object paramObj4 = communityPermissions;
151
152 if (communityPermissions == null) {
153 paramObj4 = new NullWrapper("[Ljava.lang.String;");
154 }
155
156 Object paramObj5 = guestPermissions;
157
158 if (guestPermissions == null) {
159 paramObj5 = new NullWrapper("[Ljava.lang.String;");
160 }
161
162 MethodWrapper methodWrapper = new MethodWrapper(ShoppingCategoryServiceUtil.class.getName(),
163 "addCategory",
164 new Object[] {
165 paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
166 paramObj5
167 });
168 Object returnObj = null;
169
170 try {
171 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
172 }
173 catch (Exception e) {
174 if (e instanceof com.liferay.portal.SystemException) {
175 throw (com.liferay.portal.SystemException)e;
176 }
177
178 if (e instanceof com.liferay.portal.PortalException) {
179 throw (com.liferay.portal.PortalException)e;
180 }
181
182 throw new com.liferay.portal.SystemException(e);
183 }
184
185 return (com.liferay.portlet.shopping.model.ShoppingCategory)returnObj;
186 }
187 catch (com.liferay.portal.SystemException se) {
188 _log.error(se, se);
189 throw se;
190 }
191 }
192
193 public static void deleteCategory(HttpPrincipal httpPrincipal,
194 long categoryId)
195 throws com.liferay.portal.SystemException,
196 com.liferay.portal.PortalException {
197 try {
198 Object paramObj0 = new LongWrapper(categoryId);
199 MethodWrapper methodWrapper = new MethodWrapper(ShoppingCategoryServiceUtil.class.getName(),
200 "deleteCategory", new Object[] { paramObj0 });
201
202 try {
203 TunnelUtil.invoke(httpPrincipal, methodWrapper);
204 }
205 catch (Exception e) {
206 if (e instanceof com.liferay.portal.SystemException) {
207 throw (com.liferay.portal.SystemException)e;
208 }
209
210 if (e instanceof com.liferay.portal.PortalException) {
211 throw (com.liferay.portal.PortalException)e;
212 }
213
214 throw new com.liferay.portal.SystemException(e);
215 }
216 }
217 catch (com.liferay.portal.SystemException se) {
218 _log.error(se, se);
219 throw se;
220 }
221 }
222
223 public static com.liferay.portlet.shopping.model.ShoppingCategory getCategory(
224 HttpPrincipal httpPrincipal, long categoryId)
225 throws com.liferay.portal.SystemException,
226 com.liferay.portal.PortalException {
227 try {
228 Object paramObj0 = new LongWrapper(categoryId);
229 MethodWrapper methodWrapper = new MethodWrapper(ShoppingCategoryServiceUtil.class.getName(),
230 "getCategory", new Object[] { paramObj0 });
231 Object returnObj = null;
232
233 try {
234 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
235 }
236 catch (Exception e) {
237 if (e instanceof com.liferay.portal.SystemException) {
238 throw (com.liferay.portal.SystemException)e;
239 }
240
241 if (e instanceof com.liferay.portal.PortalException) {
242 throw (com.liferay.portal.PortalException)e;
243 }
244
245 throw new com.liferay.portal.SystemException(e);
246 }
247
248 return (com.liferay.portlet.shopping.model.ShoppingCategory)returnObj;
249 }
250 catch (com.liferay.portal.SystemException se) {
251 _log.error(se, se);
252 throw se;
253 }
254 }
255
256 public static com.liferay.portlet.shopping.model.ShoppingCategory updateCategory(
257 HttpPrincipal httpPrincipal, long categoryId, long parentCategoryId,
258 java.lang.String name, java.lang.String description,
259 boolean mergeWithParentCategory)
260 throws com.liferay.portal.SystemException,
261 com.liferay.portal.PortalException {
262 try {
263 Object paramObj0 = new LongWrapper(categoryId);
264 Object paramObj1 = new LongWrapper(parentCategoryId);
265 Object paramObj2 = name;
266
267 if (name == null) {
268 paramObj2 = new NullWrapper("java.lang.String");
269 }
270
271 Object paramObj3 = description;
272
273 if (description == null) {
274 paramObj3 = new NullWrapper("java.lang.String");
275 }
276
277 Object paramObj4 = new BooleanWrapper(mergeWithParentCategory);
278 MethodWrapper methodWrapper = new MethodWrapper(ShoppingCategoryServiceUtil.class.getName(),
279 "updateCategory",
280 new Object[] {
281 paramObj0, paramObj1, paramObj2, paramObj3, paramObj4
282 });
283 Object returnObj = null;
284
285 try {
286 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
287 }
288 catch (Exception e) {
289 if (e instanceof com.liferay.portal.SystemException) {
290 throw (com.liferay.portal.SystemException)e;
291 }
292
293 if (e instanceof com.liferay.portal.PortalException) {
294 throw (com.liferay.portal.PortalException)e;
295 }
296
297 throw new com.liferay.portal.SystemException(e);
298 }
299
300 return (com.liferay.portlet.shopping.model.ShoppingCategory)returnObj;
301 }
302 catch (com.liferay.portal.SystemException se) {
303 _log.error(se, se);
304 throw se;
305 }
306 }
307
308 private static Log _log = LogFactoryUtil.getLog(ShoppingCategoryServiceHttp.class);
309 }