{
public abstract Book getBook();
public boolean isLinkDisabled()
{
Visit visit = (Visit) getPage().getVisit();
if (!visit.isUserLoggedIn())
return true;
// If the user is logged in, they can borrow it if they are
// not already holding it and aren't the owner.
Book book = getBook();
// If the book is not lendable, then disable the link.
if (!book.isLendable())
return true;
// Otherwise, disabled the link if already holding it.
return visit.isLoggedInUser(book.getHolderId());
}