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