com.xmlserv.app.basket
Class BasketContents

java.lang.Object
  |
  +--com.xmlserv.app.basket.BasketContents

public class BasketContents
extends java.lang.Object

This class describes the format selections for a given basket. Each image might be available in different formats (listed in table fileformat) and may be selected in 1-* formats for download.
Utility methods provide listings of the images in the basket plus available formats. Other methods manipulate the association/selection of formats for a given basket entry (image).


Constructor Summary
BasketContents(Basket basket, java.lang.String basepath)
           
 
Method Summary
 void addFormat(java.sql.Connection con, int image, int format)
          Associate a format with a basket entry
 org.jdom.Element availableFormats(java.sql.Connection con, java.lang.String basepath)
          Walk through basket, creating an Element for each entry and adding the available formats as content elements for that image Element
 void clearFormat(java.sql.Connection con, int image)
          Clear all Format associations for the basket_content entry identified by this basket and image id.
 void delFormat(java.sql.Connection con, int image, int format)
          Remove a format association.
 java.lang.String getBasepath()
           
 Basket getBasket()
           
 java.util.Vector list(java.sql.Connection con)
          Return the basket contents with format associations as a Vector of DownloadImage objects with Format and downloadid set.
 org.jdom.Element toElement(java.sql.Connection con)
          Return the basket contents with format associations as an element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasketContents

public BasketContents(Basket basket,
                      java.lang.String basepath)
Method Detail

availableFormats

public org.jdom.Element availableFormats(java.sql.Connection con,
                                         java.lang.String basepath)
                                  throws XMLServException
Walk through basket, creating an Element for each entry and adding the available formats as content elements for that image Element

addFormat

public void addFormat(java.sql.Connection con,
                      int image,
                      int format)
               throws XMLServException
Associate a format with a basket entry

delFormat

public void delFormat(java.sql.Connection con,
                      int image,
                      int format)
               throws XMLServException
Remove a format association.

clearFormat

public void clearFormat(java.sql.Connection con,
                        int image)
                 throws XMLServException
Clear all Format associations for the basket_content entry identified by this basket and image id.

list

public java.util.Vector list(java.sql.Connection con)
                      throws XMLServException
Return the basket contents with format associations as a Vector of DownloadImage objects with Format and downloadid set.

toElement

public org.jdom.Element toElement(java.sql.Connection con)
                           throws XMLServException
Return the basket contents with format associations as an element.

getBasket

public Basket getBasket()

getBasepath

public java.lang.String getBasepath()