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 ShoppingItem. This utility wraps
024     * {@link com.liferay.portlet.shopping.service.impl.ShoppingItemLocalServiceImpl} 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 ShoppingItemLocalService
032     * @see com.liferay.portlet.shopping.service.base.ShoppingItemLocalServiceBaseImpl
033     * @see com.liferay.portlet.shopping.service.impl.ShoppingItemLocalServiceImpl
034     * @generated
035     */
036    @ProviderType
037    public class ShoppingItemLocalServiceUtil {
038            /*
039             * NOTE FOR DEVELOPERS:
040             *
041             * Never modify this class directly. Add custom service methods to {@link com.liferay.portlet.shopping.service.impl.ShoppingItemLocalServiceImpl} and rerun ServiceBuilder to regenerate this class.
042             */
043            public static com.liferay.portlet.shopping.model.ShoppingItem addItem(
044                    long userId, long groupId, long categoryId, java.lang.String sku,
045                    java.lang.String name, java.lang.String description,
046                    java.lang.String properties, java.lang.String fieldsQuantities,
047                    boolean requiresShipping, int stockQuantity, boolean featured,
048                    java.lang.Boolean sale, boolean smallImage,
049                    java.lang.String smallImageURL, java.io.File smallImageFile,
050                    boolean mediumImage, java.lang.String mediumImageURL,
051                    java.io.File mediumImageFile, boolean largeImage,
052                    java.lang.String largeImageURL, java.io.File largeImageFile,
053                    java.util.List<com.liferay.portlet.shopping.model.ShoppingItemField> itemFields,
054                    java.util.List<com.liferay.portlet.shopping.model.ShoppingItemPrice> itemPrices,
055                    com.liferay.portal.service.ServiceContext serviceContext)
056                    throws com.liferay.portal.kernel.exception.PortalException {
057                    return getService()
058                                       .addItem(userId, groupId, categoryId, sku, name,
059                            description, properties, fieldsQuantities, requiresShipping,
060                            stockQuantity, featured, sale, smallImage, smallImageURL,
061                            smallImageFile, mediumImage, mediumImageURL, mediumImageFile,
062                            largeImage, largeImageURL, largeImageFile, itemFields, itemPrices,
063                            serviceContext);
064            }
065    
066            public static void addItemResources(
067                    com.liferay.portlet.shopping.model.ShoppingItem item,
068                    boolean addGroupPermissions, boolean addGuestPermissions)
069                    throws com.liferay.portal.kernel.exception.PortalException {
070                    getService()
071                            .addItemResources(item, addGroupPermissions, addGuestPermissions);
072            }
073    
074            public static void addItemResources(
075                    com.liferay.portlet.shopping.model.ShoppingItem item,
076                    java.lang.String[] groupPermissions, java.lang.String[] guestPermissions)
077                    throws com.liferay.portal.kernel.exception.PortalException {
078                    getService().addItemResources(item, groupPermissions, guestPermissions);
079            }
080    
081            public static void addItemResources(long itemId,
082                    boolean addGroupPermissions, boolean addGuestPermissions)
083                    throws com.liferay.portal.kernel.exception.PortalException {
084                    getService()
085                            .addItemResources(itemId, addGroupPermissions, addGuestPermissions);
086            }
087    
088            public static void addItemResources(long itemId,
089                    java.lang.String[] groupPermissions, java.lang.String[] guestPermissions)
090                    throws com.liferay.portal.kernel.exception.PortalException {
091                    getService().addItemResources(itemId, groupPermissions, guestPermissions);
092            }
093    
094            /**
095            * Adds the shopping item to the database. Also notifies the appropriate model listeners.
096            *
097            * @param shoppingItem the shopping item
098            * @return the shopping item that was added
099            */
100            public static com.liferay.portlet.shopping.model.ShoppingItem addShoppingItem(
101                    com.liferay.portlet.shopping.model.ShoppingItem shoppingItem) {
102                    return getService().addShoppingItem(shoppingItem);
103            }
104    
105            /**
106            * Creates a new shopping item with the primary key. Does not add the shopping item to the database.
107            *
108            * @param itemId the primary key for the new shopping item
109            * @return the new shopping item
110            */
111            public static com.liferay.portlet.shopping.model.ShoppingItem createShoppingItem(
112                    long itemId) {
113                    return getService().createShoppingItem(itemId);
114            }
115    
116            public static void deleteItem(
117                    com.liferay.portlet.shopping.model.ShoppingItem item)
118                    throws com.liferay.portal.kernel.exception.PortalException {
119                    getService().deleteItem(item);
120            }
121    
122            public static void deleteItem(long itemId)
123                    throws com.liferay.portal.kernel.exception.PortalException {
124                    getService().deleteItem(itemId);
125            }
126    
127            public static void deleteItems(long groupId, long categoryId)
128                    throws com.liferay.portal.kernel.exception.PortalException {
129                    getService().deleteItems(groupId, categoryId);
130            }
131    
132            /**
133            * @throws PortalException
134            */
135            public static com.liferay.portal.model.PersistedModel deletePersistedModel(
136                    com.liferay.portal.model.PersistedModel persistedModel)
137                    throws com.liferay.portal.kernel.exception.PortalException {
138                    return getService().deletePersistedModel(persistedModel);
139            }
140    
141            /**
142            * Deletes the shopping item with the primary key from the database. Also notifies the appropriate model listeners.
143            *
144            * @param itemId the primary key of the shopping item
145            * @return the shopping item that was removed
146            * @throws PortalException if a shopping item with the primary key could not be found
147            */
148            public static com.liferay.portlet.shopping.model.ShoppingItem deleteShoppingItem(
149                    long itemId) throws com.liferay.portal.kernel.exception.PortalException {
150                    return getService().deleteShoppingItem(itemId);
151            }
152    
153            /**
154            * Deletes the shopping item from the database. Also notifies the appropriate model listeners.
155            *
156            * @param shoppingItem the shopping item
157            * @return the shopping item that was removed
158            */
159            public static com.liferay.portlet.shopping.model.ShoppingItem deleteShoppingItem(
160                    com.liferay.portlet.shopping.model.ShoppingItem shoppingItem) {
161                    return getService().deleteShoppingItem(shoppingItem);
162            }
163    
164            public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() {
165                    return getService().dynamicQuery();
166            }
167    
168            /**
169            * Performs a dynamic query on the database and returns the matching rows.
170            *
171            * @param dynamicQuery the dynamic query
172            * @return the matching rows
173            */
174            public static <T> java.util.List<T> dynamicQuery(
175                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
176                    return getService().dynamicQuery(dynamicQuery);
177            }
178    
179            /**
180            * Performs a dynamic query on the database and returns a range of the matching rows.
181            *
182            * <p>
183            * 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.ShoppingItemModelImpl}. 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.
184            * </p>
185            *
186            * @param dynamicQuery the dynamic query
187            * @param start the lower bound of the range of model instances
188            * @param end the upper bound of the range of model instances (not inclusive)
189            * @return the range of matching rows
190            */
191            public static <T> java.util.List<T> dynamicQuery(
192                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
193                    int end) {
194                    return getService().dynamicQuery(dynamicQuery, start, end);
195            }
196    
197            /**
198            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
199            *
200            * <p>
201            * 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.ShoppingItemModelImpl}. 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.
202            * </p>
203            *
204            * @param dynamicQuery the dynamic query
205            * @param start the lower bound of the range of model instances
206            * @param end the upper bound of the range of model instances (not inclusive)
207            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
208            * @return the ordered range of matching rows
209            */
210            public static <T> java.util.List<T> dynamicQuery(
211                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
212                    int end,
213                    com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator) {
214                    return getService()
215                                       .dynamicQuery(dynamicQuery, start, end, orderByComparator);
216            }
217    
218            /**
219            * Returns the number of rows matching the dynamic query.
220            *
221            * @param dynamicQuery the dynamic query
222            * @return the number of rows matching the dynamic query
223            */
224            public static long dynamicQueryCount(
225                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
226                    return getService().dynamicQueryCount(dynamicQuery);
227            }
228    
229            /**
230            * Returns the number of rows matching the dynamic query.
231            *
232            * @param dynamicQuery the dynamic query
233            * @param projection the projection to apply to the query
234            * @return the number of rows matching the dynamic query
235            */
236            public static long dynamicQueryCount(
237                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery,
238                    com.liferay.portal.kernel.dao.orm.Projection projection) {
239                    return getService().dynamicQueryCount(dynamicQuery, projection);
240            }
241    
242            public static com.liferay.portlet.shopping.model.ShoppingItem fetchShoppingItem(
243                    long itemId) {
244                    return getService().fetchShoppingItem(itemId);
245            }
246    
247            public static com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery() {
248                    return getService().getActionableDynamicQuery();
249            }
250    
251            /**
252            * Returns the Spring bean ID for this bean.
253            *
254            * @return the Spring bean ID for this bean
255            */
256            public static java.lang.String getBeanIdentifier() {
257                    return getService().getBeanIdentifier();
258            }
259    
260            public static int getCategoriesItemsCount(long groupId,
261                    java.util.List<java.lang.Long> categoryIds) {
262                    return getService().getCategoriesItemsCount(groupId, categoryIds);
263            }
264    
265            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItem> getFeaturedItems(
266                    long groupId, long categoryId, int numOfItems) {
267                    return getService().getFeaturedItems(groupId, categoryId, numOfItems);
268            }
269    
270            public static com.liferay.portlet.shopping.model.ShoppingItem getItem(
271                    long companyId, java.lang.String sku)
272                    throws com.liferay.portal.kernel.exception.PortalException {
273                    return getService().getItem(companyId, sku);
274            }
275    
276            public static com.liferay.portlet.shopping.model.ShoppingItem getItem(
277                    long itemId) throws com.liferay.portal.kernel.exception.PortalException {
278                    return getService().getItem(itemId);
279            }
280    
281            public static com.liferay.portlet.shopping.model.ShoppingItem getItemByLargeImageId(
282                    long largeImageId)
283                    throws com.liferay.portal.kernel.exception.PortalException {
284                    return getService().getItemByLargeImageId(largeImageId);
285            }
286    
287            public static com.liferay.portlet.shopping.model.ShoppingItem getItemByMediumImageId(
288                    long mediumImageId)
289                    throws com.liferay.portal.kernel.exception.PortalException {
290                    return getService().getItemByMediumImageId(mediumImageId);
291            }
292    
293            public static com.liferay.portlet.shopping.model.ShoppingItem getItemBySmallImageId(
294                    long smallImageId)
295                    throws com.liferay.portal.kernel.exception.PortalException {
296                    return getService().getItemBySmallImageId(smallImageId);
297            }
298    
299            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItem> getItems(
300                    long groupId, long categoryId) {
301                    return getService().getItems(groupId, categoryId);
302            }
303    
304            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItem> getItems(
305                    long groupId, long categoryId, int start, int end,
306                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.shopping.model.ShoppingItem> obc) {
307                    return getService().getItems(groupId, categoryId, start, end, obc);
308            }
309    
310            public static int getItemsCount(long groupId, long categoryId) {
311                    return getService().getItemsCount(groupId, categoryId);
312            }
313    
314            public static com.liferay.portlet.shopping.model.ShoppingItem[] getItemsPrevAndNext(
315                    long itemId,
316                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.shopping.model.ShoppingItem> obc)
317                    throws com.liferay.portal.kernel.exception.PortalException {
318                    return getService().getItemsPrevAndNext(itemId, obc);
319            }
320    
321            public static com.liferay.portal.model.PersistedModel getPersistedModel(
322                    java.io.Serializable primaryKeyObj)
323                    throws com.liferay.portal.kernel.exception.PortalException {
324                    return getService().getPersistedModel(primaryKeyObj);
325            }
326    
327            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItem> getSaleItems(
328                    long groupId, long categoryId, int numOfItems) {
329                    return getService().getSaleItems(groupId, categoryId, numOfItems);
330            }
331    
332            /**
333            * Returns the shopping item with the primary key.
334            *
335            * @param itemId the primary key of the shopping item
336            * @return the shopping item
337            * @throws PortalException if a shopping item with the primary key could not be found
338            */
339            public static com.liferay.portlet.shopping.model.ShoppingItem getShoppingItem(
340                    long itemId) throws com.liferay.portal.kernel.exception.PortalException {
341                    return getService().getShoppingItem(itemId);
342            }
343    
344            /**
345            * Returns a range of all the shopping items.
346            *
347            * <p>
348            * 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.ShoppingItemModelImpl}. 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.
349            * </p>
350            *
351            * @param start the lower bound of the range of shopping items
352            * @param end the upper bound of the range of shopping items (not inclusive)
353            * @return the range of shopping items
354            */
355            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItem> getShoppingItems(
356                    int start, int end) {
357                    return getService().getShoppingItems(start, end);
358            }
359    
360            /**
361            * Returns the number of shopping items.
362            *
363            * @return the number of shopping items
364            */
365            public static int getShoppingItemsCount() {
366                    return getService().getShoppingItemsCount();
367            }
368    
369            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItem> search(
370                    long groupId, long[] categoryIds, java.lang.String keywords, int start,
371                    int end) {
372                    return getService().search(groupId, categoryIds, keywords, start, end);
373            }
374    
375            public static int searchCount(long groupId, long[] categoryIds,
376                    java.lang.String keywords) {
377                    return getService().searchCount(groupId, categoryIds, keywords);
378            }
379    
380            /**
381            * Sets the Spring bean ID for this bean.
382            *
383            * @param beanIdentifier the Spring bean ID for this bean
384            */
385            public static void setBeanIdentifier(java.lang.String beanIdentifier) {
386                    getService().setBeanIdentifier(beanIdentifier);
387            }
388    
389            public static com.liferay.portlet.shopping.model.ShoppingItem updateItem(
390                    long userId, long itemId, long groupId, long categoryId,
391                    java.lang.String sku, java.lang.String name,
392                    java.lang.String description, java.lang.String properties,
393                    java.lang.String fieldsQuantities, boolean requiresShipping,
394                    int stockQuantity, boolean featured, java.lang.Boolean sale,
395                    boolean smallImage, java.lang.String smallImageURL,
396                    java.io.File smallImageFile, boolean mediumImage,
397                    java.lang.String mediumImageURL, java.io.File mediumImageFile,
398                    boolean largeImage, java.lang.String largeImageURL,
399                    java.io.File largeImageFile,
400                    java.util.List<com.liferay.portlet.shopping.model.ShoppingItemField> itemFields,
401                    java.util.List<com.liferay.portlet.shopping.model.ShoppingItemPrice> itemPrices,
402                    com.liferay.portal.service.ServiceContext serviceContext)
403                    throws com.liferay.portal.kernel.exception.PortalException {
404                    return getService()
405                                       .updateItem(userId, itemId, groupId, categoryId, sku, name,
406                            description, properties, fieldsQuantities, requiresShipping,
407                            stockQuantity, featured, sale, smallImage, smallImageURL,
408                            smallImageFile, mediumImage, mediumImageURL, mediumImageFile,
409                            largeImage, largeImageURL, largeImageFile, itemFields, itemPrices,
410                            serviceContext);
411            }
412    
413            /**
414            * Updates the shopping item in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
415            *
416            * @param shoppingItem the shopping item
417            * @return the shopping item that was updated
418            */
419            public static com.liferay.portlet.shopping.model.ShoppingItem updateShoppingItem(
420                    com.liferay.portlet.shopping.model.ShoppingItem shoppingItem) {
421                    return getService().updateShoppingItem(shoppingItem);
422            }
423    
424            public static ShoppingItemLocalService getService() {
425                    if (_service == null) {
426                            _service = (ShoppingItemLocalService)PortalBeanLocatorUtil.locate(ShoppingItemLocalService.class.getName());
427    
428                            ReferenceRegistry.registerReference(ShoppingItemLocalServiceUtil.class,
429                                    "_service");
430                    }
431    
432                    return _service;
433            }
434    
435            /**
436             * @deprecated As of 6.2.0
437             */
438            @Deprecated
439            public void setService(ShoppingItemLocalService service) {
440            }
441    
442            private static ShoppingItemLocalService _service;
443    }