Class MCRBasketEntry

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

public class MCRBasketEntry extends Object
Represents an entry in a basket. Each entry has at least a unique ID, for example the MCRObjectID, and an URI that can be used to read the object's XML representation to render the object in the basket UI. Each basket entry may have an optional comment. The basket entry provides methods to resolve the object's XML and to set in in the basket entry. This can be used by applications that wish to edit XML in the basket itself.
Author:
Frank Lützenkirchen
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new basket entry.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    Returns the optional comment set for this basket entry.
    Returns the XML data of the object in the basket entry, or null if setContent() or resolveContent() was not called yet.
    Returns the ID of the object contained in this basket entry
    Returns the URI where to read the object's XML data from
    int
     
    void
    Reads the XML data of the object in the basket entry, using the given URI, and stores it in the basket entry.
    void
    setComment(String comment)
    Sets the optional comment for this basket entry.
    void
    Sets the XML data of the object in the basket entry.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MCRBasketEntry

      public MCRBasketEntry(String id, String uri)
      Creates a new basket entry. The XML that represents the object is not immediately read from the given URI. Call resolveContent() to read the content.
      Parameters:
      id - the ID of the object to add to the basket.
      uri - the URI where to read the object's xml data from
  • Method Details

    • getID

      public String getID()
      Returns the ID of the object contained in this basket entry
    • getURI

      public String getURI()
      Returns the URI where to read the object's XML data from
    • resolveContent

      public void resolveContent()
      Reads the XML data of the object in the basket entry, using the given URI, and stores it in the basket entry.
    • getContent

      public Element getContent()
      Returns the XML data of the object in the basket entry, or null if setContent() or resolveContent() was not called yet.
    • setContent

      public void setContent(Element content)
      Sets the XML data of the object in the basket entry.
    • getComment

      public String getComment()
      Returns the optional comment set for this basket entry.
    • setComment

      public void setComment(String comment)
      Sets the optional comment for this basket entry.
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object