001    /**
002     * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portlet.shopping.service;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
020    import com.liferay.portal.kernel.util.ReferenceRegistry;
021    
022    /**
023     * Provides the local service utility for ShoppingCategory. This utility wraps
024     * {@link com.liferay.portlet.shopping.service.impl.ShoppingCategoryLocalServiceImpl} and is the
025     * primary access point for service operations in application layer code running
026     * on the local server. Methods of this service will not have security checks
027     * based on the propagated JAAS credentials because this service can only be
028     * accessed from within the same VM.
029     *
030     * @author Brian Wing Shun Chan
031     * @see ShoppingCategoryLocalService
032     * @see com.liferay.portlet.shopping.service.base.ShoppingCategoryLocalServiceBaseImpl
033     * @see com.liferay.portlet.shopping.service.impl.ShoppingCategoryLocalServiceImpl
034     * @generated
035     */
036    @ProviderType
037    public class ShoppingCategoryLocalServiceUtil {
038            /*
039             * NOTE FOR DEVELOPERS:
040             *
041             * Never modify this class directly. Add custom service methods to {@link com.liferay.portlet.shopping.service.impl.ShoppingCategoryLocalServiceImpl} and rerun ServiceBuilder to regenerate this class.
042             */
043            public static com.liferay.portlet.shopping.model.ShoppingCategory addCategory(
044                    long userId, long parentCategoryId, java.lang.String name,
045                    java.lang.String description,
046                    com.liferay.portal.service.ServiceContext serviceContext)
047                    throws com.liferay.portal.kernel.exception.PortalException {
048                    return getService()
049                                       .addCategory(userId, parentCategoryId, name, description,
050                            serviceContext);
051            }
052    
053            public static void addCategoryResources(
054                    com.liferay.portlet.shopping.model.ShoppingCategory category,
055                    boolean addGroupPermissions, boolean addGuestPermissions)
056                    throws com.liferay.portal.kernel.exception.PortalException {
057                    getService()
058                            .addCategoryResources(category, addGroupPermissions,
059                            addGuestPermissions);
060            }
061    
062            public static void addCategoryResources(
063                    com.liferay.portlet.shopping.model.ShoppingCategory category,
064                    java.lang.String[] groupPermissions, java.lang.String[] guestPermissions)
065                    throws com.liferay.portal.kernel.exception.PortalException {
066                    getService()
067                            .addCategoryResources(category, groupPermissions, guestPermissions);
068            }
069    
070            public static void addCategoryResources(long categoryId,
071                    boolean addGroupPermissions, boolean addGuestPermissions)
072                    throws com.liferay.portal.kernel.exception.PortalException {
073                    getService()
074                            .addCategoryResources(categoryId, addGroupPermissions,
075                            addGuestPermissions);
076            }
077    
078            public static void addCategoryResources(long categoryId,
079                    java.lang.String[] groupPermissions, java.lang.String[] guestPermissions)
080                    throws com.liferay.portal.kernel.exception.PortalException {
081                    getService()
082                            .addCategoryResources(categoryId, groupPermissions, guestPermissions);
083            }
084    
085            /**
086            * Adds the shopping category to the database. Also notifies the appropriate model listeners.
087            *
088            * @param shoppingCategory the shopping category
089            * @return the shopping category that was added
090            */
091            public static com.liferay.portlet.shopping.model.ShoppingCategory addShoppingCategory(
092                    com.liferay.portlet.shopping.model.ShoppingCategory shoppingCategory) {
093                    return getService().addShoppingCategory(shoppingCategory);
094            }
095    
096            /**
097            * Creates a new shopping category with the primary key. Does not add the shopping category to the database.
098            *
099            * @param categoryId the primary key for the new shopping category
100            * @return the new shopping category
101            */
102            public static com.liferay.portlet.shopping.model.ShoppingCategory createShoppingCategory(
103                    long categoryId) {
104                    return getService().createShoppingCategory(categoryId);
105            }
106    
107            public static void deleteCategories(long groupId)
108                    throws com.liferay.portal.kernel.exception.PortalException {
109                    getService().deleteCategories(groupId);
110            }
111    
112            public static void deleteCategory(
113                    com.liferay.portlet.shopping.model.ShoppingCategory category)
114                    throws com.liferay.portal.kernel.exception.PortalException {
115                    getService().deleteCategory(category);
116            }
117    
118            public static void deleteCategory(long categoryId)
119                    throws com.liferay.portal.kernel.exception.PortalException {
120                    getService().deleteCategory(categoryId);
121            }
122    
123            /**
124            * @throws PortalException
125            */
126            public static com.liferay.portal.model.PersistedModel deletePersistedModel(
127                    com.liferay.portal.model.PersistedModel persistedModel)
128                    throws com.liferay.portal.kernel.exception.PortalException {
129                    return getService().deletePersistedModel(persistedModel);
130            }
131    
132            /**
133            * Deletes the shopping category with the primary key from the database. Also notifies the appropriate model listeners.
134            *
135            * @param categoryId the primary key of the shopping category
136            * @return the shopping category that was removed
137            * @throws PortalException if a shopping category with the primary key could not be found
138            */
139            public static com.liferay.portlet.shopping.model.ShoppingCategory deleteShoppingCategory(
140                    long categoryId)
141                    throws com.liferay.portal.kernel.exception.PortalException {
142                    return getService().deleteShoppingCategory(categoryId);
143            }
144    
145            /**
146            * Deletes the shopping category from the database. Also notifies the appropriate model listeners.
147            *
148            * @param shoppingCategory the shopping category
149            * @return the shopping category that was removed
150            */
151            public static com.liferay.portlet.shopping.model.ShoppingCategory deleteShoppingCategory(
152                    com.liferay.portlet.shopping.model.ShoppingCategory shoppingCategory) {
153                    return getService().deleteShoppingCategory(shoppingCategory);
154            }
155    
156            public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() {
157                    return getService().dynamicQuery();
158            }
159    
160            /**
161            * Performs a dynamic query on the database and returns the matching rows.
162            *
163            * @param dynamicQuery the dynamic query
164            * @return the matching rows
165            */
166            public static <T> java.util.List<T> dynamicQuery(
167                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
168                    return getService().dynamicQuery(dynamicQuery);
169            }
170    
171            /**
172            * Performs a dynamic query on the database and returns a range of the matching rows.
173            *
174            * <p>
175            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.shopping.model.impl.ShoppingCategoryModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
176            * </p>
177            *
178            * @param dynamicQuery the dynamic query
179            * @param start the lower bound of the range of model instances
180            * @param end the upper bound of the range of model instances (not inclusive)
181            * @return the range of matching rows
182            */
183            public static <T> java.util.List<T> dynamicQuery(
184                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
185                    int end) {
186                    return getService().dynamicQuery(dynamicQuery, start, end);
187            }
188    
189            /**
190            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
191            *
192            * <p>
193            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.shopping.model.impl.ShoppingCategoryModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
194            * </p>
195            *
196            * @param dynamicQuery the dynamic query
197            * @param start the lower bound of the range of model instances
198            * @param end the upper bound of the range of model instances (not inclusive)
199            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
200            * @return the ordered range of matching rows
201            */
202            public static <T> java.util.List<T> dynamicQuery(
203                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
204                    int end,
205                    com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator) {
206                    return getService()
207                                       .dynamicQuery(dynamicQuery, start, end, orderByComparator);
208            }
209    
210            /**
211            * Returns the number of rows matching the dynamic query.
212            *
213            * @param dynamicQuery the dynamic query
214            * @return the number of rows matching the dynamic query
215            */
216            public static long dynamicQueryCount(
217                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
218                    return getService().dynamicQueryCount(dynamicQuery);
219            }
220    
221            /**
222            * Returns the number of rows matching the dynamic query.
223            *
224            * @param dynamicQuery the dynamic query
225            * @param projection the projection to apply to the query
226            * @return the number of rows matching the dynamic query
227            */
228            public static long dynamicQueryCount(
229                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery,
230                    com.liferay.portal.kernel.dao.orm.Projection projection) {
231                    return getService().dynamicQueryCount(dynamicQuery, projection);
232            }
233    
234            public static com.liferay.portlet.shopping.model.ShoppingCategory fetchShoppingCategory(
235                    long categoryId) {
236                    return getService().fetchShoppingCategory(categoryId);
237            }
238    
239            public static com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery() {
240                    return getService().getActionableDynamicQuery();
241            }
242    
243            /**
244            * Returns the Spring bean ID for this bean.
245            *
246            * @return the Spring bean ID for this bean
247            */
248            public static java.lang.String getBeanIdentifier() {
249                    return getService().getBeanIdentifier();
250            }
251    
252            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCategory> getCategories(
253                    long groupId) {
254                    return getService().getCategories(groupId);
255            }
256    
257            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCategory> getCategories(
258                    long groupId, long parentCategoryId, int start, int end) {
259                    return getService().getCategories(groupId, parentCategoryId, start, end);
260            }
261    
262            public static int getCategoriesCount(long groupId, long parentCategoryId) {
263                    return getService().getCategoriesCount(groupId, parentCategoryId);
264            }
265    
266            public static com.liferay.portlet.shopping.model.ShoppingCategory getCategory(
267                    long categoryId)
268                    throws com.liferay.portal.kernel.exception.PortalException {
269                    return getService().getCategory(categoryId);
270            }
271    
272            public static com.liferay.portlet.shopping.model.ShoppingCategory getCategory(
273                    long groupId, java.lang.String categoryName) {
274                    return getService().getCategory(groupId, categoryName);
275            }
276    
277            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCategory> getParentCategories(
278                    com.liferay.portlet.shopping.model.ShoppingCategory category)
279                    throws com.liferay.portal.kernel.exception.PortalException {
280                    return getService().getParentCategories(category);
281            }
282    
283            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCategory> getParentCategories(
284                    long categoryId)
285                    throws com.liferay.portal.kernel.exception.PortalException {
286                    return getService().getParentCategories(categoryId);
287            }
288    
289            public static com.liferay.portlet.shopping.model.ShoppingCategory getParentCategory(
290                    com.liferay.portlet.shopping.model.ShoppingCategory category)
291                    throws com.liferay.portal.kernel.exception.PortalException {
292                    return getService().getParentCategory(category);
293            }
294    
295            public static com.liferay.portal.model.PersistedModel getPersistedModel(
296                    java.io.Serializable primaryKeyObj)
297                    throws com.liferay.portal.kernel.exception.PortalException {
298                    return getService().getPersistedModel(primaryKeyObj);
299            }
300    
301            /**
302            * Returns a range of all the shopping categories.
303            *
304            * <p>
305            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.shopping.model.impl.ShoppingCategoryModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
306            * </p>
307            *
308            * @param start the lower bound of the range of shopping categories
309            * @param end the upper bound of the range of shopping categories (not inclusive)
310            * @return the range of shopping categories
311            */
312            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCategory> getShoppingCategories(
313                    int start, int end) {
314                    return getService().getShoppingCategories(start, end);
315            }
316    
317            /**
318            * Returns the number of shopping categories.
319            *
320            * @return the number of shopping categories
321            */
322            public static int getShoppingCategoriesCount() {
323                    return getService().getShoppingCategoriesCount();
324            }
325    
326            /**
327            * Returns the shopping category with the primary key.
328            *
329            * @param categoryId the primary key of the shopping category
330            * @return the shopping category
331            * @throws PortalException if a shopping category with the primary key could not be found
332            */
333            public static com.liferay.portlet.shopping.model.ShoppingCategory getShoppingCategory(
334                    long categoryId)
335                    throws com.liferay.portal.kernel.exception.PortalException {
336                    return getService().getShoppingCategory(categoryId);
337            }
338    
339            public static void getSubcategoryIds(
340                    java.util.List<java.lang.Long> categoryIds, long groupId,
341                    long categoryId) {
342                    getService().getSubcategoryIds(categoryIds, groupId, categoryId);
343            }
344    
345            /**
346            * Sets the Spring bean ID for this bean.
347            *
348            * @param beanIdentifier the Spring bean ID for this bean
349            */
350            public static void setBeanIdentifier(java.lang.String beanIdentifier) {
351                    getService().setBeanIdentifier(beanIdentifier);
352            }
353    
354            public static com.liferay.portlet.shopping.model.ShoppingCategory updateCategory(
355                    long categoryId, long parentCategoryId, java.lang.String name,
356                    java.lang.String description, boolean mergeWithParentCategory,
357                    com.liferay.portal.service.ServiceContext serviceContext)
358                    throws com.liferay.portal.kernel.exception.PortalException {
359                    return getService()
360                                       .updateCategory(categoryId, parentCategoryId, name,
361                            description, mergeWithParentCategory, serviceContext);
362            }
363    
364            /**
365            * Updates the shopping category in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
366            *
367            * @param shoppingCategory the shopping category
368            * @return the shopping category that was updated
369            */
370            public static com.liferay.portlet.shopping.model.ShoppingCategory updateShoppingCategory(
371                    com.liferay.portlet.shopping.model.ShoppingCategory shoppingCategory) {
372                    return getService().updateShoppingCategory(shoppingCategory);
373            }
374    
375            public static ShoppingCategoryLocalService getService() {
376                    if (_service == null) {
377                            _service = (ShoppingCategoryLocalService)PortalBeanLocatorUtil.locate(ShoppingCategoryLocalService.class.getName());
378    
379                            ReferenceRegistry.registerReference(ShoppingCategoryLocalServiceUtil.class,
380                                    "_service");
381                    }
382    
383                    return _service;
384            }
385    
386            /**
387             * @deprecated As of 6.2.0
388             */
389            @Deprecated
390            public void setService(ShoppingCategoryLocalService service) {
391            }
392    
393            private static ShoppingCategoryLocalService _service;
394    }