public class CartsDAO extends Object implements Serviceable, Component
| Modifier and Type | Field and Description |
|---|---|
private AmetysObjectResolver |
_resolver
The Ametys object resolver
|
private UserHelper |
_userHelper |
protected UserManager |
_userManager
The user manager
|
private CurrentUserProvider |
_userProvider
The current user provider
|
static String |
ROLE
The Avalon role
|
| Constructor and Description |
|---|
CartsDAO() |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
_hasRight(Cart cart)
Test if the current user has the right needed by the content type to view this cart.
|
Map<String,Object> |
addElements(String cartId,
String type,
Map<String,Object> elementParams)
Add elements to a cart.
|
Map<String,Object> |
assignRights(String cartId,
String profileId,
List<Map<String,String>> entries,
String type)
Adds users or groups to a cart profile.
|
Map<String,Object> |
changeVisibility(String cartId,
String visibilityStr)
Changes the visibility of a cart.
|
Map<String,String> |
createCart(String title,
String description)
Creates a cart.
|
Map<String,Object> |
deleteCarts(List<String> ids)
Deletes some carts.
|
Map<String,Object> |
deleteElements(String cartId,
List<Map<String,String>> cartElements)
Deletes elements of a cart.
|
protected Cart |
getCart(String cartId)
Get the cart with given id
|
Map<String,Object> |
getCartProperties(Cart cart)
Get the cart type properties
|
Map<String,Object> |
getCartsInformation(List<String> cartIds)
Gets carts information.
|
Map<String,Object> |
removeAssignment(String cartId,
String profileId,
List<Map<String,String>> users,
List<Map<String,String>> groups)
Deletes users or groups to a cart profile.
|
void |
service(ServiceManager serviceManager) |
Map<String,String> |
updateCart(String id,
String title,
String description)
Updates a cart.
|
protected UserManager _userManager
private CurrentUserProvider _userProvider
private AmetysObjectResolver _resolver
private UserHelper _userHelper
public CartsDAO()
public void service(ServiceManager serviceManager) throws ServiceException
service in interface ServiceableServiceExceptionpublic Map<String,Object> getCartsInformation(List<String> cartIds)
cartIds - The ids of the carts to retrieve.public Map<String,String> createCart(String title, String description)
title - The titledescription - The descriptionpublic Map<String,String> updateCart(String id, String title, String description)
id - The id of the cart to updatetitle - The titledescription - The descriptionpublic Map<String,Object> deleteCarts(List<String> ids)
ids - The ids of the carts to deletepublic Map<String,Object> addElements(String cartId, String type, Map<String,Object> elementParams)
cartId - The cart id.type - The type of element.elementParams - The parameters of the element.public Map<String,Object> deleteElements(String cartId, List<Map<String,String>> cartElements)
cartId - The cart id.cartElements - The elements to delete.public Map<String,Object> changeVisibility(String cartId, String visibilityStr)
cartId - The cart id.visibilityStr - The visibility to set.public Map<String,Object> assignRights(String cartId, String profileId, List<Map<String,String>> entries, String type)
cartId - The cart id.profileId - The profile id.entries - The users (or groups) entries.type - The type of the entries to add: 'users' or 'groups'public Map<String,Object> removeAssignment(String cartId, String profileId, List<Map<String,String>> users, List<Map<String,String>> groups)
cartId - The cart id.profileId - The profile id.users - The users to delete.groups - The groups to delete;protected Cart getCart(String cartId)
cartId - The cart idpublic Map<String,Object> getCartProperties(Cart cart)
cart - The cart