1 package org.paneris.jammyjoes.controller; 2 3 import org.melati.Melati; 4 import org.melati.template.ServletTemplateContext; 5 import org.paneris.jammyjoes.model.JammyjoesDatabase; 6 import org.paneris.jammyjoes.mvp.ContextWrapper; 7 import org.paneris.jammyjoes.mvp.OrdersByMonthPresenter; 8 import org.paneris.jammyjoes.mvp.Presenter; 9 import org.paneris.jammyjoes.servlet.JammyJoesMelatiServlet; 10 11 public class OrdersByMonth extends JammyJoesMelatiServlet { 12 13 private static final long serialVersionUID = 1L; 14 15 protected String jammyjoesRequest(Melati melati, ServletTemplateContext context) throws Exception { 16 17 JammyjoesDatabase db = (JammyjoesDatabase) melati.getDatabase(); 18 Presenter presneter = 19 new OrdersByMonthPresenter( 20 db.getShopOrderTable(), 21 new ContextWrapper(melati.getServletTemplateContext()),db.getOrderStatusTable().paidStatuses() 22 ); 23 presneter.handleInteraction(presneter.createSelection(), presneter.createCommand()); 24 String template = "OrdersByMonth.wm"; 25 return "view/" + template; 26 } 27 28 }