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="ShoppingCategoryLocalServiceUtil.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.ShoppingCategoryLocalService</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   * @author Brian Wing Shun Chan
43   *
44   * @see com.liferay.portlet.shopping.service.ShoppingCategoryLocalService
45   *
46   */
47  public class ShoppingCategoryLocalServiceUtil {
48      public static com.liferay.portlet.shopping.model.ShoppingCategory addShoppingCategory(
49          com.liferay.portlet.shopping.model.ShoppingCategory shoppingCategory)
50          throws com.liferay.portal.SystemException {
51          return getService().addShoppingCategory(shoppingCategory);
52      }
53  
54      public static com.liferay.portlet.shopping.model.ShoppingCategory createShoppingCategory(
55          long categoryId) {
56          return getService().createShoppingCategory(categoryId);
57      }
58  
59      public static void deleteShoppingCategory(long categoryId)
60          throws com.liferay.portal.PortalException,
61              com.liferay.portal.SystemException {
62          getService().deleteShoppingCategory(categoryId);
63      }
64  
65      public static void deleteShoppingCategory(
66          com.liferay.portlet.shopping.model.ShoppingCategory shoppingCategory)
67          throws com.liferay.portal.SystemException {
68          getService().deleteShoppingCategory(shoppingCategory);
69      }
70  
71      public static java.util.List<Object> dynamicQuery(
72          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
73          throws com.liferay.portal.SystemException {
74          return getService().dynamicQuery(dynamicQuery);
75      }
76  
77      public static java.util.List<Object> dynamicQuery(
78          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
79          int end) throws com.liferay.portal.SystemException {
80          return getService().dynamicQuery(dynamicQuery, start, end);
81      }
82  
83      public static com.liferay.portlet.shopping.model.ShoppingCategory getShoppingCategory(
84          long categoryId)
85          throws com.liferay.portal.PortalException,
86              com.liferay.portal.SystemException {
87          return getService().getShoppingCategory(categoryId);
88      }
89  
90      public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCategory> getShoppingCategories(
91          int start, int end) throws com.liferay.portal.SystemException {
92          return getService().getShoppingCategories(start, end);
93      }
94  
95      public static int getShoppingCategoriesCount()
96          throws com.liferay.portal.SystemException {
97          return getService().getShoppingCategoriesCount();
98      }
99  
100     public static com.liferay.portlet.shopping.model.ShoppingCategory updateShoppingCategory(
101         com.liferay.portlet.shopping.model.ShoppingCategory shoppingCategory)
102         throws com.liferay.portal.SystemException {
103         return getService().updateShoppingCategory(shoppingCategory);
104     }
105 
106     public static com.liferay.portlet.shopping.model.ShoppingCategory addCategory(
107         long userId, long plid, long parentCategoryId, java.lang.String name,
108         java.lang.String description, boolean addCommunityPermissions,
109         boolean addGuestPermissions)
110         throws com.liferay.portal.PortalException,
111             com.liferay.portal.SystemException {
112         return getService()
113                    .addCategory(userId, plid, parentCategoryId, name,
114             description, addCommunityPermissions, addGuestPermissions);
115     }
116 
117     public static com.liferay.portlet.shopping.model.ShoppingCategory addCategory(
118         long userId, long plid, long parentCategoryId, java.lang.String name,
119         java.lang.String description, java.lang.String[] communityPermissions,
120         java.lang.String[] guestPermissions)
121         throws com.liferay.portal.PortalException,
122             com.liferay.portal.SystemException {
123         return getService()
124                    .addCategory(userId, plid, parentCategoryId, name,
125             description, communityPermissions, guestPermissions);
126     }
127 
128     public static com.liferay.portlet.shopping.model.ShoppingCategory addCategory(
129         long userId, long plid, long parentCategoryId, java.lang.String name,
130         java.lang.String description,
131         java.lang.Boolean addCommunityPermissions,
132         java.lang.Boolean addGuestPermissions,
133         java.lang.String[] communityPermissions,
134         java.lang.String[] guestPermissions)
135         throws com.liferay.portal.PortalException,
136             com.liferay.portal.SystemException {
137         return getService()
138                    .addCategory(userId, plid, parentCategoryId, name,
139             description, addCommunityPermissions, addGuestPermissions,
140             communityPermissions, guestPermissions);
141     }
142 
143     public static void addCategoryResources(long categoryId,
144         boolean addCommunityPermissions, boolean addGuestPermissions)
145         throws com.liferay.portal.PortalException,
146             com.liferay.portal.SystemException {
147         getService()
148             .addCategoryResources(categoryId, addCommunityPermissions,
149             addGuestPermissions);
150     }
151 
152     public static void addCategoryResources(
153         com.liferay.portlet.shopping.model.ShoppingCategory category,
154         boolean addCommunityPermissions, boolean addGuestPermissions)
155         throws com.liferay.portal.PortalException,
156             com.liferay.portal.SystemException {
157         getService()
158             .addCategoryResources(category, addCommunityPermissions,
159             addGuestPermissions);
160     }
161 
162     public static void addCategoryResources(long categoryId,
163         java.lang.String[] communityPermissions,
164         java.lang.String[] guestPermissions)
165         throws com.liferay.portal.PortalException,
166             com.liferay.portal.SystemException {
167         getService()
168             .addCategoryResources(categoryId, communityPermissions,
169             guestPermissions);
170     }
171 
172     public static void addCategoryResources(
173         com.liferay.portlet.shopping.model.ShoppingCategory category,
174         java.lang.String[] communityPermissions,
175         java.lang.String[] guestPermissions)
176         throws com.liferay.portal.PortalException,
177             com.liferay.portal.SystemException {
178         getService()
179             .addCategoryResources(category, communityPermissions,
180             guestPermissions);
181     }
182 
183     public static void deleteCategories(long groupId)
184         throws com.liferay.portal.PortalException,
185             com.liferay.portal.SystemException {
186         getService().deleteCategories(groupId);
187     }
188 
189     public static void deleteCategory(long categoryId)
190         throws com.liferay.portal.PortalException,
191             com.liferay.portal.SystemException {
192         getService().deleteCategory(categoryId);
193     }
194 
195     public static void deleteCategory(
196         com.liferay.portlet.shopping.model.ShoppingCategory category)
197         throws com.liferay.portal.PortalException,
198             com.liferay.portal.SystemException {
199         getService().deleteCategory(category);
200     }
201 
202     public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCategory> getCategories(
203         long groupId) throws com.liferay.portal.SystemException {
204         return getService().getCategories(groupId);
205     }
206 
207     public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCategory> getCategories(
208         long groupId, long parentCategoryId, int start, int end)
209         throws com.liferay.portal.SystemException {
210         return getService().getCategories(groupId, parentCategoryId, start, end);
211     }
212 
213     public static int getCategoriesCount(long groupId, long parentCategoryId)
214         throws com.liferay.portal.SystemException {
215         return getService().getCategoriesCount(groupId, parentCategoryId);
216     }
217 
218     public static com.liferay.portlet.shopping.model.ShoppingCategory getCategory(
219         long categoryId)
220         throws com.liferay.portal.PortalException,
221             com.liferay.portal.SystemException {
222         return getService().getCategory(categoryId);
223     }
224 
225     public static com.liferay.portlet.shopping.model.ShoppingCategory getParentCategory(
226         com.liferay.portlet.shopping.model.ShoppingCategory category)
227         throws com.liferay.portal.PortalException,
228             com.liferay.portal.SystemException {
229         return getService().getParentCategory(category);
230     }
231 
232     public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCategory> getParentCategories(
233         long categoryId)
234         throws com.liferay.portal.PortalException,
235             com.liferay.portal.SystemException {
236         return getService().getParentCategories(categoryId);
237     }
238 
239     public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCategory> getParentCategories(
240         com.liferay.portlet.shopping.model.ShoppingCategory category)
241         throws com.liferay.portal.PortalException,
242             com.liferay.portal.SystemException {
243         return getService().getParentCategories(category);
244     }
245 
246     public static void getSubcategoryIds(java.util.List<Long> categoryIds,
247         long groupId, long categoryId)
248         throws com.liferay.portal.SystemException {
249         getService().getSubcategoryIds(categoryIds, groupId, categoryId);
250     }
251 
252     public static com.liferay.portlet.shopping.model.ShoppingCategory updateCategory(
253         long categoryId, long parentCategoryId, java.lang.String name,
254         java.lang.String description, boolean mergeWithParentCategory)
255         throws com.liferay.portal.PortalException,
256             com.liferay.portal.SystemException {
257         return getService()
258                    .updateCategory(categoryId, parentCategoryId, name,
259             description, mergeWithParentCategory);
260     }
261 
262     public static ShoppingCategoryLocalService getService() {
263         if (_service == null) {
264             throw new RuntimeException(
265                 "ShoppingCategoryLocalService is not set");
266         }
267 
268         return _service;
269     }
270 
271     public void setService(ShoppingCategoryLocalService service) {
272         _service = service;
273     }
274 
275     private static ShoppingCategoryLocalService _service;
276 }