1
22
23 package com.liferay.portlet.shopping.service;
24
25
26
53 public class ShoppingItemLocalServiceUtil {
54 public static com.liferay.portlet.shopping.model.ShoppingItem addShoppingItem(
55 com.liferay.portlet.shopping.model.ShoppingItem shoppingItem)
56 throws com.liferay.portal.SystemException {
57 ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
58
59 return shoppingItemLocalService.addShoppingItem(shoppingItem);
60 }
61
62 public static void deleteShoppingItem(long itemId)
63 throws com.liferay.portal.PortalException,
64 com.liferay.portal.SystemException {
65 ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
66
67 shoppingItemLocalService.deleteShoppingItem(itemId);
68 }
69
70 public static void deleteShoppingItem(
71 com.liferay.portlet.shopping.model.ShoppingItem shoppingItem)
72 throws com.liferay.portal.SystemException {
73 ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
74
75 shoppingItemLocalService.deleteShoppingItem(shoppingItem);
76 }
77
78 public static java.util.List<Object> dynamicQuery(
79 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
80 throws com.liferay.portal.SystemException {
81 ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
82
83 return shoppingItemLocalService.dynamicQuery(dynamicQuery);
84 }
85
86 public static java.util.List<Object> dynamicQuery(
87 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
88 int end) throws com.liferay.portal.SystemException {
89 ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
90
91 return shoppingItemLocalService.dynamicQuery(dynamicQuery, start, end);
92 }
93
94 public static com.liferay.portlet.shopping.model.ShoppingItem getShoppingItem(
95 long itemId)
96 throws com.liferay.portal.PortalException,
97 com.liferay.portal.SystemException {
98 ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
99
100 return shoppingItemLocalService.getShoppingItem(itemId);
101 }
102
103 public static com.liferay.portlet.shopping.model.ShoppingItem updateShoppingItem(
104 com.liferay.portlet.shopping.model.ShoppingItem shoppingItem)
105 throws com.liferay.portal.SystemException {
106 ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
107
108 return shoppingItemLocalService.updateShoppingItem(shoppingItem);
109 }
110
111 public static void addBookItems(long userId, long categoryId,
112 java.lang.String[] isbns)
113 throws com.liferay.portal.PortalException,
114 com.liferay.portal.SystemException {
115 ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
116
117 shoppingItemLocalService.addBookItems(userId, categoryId, isbns);
118 }
119
120 public static com.liferay.portlet.shopping.model.ShoppingItem addItem(
121 long userId, long categoryId, java.lang.String sku,
122 java.lang.String name, java.lang.String description,
123 java.lang.String properties, java.lang.String fieldsQuantities,
124 boolean requiresShipping, int stockQuantity, boolean featured,
125 java.lang.Boolean sale, boolean smallImage,
126 java.lang.String smallImageURL, java.io.File smallFile,
127 boolean mediumImage, java.lang.String mediumImageURL,
128 java.io.File mediumFile, boolean largeImage,
129 java.lang.String largeImageURL, java.io.File largeFile,
130 java.util.List<com.liferay.portlet.shopping.model.ShoppingItemField> itemFields,
131 java.util.List<com.liferay.portlet.shopping.model.ShoppingItemPrice> itemPrices,
132 boolean addCommunityPermissions, boolean addGuestPermissions)
133 throws com.liferay.portal.PortalException,
134 com.liferay.portal.SystemException {
135 ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
136
137 return shoppingItemLocalService.addItem(userId, categoryId, sku, name,
138 description, properties, fieldsQuantities, requiresShipping,
139 stockQuantity, featured, sale, smallImage, smallImageURL,
140 smallFile, mediumImage, mediumImageURL, mediumFile, largeImage,
141 largeImageURL, largeFile, itemFields, itemPrices,
142 addCommunityPermissions, addGuestPermissions);
143 }
144
145 public static com.liferay.portlet.shopping.model.ShoppingItem addItem(
146 long userId, long categoryId, java.lang.String sku,
147 java.lang.String name, java.lang.String description,
148 java.lang.String properties, java.lang.String fieldsQuantities,
149 boolean requiresShipping, int stockQuantity, boolean featured,
150 java.lang.Boolean sale, boolean smallImage,
151 java.lang.String smallImageURL, java.io.File smallFile,
152 boolean mediumImage, java.lang.String mediumImageURL,
153 java.io.File mediumFile, boolean largeImage,
154 java.lang.String largeImageURL, java.io.File largeFile,
155 java.util.List<com.liferay.portlet.shopping.model.ShoppingItemField> itemFields,
156 java.util.List<com.liferay.portlet.shopping.model.ShoppingItemPrice> itemPrices,
157 java.lang.String[] communityPermissions,
158 java.lang.String[] guestPermissions)
159 throws com.liferay.portal.PortalException,
160 com.liferay.portal.SystemException {
161 ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
162
163 return shoppingItemLocalService.addItem(userId, categoryId, sku, name,
164 description, properties, fieldsQuantities, requiresShipping,
165 stockQuantity, featured, sale, smallImage, smallImageURL,
166 smallFile, mediumImage, mediumImageURL, mediumFile, largeImage,
167 largeImageURL, largeFile, itemFields, itemPrices,
168 communityPermissions, guestPermissions);
169 }
170
171 public static com.liferay.portlet.shopping.model.ShoppingItem addItem(
172 long userId, long categoryId, java.lang.String sku,
173 java.lang.String name, java.lang.String description,
174 java.lang.String properties, java.lang.String fieldsQuantities,
175 boolean requiresShipping, int stockQuantity, boolean featured,
176 java.lang.Boolean sale, boolean smallImage,
177 java.lang.String smallImageURL, java.io.File smallFile,
178 boolean mediumImage, java.lang.String mediumImageURL,
179 java.io.File mediumFile, boolean largeImage,
180 java.lang.String largeImageURL, java.io.File largeFile,
181 java.util.List<com.liferay.portlet.shopping.model.ShoppingItemField> itemFields,
182 java.util.List<com.liferay.portlet.shopping.model.ShoppingItemPrice> itemPrices,
183 java.lang.Boolean addCommunityPermissions,
184 java.lang.Boolean addGuestPermissions,
185 java.lang.String[] communityPermissions,
186 java.lang.String[] guestPermissions)
187 throws com.liferay.portal.PortalException,
188 com.liferay.portal.SystemException {
189 ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
190
191 return shoppingItemLocalService.addItem(userId, categoryId, sku, name,
192 description, properties, fieldsQuantities, requiresShipping,
193 stockQuantity, featured, sale, smallImage, smallImageURL,
194 smallFile, mediumImage, mediumImageURL, mediumFile, largeImage,
195 largeImageURL, largeFile, itemFields, itemPrices,
196 addCommunityPermissions, addGuestPermissions, communityPermissions,
197 guestPermissions);
198 }
199
200 public static void addItemResources(long itemId,
201 boolean addCommunityPermissions, boolean addGuestPermissions)
202 throws com.liferay.portal.PortalException,
203 com.liferay.portal.SystemException {
204 ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
205
206 shoppingItemLocalService.addItemResources(itemId,
207 addCommunityPermissions, addGuestPermissions);
208 }
209
210 public static void addItemResources(
211 com.liferay.portlet.shopping.model.ShoppingCategory category,
212 com.liferay.portlet.shopping.model.ShoppingItem item,
213 boolean addCommunityPermissions, boolean addGuestPermissions)
214 throws com.liferay.portal.PortalException,
215 com.liferay.portal.SystemException {
216 ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
217
218 shoppingItemLocalService.addItemResources(category, item,
219 addCommunityPermissions, addGuestPermissions);
220 }
221
222 public static void addItemResources(long itemId,
223 java.lang.String[] communityPermissions,
224 java.lang.String[] guestPermissions)
225 throws com.liferay.portal.PortalException,
226 com.liferay.portal.SystemException {
227 ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
228
229 shoppingItemLocalService.addItemResources(itemId, communityPermissions,
230 guestPermissions);
231 }
232
233 public static void addItemResources(
234 com.liferay.portlet.shopping.model.ShoppingCategory category,
235 com.liferay.portlet.shopping.model.ShoppingItem item,
236 java.lang.String[] communityPermissions,
237 java.lang.String[] guestPermissions)
238 throws com.liferay.portal.PortalException,
239 com.liferay.portal.SystemException {
240 ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
241
242 shoppingItemLocalService.addItemResources(category, item,
243 communityPermissions, guestPermissions);
244 }
245
246 public static void deleteItem(long itemId)
247 throws com.liferay.portal.PortalException,
248 com.liferay.portal.SystemException {
249 ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
250
251 shoppingItemLocalService.deleteItem(itemId);
252 }
253
254 public static void deleteItem(
255 com.liferay.portlet.shopping.model.ShoppingItem item)
256 throws com.liferay.portal.PortalException,
257 com.liferay.portal.SystemException {
258 ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
259
260 shoppingItemLocalService.deleteItem(item);
261 }
262
263 public static void deleteItems(long categoryId)
264 throws com.liferay.portal.PortalException,
265 com.liferay.portal.SystemException {
266 ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
267
268 shoppingItemLocalService.deleteItems(categoryId);
269 }
270
271 public static int getCategoriesItemsCount(java.util.List<Long> categoryIds)
272 throws com.liferay.portal.SystemException {
273 ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
274
275 return shoppingItemLocalService.getCategoriesItemsCount(categoryIds);
276 }
277
278 public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItem> getFeaturedItems(
279 long groupId, long categoryId, int numOfItems)
280 throws com.liferay.portal.SystemException {
281 ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
282
283 return shoppingItemLocalService.getFeaturedItems(groupId, categoryId,
284 numOfItems);
285 }
286
287 public static com.liferay.portlet.shopping.model.ShoppingItem getItem(
288 long itemId)
289 throws com.liferay.portal.PortalException,
290 com.liferay.portal.SystemException {
291 ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
292
293 return shoppingItemLocalService.getItem(itemId);
294 }
295
296 public static com.liferay.portlet.shopping.model.ShoppingItem getItem(
297 long companyId, java.lang.String sku)
298 throws com.liferay.portal.PortalException,
299 com.liferay.portal.SystemException {
300 ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
301
302 return shoppingItemLocalService.getItem(companyId, sku);
303 }
304
305 public static com.liferay.portlet.shopping.model.ShoppingItem getItemByLargeImageId(
306 long largeImageId)
307 throws com.liferay.portal.PortalException,
308 com.liferay.portal.SystemException {
309 ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
310
311 return shoppingItemLocalService.getItemByLargeImageId(largeImageId);
312 }
313
314 public static com.liferay.portlet.shopping.model.ShoppingItem getItemByMediumImageId(
315 long mediumImageId)
316 throws com.liferay.portal.PortalException,
317 com.liferay.portal.SystemException {
318 ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
319
320 return shoppingItemLocalService.getItemByMediumImageId(mediumImageId);
321 }
322
323 public static com.liferay.portlet.shopping.model.ShoppingItem getItemBySmallImageId(
324 long smallImageId)
325 throws com.liferay.portal.PortalException,
326 com.liferay.portal.SystemException {
327 ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
328
329 return shoppingItemLocalService.getItemBySmallImageId(smallImageId);
330 }
331
332 public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItem> getItems(
333 long categoryId) throws com.liferay.portal.SystemException {
334 ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
335
336 return shoppingItemLocalService.getItems(categoryId);
337 }
338
339 public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItem> getItems(
340 long categoryId, int start, int end,
341 com.liferay.portal.kernel.util.OrderByComparator obc)
342 throws com.liferay.portal.SystemException {
343 ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
344
345 return shoppingItemLocalService.getItems(categoryId, start, end, obc);
346 }
347
348 public static com.liferay.portlet.shopping.model.ShoppingItem[] getItemsPrevAndNext(
349 long itemId, com.liferay.portal.kernel.util.OrderByComparator obc)
350 throws com.liferay.portal.PortalException,
351 com.liferay.portal.SystemException {
352 ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
353
354 return shoppingItemLocalService.getItemsPrevAndNext(itemId, obc);
355 }
356
357 public static int getItemsCount(long categoryId)
358 throws com.liferay.portal.SystemException {
359 ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
360
361 return shoppingItemLocalService.getItemsCount(categoryId);
362 }
363
364 public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItem> getSaleItems(
365 long groupId, long categoryId, int numOfItems)
366 throws com.liferay.portal.SystemException {
367 ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
368
369 return shoppingItemLocalService.getSaleItems(groupId, categoryId,
370 numOfItems);
371 }
372
373 public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItem> search(
374 long groupId, long[] categoryIds, java.lang.String keywords, int start,
375 int end) throws com.liferay.portal.SystemException {
376 ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
377
378 return shoppingItemLocalService.search(groupId, categoryIds, keywords,
379 start, end);
380 }
381
382 public static int searchCount(long groupId, long[] categoryIds,
383 java.lang.String keywords) throws com.liferay.portal.SystemException {
384 ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
385
386 return shoppingItemLocalService.searchCount(groupId, categoryIds,
387 keywords);
388 }
389
390 public static com.liferay.portlet.shopping.model.ShoppingItem updateItem(
391 long userId, long itemId, long categoryId, java.lang.String sku,
392 java.lang.String name, java.lang.String description,
393 java.lang.String properties, java.lang.String fieldsQuantities,
394 boolean requiresShipping, int stockQuantity, boolean featured,
395 java.lang.Boolean sale, boolean smallImage,
396 java.lang.String smallImageURL, java.io.File smallFile,
397 boolean mediumImage, java.lang.String mediumImageURL,
398 java.io.File mediumFile, boolean largeImage,
399 java.lang.String largeImageURL, java.io.File largeFile,
400 java.util.List<com.liferay.portlet.shopping.model.ShoppingItemField> itemFields,
401 java.util.List<com.liferay.portlet.shopping.model.ShoppingItemPrice> itemPrices)
402 throws com.liferay.portal.PortalException,
403 com.liferay.portal.SystemException {
404 ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
405
406 return shoppingItemLocalService.updateItem(userId, itemId, categoryId,
407 sku, name, description, properties, fieldsQuantities,
408 requiresShipping, stockQuantity, featured, sale, smallImage,
409 smallImageURL, smallFile, mediumImage, mediumImageURL, mediumFile,
410 largeImage, largeImageURL, largeFile, itemFields, itemPrices);
411 }
412 }