Class MCRBasketManager

java.lang.Object
org.mycore.frontend.basket.MCRBasketManager

public class MCRBasketManager extends Object
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 Details

    • MCRBasketManager

      public MCRBasketManager()
  • Method Details

    • getOrCreateBasketInSession

      public static MCRBasket getOrCreateBasketInSession(String type)
      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

      public static MCRBasket getBasketFromSession(String type)
      Returns the basket of the given type from the current session, if there is any.
    • setBasketInSession

      public static void setBasketInSession(MCRBasket basket)
      Stores the given basket in the current user's session
    • contains

      public static boolean contains(String type, String id)
      Checks if a basket entry is present in the current basket
      Parameters:
      type - basket type
      id - basket entry id
      Returns:
      true if a basket of this type exist and contains basket entry with the given id