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 ShoppingCategory. 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 ShoppingCategoryLocalServiceUtil
036     * @see com.liferay.portlet.shopping.service.base.ShoppingCategoryLocalServiceBaseImpl
037     * @see com.liferay.portlet.shopping.service.impl.ShoppingCategoryLocalServiceImpl
038     * @generated
039     */
040    @ProviderType
041    @Transactional(isolation = Isolation.PORTAL, rollbackFor =  {
042            PortalException.class, SystemException.class})
043    public interface ShoppingCategoryLocalService extends BaseLocalService,
044            PersistedModelLocalService {
045            /*
046             * NOTE FOR DEVELOPERS:
047             *
048             * Never modify or reference this interface directly. Always use {@link ShoppingCategoryLocalServiceUtil} to access the shopping category local service. Add custom service methods to {@link com.liferay.portlet.shopping.service.impl.ShoppingCategoryLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface.
049             */
050            public com.liferay.portlet.shopping.model.ShoppingCategory addCategory(
051                    long userId, long parentCategoryId, java.lang.String name,
052                    java.lang.String description,
053                    com.liferay.portal.service.ServiceContext serviceContext)
054                    throws PortalException;
055    
056            public void addCategoryResources(
057                    com.liferay.portlet.shopping.model.ShoppingCategory category,
058                    boolean addGroupPermissions, boolean addGuestPermissions)
059                    throws PortalException;
060    
061            public void addCategoryResources(
062                    com.liferay.portlet.shopping.model.ShoppingCategory category,
063                    java.lang.String[] groupPermissions, java.lang.String[] guestPermissions)
064                    throws PortalException;
065    
066            public void addCategoryResources(long categoryId,
067                    boolean addGroupPermissions, boolean addGuestPermissions)
068                    throws PortalException;
069    
070            public void addCategoryResources(long categoryId,
071                    java.lang.String[] groupPermissions, java.lang.String[] guestPermissions)
072                    throws PortalException;
073    
074            /**
075            * Adds the shopping category to the database. Also notifies the appropriate model listeners.
076            *
077            * @param shoppingCategory the shopping category
078            * @return the shopping category that was added
079            */
080            @com.liferay.portal.kernel.search.Indexable(type = IndexableType.REINDEX)
081            public com.liferay.portlet.shopping.model.ShoppingCategory addShoppingCategory(
082                    com.liferay.portlet.shopping.model.ShoppingCategory shoppingCategory);
083    
084            /**
085            * Creates a new shopping category with the primary key. Does not add the shopping category to the database.
086            *
087            * @param categoryId the primary key for the new shopping category
088            * @return the new shopping category
089            */
090            public com.liferay.portlet.shopping.model.ShoppingCategory createShoppingCategory(
091                    long categoryId);
092    
093            public void deleteCategories(long groupId) throws PortalException;
094    
095            public void deleteCategory(
096                    com.liferay.portlet.shopping.model.ShoppingCategory category)
097                    throws PortalException;
098    
099            public void deleteCategory(long categoryId) throws PortalException;
100    
101            /**
102            * @throws PortalException
103            */
104            @Override
105            public com.liferay.portal.model.PersistedModel deletePersistedModel(
106                    com.liferay.portal.model.PersistedModel persistedModel)
107                    throws PortalException;
108    
109            /**
110            * Deletes the shopping category with the primary key from the database. Also notifies the appropriate model listeners.
111            *
112            * @param categoryId the primary key of the shopping category
113            * @return the shopping category that was removed
114            * @throws PortalException if a shopping category with the primary key could not be found
115            */
116            @com.liferay.portal.kernel.search.Indexable(type = IndexableType.DELETE)
117            public com.liferay.portlet.shopping.model.ShoppingCategory deleteShoppingCategory(
118                    long categoryId) throws PortalException;
119    
120            /**
121            * Deletes the shopping category from the database. Also notifies the appropriate model listeners.
122            *
123            * @param shoppingCategory the shopping category
124            * @return the shopping category that was removed
125            */
126            @com.liferay.portal.kernel.search.Indexable(type = IndexableType.DELETE)
127            public com.liferay.portlet.shopping.model.ShoppingCategory deleteShoppingCategory(
128                    com.liferay.portlet.shopping.model.ShoppingCategory shoppingCategory);
129    
130            public com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery();
131    
132            /**
133            * Performs a dynamic query on the database and returns the matching rows.
134            *
135            * @param dynamicQuery the dynamic query
136            * @return the matching rows
137            */
138            public <T> java.util.List<T> dynamicQuery(
139                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery);
140    
141            /**
142            * Performs a dynamic query on the database and returns a range of the matching rows.
143            *
144            * <p>
145            * 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.ShoppingCategoryModelImpl}. 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.
146            * </p>
147            *
148            * @param dynamicQuery the dynamic query
149            * @param start the lower bound of the range of model instances
150            * @param end the upper bound of the range of model instances (not inclusive)
151            * @return the range of matching rows
152            */
153            public <T> java.util.List<T> dynamicQuery(
154                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
155                    int end);
156    
157            /**
158            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
159            *
160            * <p>
161            * 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.ShoppingCategoryModelImpl}. 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.
162            * </p>
163            *
164            * @param dynamicQuery the dynamic query
165            * @param start the lower bound of the range of model instances
166            * @param end the upper bound of the range of model instances (not inclusive)
167            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
168            * @return the ordered range of matching rows
169            */
170            public <T> java.util.List<T> dynamicQuery(
171                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
172                    int end,
173                    com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator);
174    
175            /**
176            * Returns the number of rows matching the dynamic query.
177            *
178            * @param dynamicQuery the dynamic query
179            * @return the number of rows matching the dynamic query
180            */
181            public long dynamicQueryCount(
182                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery);
183    
184            /**
185            * Returns the number of rows matching the dynamic query.
186            *
187            * @param dynamicQuery the dynamic query
188            * @param projection the projection to apply to the 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                    com.liferay.portal.kernel.dao.orm.Projection projection);
194    
195            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
196            public com.liferay.portlet.shopping.model.ShoppingCategory fetchShoppingCategory(
197                    long categoryId);
198    
199            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
200            public com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery();
201    
202            /**
203            * Returns the Spring bean ID for this bean.
204            *
205            * @return the Spring bean ID for this bean
206            */
207            public java.lang.String getBeanIdentifier();
208    
209            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
210            public java.util.List<com.liferay.portlet.shopping.model.ShoppingCategory> getCategories(
211                    long groupId);
212    
213            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
214            public java.util.List<com.liferay.portlet.shopping.model.ShoppingCategory> getCategories(
215                    long groupId, long parentCategoryId, int start, int end);
216    
217            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
218            public int getCategoriesCount(long groupId, long parentCategoryId);
219    
220            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
221            public com.liferay.portlet.shopping.model.ShoppingCategory getCategory(
222                    long categoryId) throws PortalException;
223    
224            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
225            public com.liferay.portlet.shopping.model.ShoppingCategory getCategory(
226                    long groupId, java.lang.String categoryName);
227    
228            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
229            public java.util.List<com.liferay.portlet.shopping.model.ShoppingCategory> getParentCategories(
230                    com.liferay.portlet.shopping.model.ShoppingCategory category)
231                    throws PortalException;
232    
233            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
234            public java.util.List<com.liferay.portlet.shopping.model.ShoppingCategory> getParentCategories(
235                    long categoryId) throws PortalException;
236    
237            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
238            public com.liferay.portlet.shopping.model.ShoppingCategory getParentCategory(
239                    com.liferay.portlet.shopping.model.ShoppingCategory category)
240                    throws PortalException;
241    
242            @Override
243            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
244            public com.liferay.portal.model.PersistedModel getPersistedModel(
245                    java.io.Serializable primaryKeyObj) throws PortalException;
246    
247            /**
248            * Returns a range of all the shopping categories.
249            *
250            * <p>
251            * 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.ShoppingCategoryModelImpl}. 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.
252            * </p>
253            *
254            * @param start the lower bound of the range of shopping categories
255            * @param end the upper bound of the range of shopping categories (not inclusive)
256            * @return the range of shopping categories
257            */
258            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
259            public java.util.List<com.liferay.portlet.shopping.model.ShoppingCategory> getShoppingCategories(
260                    int start, int end);
261    
262            /**
263            * Returns the number of shopping categories.
264            *
265            * @return the number of shopping categories
266            */
267            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
268            public int getShoppingCategoriesCount();
269    
270            /**
271            * Returns the shopping category with the primary key.
272            *
273            * @param categoryId the primary key of the shopping category
274            * @return the shopping category
275            * @throws PortalException if a shopping category with the primary key could not be found
276            */
277            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
278            public com.liferay.portlet.shopping.model.ShoppingCategory getShoppingCategory(
279                    long categoryId) throws PortalException;
280    
281            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
282            public void getSubcategoryIds(java.util.List<java.lang.Long> categoryIds,
283                    long groupId, long categoryId);
284    
285            /**
286            * Sets the Spring bean ID for this bean.
287            *
288            * @param beanIdentifier the Spring bean ID for this bean
289            */
290            public void setBeanIdentifier(java.lang.String beanIdentifier);
291    
292            public com.liferay.portlet.shopping.model.ShoppingCategory updateCategory(
293                    long categoryId, long parentCategoryId, java.lang.String name,
294                    java.lang.String description, boolean mergeWithParentCategory,
295                    com.liferay.portal.service.ServiceContext serviceContext)
296                    throws PortalException;
297    
298            /**
299            * Updates the shopping category in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
300            *
301            * @param shoppingCategory the shopping category
302            * @return the shopping category that was updated
303            */
304            @com.liferay.portal.kernel.search.Indexable(type = IndexableType.REINDEX)
305            public com.liferay.portlet.shopping.model.ShoppingCategory updateShoppingCategory(
306                    com.liferay.portlet.shopping.model.ShoppingCategory shoppingCategory);
307    }