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.exception.PortalException;
020    import com.liferay.portal.kernel.exception.SystemException;
021    import com.liferay.portal.kernel.search.IndexableType;
022    import com.liferay.portal.kernel.transaction.Isolation;
023    import com.liferay.portal.kernel.transaction.Propagation;
024    import com.liferay.portal.kernel.transaction.Transactional;
025    import com.liferay.portal.service.BaseLocalService;
026    import com.liferay.portal.service.PersistedModelLocalService;
027    
028    /**
029     * Provides the local service interface for ShoppingItem. Methods of this
030     * service will not have security checks based on the propagated JAAS
031     * credentials because this service can only be accessed from within the same
032     * VM.
033     *
034     * @author Brian Wing Shun Chan
035     * @see ShoppingItemLocalServiceUtil
036     * @see com.liferay.portlet.shopping.service.base.ShoppingItemLocalServiceBaseImpl
037     * @see com.liferay.portlet.shopping.service.impl.ShoppingItemLocalServiceImpl
038     * @generated
039     */
040    @ProviderType
041    @Transactional(isolation = Isolation.PORTAL, rollbackFor =  {
042            PortalException.class, SystemException.class})
043    public interface ShoppingItemLocalService extends BaseLocalService,
044            PersistedModelLocalService {
045            /*
046             * NOTE FOR DEVELOPERS:
047             *
048             * Never modify or reference this interface directly. Always use {@link ShoppingItemLocalServiceUtil} to access the shopping item local service. Add custom service methods to {@link com.liferay.portlet.shopping.service.impl.ShoppingItemLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface.
049             */
050            public com.liferay.portlet.shopping.model.ShoppingItem addItem(
051                    long userId, long groupId, long categoryId, java.lang.String sku,
052                    java.lang.String name, java.lang.String description,
053                    java.lang.String properties, java.lang.String fieldsQuantities,
054                    boolean requiresShipping, int stockQuantity, boolean featured,
055                    java.lang.Boolean sale, boolean smallImage,
056                    java.lang.String smallImageURL, java.io.File smallImageFile,
057                    boolean mediumImage, java.lang.String mediumImageURL,
058                    java.io.File mediumImageFile, boolean largeImage,
059                    java.lang.String largeImageURL, java.io.File largeImageFile,
060                    java.util.List<com.liferay.portlet.shopping.model.ShoppingItemField> itemFields,
061                    java.util.List<com.liferay.portlet.shopping.model.ShoppingItemPrice> itemPrices,
062                    com.liferay.portal.service.ServiceContext serviceContext)
063                    throws com.liferay.portal.kernel.exception.PortalException;
064    
065            public void addItemResources(
066                    com.liferay.portlet.shopping.model.ShoppingItem item,
067                    boolean addGroupPermissions, boolean addGuestPermissions)
068                    throws com.liferay.portal.kernel.exception.PortalException;
069    
070            public void addItemResources(
071                    com.liferay.portlet.shopping.model.ShoppingItem item,
072                    java.lang.String[] groupPermissions, java.lang.String[] guestPermissions)
073                    throws com.liferay.portal.kernel.exception.PortalException;
074    
075            public void addItemResources(long itemId, boolean addGroupPermissions,
076                    boolean addGuestPermissions)
077                    throws com.liferay.portal.kernel.exception.PortalException;
078    
079            public void addItemResources(long itemId,
080                    java.lang.String[] groupPermissions, java.lang.String[] guestPermissions)
081                    throws com.liferay.portal.kernel.exception.PortalException;
082    
083            /**
084            * Adds the shopping item to the database. Also notifies the appropriate model listeners.
085            *
086            * @param shoppingItem the shopping item
087            * @return the shopping item that was added
088            */
089            @com.liferay.portal.kernel.search.Indexable(type = IndexableType.REINDEX)
090            public com.liferay.portlet.shopping.model.ShoppingItem addShoppingItem(
091                    com.liferay.portlet.shopping.model.ShoppingItem shoppingItem);
092    
093            /**
094            * Creates a new shopping item with the primary key. Does not add the shopping item to the database.
095            *
096            * @param itemId the primary key for the new shopping item
097            * @return the new shopping item
098            */
099            public com.liferay.portlet.shopping.model.ShoppingItem createShoppingItem(
100                    long itemId);
101    
102            public void deleteItem(com.liferay.portlet.shopping.model.ShoppingItem item)
103                    throws com.liferay.portal.kernel.exception.PortalException;
104    
105            public void deleteItem(long itemId)
106                    throws com.liferay.portal.kernel.exception.PortalException;
107    
108            public void deleteItems(long groupId, long categoryId)
109                    throws com.liferay.portal.kernel.exception.PortalException;
110    
111            /**
112            * @throws PortalException
113            */
114            @Override
115            public com.liferay.portal.model.PersistedModel deletePersistedModel(
116                    com.liferay.portal.model.PersistedModel persistedModel)
117                    throws com.liferay.portal.kernel.exception.PortalException;
118    
119            /**
120            * Deletes the shopping item with the primary key from the database. Also notifies the appropriate model listeners.
121            *
122            * @param itemId the primary key of the shopping item
123            * @return the shopping item that was removed
124            * @throws PortalException if a shopping item with the primary key could not be found
125            */
126            @com.liferay.portal.kernel.search.Indexable(type = IndexableType.DELETE)
127            public com.liferay.portlet.shopping.model.ShoppingItem deleteShoppingItem(
128                    long itemId) throws com.liferay.portal.kernel.exception.PortalException;
129    
130            /**
131            * Deletes the shopping item from the database. Also notifies the appropriate model listeners.
132            *
133            * @param shoppingItem the shopping item
134            * @return the shopping item that was removed
135            */
136            @com.liferay.portal.kernel.search.Indexable(type = IndexableType.DELETE)
137            public com.liferay.portlet.shopping.model.ShoppingItem deleteShoppingItem(
138                    com.liferay.portlet.shopping.model.ShoppingItem shoppingItem);
139    
140            public com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery();
141    
142            /**
143            * Performs a dynamic query on the database and returns the matching rows.
144            *
145            * @param dynamicQuery the dynamic query
146            * @return the matching rows
147            */
148            public <T> java.util.List<T> dynamicQuery(
149                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery);
150    
151            /**
152            * Performs a dynamic query on the database and returns a range of the matching rows.
153            *
154            * <p>
155            * 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.
156            * </p>
157            *
158            * @param dynamicQuery the dynamic query
159            * @param start the lower bound of the range of model instances
160            * @param end the upper bound of the range of model instances (not inclusive)
161            * @return the range of matching rows
162            */
163            public <T> java.util.List<T> dynamicQuery(
164                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
165                    int end);
166    
167            /**
168            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
169            *
170            * <p>
171            * 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.
172            * </p>
173            *
174            * @param dynamicQuery the dynamic query
175            * @param start the lower bound of the range of model instances
176            * @param end the upper bound of the range of model instances (not inclusive)
177            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
178            * @return the ordered range of matching rows
179            */
180            public <T> java.util.List<T> dynamicQuery(
181                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
182                    int end,
183                    com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator);
184    
185            /**
186            * Returns the number of rows matching the dynamic query.
187            *
188            * @param dynamicQuery the dynamic query
189            * @return the number of rows matching the dynamic query
190            */
191            public long dynamicQueryCount(
192                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery);
193    
194            /**
195            * Returns the number of rows matching the dynamic query.
196            *
197            * @param dynamicQuery the dynamic query
198            * @param projection the projection to apply to the query
199            * @return the number of rows matching the dynamic query
200            */
201            public long dynamicQueryCount(
202                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery,
203                    com.liferay.portal.kernel.dao.orm.Projection projection);
204    
205            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
206            public com.liferay.portlet.shopping.model.ShoppingItem fetchShoppingItem(
207                    long itemId);
208    
209            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
210            public com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery();
211    
212            /**
213            * Returns the Spring bean ID for this bean.
214            *
215            * @return the Spring bean ID for this bean
216            */
217            public java.lang.String getBeanIdentifier();
218    
219            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
220            public int getCategoriesItemsCount(long groupId,
221                    java.util.List<java.lang.Long> categoryIds);
222    
223            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
224            public java.util.List<com.liferay.portlet.shopping.model.ShoppingItem> getFeaturedItems(
225                    long groupId, long categoryId, int numOfItems);
226    
227            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
228            public com.liferay.portlet.shopping.model.ShoppingItem getItem(
229                    long companyId, java.lang.String sku)
230                    throws com.liferay.portal.kernel.exception.PortalException;
231    
232            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
233            public com.liferay.portlet.shopping.model.ShoppingItem getItem(long itemId)
234                    throws com.liferay.portal.kernel.exception.PortalException;
235    
236            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
237            public com.liferay.portlet.shopping.model.ShoppingItem getItemByLargeImageId(
238                    long largeImageId)
239                    throws com.liferay.portal.kernel.exception.PortalException;
240    
241            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
242            public com.liferay.portlet.shopping.model.ShoppingItem getItemByMediumImageId(
243                    long mediumImageId)
244                    throws com.liferay.portal.kernel.exception.PortalException;
245    
246            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
247            public com.liferay.portlet.shopping.model.ShoppingItem getItemBySmallImageId(
248                    long smallImageId)
249                    throws com.liferay.portal.kernel.exception.PortalException;
250    
251            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
252            public java.util.List<com.liferay.portlet.shopping.model.ShoppingItem> getItems(
253                    long groupId, long categoryId);
254    
255            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
256            public java.util.List<com.liferay.portlet.shopping.model.ShoppingItem> getItems(
257                    long groupId, long categoryId, int start, int end,
258                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.shopping.model.ShoppingItem> obc);
259    
260            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
261            public int getItemsCount(long groupId, long categoryId);
262    
263            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
264            public com.liferay.portlet.shopping.model.ShoppingItem[] getItemsPrevAndNext(
265                    long itemId,
266                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.shopping.model.ShoppingItem> obc)
267                    throws com.liferay.portal.kernel.exception.PortalException;
268    
269            @Override
270            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
271            public com.liferay.portal.model.PersistedModel getPersistedModel(
272                    java.io.Serializable primaryKeyObj)
273                    throws com.liferay.portal.kernel.exception.PortalException;
274    
275            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
276            public java.util.List<com.liferay.portlet.shopping.model.ShoppingItem> getSaleItems(
277                    long groupId, long categoryId, int numOfItems);
278    
279            /**
280            * Returns the shopping item with the primary key.
281            *
282            * @param itemId the primary key of the shopping item
283            * @return the shopping item
284            * @throws PortalException if a shopping item with the primary key could not be found
285            */
286            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
287            public com.liferay.portlet.shopping.model.ShoppingItem getShoppingItem(
288                    long itemId) throws com.liferay.portal.kernel.exception.PortalException;
289    
290            /**
291            * Returns a range of all the shopping items.
292            *
293            * <p>
294            * 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.
295            * </p>
296            *
297            * @param start the lower bound of the range of shopping items
298            * @param end the upper bound of the range of shopping items (not inclusive)
299            * @return the range of shopping items
300            */
301            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
302            public java.util.List<com.liferay.portlet.shopping.model.ShoppingItem> getShoppingItems(
303                    int start, int end);
304    
305            /**
306            * Returns the number of shopping items.
307            *
308            * @return the number of shopping items
309            */
310            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
311            public int getShoppingItemsCount();
312    
313            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
314            public java.util.List<com.liferay.portlet.shopping.model.ShoppingItem> search(
315                    long groupId, long[] categoryIds, java.lang.String keywords, int start,
316                    int end);
317    
318            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
319            public int searchCount(long groupId, long[] categoryIds,
320                    java.lang.String keywords);
321    
322            /**
323            * Sets the Spring bean ID for this bean.
324            *
325            * @param beanIdentifier the Spring bean ID for this bean
326            */
327            public void setBeanIdentifier(java.lang.String beanIdentifier);
328    
329            public com.liferay.portlet.shopping.model.ShoppingItem updateItem(
330                    long userId, long itemId, long groupId, long categoryId,
331                    java.lang.String sku, java.lang.String name,
332                    java.lang.String description, java.lang.String properties,
333                    java.lang.String fieldsQuantities, boolean requiresShipping,
334                    int stockQuantity, boolean featured, java.lang.Boolean sale,
335                    boolean smallImage, java.lang.String smallImageURL,
336                    java.io.File smallImageFile, boolean mediumImage,
337                    java.lang.String mediumImageURL, java.io.File mediumImageFile,
338                    boolean largeImage, java.lang.String largeImageURL,
339                    java.io.File largeImageFile,
340                    java.util.List<com.liferay.portlet.shopping.model.ShoppingItemField> itemFields,
341                    java.util.List<com.liferay.portlet.shopping.model.ShoppingItemPrice> itemPrices,
342                    com.liferay.portal.service.ServiceContext serviceContext)
343                    throws com.liferay.portal.kernel.exception.PortalException;
344    
345            /**
346            * Updates the shopping item in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
347            *
348            * @param shoppingItem the shopping item
349            * @return the shopping item that was updated
350            */
351            @com.liferay.portal.kernel.search.Indexable(type = IndexableType.REINDEX)
352            public com.liferay.portlet.shopping.model.ShoppingItem updateShoppingItem(
353                    com.liferay.portlet.shopping.model.ShoppingItem shoppingItem);
354    }