|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.xmlserv.app.basket.Basket
Basket abstraction. The XMLServ Applications Basket* just interact with instances of this class.
Constructor Summary | |
Basket(java.sql.Connection con,
int id)
Constructor used by BasketReceipt. |
|
Basket(java.sql.Connection con,
int userid,
int id)
Load an existing basket. |
|
Basket(java.sql.Connection con,
int userid,
java.lang.String basketid)
Create object by loading data associated with given basketid. |
|
Basket(java.sql.Connection con,
java.lang.String basketid)
Constructor used by BasketReceipt. |
|
Basket(java.sql.Connection con,
java.lang.String name,
int userid)
Create a new Basket. |
Method Summary | |
void |
add(java.sql.Connection con,
int image)
Add an Image to the basket. |
static void |
cleanup(java.sql.Connection con,
int userid,
Basket currentBasket,
boolean radicalCleanup)
Forward to cleanup(Connection, int, int). currentBasket can be null. |
static void |
cleanup(java.sql.Connection con,
int userid,
int currentBasket,
boolean radicalCleanup)
Remove any empty baskets without a name that are still open and older than one day except the current basket. |
void |
clear(java.sql.Connection con)
Clear basket contents. |
Basket |
clone(java.sql.Connection con,
java.lang.String name)
Create a fresh deep copy of this basket. |
void |
close(java.sql.Connection con)
|
void |
del(java.sql.Connection con,
int image)
Delete an Image from the basket. |
static void |
drop(java.sql.Connection con,
int userid,
int id)
Delete the basket itself. |
static void |
drop(java.sql.Connection con,
int userid,
java.lang.String basketid)
Delete the basket itself. |
java.lang.String |
getBasketid()
|
java.lang.String |
getCompleted()
|
int |
getContentID(java.sql.Connection con,
int image)
Return the id from basket_contents associated with the given image and this basket. |
java.lang.String |
getCtime()
|
int |
getId()
|
java.lang.String |
getName()
|
BasketRecipient |
getRecipient(java.sql.Connection con)
Get the recipient for this basket. |
int |
getUserid()
|
boolean |
isBasketClosed()
|
boolean |
isMailinglistRecipient(java.sql.Connection con)
|
java.util.Vector |
list(java.sql.Connection con)
Return list of basket contents (image ids in a Vector). |
static org.jdom.Element |
listBaskets(java.sql.Connection con,
int userid)
List users baskets. |
static org.jdom.Element |
listBaskets(java.sql.Connection con,
int userid,
boolean closed)
List users baskets. |
void |
setName(java.sql.Connection con,
java.lang.String name)
|
void |
setRecipient(java.sql.Connection con,
Mailinglist mailinglist)
Set a mailinglist recipient for this basket. |
void |
setRecipient(java.sql.Connection con,
PhoneBook.Entry recipient)
Set recipient of this basket. |
void |
setRecipient(java.sql.Connection con,
User recipient)
Set recipient rof this basket. |
org.jdom.Element |
toElement(java.sql.Connection con,
SecurityManager securityManager)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Basket(java.sql.Connection con, java.lang.String name, int userid) throws XMLServException
con
- The DB Connectionname
- The name of this basket. May be null or empty.public Basket(java.sql.Connection con, int userid, int id) throws XMLServException
con
- A DB connection used to load basket data.userid
- The numeric user id.id
- The unique (numeric) id.public Basket(java.sql.Connection con, int userid, java.lang.String basketid) throws XMLServException
con
- The DB connection.userid
- The numeric user id.basketid
- The unique 'random' basketid (referencing the field basketid in the DB)public Basket(java.sql.Connection con, int id) throws XMLServException
public Basket(java.sql.Connection con, java.lang.String basketid) throws XMLServException
Method Detail |
public Basket clone(java.sql.Connection con, java.lang.String name) throws XMLServException
public static org.jdom.Element listBaskets(java.sql.Connection con, int userid) throws XMLServException
con
- The DB connection.userid
- The users numeric id.public static org.jdom.Element listBaskets(java.sql.Connection con, int userid, boolean closed) throws XMLServException
con
- The DB connection.userid
- The users numeric id.closed
- If true, show only closed baskets. Show all otherwise.public void add(java.sql.Connection con, int image) throws XMLServException
con
- The DB Connection to use.image
- The Image ID.public void del(java.sql.Connection con, int image) throws XMLServException
con
- The DB Connection.image
- The Image ID to remove.public java.util.Vector list(java.sql.Connection con) throws XMLServException
con
- The DB connection.public int getContentID(java.sql.Connection con, int image) throws java.sql.SQLException
public void clear(java.sql.Connection con) throws XMLServException
public void close(java.sql.Connection con) throws XMLServException
public static void drop(java.sql.Connection con, int userid, java.lang.String basketid) throws XMLServException
basketid
- The String Basket ID.public static void drop(java.sql.Connection con, int userid, int id) throws XMLServException
basketid
- The String Basket ID.public org.jdom.Element toElement(java.sql.Connection con, SecurityManager securityManager) throws XMLServException
public static void cleanup(java.sql.Connection con, int userid, Basket currentBasket, boolean radicalCleanup) throws XMLServException
radicalDelete
- If false, delete only 'old' empty baskets without a name. Delete all open baskets except the current one otherwise.public static void cleanup(java.sql.Connection con, int userid, int currentBasket, boolean radicalCleanup) throws XMLServException
radicalDelete
- If false, delete only 'old' empty baskets without a name. Delete all open baskets except the current one otherwise.public int getId()
public java.lang.String getBasketid()
public java.lang.String getName()
public void setName(java.sql.Connection con, java.lang.String name) throws XMLServException
public boolean isMailinglistRecipient(java.sql.Connection con) throws XMLServException
public BasketRecipient getRecipient(java.sql.Connection con) throws XMLServException
public void setRecipient(java.sql.Connection con, PhoneBook.Entry recipient) throws XMLServException
public void setRecipient(java.sql.Connection con, User recipient) throws XMLServException
public void setRecipient(java.sql.Connection con, Mailinglist mailinglist) throws XMLServException
public int getUserid()
public java.lang.String getCtime()
public java.lang.String getCompleted()
public boolean isBasketClosed()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |