public final class ShoppingCartService extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
DATASTORE_KEY_ENABLE_DATABASE_PERSISTENCE
Datastore key for the boolean value that indicates whether shopping cart
items of registered users must be saved in the database
|
| Modifier and Type | Method and Description |
|---|---|
void |
addItemToShoppingCart(ShoppingCartItem item)
Add an item to the shopping cart of a user.
|
void |
addItemToShoppingCart(ShoppingCartItem item,
fr.paris.lutece.portal.service.security.LuteceUser user)
Add an item to the shopping cart of a user
|
protected void |
checkAnonymousShoppingCart(String strUserName)
Check if the current user has items in his anonymous shopping cart
|
void |
emptyShoppingCartOfUser(String strUserName,
boolean bNotifyProviderService)
Remove every items of the shopping of a user
|
static ShoppingCartService |
getInstance()
Get the service instance
|
ShoppingCartItem |
getShoppingCartItem(int nIdShoppingCartItem,
String strUserName)
Get a shopping cart item from its id
|
List<ShoppingCartItem> |
getShoppingCartItems(fr.paris.lutece.portal.service.security.LuteceUser user,
String strIdProvider)
Get the list of shopping cart items for a given user
|
List<ShoppingCartItem> |
getShoppingCartItemsByFilter(ShoppingCartItemFilter filter)
Get the list of shopping cart items that match a given filter.
|
List<ShoppingCartItem> |
getShoppingCartOfUser(fr.paris.lutece.portal.service.security.LuteceUser user)
Get the list of shopping cart items of a user
|
List<ShoppingCartItem> |
getShoppingCartOfUser(String strUserName)
Get the list of shopping cart items of a user
|
void |
removeShoppingCartItem(String strUserName,
int nIdItem,
boolean bNotifyProviderService)
Remove a shopping cart item and notify
|
public static final String DATASTORE_KEY_ENABLE_DATABASE_PERSISTENCE
public static ShoppingCartService getInstance()
public void addItemToShoppingCart(ShoppingCartItem item, fr.paris.lutece.portal.service.security.LuteceUser user)
item - The item to adduser - The userpublic void addItemToShoppingCart(ShoppingCartItem item)
item - The item to add to the shopping cartpublic List<ShoppingCartItem> getShoppingCartOfUser(fr.paris.lutece.portal.service.security.LuteceUser user)
user - The userpublic List<ShoppingCartItem> getShoppingCartOfUser(String strUserName)
strUserName - The name of the lutece userpublic List<ShoppingCartItem> getShoppingCartItems(fr.paris.lutece.portal.service.security.LuteceUser user, String strIdProvider)
user - The user to get the shopping cart ofstrIdProvider - The provider of items to getpublic ShoppingCartItem getShoppingCartItem(int nIdShoppingCartItem, String strUserName)
nIdShoppingCartItem - The id of the shopping cart itemstrUserName - The name of the user associated with the shopping cart
itempublic List<ShoppingCartItem> getShoppingCartItemsByFilter(ShoppingCartItemFilter filter)
filter - The filterpublic void removeShoppingCartItem(String strUserName, int nIdItem, boolean bNotifyProviderService)
strUserName - The name of the user the item belongs tonIdItem - The id of the item to removebNotifyProviderService - True to notify the provider service that
the item was removedpublic void emptyShoppingCartOfUser(String strUserName, boolean bNotifyProviderService)
strUserName - The name of the user to empty the shopping cart of, or
null if the user has not logged in.bNotifyProviderService - True to notify the provider service of
every item removed, false otherwiseprotected void checkAnonymousShoppingCart(String strUserName)
strUserName - The name of the user to check the shopping cart ofCopyright © 2014 Mairie de Paris. All rights reserved.