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