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.persistence;
16  
17  import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
18  import com.liferay.portal.kernel.util.ReferenceRegistry;
19  
20  /**
21   * <a href="ShoppingItemFinderUtil.java.html"><b><i>View Source</i></b></a>
22   *
23   * @author Brian Wing Shun Chan
24   */
25  public class ShoppingItemFinderUtil {
26      public static int countByCategoryIds(
27          java.util.List<java.lang.Long> categoryIds)
28          throws com.liferay.portal.SystemException {
29          return getFinder().countByCategoryIds(categoryIds);
30      }
31  
32      public static int countByFeatured(long groupId, long[] categoryIds)
33          throws com.liferay.portal.SystemException {
34          return getFinder().countByFeatured(groupId, categoryIds);
35      }
36  
37      public static int countByKeywords(long groupId, long[] categoryIds,
38          java.lang.String keywords) throws com.liferay.portal.SystemException {
39          return getFinder().countByKeywords(groupId, categoryIds, keywords);
40      }
41  
42      public static int countBySale(long groupId, long[] categoryIds)
43          throws com.liferay.portal.SystemException {
44          return getFinder().countBySale(groupId, categoryIds);
45      }
46  
47      public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItem> findByFeatured(
48          long groupId, long[] categoryIds, int numOfItems)
49          throws com.liferay.portal.SystemException {
50          return getFinder().findByFeatured(groupId, categoryIds, numOfItems);
51      }
52  
53      public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItem> findByKeywords(
54          long groupId, long[] categoryIds, java.lang.String keywords, int start,
55          int end) throws com.liferay.portal.SystemException {
56          return getFinder()
57                     .findByKeywords(groupId, categoryIds, keywords, start, end);
58      }
59  
60      public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItem> findBySale(
61          long groupId, long[] categoryIds, int numOfItems)
62          throws com.liferay.portal.SystemException {
63          return getFinder().findBySale(groupId, categoryIds, numOfItems);
64      }
65  
66      public static ShoppingItemFinder getFinder() {
67          if (_finder == null) {
68              _finder = (ShoppingItemFinder)PortalBeanLocatorUtil.locate(ShoppingItemFinder.class.getName());
69  
70              ReferenceRegistry.registerReference(ShoppingItemFinderUtil.class,
71                  "_finder");
72          }
73  
74          return _finder;
75      }
76  
77      public void setFinder(ShoppingItemFinder finder) {
78          _finder = finder;
79  
80          ReferenceRegistry.registerReference(ShoppingItemFinderUtil.class,
81              "_finder");
82      }
83  
84      private static ShoppingItemFinder _finder;
85  }