1   /**
2    * Copyright (c) 2000-2009 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   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
15   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
17   * SOFTWARE.
18   */
19  
20  package com.liferay.portlet.shopping.service;
21  
22  
23  /**
24   * <a href="ShoppingCategoryLocalServiceUtil.java.html"><b><i>View Source</i></b></a>
25   *
26   * <p>
27   * ServiceBuilder generated this class. Modifications in this class will be
28   * overwritten the next time is generated.
29   * </p>
30   *
31   * <p>
32   * This class provides static methods for the
33   * <code>com.liferay.portlet.shopping.service.ShoppingCategoryLocalService</code>
34   * bean. The static methods of this class calls the same methods of the bean
35   * instance. It's convenient to be able to just write one line to call a method
36   * on a bean instead of writing a lookup call and a method call.
37   * </p>
38   *
39   * @author Brian Wing Shun Chan
40   *
41   * @see com.liferay.portlet.shopping.service.ShoppingCategoryLocalService
42   *
43   */
44  public class ShoppingCategoryLocalServiceUtil {
45      public static com.liferay.portlet.shopping.model.ShoppingCategory addShoppingCategory(
46          com.liferay.portlet.shopping.model.ShoppingCategory shoppingCategory)
47          throws com.liferay.portal.SystemException {
48          return getService().addShoppingCategory(shoppingCategory);
49      }
50  
51      public static com.liferay.portlet.shopping.model.ShoppingCategory createShoppingCategory(
52          long categoryId) {
53          return getService().createShoppingCategory(categoryId);
54      }
55  
56      public static void deleteShoppingCategory(long categoryId)
57          throws com.liferay.portal.PortalException,
58              com.liferay.portal.SystemException {
59          getService().deleteShoppingCategory(categoryId);
60      }
61  
62      public static void deleteShoppingCategory(
63          com.liferay.portlet.shopping.model.ShoppingCategory shoppingCategory)
64          throws com.liferay.portal.SystemException {
65          getService().deleteShoppingCategory(shoppingCategory);
66      }
67  
68      public static java.util.List<Object> dynamicQuery(
69          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
70          throws com.liferay.portal.SystemException {
71          return getService().dynamicQuery(dynamicQuery);
72      }
73  
74      public static java.util.List<Object> dynamicQuery(
75          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
76          int end) throws com.liferay.portal.SystemException {
77          return getService().dynamicQuery(dynamicQuery, start, end);
78      }
79  
80      public static com.liferay.portlet.shopping.model.ShoppingCategory getShoppingCategory(
81          long categoryId)
82          throws com.liferay.portal.PortalException,
83              com.liferay.portal.SystemException {
84          return getService().getShoppingCategory(categoryId);
85      }
86  
87      public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCategory> getShoppingCategories(
88          int start, int end) throws com.liferay.portal.SystemException {
89          return getService().getShoppingCategories(start, end);
90      }
91  
92      public static int getShoppingCategoriesCount()
93          throws com.liferay.portal.SystemException {
94          return getService().getShoppingCategoriesCount();
95      }
96  
97      public static com.liferay.portlet.shopping.model.ShoppingCategory updateShoppingCategory(
98          com.liferay.portlet.shopping.model.ShoppingCategory shoppingCategory)
99          throws com.liferay.portal.SystemException {
100         return getService().updateShoppingCategory(shoppingCategory);
101     }
102 
103     public static com.liferay.portlet.shopping.model.ShoppingCategory updateShoppingCategory(
104         com.liferay.portlet.shopping.model.ShoppingCategory shoppingCategory,
105         boolean merge) throws com.liferay.portal.SystemException {
106         return getService().updateShoppingCategory(shoppingCategory, merge);
107     }
108 
109     public static com.liferay.portlet.shopping.model.ShoppingCategory addCategory(
110         long userId, long parentCategoryId, java.lang.String name,
111         java.lang.String description,
112         com.liferay.portal.service.ServiceContext serviceContext)
113         throws com.liferay.portal.PortalException,
114             com.liferay.portal.SystemException {
115         return getService()
116                    .addCategory(userId, parentCategoryId, name, description,
117             serviceContext);
118     }
119 
120     public static void addCategoryResources(long categoryId,
121         boolean addCommunityPermissions, boolean addGuestPermissions)
122         throws com.liferay.portal.PortalException,
123             com.liferay.portal.SystemException {
124         getService()
125             .addCategoryResources(categoryId, addCommunityPermissions,
126             addGuestPermissions);
127     }
128 
129     public static void addCategoryResources(
130         com.liferay.portlet.shopping.model.ShoppingCategory category,
131         boolean addCommunityPermissions, boolean addGuestPermissions)
132         throws com.liferay.portal.PortalException,
133             com.liferay.portal.SystemException {
134         getService()
135             .addCategoryResources(category, addCommunityPermissions,
136             addGuestPermissions);
137     }
138 
139     public static void addCategoryResources(long categoryId,
140         java.lang.String[] communityPermissions,
141         java.lang.String[] guestPermissions)
142         throws com.liferay.portal.PortalException,
143             com.liferay.portal.SystemException {
144         getService()
145             .addCategoryResources(categoryId, communityPermissions,
146             guestPermissions);
147     }
148 
149     public static void addCategoryResources(
150         com.liferay.portlet.shopping.model.ShoppingCategory category,
151         java.lang.String[] communityPermissions,
152         java.lang.String[] guestPermissions)
153         throws com.liferay.portal.PortalException,
154             com.liferay.portal.SystemException {
155         getService()
156             .addCategoryResources(category, communityPermissions,
157             guestPermissions);
158     }
159 
160     public static void deleteCategories(long groupId)
161         throws com.liferay.portal.PortalException,
162             com.liferay.portal.SystemException {
163         getService().deleteCategories(groupId);
164     }
165 
166     public static void deleteCategory(long categoryId)
167         throws com.liferay.portal.PortalException,
168             com.liferay.portal.SystemException {
169         getService().deleteCategory(categoryId);
170     }
171 
172     public static void deleteCategory(
173         com.liferay.portlet.shopping.model.ShoppingCategory category)
174         throws com.liferay.portal.PortalException,
175             com.liferay.portal.SystemException {
176         getService().deleteCategory(category);
177     }
178 
179     public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCategory> getCategories(
180         long groupId) throws com.liferay.portal.SystemException {
181         return getService().getCategories(groupId);
182     }
183 
184     public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCategory> getCategories(
185         long groupId, long parentCategoryId, int start, int end)
186         throws com.liferay.portal.SystemException {
187         return getService().getCategories(groupId, parentCategoryId, start, end);
188     }
189 
190     public static int getCategoriesCount(long groupId, long parentCategoryId)
191         throws com.liferay.portal.SystemException {
192         return getService().getCategoriesCount(groupId, parentCategoryId);
193     }
194 
195     public static com.liferay.portlet.shopping.model.ShoppingCategory getCategory(
196         long categoryId)
197         throws com.liferay.portal.PortalException,
198             com.liferay.portal.SystemException {
199         return getService().getCategory(categoryId);
200     }
201 
202     public static com.liferay.portlet.shopping.model.ShoppingCategory getParentCategory(
203         com.liferay.portlet.shopping.model.ShoppingCategory category)
204         throws com.liferay.portal.PortalException,
205             com.liferay.portal.SystemException {
206         return getService().getParentCategory(category);
207     }
208 
209     public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCategory> getParentCategories(
210         long categoryId)
211         throws com.liferay.portal.PortalException,
212             com.liferay.portal.SystemException {
213         return getService().getParentCategories(categoryId);
214     }
215 
216     public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCategory> getParentCategories(
217         com.liferay.portlet.shopping.model.ShoppingCategory category)
218         throws com.liferay.portal.PortalException,
219             com.liferay.portal.SystemException {
220         return getService().getParentCategories(category);
221     }
222 
223     public static void getSubcategoryIds(java.util.List<Long> categoryIds,
224         long groupId, long categoryId)
225         throws com.liferay.portal.SystemException {
226         getService().getSubcategoryIds(categoryIds, groupId, categoryId);
227     }
228 
229     public static com.liferay.portlet.shopping.model.ShoppingCategory updateCategory(
230         long categoryId, long parentCategoryId, java.lang.String name,
231         java.lang.String description, boolean mergeWithParentCategory,
232         com.liferay.portal.service.ServiceContext serviceContext)
233         throws com.liferay.portal.PortalException,
234             com.liferay.portal.SystemException {
235         return getService()
236                    .updateCategory(categoryId, parentCategoryId, name,
237             description, mergeWithParentCategory, serviceContext);
238     }
239 
240     public static ShoppingCategoryLocalService getService() {
241         if (_service == null) {
242             throw new RuntimeException(
243                 "ShoppingCategoryLocalService is not set");
244         }
245 
246         return _service;
247     }
248 
249     public void setService(ShoppingCategoryLocalService service) {
250         _service = service;
251     }
252 
253     private static ShoppingCategoryLocalService _service;
254 }