1   /**
2    * Copyright (c) 2000-2007 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   * <a href="ShoppingItemLocalServiceUtil.java.html"><b><i>View Source</i></b></a>
27   *
28   * <p>
29   * ServiceBuilder generated this class. Modifications in this class will be overwritten
30   * the next time is generated.
31   * </p>
32   *
33   * <p>
34   * This class provides static methods for the <code>com.liferay.portlet.shopping.service.ShoppingItemLocalService</code>
35   * bean. The static methods of this class calls the same methods of the bean instance.
36   * It's convenient to be able to just write one line to call a method on a bean
37   * instead of writing a lookup call and a method call.
38   * </p>
39   *
40   * <p>
41   * <code>com.liferay.portlet.shopping.service.ShoppingItemLocalServiceFactory</code>
42   * is responsible for the lookup of the bean.
43   * </p>
44   *
45   * @author Brian Wing Shun Chan
46   *
47   * @see com.liferay.portlet.shopping.service.ShoppingItemLocalService
48   * @see com.liferay.portlet.shopping.service.ShoppingItemLocalServiceFactory
49   *
50   */
51  public class ShoppingItemLocalServiceUtil {
52      public static com.liferay.portlet.shopping.model.ShoppingItem addShoppingItem(
53          com.liferay.portlet.shopping.model.ShoppingItem model)
54          throws com.liferay.portal.SystemException {
55          ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
56  
57          return shoppingItemLocalService.addShoppingItem(model);
58      }
59  
60      public static java.util.List dynamicQuery(
61          com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer)
62          throws com.liferay.portal.SystemException {
63          ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
64  
65          return shoppingItemLocalService.dynamicQuery(queryInitializer);
66      }
67  
68      public static java.util.List dynamicQuery(
69          com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer,
70          int begin, int end) throws com.liferay.portal.SystemException {
71          ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
72  
73          return shoppingItemLocalService.dynamicQuery(queryInitializer, begin,
74              end);
75      }
76  
77      public static com.liferay.portlet.shopping.model.ShoppingItem updateShoppingItem(
78          com.liferay.portlet.shopping.model.ShoppingItem model)
79          throws com.liferay.portal.SystemException {
80          ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
81  
82          return shoppingItemLocalService.updateShoppingItem(model);
83      }
84  
85      public static void addBookItems(long userId, long categoryId,
86          java.lang.String[] isbns)
87          throws com.liferay.portal.PortalException, 
88              com.liferay.portal.SystemException {
89          ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
90          shoppingItemLocalService.addBookItems(userId, categoryId, isbns);
91      }
92  
93      public static com.liferay.portlet.shopping.model.ShoppingItem addItem(
94          long userId, long categoryId, java.lang.String sku,
95          java.lang.String name, java.lang.String description,
96          java.lang.String properties, java.lang.String fieldsQuantities,
97          boolean requiresShipping, int stockQuantity, boolean featured,
98          java.lang.Boolean sale, boolean smallImage,
99          java.lang.String smallImageURL, java.io.File smallFile,
100         boolean mediumImage, java.lang.String mediumImageURL,
101         java.io.File mediumFile, boolean largeImage,
102         java.lang.String largeImageURL, java.io.File largeFile,
103         java.util.List itemFields, java.util.List itemPrices,
104         boolean addCommunityPermissions, boolean addGuestPermissions)
105         throws com.liferay.portal.PortalException, 
106             com.liferay.portal.SystemException {
107         ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
108 
109         return shoppingItemLocalService.addItem(userId, categoryId, sku, name,
110             description, properties, fieldsQuantities, requiresShipping,
111             stockQuantity, featured, sale, smallImage, smallImageURL,
112             smallFile, mediumImage, mediumImageURL, mediumFile, largeImage,
113             largeImageURL, largeFile, itemFields, itemPrices,
114             addCommunityPermissions, addGuestPermissions);
115     }
116 
117     public static com.liferay.portlet.shopping.model.ShoppingItem addItem(
118         long userId, long categoryId, java.lang.String sku,
119         java.lang.String name, java.lang.String description,
120         java.lang.String properties, java.lang.String fieldsQuantities,
121         boolean requiresShipping, int stockQuantity, boolean featured,
122         java.lang.Boolean sale, boolean smallImage,
123         java.lang.String smallImageURL, java.io.File smallFile,
124         boolean mediumImage, java.lang.String mediumImageURL,
125         java.io.File mediumFile, boolean largeImage,
126         java.lang.String largeImageURL, java.io.File largeFile,
127         java.util.List itemFields, java.util.List itemPrices,
128         java.lang.String[] communityPermissions,
129         java.lang.String[] guestPermissions)
130         throws com.liferay.portal.PortalException, 
131             com.liferay.portal.SystemException {
132         ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
133 
134         return shoppingItemLocalService.addItem(userId, categoryId, sku, name,
135             description, properties, fieldsQuantities, requiresShipping,
136             stockQuantity, featured, sale, smallImage, smallImageURL,
137             smallFile, mediumImage, mediumImageURL, mediumFile, largeImage,
138             largeImageURL, largeFile, itemFields, itemPrices,
139             communityPermissions, guestPermissions);
140     }
141 
142     public static com.liferay.portlet.shopping.model.ShoppingItem addItem(
143         long userId, long categoryId, java.lang.String sku,
144         java.lang.String name, java.lang.String description,
145         java.lang.String properties, java.lang.String fieldsQuantities,
146         boolean requiresShipping, int stockQuantity, boolean featured,
147         java.lang.Boolean sale, boolean smallImage,
148         java.lang.String smallImageURL, java.io.File smallFile,
149         boolean mediumImage, java.lang.String mediumImageURL,
150         java.io.File mediumFile, boolean largeImage,
151         java.lang.String largeImageURL, java.io.File largeFile,
152         java.util.List itemFields, java.util.List itemPrices,
153         java.lang.Boolean addCommunityPermissions,
154         java.lang.Boolean addGuestPermissions,
155         java.lang.String[] communityPermissions,
156         java.lang.String[] guestPermissions)
157         throws com.liferay.portal.PortalException, 
158             com.liferay.portal.SystemException {
159         ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
160 
161         return shoppingItemLocalService.addItem(userId, categoryId, sku, name,
162             description, properties, fieldsQuantities, requiresShipping,
163             stockQuantity, featured, sale, smallImage, smallImageURL,
164             smallFile, mediumImage, mediumImageURL, mediumFile, largeImage,
165             largeImageURL, largeFile, itemFields, itemPrices,
166             addCommunityPermissions, addGuestPermissions, communityPermissions,
167             guestPermissions);
168     }
169 
170     public static void addItemResources(long itemId,
171         boolean addCommunityPermissions, boolean addGuestPermissions)
172         throws com.liferay.portal.PortalException, 
173             com.liferay.portal.SystemException {
174         ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
175         shoppingItemLocalService.addItemResources(itemId,
176             addCommunityPermissions, addGuestPermissions);
177     }
178 
179     public static void addItemResources(
180         com.liferay.portlet.shopping.model.ShoppingCategory category,
181         com.liferay.portlet.shopping.model.ShoppingItem item,
182         boolean addCommunityPermissions, boolean addGuestPermissions)
183         throws com.liferay.portal.PortalException, 
184             com.liferay.portal.SystemException {
185         ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
186         shoppingItemLocalService.addItemResources(category, item,
187             addCommunityPermissions, addGuestPermissions);
188     }
189 
190     public static void addItemResources(long itemId,
191         java.lang.String[] communityPermissions,
192         java.lang.String[] guestPermissions)
193         throws com.liferay.portal.PortalException, 
194             com.liferay.portal.SystemException {
195         ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
196         shoppingItemLocalService.addItemResources(itemId, communityPermissions,
197             guestPermissions);
198     }
199 
200     public static void addItemResources(
201         com.liferay.portlet.shopping.model.ShoppingCategory category,
202         com.liferay.portlet.shopping.model.ShoppingItem item,
203         java.lang.String[] communityPermissions,
204         java.lang.String[] guestPermissions)
205         throws com.liferay.portal.PortalException, 
206             com.liferay.portal.SystemException {
207         ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
208         shoppingItemLocalService.addItemResources(category, item,
209             communityPermissions, guestPermissions);
210     }
211 
212     public static void deleteItem(long itemId)
213         throws com.liferay.portal.PortalException, 
214             com.liferay.portal.SystemException {
215         ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
216         shoppingItemLocalService.deleteItem(itemId);
217     }
218 
219     public static void deleteItem(
220         com.liferay.portlet.shopping.model.ShoppingItem item)
221         throws com.liferay.portal.PortalException, 
222             com.liferay.portal.SystemException {
223         ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
224         shoppingItemLocalService.deleteItem(item);
225     }
226 
227     public static void deleteItems(long categoryId)
228         throws com.liferay.portal.PortalException, 
229             com.liferay.portal.SystemException {
230         ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
231         shoppingItemLocalService.deleteItems(categoryId);
232     }
233 
234     public static int getCategoriesItemsCount(java.util.List categoryIds)
235         throws com.liferay.portal.SystemException {
236         ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
237 
238         return shoppingItemLocalService.getCategoriesItemsCount(categoryIds);
239     }
240 
241     public static java.util.List getFeaturedItems(long groupId,
242         long categoryId, int numOfItems)
243         throws com.liferay.portal.SystemException {
244         ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
245 
246         return shoppingItemLocalService.getFeaturedItems(groupId, categoryId,
247             numOfItems);
248     }
249 
250     public static com.liferay.portlet.shopping.model.ShoppingItem getItem(
251         long itemId)
252         throws com.liferay.portal.PortalException, 
253             com.liferay.portal.SystemException {
254         ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
255 
256         return shoppingItemLocalService.getItem(itemId);
257     }
258 
259     public static com.liferay.portlet.shopping.model.ShoppingItem getItem(
260         long companyId, java.lang.String sku)
261         throws com.liferay.portal.PortalException, 
262             com.liferay.portal.SystemException {
263         ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
264 
265         return shoppingItemLocalService.getItem(companyId, sku);
266     }
267 
268     public static java.util.List getItems(long categoryId)
269         throws com.liferay.portal.SystemException {
270         ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
271 
272         return shoppingItemLocalService.getItems(categoryId);
273     }
274 
275     public static java.util.List getItems(long categoryId, int begin, int end,
276         com.liferay.portal.kernel.util.OrderByComparator obc)
277         throws com.liferay.portal.SystemException {
278         ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
279 
280         return shoppingItemLocalService.getItems(categoryId, begin, end, obc);
281     }
282 
283     public static com.liferay.portlet.shopping.model.ShoppingItem[] getItemsPrevAndNext(
284         long itemId, com.liferay.portal.kernel.util.OrderByComparator obc)
285         throws com.liferay.portal.PortalException, 
286             com.liferay.portal.SystemException {
287         ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
288 
289         return shoppingItemLocalService.getItemsPrevAndNext(itemId, obc);
290     }
291 
292     public static int getItemsCount(long categoryId)
293         throws com.liferay.portal.SystemException {
294         ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
295 
296         return shoppingItemLocalService.getItemsCount(categoryId);
297     }
298 
299     public static java.util.List getSaleItems(long groupId, long categoryId,
300         int numOfItems) throws com.liferay.portal.SystemException {
301         ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
302 
303         return shoppingItemLocalService.getSaleItems(groupId, categoryId,
304             numOfItems);
305     }
306 
307     public static java.util.List search(long groupId, long[] categoryIds,
308         java.lang.String keywords, int begin, int end)
309         throws com.liferay.portal.SystemException {
310         ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
311 
312         return shoppingItemLocalService.search(groupId, categoryIds, keywords,
313             begin, end);
314     }
315 
316     public static int searchCount(long groupId, long[] categoryIds,
317         java.lang.String keywords) throws com.liferay.portal.SystemException {
318         ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
319 
320         return shoppingItemLocalService.searchCount(groupId, categoryIds,
321             keywords);
322     }
323 
324     public static com.liferay.portlet.shopping.model.ShoppingItem updateItem(
325         long userId, long itemId, long categoryId, java.lang.String sku,
326         java.lang.String name, java.lang.String description,
327         java.lang.String properties, java.lang.String fieldsQuantities,
328         boolean requiresShipping, int stockQuantity, boolean featured,
329         java.lang.Boolean sale, boolean smallImage,
330         java.lang.String smallImageURL, java.io.File smallFile,
331         boolean mediumImage, java.lang.String mediumImageURL,
332         java.io.File mediumFile, boolean largeImage,
333         java.lang.String largeImageURL, java.io.File largeFile,
334         java.util.List itemFields, java.util.List itemPrices)
335         throws com.liferay.portal.PortalException, 
336             com.liferay.portal.SystemException {
337         ShoppingItemLocalService shoppingItemLocalService = ShoppingItemLocalServiceFactory.getService();
338 
339         return shoppingItemLocalService.updateItem(userId, itemId, categoryId,
340             sku, name, description, properties, fieldsQuantities,
341             requiresShipping, stockQuantity, featured, sale, smallImage,
342             smallImageURL, smallFile, mediumImage, mediumImageURL, mediumFile,
343             largeImage, largeImageURL, largeFile, itemFields, itemPrices);
344     }
345 }