Package org.mycore.frontend.basket
Class MCRBasketManager
java.lang.Object
org.mycore.frontend.basket.MCRBasketManager
Manages basket objects in the user's current MCRSession.
A session may store multiple baskets with different type IDs,
for example a basket for documents and another for an other type of entry.
- Author:
- Frank Lützenkirchen
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
Checks if a basket entry is present in the current basketstatic MCRBasket
getBasketFromSession
(String type) Returns the basket of the given type from the current session, if there is any.static MCRBasket
Convenience method to get a basket of the given type.static void
setBasketInSession
(MCRBasket basket) Stores the given basket in the current user's session
-
Constructor Details
-
MCRBasketManager
public MCRBasketManager()
-
-
Method Details
-
getOrCreateBasketInSession
Convenience method to get a basket of the given type. When there already is a basket in the session, that basket is returned. Otherwise a new basket is created and saved in the session. -
getBasketFromSession
Returns the basket of the given type from the current session, if there is any. -
setBasketInSession
Stores the given basket in the current user's session -
contains
Checks if a basket entry is present in the current basket- Parameters:
type
- basket typeid
- basket entry id- Returns:
- true if a basket of this type exist and contains basket entry with the given id
-