/portal-service/src/com/liferay/portlet/shopping/service/ShoppingCartLocalService.java

https://github.com/Oggi/liferay-portal · Java · 260 lines · 86 code · 25 blank · 149 comment · 0 complexity · 6446c0d88e063572c4d3c165ee5b2817 MD5 · raw file

  1. /**
  2. * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
  3. *
  4. * This library is free software; you can redistribute it and/or modify it under
  5. * the terms of the GNU Lesser General Public License as published by the Free
  6. * Software Foundation; either version 2.1 of the License, or (at your option)
  7. * any later version.
  8. *
  9. * This library is distributed in the hope that it will be useful, but WITHOUT
  10. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  11. * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
  12. * details.
  13. */
  14. package com.liferay.portlet.shopping.service;
  15. import com.liferay.portal.kernel.exception.PortalException;
  16. import com.liferay.portal.kernel.exception.SystemException;
  17. import com.liferay.portal.kernel.transaction.Isolation;
  18. import com.liferay.portal.kernel.transaction.Propagation;
  19. import com.liferay.portal.kernel.transaction.Transactional;
  20. import com.liferay.portal.service.PersistedModelLocalService;
  21. /**
  22. * The interface for the shopping cart local service.
  23. *
  24. * <p>
  25. * 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.
  26. * </p>
  27. *
  28. * @author Brian Wing Shun Chan
  29. * @see ShoppingCartLocalServiceUtil
  30. * @see com.liferay.portlet.shopping.service.base.ShoppingCartLocalServiceBaseImpl
  31. * @see com.liferay.portlet.shopping.service.impl.ShoppingCartLocalServiceImpl
  32. * @generated
  33. */
  34. @Transactional(isolation = Isolation.PORTAL, rollbackFor = {
  35. PortalException.class, SystemException.class})
  36. public interface ShoppingCartLocalService extends PersistedModelLocalService {
  37. /*
  38. * NOTE FOR DEVELOPERS:
  39. *
  40. * Never modify or reference this interface directly. Always use {@link ShoppingCartLocalServiceUtil} to access the shopping cart local service. Add custom service methods to {@link com.liferay.portlet.shopping.service.impl.ShoppingCartLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface.
  41. */
  42. /**
  43. * Adds the shopping cart to the database. Also notifies the appropriate model listeners.
  44. *
  45. * @param shoppingCart the shopping cart
  46. * @return the shopping cart that was added
  47. * @throws SystemException if a system exception occurred
  48. */
  49. public com.liferay.portlet.shopping.model.ShoppingCart addShoppingCart(
  50. com.liferay.portlet.shopping.model.ShoppingCart shoppingCart)
  51. throws com.liferay.portal.kernel.exception.SystemException;
  52. /**
  53. * Creates a new shopping cart with the primary key. Does not add the shopping cart to the database.
  54. *
  55. * @param cartId the primary key for the new shopping cart
  56. * @return the new shopping cart
  57. */
  58. public com.liferay.portlet.shopping.model.ShoppingCart createShoppingCart(
  59. long cartId);
  60. /**
  61. * Deletes the shopping cart with the primary key from the database. Also notifies the appropriate model listeners.
  62. *
  63. * @param cartId the primary key of the shopping cart
  64. * @throws PortalException if a shopping cart with the primary key could not be found
  65. * @throws SystemException if a system exception occurred
  66. */
  67. public void deleteShoppingCart(long cartId)
  68. throws com.liferay.portal.kernel.exception.PortalException,
  69. com.liferay.portal.kernel.exception.SystemException;
  70. /**
  71. * Deletes the shopping cart from the database. Also notifies the appropriate model listeners.
  72. *
  73. * @param shoppingCart the shopping cart
  74. * @throws SystemException if a system exception occurred
  75. */
  76. public void deleteShoppingCart(
  77. com.liferay.portlet.shopping.model.ShoppingCart shoppingCart)
  78. throws com.liferay.portal.kernel.exception.SystemException;
  79. /**
  80. * Performs a dynamic query on the database and returns the matching rows.
  81. *
  82. * @param dynamicQuery the dynamic query
  83. * @return the matching rows
  84. * @throws SystemException if a system exception occurred
  85. */
  86. @SuppressWarnings("rawtypes")
  87. public java.util.List dynamicQuery(
  88. com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
  89. throws com.liferay.portal.kernel.exception.SystemException;
  90. /**
  91. * Performs a dynamic query on the database and returns a range of the matching rows.
  92. *
  93. * <p>
  94. * 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.
  95. * </p>
  96. *
  97. * @param dynamicQuery the dynamic query
  98. * @param start the lower bound of the range of model instances
  99. * @param end the upper bound of the range of model instances (not inclusive)
  100. * @return the range of matching rows
  101. * @throws SystemException if a system exception occurred
  102. */
  103. @SuppressWarnings("rawtypes")
  104. public java.util.List dynamicQuery(
  105. com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
  106. int end) throws com.liferay.portal.kernel.exception.SystemException;
  107. /**
  108. * Performs a dynamic query on the database and returns an ordered range of the matching rows.
  109. *
  110. * <p>
  111. * 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.
  112. * </p>
  113. *
  114. * @param dynamicQuery the dynamic query
  115. * @param start the lower bound of the range of model instances
  116. * @param end the upper bound of the range of model instances (not inclusive)
  117. * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
  118. * @return the ordered range of matching rows
  119. * @throws SystemException if a system exception occurred
  120. */
  121. @SuppressWarnings("rawtypes")
  122. public java.util.List dynamicQuery(
  123. com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
  124. int end,
  125. com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
  126. throws com.liferay.portal.kernel.exception.SystemException;
  127. /**
  128. * Returns the number of rows that match the dynamic query.
  129. *
  130. * @param dynamicQuery the dynamic query
  131. * @return the number of rows that match the dynamic query
  132. * @throws SystemException if a system exception occurred
  133. */
  134. public long dynamicQueryCount(
  135. com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
  136. throws com.liferay.portal.kernel.exception.SystemException;
  137. @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
  138. public com.liferay.portlet.shopping.model.ShoppingCart fetchShoppingCart(
  139. long cartId) throws com.liferay.portal.kernel.exception.SystemException;
  140. /**
  141. * Returns the shopping cart with the primary key.
  142. *
  143. * @param cartId the primary key of the shopping cart
  144. * @return the shopping cart
  145. * @throws PortalException if a shopping cart with the primary key could not be found
  146. * @throws SystemException if a system exception occurred
  147. */
  148. @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
  149. public com.liferay.portlet.shopping.model.ShoppingCart getShoppingCart(
  150. long cartId)
  151. throws com.liferay.portal.kernel.exception.PortalException,
  152. com.liferay.portal.kernel.exception.SystemException;
  153. @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
  154. public com.liferay.portal.model.PersistedModel getPersistedModel(
  155. java.io.Serializable primaryKeyObj)
  156. throws com.liferay.portal.kernel.exception.PortalException,
  157. com.liferay.portal.kernel.exception.SystemException;
  158. /**
  159. * Returns a range of all the shopping carts.
  160. *
  161. * <p>
  162. * 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.
  163. * </p>
  164. *
  165. * @param start the lower bound of the range of shopping carts
  166. * @param end the upper bound of the range of shopping carts (not inclusive)
  167. * @return the range of shopping carts
  168. * @throws SystemException if a system exception occurred
  169. */
  170. @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
  171. public java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> getShoppingCarts(
  172. int start, int end)
  173. throws com.liferay.portal.kernel.exception.SystemException;
  174. /**
  175. * Returns the number of shopping carts.
  176. *
  177. * @return the number of shopping carts
  178. * @throws SystemException if a system exception occurred
  179. */
  180. @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
  181. public int getShoppingCartsCount()
  182. throws com.liferay.portal.kernel.exception.SystemException;
  183. /**
  184. * Updates the shopping cart in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
  185. *
  186. * @param shoppingCart the shopping cart
  187. * @return the shopping cart that was updated
  188. * @throws SystemException if a system exception occurred
  189. */
  190. public com.liferay.portlet.shopping.model.ShoppingCart updateShoppingCart(
  191. com.liferay.portlet.shopping.model.ShoppingCart shoppingCart)
  192. throws com.liferay.portal.kernel.exception.SystemException;
  193. /**
  194. * Updates the shopping cart in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
  195. *
  196. * @param shoppingCart the shopping cart
  197. * @param merge whether to merge the shopping cart 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.
  198. * @return the shopping cart that was updated
  199. * @throws SystemException if a system exception occurred
  200. */
  201. public com.liferay.portlet.shopping.model.ShoppingCart updateShoppingCart(
  202. com.liferay.portlet.shopping.model.ShoppingCart shoppingCart,
  203. boolean merge)
  204. throws com.liferay.portal.kernel.exception.SystemException;
  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. * Sets the Spring bean ID for this bean.
  213. *
  214. * @param beanIdentifier the Spring bean ID for this bean
  215. */
  216. public void setBeanIdentifier(java.lang.String beanIdentifier);
  217. public void deleteGroupCarts(long groupId)
  218. throws com.liferay.portal.kernel.exception.SystemException;
  219. public void deleteUserCarts(long userId)
  220. throws com.liferay.portal.kernel.exception.SystemException;
  221. @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
  222. public com.liferay.portlet.shopping.model.ShoppingCart getCart(
  223. long userId, long groupId)
  224. throws com.liferay.portal.kernel.exception.PortalException,
  225. com.liferay.portal.kernel.exception.SystemException;
  226. @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
  227. public java.util.Map<com.liferay.portlet.shopping.model.ShoppingCartItem, java.lang.Integer> getItems(
  228. long groupId, java.lang.String itemIds)
  229. throws com.liferay.portal.kernel.exception.SystemException;
  230. public com.liferay.portlet.shopping.model.ShoppingCart updateCart(
  231. long userId, long groupId, java.lang.String itemIds,
  232. java.lang.String couponCodes, int altShipping, boolean insure)
  233. throws com.liferay.portal.kernel.exception.PortalException,
  234. com.liferay.portal.kernel.exception.SystemException;
  235. }