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 com.liferay.portal.kernel.exception.PortalException; 055 056 public void addCategoryResources( 057 com.liferay.portlet.shopping.model.ShoppingCategory category, 058 boolean addGroupPermissions, boolean addGuestPermissions) 059 throws com.liferay.portal.kernel.exception.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 com.liferay.portal.kernel.exception.PortalException; 065 066 public void addCategoryResources(long categoryId, 067 boolean addGroupPermissions, boolean addGuestPermissions) 068 throws com.liferay.portal.kernel.exception.PortalException; 069 070 public void addCategoryResources(long categoryId, 071 java.lang.String[] groupPermissions, java.lang.String[] guestPermissions) 072 throws com.liferay.portal.kernel.exception.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) 094 throws com.liferay.portal.kernel.exception.PortalException; 095 096 public void deleteCategory( 097 com.liferay.portlet.shopping.model.ShoppingCategory category) 098 throws com.liferay.portal.kernel.exception.PortalException; 099 100 public void deleteCategory(long categoryId) 101 throws com.liferay.portal.kernel.exception.PortalException; 102 103 /** 104 * @throws PortalException 105 */ 106 @Override 107 public com.liferay.portal.model.PersistedModel deletePersistedModel( 108 com.liferay.portal.model.PersistedModel persistedModel) 109 throws com.liferay.portal.kernel.exception.PortalException; 110 111 /** 112 * Deletes the shopping category with the primary key from the database. Also notifies the appropriate model listeners. 113 * 114 * @param categoryId the primary key of the shopping category 115 * @return the shopping category that was removed 116 * @throws PortalException if a shopping category with the primary key could not be found 117 */ 118 @com.liferay.portal.kernel.search.Indexable(type = IndexableType.DELETE) 119 public com.liferay.portlet.shopping.model.ShoppingCategory deleteShoppingCategory( 120 long categoryId) 121 throws com.liferay.portal.kernel.exception.PortalException; 122 123 /** 124 * Deletes the shopping category from the database. Also notifies the appropriate model listeners. 125 * 126 * @param shoppingCategory the shopping category 127 * @return the shopping category that was removed 128 */ 129 @com.liferay.portal.kernel.search.Indexable(type = IndexableType.DELETE) 130 public com.liferay.portlet.shopping.model.ShoppingCategory deleteShoppingCategory( 131 com.liferay.portlet.shopping.model.ShoppingCategory shoppingCategory); 132 133 public com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery(); 134 135 /** 136 * Performs a dynamic query on the database and returns the matching rows. 137 * 138 * @param dynamicQuery the dynamic query 139 * @return the matching rows 140 */ 141 public <T> java.util.List<T> dynamicQuery( 142 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery); 143 144 /** 145 * Performs a dynamic query on the database and returns a range of the matching rows. 146 * 147 * <p> 148 * 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. 149 * </p> 150 * 151 * @param dynamicQuery the dynamic query 152 * @param start the lower bound of the range of model instances 153 * @param end the upper bound of the range of model instances (not inclusive) 154 * @return the range of matching rows 155 */ 156 public <T> java.util.List<T> dynamicQuery( 157 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 158 int end); 159 160 /** 161 * Performs a dynamic query on the database and returns an ordered range of the matching rows. 162 * 163 * <p> 164 * 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. 165 * </p> 166 * 167 * @param dynamicQuery the dynamic query 168 * @param start the lower bound of the range of model instances 169 * @param end the upper bound of the range of model instances (not inclusive) 170 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 171 * @return the ordered range of matching rows 172 */ 173 public <T> java.util.List<T> dynamicQuery( 174 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 175 int end, 176 com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator); 177 178 /** 179 * Returns the number of rows matching the dynamic query. 180 * 181 * @param dynamicQuery the dynamic query 182 * @return the number of rows matching the dynamic query 183 */ 184 public long dynamicQueryCount( 185 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery); 186 187 /** 188 * Returns the number of rows matching the dynamic query. 189 * 190 * @param dynamicQuery the dynamic query 191 * @param projection the projection to apply to the query 192 * @return the number of rows matching the dynamic query 193 */ 194 public long dynamicQueryCount( 195 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, 196 com.liferay.portal.kernel.dao.orm.Projection projection); 197 198 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 199 public com.liferay.portlet.shopping.model.ShoppingCategory fetchShoppingCategory( 200 long categoryId); 201 202 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 203 public com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery(); 204 205 /** 206 * Returns the Spring bean ID for this bean. 207 * 208 * @return the Spring bean ID for this bean 209 */ 210 public java.lang.String getBeanIdentifier(); 211 212 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 213 public java.util.List<com.liferay.portlet.shopping.model.ShoppingCategory> getCategories( 214 long groupId); 215 216 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 217 public java.util.List<com.liferay.portlet.shopping.model.ShoppingCategory> getCategories( 218 long groupId, long parentCategoryId, int start, int end); 219 220 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 221 public int getCategoriesCount(long groupId, long parentCategoryId); 222 223 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 224 public com.liferay.portlet.shopping.model.ShoppingCategory getCategory( 225 long categoryId) 226 throws com.liferay.portal.kernel.exception.PortalException; 227 228 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 229 public com.liferay.portlet.shopping.model.ShoppingCategory getCategory( 230 long groupId, java.lang.String categoryName); 231 232 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 233 public java.util.List<com.liferay.portlet.shopping.model.ShoppingCategory> getParentCategories( 234 com.liferay.portlet.shopping.model.ShoppingCategory category) 235 throws com.liferay.portal.kernel.exception.PortalException; 236 237 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 238 public java.util.List<com.liferay.portlet.shopping.model.ShoppingCategory> getParentCategories( 239 long categoryId) 240 throws com.liferay.portal.kernel.exception.PortalException; 241 242 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 243 public com.liferay.portlet.shopping.model.ShoppingCategory getParentCategory( 244 com.liferay.portlet.shopping.model.ShoppingCategory category) 245 throws com.liferay.portal.kernel.exception.PortalException; 246 247 @Override 248 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 249 public com.liferay.portal.model.PersistedModel getPersistedModel( 250 java.io.Serializable primaryKeyObj) 251 throws com.liferay.portal.kernel.exception.PortalException; 252 253 /** 254 * Returns a range of all the shopping categories. 255 * 256 * <p> 257 * 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. 258 * </p> 259 * 260 * @param start the lower bound of the range of shopping categories 261 * @param end the upper bound of the range of shopping categories (not inclusive) 262 * @return the range of shopping categories 263 */ 264 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 265 public java.util.List<com.liferay.portlet.shopping.model.ShoppingCategory> getShoppingCategories( 266 int start, int end); 267 268 /** 269 * Returns the number of shopping categories. 270 * 271 * @return the number of shopping categories 272 */ 273 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 274 public int getShoppingCategoriesCount(); 275 276 /** 277 * Returns the shopping category with the primary key. 278 * 279 * @param categoryId the primary key of the shopping category 280 * @return the shopping category 281 * @throws PortalException if a shopping category with the primary key could not be found 282 */ 283 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 284 public com.liferay.portlet.shopping.model.ShoppingCategory getShoppingCategory( 285 long categoryId) 286 throws com.liferay.portal.kernel.exception.PortalException; 287 288 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 289 public void getSubcategoryIds(java.util.List<java.lang.Long> categoryIds, 290 long groupId, long categoryId); 291 292 /** 293 * Sets the Spring bean ID for this bean. 294 * 295 * @param beanIdentifier the Spring bean ID for this bean 296 */ 297 public void setBeanIdentifier(java.lang.String beanIdentifier); 298 299 public com.liferay.portlet.shopping.model.ShoppingCategory updateCategory( 300 long categoryId, long parentCategoryId, java.lang.String name, 301 java.lang.String description, boolean mergeWithParentCategory, 302 com.liferay.portal.service.ServiceContext serviceContext) 303 throws com.liferay.portal.kernel.exception.PortalException; 304 305 /** 306 * Updates the shopping category in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 307 * 308 * @param shoppingCategory the shopping category 309 * @return the shopping category that was updated 310 */ 311 @com.liferay.portal.kernel.search.Indexable(type = IndexableType.REINDEX) 312 public com.liferay.portlet.shopping.model.ShoppingCategory updateShoppingCategory( 313 com.liferay.portlet.shopping.model.ShoppingCategory shoppingCategory); 314 }