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="ShoppingItemServiceUtil.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 ShoppingItemService} 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       ShoppingItemService
39   * @generated
40   */
41  public class ShoppingItemServiceUtil {
42      public static void addBookItems(long categoryId, java.lang.String[] isbns)
43          throws com.liferay.portal.PortalException,
44              com.liferay.portal.SystemException {
45          getService().addBookItems(categoryId, isbns);
46      }
47  
48      public static com.liferay.portlet.shopping.model.ShoppingItem addItem(
49          long categoryId, java.lang.String sku, java.lang.String name,
50          java.lang.String description, java.lang.String properties,
51          java.lang.String fieldsQuantities, boolean requiresShipping,
52          int stockQuantity, boolean featured, java.lang.Boolean sale,
53          boolean smallImage, java.lang.String smallImageURL,
54          java.io.File smallFile, boolean mediumImage,
55          java.lang.String mediumImageURL, java.io.File mediumFile,
56          boolean largeImage, java.lang.String largeImageURL,
57          java.io.File largeFile,
58          java.util.List<com.liferay.portlet.shopping.model.ShoppingItemField> itemFields,
59          java.util.List<com.liferay.portlet.shopping.model.ShoppingItemPrice> itemPrices,
60          com.liferay.portal.service.ServiceContext serviceContext)
61          throws com.liferay.portal.PortalException,
62              com.liferay.portal.SystemException {
63          return getService()
64                     .addItem(categoryId, sku, name, description, properties,
65              fieldsQuantities, requiresShipping, stockQuantity, featured, sale,
66              smallImage, smallImageURL, smallFile, mediumImage, mediumImageURL,
67              mediumFile, largeImage, largeImageURL, largeFile, itemFields,
68              itemPrices, serviceContext);
69      }
70  
71      public static void deleteItem(long itemId)
72          throws com.liferay.portal.PortalException,
73              com.liferay.portal.SystemException {
74          getService().deleteItem(itemId);
75      }
76  
77      public static com.liferay.portlet.shopping.model.ShoppingItem getItem(
78          long itemId)
79          throws com.liferay.portal.PortalException,
80              com.liferay.portal.SystemException {
81          return getService().getItem(itemId);
82      }
83  
84      public static com.liferay.portlet.shopping.model.ShoppingItem updateItem(
85          long itemId, long categoryId, java.lang.String sku,
86          java.lang.String name, java.lang.String description,
87          java.lang.String properties, java.lang.String fieldsQuantities,
88          boolean requiresShipping, int stockQuantity, boolean featured,
89          java.lang.Boolean sale, boolean smallImage,
90          java.lang.String smallImageURL, java.io.File smallFile,
91          boolean mediumImage, java.lang.String mediumImageURL,
92          java.io.File mediumFile, boolean largeImage,
93          java.lang.String largeImageURL, java.io.File largeFile,
94          java.util.List<com.liferay.portlet.shopping.model.ShoppingItemField> itemFields,
95          java.util.List<com.liferay.portlet.shopping.model.ShoppingItemPrice> itemPrices,
96          com.liferay.portal.service.ServiceContext serviceContext)
97          throws com.liferay.portal.PortalException,
98              com.liferay.portal.SystemException {
99          return getService()
100                    .updateItem(itemId, categoryId, sku, name, description,
101             properties, fieldsQuantities, requiresShipping, stockQuantity,
102             featured, sale, smallImage, smallImageURL, smallFile, mediumImage,
103             mediumImageURL, mediumFile, largeImage, largeImageURL, largeFile,
104             itemFields, itemPrices, serviceContext);
105     }
106 
107     public static ShoppingItemService getService() {
108         if (_service == null) {
109             _service = (ShoppingItemService)PortalBeanLocatorUtil.locate(ShoppingItemService.class.getName());
110 
111             ReferenceRegistry.registerReference(ShoppingItemServiceUtil.class,
112                 "_service");
113             MethodCache.remove(ShoppingItemService.class);
114         }
115 
116         return _service;
117     }
118 
119     public void setService(ShoppingItemService service) {
120         MethodCache.remove(ShoppingItemService.class);
121 
122         _service = service;
123 
124         ReferenceRegistry.registerReference(ShoppingItemServiceUtil.class,
125             "_service");
126         MethodCache.remove(ShoppingItemService.class);
127     }
128 
129     private static ShoppingItemService _service;
130 }