1   /**
2    * Copyright (c) 2000-2008 Liferay, Inc. All rights reserved.
3    *
4    * Permission is hereby granted, free of charge, to any person obtaining a copy
5    * of this software and associated documentation files (the "Software"), to deal
6    * in the Software without restriction, including without limitation the rights
7    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8    * copies of the Software, and to permit persons to whom the Software is
9    * furnished to do so, subject to the following conditions:
10   *
11   * The above copyright notice and this permission notice shall be included in
12   * all copies or substantial portions of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
22  
23  package com.liferay.portlet.shopping.service;
24  
25  
26  /**
27   * <a href="ShoppingItemLocalServiceUtil.java.html"><b><i>View Source</i></b></a>
28   *
29   * <p>
30   * ServiceBuilder generated this class. Modifications in this class will be
31   * overwritten the next time is generated.
32   * </p>
33   *
34   * <p>
35   * This class provides static methods for the
36   * <code>com.liferay.portlet.shopping.service.ShoppingItemLocalService</code>
37   * bean. The static methods of this class calls the same methods of the bean
38   * instance. It's convenient to be able to just write one line to call a method
39   * on a bean instead of writing a lookup call and a method call.
40   * </p>
41   *
42   * <p>
43   * <code>com.liferay.portlet.shopping.service.ShoppingItemLocalServiceFactory</code>
44   * is responsible for the lookup of the bean.
45   * </p>
46   *
47   * @author Brian Wing Shun Chan
48   *
49   * @see com.liferay.portlet.shopping.service.ShoppingItemLocalService
50   * @see com.liferay.portlet.shopping.service.ShoppingItemLocalServiceFactory
51   *
52   */
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.PortalException,
73              com.liferay.portal.SystemException {
74          ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
75  
76          shoppingItemLocalService.deleteShoppingItem(shoppingItem);
77      }
78  
79      public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItem> dynamicQuery(
80          com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer)
81          throws com.liferay.portal.SystemException {
82          ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
83  
84          return shoppingItemLocalService.dynamicQuery(queryInitializer);
85      }
86  
87      public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItem> dynamicQuery(
88          com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer,
89          int begin, int end) throws com.liferay.portal.SystemException {
90          ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
91  
92          return shoppingItemLocalService.dynamicQuery(queryInitializer, begin,
93              end);
94      }
95  
96      public static com.liferay.portlet.shopping.model.ShoppingItem updateShoppingItem(
97          com.liferay.portlet.shopping.model.ShoppingItem shoppingItem)
98          throws com.liferay.portal.SystemException {
99          ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
100 
101         return shoppingItemLocalService.updateShoppingItem(shoppingItem);
102     }
103 
104     public static void addBookItems(long userId, long categoryId,
105         java.lang.String[] isbns)
106         throws com.liferay.portal.PortalException,
107             com.liferay.portal.SystemException {
108         ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
109 
110         shoppingItemLocalService.addBookItems(userId, categoryId, isbns);
111     }
112 
113     public static com.liferay.portlet.shopping.model.ShoppingItem addItem(
114         long userId, long categoryId, java.lang.String sku,
115         java.lang.String name, java.lang.String description,
116         java.lang.String properties, java.lang.String fieldsQuantities,
117         boolean requiresShipping, int stockQuantity, boolean featured,
118         java.lang.Boolean sale, boolean smallImage,
119         java.lang.String smallImageURL, java.io.File smallFile,
120         boolean mediumImage, java.lang.String mediumImageURL,
121         java.io.File mediumFile, boolean largeImage,
122         java.lang.String largeImageURL, java.io.File largeFile,
123         java.util.List<com.liferay.portlet.shopping.model.ShoppingItemField> itemFields,
124         java.util.List<com.liferay.portlet.shopping.model.ShoppingItemPrice> itemPrices,
125         boolean addCommunityPermissions, boolean addGuestPermissions)
126         throws com.liferay.portal.PortalException,
127             com.liferay.portal.SystemException {
128         ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
129 
130         return shoppingItemLocalService.addItem(userId, categoryId, sku, name,
131             description, properties, fieldsQuantities, requiresShipping,
132             stockQuantity, featured, sale, smallImage, smallImageURL,
133             smallFile, mediumImage, mediumImageURL, mediumFile, largeImage,
134             largeImageURL, largeFile, itemFields, itemPrices,
135             addCommunityPermissions, addGuestPermissions);
136     }
137 
138     public static com.liferay.portlet.shopping.model.ShoppingItem addItem(
139         long userId, long categoryId, java.lang.String sku,
140         java.lang.String name, java.lang.String description,
141         java.lang.String properties, java.lang.String fieldsQuantities,
142         boolean requiresShipping, int stockQuantity, boolean featured,
143         java.lang.Boolean sale, boolean smallImage,
144         java.lang.String smallImageURL, java.io.File smallFile,
145         boolean mediumImage, java.lang.String mediumImageURL,
146         java.io.File mediumFile, boolean largeImage,
147         java.lang.String largeImageURL, java.io.File largeFile,
148         java.util.List<com.liferay.portlet.shopping.model.ShoppingItemField> itemFields,
149         java.util.List<com.liferay.portlet.shopping.model.ShoppingItemPrice> itemPrices,
150         java.lang.String[] communityPermissions,
151         java.lang.String[] guestPermissions)
152         throws com.liferay.portal.PortalException,
153             com.liferay.portal.SystemException {
154         ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
155 
156         return shoppingItemLocalService.addItem(userId, categoryId, sku, name,
157             description, properties, fieldsQuantities, requiresShipping,
158             stockQuantity, featured, sale, smallImage, smallImageURL,
159             smallFile, mediumImage, mediumImageURL, mediumFile, largeImage,
160             largeImageURL, largeFile, itemFields, itemPrices,
161             communityPermissions, guestPermissions);
162     }
163 
164     public static com.liferay.portlet.shopping.model.ShoppingItem addItem(
165         long userId, long categoryId, java.lang.String sku,
166         java.lang.String name, java.lang.String description,
167         java.lang.String properties, java.lang.String fieldsQuantities,
168         boolean requiresShipping, int stockQuantity, boolean featured,
169         java.lang.Boolean sale, boolean smallImage,
170         java.lang.String smallImageURL, java.io.File smallFile,
171         boolean mediumImage, java.lang.String mediumImageURL,
172         java.io.File mediumFile, boolean largeImage,
173         java.lang.String largeImageURL, java.io.File largeFile,
174         java.util.List<com.liferay.portlet.shopping.model.ShoppingItemField> itemFields,
175         java.util.List<com.liferay.portlet.shopping.model.ShoppingItemPrice> itemPrices,
176         java.lang.Boolean addCommunityPermissions,
177         java.lang.Boolean addGuestPermissions,
178         java.lang.String[] communityPermissions,
179         java.lang.String[] guestPermissions)
180         throws com.liferay.portal.PortalException,
181             com.liferay.portal.SystemException {
182         ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
183 
184         return shoppingItemLocalService.addItem(userId, categoryId, sku, name,
185             description, properties, fieldsQuantities, requiresShipping,
186             stockQuantity, featured, sale, smallImage, smallImageURL,
187             smallFile, mediumImage, mediumImageURL, mediumFile, largeImage,
188             largeImageURL, largeFile, itemFields, itemPrices,
189             addCommunityPermissions, addGuestPermissions, communityPermissions,
190             guestPermissions);
191     }
192 
193     public static void addItemResources(long itemId,
194         boolean addCommunityPermissions, boolean addGuestPermissions)
195         throws com.liferay.portal.PortalException,
196             com.liferay.portal.SystemException {
197         ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
198 
199         shoppingItemLocalService.addItemResources(itemId,
200             addCommunityPermissions, addGuestPermissions);
201     }
202 
203     public static void addItemResources(
204         com.liferay.portlet.shopping.model.ShoppingCategory category,
205         com.liferay.portlet.shopping.model.ShoppingItem item,
206         boolean addCommunityPermissions, boolean addGuestPermissions)
207         throws com.liferay.portal.PortalException,
208             com.liferay.portal.SystemException {
209         ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
210 
211         shoppingItemLocalService.addItemResources(category, item,
212             addCommunityPermissions, addGuestPermissions);
213     }
214 
215     public static void addItemResources(long itemId,
216         java.lang.String[] communityPermissions,
217         java.lang.String[] guestPermissions)
218         throws com.liferay.portal.PortalException,
219             com.liferay.portal.SystemException {
220         ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
221 
222         shoppingItemLocalService.addItemResources(itemId, communityPermissions,
223             guestPermissions);
224     }
225 
226     public static void addItemResources(
227         com.liferay.portlet.shopping.model.ShoppingCategory category,
228         com.liferay.portlet.shopping.model.ShoppingItem item,
229         java.lang.String[] communityPermissions,
230         java.lang.String[] guestPermissions)
231         throws com.liferay.portal.PortalException,
232             com.liferay.portal.SystemException {
233         ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
234 
235         shoppingItemLocalService.addItemResources(category, item,
236             communityPermissions, guestPermissions);
237     }
238 
239     public static void deleteItem(long itemId)
240         throws com.liferay.portal.PortalException,
241             com.liferay.portal.SystemException {
242         ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
243 
244         shoppingItemLocalService.deleteItem(itemId);
245     }
246 
247     public static void deleteItem(
248         com.liferay.portlet.shopping.model.ShoppingItem item)
249         throws com.liferay.portal.PortalException,
250             com.liferay.portal.SystemException {
251         ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
252 
253         shoppingItemLocalService.deleteItem(item);
254     }
255 
256     public static void deleteItems(long categoryId)
257         throws com.liferay.portal.PortalException,
258             com.liferay.portal.SystemException {
259         ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
260 
261         shoppingItemLocalService.deleteItems(categoryId);
262     }
263 
264     public static int getCategoriesItemsCount(java.util.List<Long> categoryIds)
265         throws com.liferay.portal.SystemException {
266         ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
267 
268         return shoppingItemLocalService.getCategoriesItemsCount(categoryIds);
269     }
270 
271     public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItem> getFeaturedItems(
272         long groupId, long categoryId, int numOfItems)
273         throws com.liferay.portal.SystemException {
274         ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
275 
276         return shoppingItemLocalService.getFeaturedItems(groupId, categoryId,
277             numOfItems);
278     }
279 
280     public static com.liferay.portlet.shopping.model.ShoppingItem getItem(
281         long itemId)
282         throws com.liferay.portal.PortalException,
283             com.liferay.portal.SystemException {
284         ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
285 
286         return shoppingItemLocalService.getItem(itemId);
287     }
288 
289     public static com.liferay.portlet.shopping.model.ShoppingItem getItem(
290         long companyId, java.lang.String sku)
291         throws com.liferay.portal.PortalException,
292             com.liferay.portal.SystemException {
293         ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
294 
295         return shoppingItemLocalService.getItem(companyId, sku);
296     }
297 
298     public static com.liferay.portlet.shopping.model.ShoppingItem getItemByLargeImageId(
299         long largeImageId)
300         throws com.liferay.portal.PortalException,
301             com.liferay.portal.SystemException {
302         ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
303 
304         return shoppingItemLocalService.getItemByLargeImageId(largeImageId);
305     }
306 
307     public static com.liferay.portlet.shopping.model.ShoppingItem getItemByMediumImageId(
308         long mediumImageId)
309         throws com.liferay.portal.PortalException,
310             com.liferay.portal.SystemException {
311         ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
312 
313         return shoppingItemLocalService.getItemByMediumImageId(mediumImageId);
314     }
315 
316     public static com.liferay.portlet.shopping.model.ShoppingItem getItemBySmallImageId(
317         long smallImageId)
318         throws com.liferay.portal.PortalException,
319             com.liferay.portal.SystemException {
320         ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
321 
322         return shoppingItemLocalService.getItemBySmallImageId(smallImageId);
323     }
324 
325     public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItem> getItems(
326         long categoryId) throws com.liferay.portal.SystemException {
327         ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
328 
329         return shoppingItemLocalService.getItems(categoryId);
330     }
331 
332     public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItem> getItems(
333         long categoryId, int begin, int end,
334         com.liferay.portal.kernel.util.OrderByComparator obc)
335         throws com.liferay.portal.SystemException {
336         ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
337 
338         return shoppingItemLocalService.getItems(categoryId, begin, end, obc);
339     }
340 
341     public static com.liferay.portlet.shopping.model.ShoppingItem[] getItemsPrevAndNext(
342         long itemId, com.liferay.portal.kernel.util.OrderByComparator obc)
343         throws com.liferay.portal.PortalException,
344             com.liferay.portal.SystemException {
345         ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
346 
347         return shoppingItemLocalService.getItemsPrevAndNext(itemId, obc);
348     }
349 
350     public static int getItemsCount(long categoryId)
351         throws com.liferay.portal.SystemException {
352         ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
353 
354         return shoppingItemLocalService.getItemsCount(categoryId);
355     }
356 
357     public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItem> getSaleItems(
358         long groupId, long categoryId, int numOfItems)
359         throws com.liferay.portal.SystemException {
360         ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
361 
362         return shoppingItemLocalService.getSaleItems(groupId, categoryId,
363             numOfItems);
364     }
365 
366     public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItem> search(
367         long groupId, long[] categoryIds, java.lang.String keywords, int begin,
368         int end) throws com.liferay.portal.SystemException {
369         ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
370 
371         return shoppingItemLocalService.search(groupId, categoryIds, keywords,
372             begin, end);
373     }
374 
375     public static int searchCount(long groupId, long[] categoryIds,
376         java.lang.String keywords) throws com.liferay.portal.SystemException {
377         ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
378 
379         return shoppingItemLocalService.searchCount(groupId, categoryIds,
380             keywords);
381     }
382 
383     public static com.liferay.portlet.shopping.model.ShoppingItem updateItem(
384         long userId, long itemId, long categoryId, java.lang.String sku,
385         java.lang.String name, java.lang.String description,
386         java.lang.String properties, java.lang.String fieldsQuantities,
387         boolean requiresShipping, int stockQuantity, boolean featured,
388         java.lang.Boolean sale, boolean smallImage,
389         java.lang.String smallImageURL, java.io.File smallFile,
390         boolean mediumImage, java.lang.String mediumImageURL,
391         java.io.File mediumFile, boolean largeImage,
392         java.lang.String largeImageURL, java.io.File largeFile,
393         java.util.List<com.liferay.portlet.shopping.model.ShoppingItemField> itemFields,
394         java.util.List<com.liferay.portlet.shopping.model.ShoppingItemPrice> itemPrices)
395         throws com.liferay.portal.PortalException,
396             com.liferay.portal.SystemException {
397         ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
398 
399         return shoppingItemLocalService.updateItem(userId, itemId, categoryId,
400             sku, name, description, properties, fieldsQuantities,
401             requiresShipping, stockQuantity, featured, sale, smallImage,
402             smallImageURL, smallFile, mediumImage, mediumImageURL, mediumFile,
403             largeImage, largeImageURL, largeFile, itemFields, itemPrices);
404     }
405 }