001    /**
002     * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
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 smallFile,
272                    boolean mediumImage, java.lang.String mediumImageURL,
273                    java.io.File mediumFile, boolean largeImage,
274                    java.lang.String largeImageURL, java.io.File largeFile,
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                            smallFile, mediumImage, mediumImageURL, mediumFile, largeImage,
285                            largeImageURL, largeFile, itemFields, itemPrices, serviceContext);
286            }
287    
288            public static void addItemResources(long itemId,
289                    boolean addCommunityPermissions, boolean addGuestPermissions)
290                    throws com.liferay.portal.kernel.exception.PortalException,
291                            com.liferay.portal.kernel.exception.SystemException {
292                    getService()
293                            .addItemResources(itemId, addCommunityPermissions,
294                            addGuestPermissions);
295            }
296    
297            public static void addItemResources(long itemId,
298                    java.lang.String[] communityPermissions,
299                    java.lang.String[] guestPermissions)
300                    throws com.liferay.portal.kernel.exception.PortalException,
301                            com.liferay.portal.kernel.exception.SystemException {
302                    getService()
303                            .addItemResources(itemId, communityPermissions, guestPermissions);
304            }
305    
306            public static void addItemResources(
307                    com.liferay.portlet.shopping.model.ShoppingItem item,
308                    boolean addCommunityPermissions, boolean addGuestPermissions)
309                    throws com.liferay.portal.kernel.exception.PortalException,
310                            com.liferay.portal.kernel.exception.SystemException {
311                    getService()
312                            .addItemResources(item, addCommunityPermissions, addGuestPermissions);
313            }
314    
315            public static void addItemResources(
316                    com.liferay.portlet.shopping.model.ShoppingItem item,
317                    java.lang.String[] communityPermissions,
318                    java.lang.String[] guestPermissions)
319                    throws com.liferay.portal.kernel.exception.PortalException,
320                            com.liferay.portal.kernel.exception.SystemException {
321                    getService()
322                            .addItemResources(item, communityPermissions, guestPermissions);
323            }
324    
325            public static void deleteItem(long itemId)
326                    throws com.liferay.portal.kernel.exception.PortalException,
327                            com.liferay.portal.kernel.exception.SystemException {
328                    getService().deleteItem(itemId);
329            }
330    
331            public static void deleteItem(
332                    com.liferay.portlet.shopping.model.ShoppingItem item)
333                    throws com.liferay.portal.kernel.exception.PortalException,
334                            com.liferay.portal.kernel.exception.SystemException {
335                    getService().deleteItem(item);
336            }
337    
338            public static void deleteItems(long groupId, long categoryId)
339                    throws com.liferay.portal.kernel.exception.PortalException,
340                            com.liferay.portal.kernel.exception.SystemException {
341                    getService().deleteItems(groupId, categoryId);
342            }
343    
344            public static int getCategoriesItemsCount(long groupId,
345                    java.util.List<java.lang.Long> categoryIds)
346                    throws com.liferay.portal.kernel.exception.SystemException {
347                    return getService().getCategoriesItemsCount(groupId, categoryIds);
348            }
349    
350            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItem> getFeaturedItems(
351                    long groupId, long categoryId, int numOfItems)
352                    throws com.liferay.portal.kernel.exception.SystemException {
353                    return getService().getFeaturedItems(groupId, categoryId, numOfItems);
354            }
355    
356            public static com.liferay.portlet.shopping.model.ShoppingItem getItem(
357                    long itemId)
358                    throws com.liferay.portal.kernel.exception.PortalException,
359                            com.liferay.portal.kernel.exception.SystemException {
360                    return getService().getItem(itemId);
361            }
362    
363            public static com.liferay.portlet.shopping.model.ShoppingItem getItem(
364                    long companyId, java.lang.String sku)
365                    throws com.liferay.portal.kernel.exception.PortalException,
366                            com.liferay.portal.kernel.exception.SystemException {
367                    return getService().getItem(companyId, sku);
368            }
369    
370            public static com.liferay.portlet.shopping.model.ShoppingItem getItemByLargeImageId(
371                    long largeImageId)
372                    throws com.liferay.portal.kernel.exception.PortalException,
373                            com.liferay.portal.kernel.exception.SystemException {
374                    return getService().getItemByLargeImageId(largeImageId);
375            }
376    
377            public static com.liferay.portlet.shopping.model.ShoppingItem getItemByMediumImageId(
378                    long mediumImageId)
379                    throws com.liferay.portal.kernel.exception.PortalException,
380                            com.liferay.portal.kernel.exception.SystemException {
381                    return getService().getItemByMediumImageId(mediumImageId);
382            }
383    
384            public static com.liferay.portlet.shopping.model.ShoppingItem getItemBySmallImageId(
385                    long smallImageId)
386                    throws com.liferay.portal.kernel.exception.PortalException,
387                            com.liferay.portal.kernel.exception.SystemException {
388                    return getService().getItemBySmallImageId(smallImageId);
389            }
390    
391            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItem> getItems(
392                    long groupId, long categoryId)
393                    throws com.liferay.portal.kernel.exception.SystemException {
394                    return getService().getItems(groupId, categoryId);
395            }
396    
397            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItem> getItems(
398                    long groupId, long categoryId, int start, int end,
399                    com.liferay.portal.kernel.util.OrderByComparator obc)
400                    throws com.liferay.portal.kernel.exception.SystemException {
401                    return getService().getItems(groupId, categoryId, start, end, obc);
402            }
403    
404            public static int getItemsCount(long groupId, long categoryId)
405                    throws com.liferay.portal.kernel.exception.SystemException {
406                    return getService().getItemsCount(groupId, categoryId);
407            }
408    
409            public static com.liferay.portlet.shopping.model.ShoppingItem[] getItemsPrevAndNext(
410                    long itemId, com.liferay.portal.kernel.util.OrderByComparator obc)
411                    throws com.liferay.portal.kernel.exception.PortalException,
412                            com.liferay.portal.kernel.exception.SystemException {
413                    return getService().getItemsPrevAndNext(itemId, obc);
414            }
415    
416            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItem> getSaleItems(
417                    long groupId, long categoryId, int numOfItems)
418                    throws com.liferay.portal.kernel.exception.SystemException {
419                    return getService().getSaleItems(groupId, categoryId, numOfItems);
420            }
421    
422            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItem> search(
423                    long groupId, long[] categoryIds, java.lang.String keywords, int start,
424                    int end) throws com.liferay.portal.kernel.exception.SystemException {
425                    return getService().search(groupId, categoryIds, keywords, start, end);
426            }
427    
428            public static int searchCount(long groupId, long[] categoryIds,
429                    java.lang.String keywords)
430                    throws com.liferay.portal.kernel.exception.SystemException {
431                    return getService().searchCount(groupId, categoryIds, keywords);
432            }
433    
434            public static com.liferay.portlet.shopping.model.ShoppingItem updateItem(
435                    long userId, long itemId, long groupId, long categoryId,
436                    java.lang.String sku, java.lang.String name,
437                    java.lang.String description, java.lang.String properties,
438                    java.lang.String fieldsQuantities, boolean requiresShipping,
439                    int stockQuantity, boolean featured, java.lang.Boolean sale,
440                    boolean smallImage, java.lang.String smallImageURL,
441                    java.io.File smallFile, boolean mediumImage,
442                    java.lang.String mediumImageURL, java.io.File mediumFile,
443                    boolean largeImage, java.lang.String largeImageURL,
444                    java.io.File largeFile,
445                    java.util.List<com.liferay.portlet.shopping.model.ShoppingItemField> itemFields,
446                    java.util.List<com.liferay.portlet.shopping.model.ShoppingItemPrice> itemPrices,
447                    com.liferay.portal.service.ServiceContext serviceContext)
448                    throws com.liferay.portal.kernel.exception.PortalException,
449                            com.liferay.portal.kernel.exception.SystemException {
450                    return getService()
451                                       .updateItem(userId, itemId, groupId, categoryId, sku, name,
452                            description, properties, fieldsQuantities, requiresShipping,
453                            stockQuantity, featured, sale, smallImage, smallImageURL,
454                            smallFile, mediumImage, mediumImageURL, mediumFile, largeImage,
455                            largeImageURL, largeFile, itemFields, itemPrices, serviceContext);
456            }
457    
458            public static ShoppingItemLocalService getService() {
459                    if (_service == null) {
460                            _service = (ShoppingItemLocalService)PortalBeanLocatorUtil.locate(ShoppingItemLocalService.class.getName());
461    
462                            ReferenceRegistry.registerReference(ShoppingItemLocalServiceUtil.class,
463                                    "_service");
464                            MethodCache.remove(ShoppingItemLocalService.class);
465                    }
466    
467                    return _service;
468            }
469    
470            public void setService(ShoppingItemLocalService service) {
471                    MethodCache.remove(ShoppingItemLocalService.class);
472    
473                    _service = service;
474    
475                    ReferenceRegistry.registerReference(ShoppingItemLocalServiceUtil.class,
476                            "_service");
477                    MethodCache.remove(ShoppingItemLocalService.class);
478            }
479    
480            private static ShoppingItemLocalService _service;
481    }