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