package com.veggie.src.java;

import com.veggie.src.java.form.Form;
import com.veggie.src.java.form.AbstractFormBuilder;
import com.veggie.src.java.form.AbstractFormBuilderFactory;

public class RenewController implements Controller
{
  private AbstractFormBuilderFactory fbf;
  private AbstractFormBuilder fb;
  private Form f;

  public RenewController()
  {

  }

  public Form createForm()
  {
    return f;
  }

}

@@ -23,16 +23,39 @@
 .java;%0A%0A
+import java.util.List;%0A
 import c
@@ -196,16 +196,444 @@
 Factory;
+%0Aimport com.veggie.src.java.notification.Notification;%0Aimport com.veggie.src.java.database.AbstractDatabaseManagerFactory;%0Aimport com.veggie.src.java.database.prototype.PrototypeAccountDatabaseManager;%0Aimport com.veggie.src.java.database.TransactionDatabaseManager;%0Aimport com.veggie.src.java.database.AccountDatabaseManager;%0Aimport com.veggie.src.java.database.ItemDatabaseManager;%0Aimport com.veggie.src.java.RentalTransaction;
 %0A%0Apublic
@@ -712,155 +712,1445 @@
 lder
-Factory fbf;%0A  private AbstractFormBuilder fb;%0A  private Form f;%0A%0A  public RenewController()%0A  %7B%0A%0A  %7D%0A%0A  public Form createForm
+ formBuilder;%0A  private Form form;%0A  Notification notification;%0A%0A  public RenewController()%0A  %7B%0A    formBuilder = AbstractFormBuilderFactory.getInstance().createFormBuilder();%0A    formBuilder.addField(%22User ID%22);%0A    formBuilder.addField(%22Item ID%22);%0A    form = formBuilder.getResult();%0A  %7D%0A%0A  public Form createForm()%0A  %7B%0A    return form;%0A  %7D%0A  %0A  public Notification submitForm()%0A  %7B%0A     List%3CString%3E formData = form.getData();%0A      int itemid;%0A      int userid;%0A      try%7B%0A      %09userid = Integer.parseInt(formData.get(0));%0A      %09itemid = Integer.parseInt(formData.get(1));%0A         TransactionDatabaseManager transactionDBManager = AbstractDatabaseManagerFactory.getInstance().createTransactionDatabaseManager();%0A      transactionDBManager.finalizeTransaction(itemid);%0A         AccountDatabaseManager accountDBManager = AbstractDatabaseManagerFactory.getInstance().createAccountDatabaseManager();%0A         PatronAccount patron;%0A         patron = (PatronAccount)accountDBManager.getUser(userid);%0A         ItemDatabaseManager itemDBManager = AbstractDatabaseManagerFactory.getInstance().createItemDatabaseManager
 ()
+;
 %0A  
-%7B%0A    return f;
+       MediaItem med = itemDBManager.getItem(itemid);%0A        RentalTransaction rent = new RentalTransaction(patron, med, 0);%0A        transactionDBManager.addTransaction(rent);%0A      %7Dcatch(Exception e)%7B%0A      %09System.out.println(%22Error: incorrect form data%22);%0A      %7D%0A      %0A      return notification;   //???????%0A
 %0A  %7D

Update RenewController.java