1   /**
2    * Copyright (c) 2000-2009 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 updateShoppingCategory(
107         com.liferay.portlet.shopping.model.ShoppingCategory shoppingCategory,
108         boolean merge) throws com.liferay.portal.SystemException {
109         return getService().updateShoppingCategory(shoppingCategory, merge);
110     }
111 
112     public static com.liferay.portlet.shopping.model.ShoppingCategory addCategory(
113         long userId, long plid, long parentCategoryId, java.lang.String name,
114         java.lang.String description, boolean addCommunityPermissions,
115         boolean addGuestPermissions)
116         throws com.liferay.portal.PortalException,
117             com.liferay.portal.SystemException {
118         return getService()
119                    .addCategory(userId, plid, parentCategoryId, name,
120             description, addCommunityPermissions, addGuestPermissions);
121     }
122 
123     public static com.liferay.portlet.shopping.model.ShoppingCategory addCategory(
124         long userId, long plid, long parentCategoryId, java.lang.String name,
125         java.lang.String description, java.lang.String[] communityPermissions,
126         java.lang.String[] guestPermissions)
127         throws com.liferay.portal.PortalException,
128             com.liferay.portal.SystemException {
129         return getService()
130                    .addCategory(userId, plid, parentCategoryId, name,
131             description, communityPermissions, guestPermissions);
132     }
133 
134     public static com.liferay.portlet.shopping.model.ShoppingCategory addCategory(
135         long userId, long plid, long parentCategoryId, java.lang.String name,
136         java.lang.String description,
137         java.lang.Boolean addCommunityPermissions,
138         java.lang.Boolean addGuestPermissions,
139         java.lang.String[] communityPermissions,
140         java.lang.String[] guestPermissions)
141         throws com.liferay.portal.PortalException,
142             com.liferay.portal.SystemException {
143         return getService()
144                    .addCategory(userId, plid, parentCategoryId, name,
145             description, addCommunityPermissions, addGuestPermissions,
146             communityPermissions, guestPermissions);
147     }
148 
149     public static void addCategoryResources(long categoryId,
150         boolean addCommunityPermissions, boolean addGuestPermissions)
151         throws com.liferay.portal.PortalException,
152             com.liferay.portal.SystemException {
153         getService()
154             .addCategoryResources(categoryId, addCommunityPermissions,
155             addGuestPermissions);
156     }
157 
158     public static void addCategoryResources(
159         com.liferay.portlet.shopping.model.ShoppingCategory category,
160         boolean addCommunityPermissions, boolean addGuestPermissions)
161         throws com.liferay.portal.PortalException,
162             com.liferay.portal.SystemException {
163         getService()
164             .addCategoryResources(category, addCommunityPermissions,
165             addGuestPermissions);
166     }
167 
168     public static void addCategoryResources(long categoryId,
169         java.lang.String[] communityPermissions,
170         java.lang.String[] guestPermissions)
171         throws com.liferay.portal.PortalException,
172             com.liferay.portal.SystemException {
173         getService()
174             .addCategoryResources(categoryId, communityPermissions,
175             guestPermissions);
176     }
177 
178     public static void addCategoryResources(
179         com.liferay.portlet.shopping.model.ShoppingCategory category,
180         java.lang.String[] communityPermissions,
181         java.lang.String[] guestPermissions)
182         throws com.liferay.portal.PortalException,
183             com.liferay.portal.SystemException {
184         getService()
185             .addCategoryResources(category, communityPermissions,
186             guestPermissions);
187     }
188 
189     public static void deleteCategories(long groupId)
190         throws com.liferay.portal.PortalException,
191             com.liferay.portal.SystemException {
192         getService().deleteCategories(groupId);
193     }
194 
195     public static void deleteCategory(long categoryId)
196         throws com.liferay.portal.PortalException,
197             com.liferay.portal.SystemException {
198         getService().deleteCategory(categoryId);
199     }
200 
201     public static void deleteCategory(
202         com.liferay.portlet.shopping.model.ShoppingCategory category)
203         throws com.liferay.portal.PortalException,
204             com.liferay.portal.SystemException {
205         getService().deleteCategory(category);
206     }
207 
208     public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCategory> getCategories(
209         long groupId) throws com.liferay.portal.SystemException {
210         return getService().getCategories(groupId);
211     }
212 
213     public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCategory> getCategories(
214         long groupId, long parentCategoryId, int start, int end)
215         throws com.liferay.portal.SystemException {
216         return getService().getCategories(groupId, parentCategoryId, start, end);
217     }
218 
219     public static int getCategoriesCount(long groupId, long parentCategoryId)
220         throws com.liferay.portal.SystemException {
221         return getService().getCategoriesCount(groupId, parentCategoryId);
222     }
223 
224     public static com.liferay.portlet.shopping.model.ShoppingCategory getCategory(
225         long categoryId)
226         throws com.liferay.portal.PortalException,
227             com.liferay.portal.SystemException {
228         return getService().getCategory(categoryId);
229     }
230 
231     public static com.liferay.portlet.shopping.model.ShoppingCategory getParentCategory(
232         com.liferay.portlet.shopping.model.ShoppingCategory category)
233         throws com.liferay.portal.PortalException,
234             com.liferay.portal.SystemException {
235         return getService().getParentCategory(category);
236     }
237 
238     public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCategory> getParentCategories(
239         long categoryId)
240         throws com.liferay.portal.PortalException,
241             com.liferay.portal.SystemException {
242         return getService().getParentCategories(categoryId);
243     }
244 
245     public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCategory> getParentCategories(
246         com.liferay.portlet.shopping.model.ShoppingCategory category)
247         throws com.liferay.portal.PortalException,
248             com.liferay.portal.SystemException {
249         return getService().getParentCategories(category);
250     }
251 
252     public static void getSubcategoryIds(java.util.List<Long> categoryIds,
253         long groupId, long categoryId)
254         throws com.liferay.portal.SystemException {
255         getService().getSubcategoryIds(categoryIds, groupId, categoryId);
256     }
257 
258     public static com.liferay.portlet.shopping.model.ShoppingCategory updateCategory(
259         long categoryId, long parentCategoryId, java.lang.String name,
260         java.lang.String description, boolean mergeWithParentCategory)
261         throws com.liferay.portal.PortalException,
262             com.liferay.portal.SystemException {
263         return getService()
264                    .updateCategory(categoryId, parentCategoryId, name,
265             description, mergeWithParentCategory);
266     }
267 
268     public static ShoppingCategoryLocalService getService() {
269         if (_service == null) {
270             throw new RuntimeException(
271                 "ShoppingCategoryLocalService is not set");
272         }
273 
274         return _service;
275     }
276 
277     public void setService(ShoppingCategoryLocalService service) {
278         _service = service;
279     }
280 
281     private static ShoppingCategoryLocalService _service;
282 }